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

jadex.base.test.impl.SharedExecutionService Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 4.0.267
Show newest version
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);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy