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

jadex.bpmn.examples.nfprops.AService Maven / Gradle / Ivy

Go to download

The Jadex bpmn applications package contains several example applications, benchmarks and testcases using bpmn workflows.

There is a newer version: 4.0.267
Show newest version
package jadex.bpmn.examples.nfprops;

import jadex.bridge.IInternalAccess;
import jadex.bridge.component.IExecutionFeature;
import jadex.bridge.service.IServiceIdentifier;
import jadex.bridge.service.annotation.Service;
import jadex.bridge.service.annotation.ServiceComponent;
import jadex.bridge.service.annotation.ServiceIdentifier;
import jadex.commons.future.Future;
import jadex.commons.future.IFuture;

/**
 * 
 */
@Service
public class AService implements IAService
{
	@ServiceComponent
	protected IInternalAccess comp;
	
	@ServiceIdentifier
	protected IServiceIdentifier sid;
	
	/** The test string. */
	protected long wait = (long)(Math.random()*1000);
	
	/** The invocation counter. */
	protected int cnt;
	
	/**
	 *  Test method.
	 */
	public IFuture test()
	{
		System.out.println("invoked service: "+sid.getProviderId()+" cnt="+(++cnt)+" wait="+wait);
		comp.getComponentFeature(IExecutionFeature.class).waitForDelay(wait).get();
		return new Future(sid.toString());
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy