jadex.micro.testcases.tuplefuture.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.tuplefuture;
import jadex.bridge.service.annotation.Service;
import jadex.commons.future.ITuple2Future;
import jadex.commons.future.Tuple2Future;
import jadex.micro.annotation.Agent;
import jadex.micro.annotation.ProvidedService;
import jadex.micro.annotation.ProvidedServices;
/**
* Agent implementing the test service.
*/
@Agent
@Service
@ProvidedServices({@ProvidedService(type=ITestService.class)})
public class ProviderAgent implements ITestService
{
/**
* Example implementation of the method.
*/
public ITuple2Future getSomeResults()
{
// Tuple2Future ret = new Tuple2Future("hello", Integer.valueOf(99));
Tuple2Future ret = new Tuple2Future();
ret.setSecondResult(Integer.valueOf(99));
ret.setFirstResult("hello");
System.out.println("called method getSomeResults()");
return ret;
}
// /**
// * Example implementation of the method.
// */
// public ITuple2Future getSomeResults2()
// {
// return getSomeResults();
// }
// /**
// *
// */
// public IIntermediateFuture getSomeResults()
// {
// IntermediateFuture ret = new IntermediateFuture(Arrays.asList(new String[]{"a", "b"}));
// System.out.println("called method getSomeResults()");
// return ret;
// }
}