Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.distributeme.agents.operatives;
 
This agent will move into given destination vm and print out a HelloWorld to SysOut.

Author(s):
lrosenberg
public class HelloWorldAgent2 implements Agent{
	private static final long serialVersionUID = 1L;
	public void prepareForTransport() {
		..println("Going to move now!");
	}
	public void awake() {
		..println("Good bye World");
	}
	public static void main(String[] argsthrows Exception{
		LoggerFactory.getLogger(HelloWorldAgent2.class).info("TEST");
		..println("Creating agent");
		String target = "rmi://org_distributeme_test_echo_EchoService.lfxyotkpcy@192.168.200.101:9250@20110817012752";
		if (args.length!=1){
			//return later
		}else{
			target = args[0];
		}
		..println("Trying to send agent to "+target);
		..sendAgent(agent, ServiceDescriptor.fromSystemWideUniqueId(target));
		..println("done");
	}
New to GrepCode? Check out our FAQ X