jadex.micro.testcases.killcomponent.ProviderAgent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applications-micro Show documentation
Show all versions of jadex-applications-micro Show documentation
The Jadex micro applications package contains several example applications, benchmarks and testcases using micro agents.
package jadex.micro.testcases.killcomponent;
import jadex.bridge.ServiceCall;
import jadex.bridge.component.IArgumentsResultsFeature;
import jadex.commons.future.Future;
import jadex.commons.future.IFuture;
import jadex.micro.annotation.Agent;
import jadex.micro.annotation.AgentBody;
import jadex.micro.annotation.AgentCreated;
import jadex.micro.annotation.AgentFeature;
/**
*
*/
@Agent
public class ProviderAgent
{
@AgentFeature
private IArgumentsResultsFeature argResults;
@AgentCreated
private void created() {
System.out.println("provider created");
}
@AgentBody
private void body() {
argResults.getResults().put("exampleresult", "value");
}
/**
* Call a method that must use a secure
* transport under the hood.
*/
public IFuture method(String msg)
{
ServiceCall sc = ServiceCall.getCurrentInvocation();
Future ret = new Future();
return ret;
}
}