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

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

import jadex.bridge.ServiceCall;
import jadex.bridge.service.annotation.Authenticated;
import jadex.bridge.service.annotation.Service;
import jadex.commons.future.IFuture;
import jadex.micro.annotation.Agent;
import jadex.micro.annotation.Implementation;
import jadex.micro.annotation.ProvidedService;
import jadex.micro.annotation.ProvidedServices;


/**
 *  Agent implementing the test service.
 */
@Agent
@ProvidedServices(@ProvidedService(type=ITestService.class, implementation=@Implementation(expression="$pojoagent")))
@Service
public class ProviderAgent implements ITestService
{
	/**
	 *  Allow calling a method only from an authenticated user.
	 */
//	@Authenticated(names={"VSISSTAFF17", "Alex-PC-neu", "Lars-PC", "willi", "hans"})
	@Authenticated(virtuals="testuser")
	public IFuture method(String msg)
	{
		ServiceCall sc = ServiceCall.getCurrentInvocation();
//		System.out.println("Called method: "+msg+" "+sc.getTimeout()
//			+" "+sc.isRealtime()+" "+sc.getProperties());
		return IFuture.DONE;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy