jadex.micro.testcases.nflatency.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.nflatency;
import jadex.bridge.IComponentStep;
import jadex.bridge.IInternalAccess;
import jadex.bridge.component.IExecutionFeature;
import jadex.bridge.service.annotation.Service;
import jadex.commons.future.IFuture;
import jadex.micro.annotation.Agent;
import jadex.micro.annotation.ProvidedService;
import jadex.micro.annotation.ProvidedServices;
/**
*
*/
@Agent
@Service
@ProvidedServices(@ProvidedService(type=ITestService.class))
public class ProviderAgent implements ITestService
{
@Agent
protected IInternalAccess agent;
/**
*
*/
public IFuture methodA(long wait)
{
// System.out.println("methodA impl called: "+wait);
return agent.getComponentFeature(IExecutionFeature.class).waitForDelay(wait, new IComponentStep()
{
public IFuture execute(IInternalAccess ia)
{
return IFuture.DONE;
}
});
}
/**
*
*/
public IFuture methodB(long wait)
{
return methodA(wait);
}
}