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

jadex.micro.testcases.timeoutcascade.Service1Agent 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.service.annotation.Service;
import jadex.bridge.service.component.IRequiredServicesFeature;
import jadex.commons.future.IFuture;
import jadex.micro.annotation.Agent;
import jadex.micro.annotation.Binding;
import jadex.micro.annotation.RequiredService;
import jadex.micro.annotation.RequiredServices;


/**
 *  Service 1 agent.
 *  Calls service 2 on agent 2.
 */
@Agent(autoprovide=true)
@Service
@RequiredServices({@RequiredService(name = "ser2", type=IService2.class, 
	binding = @Binding(dynamic = true, scope = Binding.SCOPE_PLATFORM))})
public class Service1Agent implements IService1
{
	@Agent
	protected IInternalAccess agent;

	public IFuture service()
	{
		IService2 ser2 = (IService2)agent.getComponentFeature(IRequiredServicesFeature.class).getRequiredService("ser2").get();
		ser2.service().get();

		return IFuture.DONE;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy