jadex.base.test.impl.SharedSimulationService 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.clock.IClockService;
import jadex.bridge.service.types.execution.IExecutionService;
import jadex.bridge.service.types.simulation.ISimulationService;
import jadex.commons.IChangeListener;
import jadex.commons.future.IFuture;
/**
* Helper class to allow sharing a simulation service across platforms in same VM.
*/
public class SharedSimulationService extends SharedService implements ISimulationService
{
/**
* Get the instance.
*/
public SharedSimulationService(IComponentIdentifier provider, SharedServiceFactory factory)
{
super(provider, ISimulationService.class, factory);
}
//-------- ISimulationService interface --------
@Override
public IFuture pause()
{
return getInstance().pause();
}
@Override
public IFuture start()
{
return getInstance().start();
}
@Override
public IFuture stepEvent()
{
return getInstance().stepEvent();
}
@Override
public IFuture stepTime()
{
return getInstance().stepTime();
}
@Override
public IFuture setClockType(String type)
{
return getInstance().setClockType(type);
}
@Override
public IFuture getMode()
{
return getInstance().getMode();
}
@Override
public IFuture isExecuting()
{
return getInstance().isExecuting();
}
@Override
public IClockService getClockService()
{
return getInstance().getClockService();
}
@Override
public IExecutionService getExecutorService()
{
return getInstance().getExecutorService();
}
@Override
public IFuture addAdvanceBlocker(IFuture> blocker)
{
return getInstance().addAdvanceBlocker(blocker);
}
@Override
public void addChangeListener(IChangeListener listener)
{
getInstance().addChangeListener(listener);
}
@Override
public void removeChangeListener(IChangeListener listener)
{
getInstance().removeChangeListener(listener);
}
}