jadex.bpmn.examples.nfprops.AService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applications-bpmn Show documentation
Show all versions of jadex-applications-bpmn Show documentation
The Jadex bpmn applications package contains several example applications, benchmarks and testcases using bpmn workflows.
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());
}
}