All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.micro.testcases.nfmethodprop.ProviderAgent Maven / Gradle / Ivy

Go to download

The Jadex micro applications package contains several example applications, benchmarks and testcases using micro agents.

There is a newer version: 4.0.267
Show newest version
package jadex.micro.testcases.nfmethodprop;

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;
	
	/**
	 * 
	 */
//	@NFProperties(@NFProperty(value=WaitingTimeProperty.class))
	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;
			}
		});
	}
	
	/**
	 * 
	 */
//	@NFProperties(@NFProperty(value=WaitingTimeProperty.class))
	public IFuture methodB(long wait)
	{
		return methodA(wait);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy