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

jadex.micro.testcases.timeoutcascade.Service2Agent 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.timeoutcascade;

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;

/**
 *  Service 2 agent.
 *  Offers service that needs long time (exceeds def timeout).
 */
@Service
@Agent(autoprovide=true)
public class Service2Agent implements IService2
{
	@Agent
	protected IInternalAccess agent;	
	
	public IFuture service()
	{
		// wait longer than default 30 secs
		// get must set no timeout to avoid being interrupted
		agent.getComponentFeature(IExecutionFeature.class).waitForDelay(35000).get();
		return IFuture.DONE;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy