jadex.base.test.impl.SharedExecutionService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-platform-bridge Show documentation
Show all versions of jadex-platform-bridge Show documentation
Jadex bridge is a base package for kernels and platforms, i.e., it is used by both and provides commonly used interfaces and classes for active components and their management.
package jadex.base.test.impl;
import jadex.bridge.IComponentIdentifier;
import jadex.bridge.service.types.execution.IExecutionService;
import jadex.commons.concurrent.IExecutable;
import jadex.commons.future.IFuture;
/**
* Helper class to allow sharing an execution service across platforms in same VM.
*/
public class SharedExecutionService extends SharedService implements IExecutionService
{
/**
* Get the instance.
*/
public SharedExecutionService(IComponentIdentifier provider, SharedServiceFactory factory)
{
super(provider, IExecutionService.class, factory);
}
//-------- IExecutionService interface --------
@Override
public IExecutable[] getRunningTasks()
{
return getInstance().getRunningTasks();
}
@Override
public IFuture getNextIdleFuture()
{
return getInstance().getNextIdleFuture();
}
@Override
public void execute(IExecutable task)
{
getInstance().execute(task);
}
@Override
public IFuture cancel(IExecutable task)
{
return getInstance().cancel(task);
}
}