Package jadex.base.test.impl
Class SharedService<T>
- java.lang.Object
-
- jadex.bridge.service.BasicService
-
- jadex.base.test.impl.SharedService<T>
-
- All Implemented Interfaces:
IInternalService
,IService
- Direct Known Subclasses:
SharedClockService
,SharedExecutionService
,SharedSimulationService
,SharedThreadPoolService
public abstract class SharedService<T> extends BasicService
Helper class to allow sharing a service across platforms in same VM.
-
-
Field Summary
Fields Modifier and Type Field Description protected SharedServiceFactory<T>
factory
The factory from which this impl was created.-
Fields inherited from class jadex.bridge.service.BasicService
DEFAULT_SYSTEM_SECURITY, idcnt, impltype, internalaccess, providerid, shutdowned, sid, started, type
-
Fields inherited from interface jadex.bridge.service.IService
EMPTY_SERVICES
-
-
Constructor Summary
Constructors Constructor Description SharedService(IComponentIdentifier provider, java.lang.Class<T> type, SharedServiceFactory<T> factory)
Get the instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getInstance()
Get the shared instance to delegate calls to.jadex.commons.future.IFuture<java.lang.Void>
shutdownService()
Shutdown the service.jadex.commons.future.IFuture<java.lang.Void>
startService()
Start the service.-
Methods inherited from class jadex.bridge.service.BasicService
createServiceIdentifier, createServiceIdentifier, equals, generateServiceName, getInterfaceType, getInternalAccess, getInvokeMethod, getMethodInfos, getMethodTimeout, getPropertyMap, getProviderId, getSecurityLevel, getServiceId, hashCode, initNFProperties, invokeMethod, isUnrestricted, isValid, setComponentAccess, setPropertyMap, setServiceIdentifier, toString
-
-
-
-
Field Detail
-
factory
protected SharedServiceFactory<T> factory
The factory from which this impl was created.
-
-
Constructor Detail
-
SharedService
public SharedService(IComponentIdentifier provider, java.lang.Class<T> type, SharedServiceFactory<T> factory)
Get the instance.
-
-
Method Detail
-
getInstance
public T getInstance()
Get the shared instance to delegate calls to.
-
startService
public jadex.commons.future.IFuture<java.lang.Void> startService()
Description copied from class:BasicService
Start the service.- Specified by:
startService
in interfaceIInternalService
- Overrides:
startService
in classBasicService
- Returns:
- A future that is done when the service has completed starting.
-
shutdownService
public jadex.commons.future.IFuture<java.lang.Void> shutdownService()
Description copied from class:BasicService
Shutdown the service.- Specified by:
shutdownService
in interfaceIInternalService
- Overrides:
shutdownService
in classBasicService
- Returns:
- A future that is done when the service has completed its shutdown.
-
-