The agent support in distributeme is yet experimental and shouldn't be used in production environment
What are agents
Agents are mobile programs which can move between different jvms via DistributeMe mechanisms and are executed in the target jvm.
Why do we need agents
Agents can do things, standard programs can't.
- Get access to methods of services or other components that are not exposed via DistributeMe over net.
- Execute massive calculations locally (if you need to make 1000 requests its much faster to execute them locally and move the results, as to execute them over network).
- Load new code which didn't exist at the compile/start time of the service.
- Inspect the JVM.
How does it work.
This is a HelloWorld Agent which simply travels to the target JVM and prints out a "HelloWorld" message there. Note, that the agent code can be written after the service is deployed.
def data = new URL('http://svn.anotheria.net/opensource/distributeme/trunk/distributeme-agents/java/org/distributeme/agents/operatives/HelloWorldAgent.java').getText()
' + data + '