jadex.micro.testcases.lazyinject.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.lazyinject;
import jadex.bridge.service.annotation.Service;
import jadex.commons.future.IIntermediateFuture;
import jadex.commons.future.ITuple2Future;
import jadex.commons.future.IntermediateFuture;
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 getFirstTupleResult()
{
Tuple2Future ret = new Tuple2Future();
ret.setFirstResult("hello");
System.out.println("called method getFirstTupleResult()");
return ret;
}
/**
* Example implementation of the method.
*/
public IIntermediateFuture getIntermediateResults() {
IntermediateFuture ret = new IntermediateFuture();
ret.addIntermediateResult("hello");
System.out.println("called method getIntermediateResults()");
return ret;
}
}