Package jadex.platform.service.daemon
Class DaemonService
- java.lang.Object
- 
- jadex.platform.service.daemon.DaemonService
 
- 
- All Implemented Interfaces:
- IDaemonService
 
 public class DaemonService extends java.lang.Object implements IDaemonService The daemon service.
- 
- 
Field SummaryFields Modifier and Type Field Description protected IInternalAccessagentThe agent.protected java.util.Map<java.lang.String,Future<IComponentIdentifier>>futuresThe futures waiting for starting platforms.protected java.util.List<IRemoteChangeListener<IComponentIdentifier>>listenersThe listeners.protected java.util.Map<IComponentIdentifier,java.lang.Process>platformsThe started platforms.- 
Fields inherited from interface jadex.bridge.service.types.daemon.IDaemonServiceADDED, REMOVED
 
- 
 - 
Constructor SummaryConstructors Constructor Description DaemonService()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description IFuture<java.lang.Void>addChangeListener(IRemoteChangeListener<IComponentIdentifier> listener)Add a change listener.protected IFuture<StartOptions>adjustOptions(StartOptions opt)Create or adjust options (e.g.IFuture<java.util.Set<IComponentIdentifier>>getPlatforms()Get the component identifiers of all (managed) platforms.protected voidmessageReceived(IComponentIdentifier cid, java.lang.String pid)Called from agent when a handshake message is recieved.protected voidnotifyListeners(ChangeEvent<IComponentIdentifier> event)Notify the listeners.IFuture<java.lang.Void>removeChangeListener(IRemoteChangeListener<IComponentIdentifier> listener)Remove a change listener.IFuture<java.lang.Void>shutdownPlatform(IComponentIdentifier cid)Shutdown a platform.voidstart()Start the service.IFuture<java.lang.Void>startPlatform(StartOptions options)Start a platform using a configuration.IFuture<java.lang.Void>startPlatform(StartOptions options, long wait)Start a platform using a configuration.IFuture<IComponentIdentifier>startPlatformAndWait(StartOptions options)Start a platform using a configuration.
 
- 
- 
- 
Field Detail- 
agentprotected IInternalAccess agent The agent.
 - 
platformsprotected java.util.Map<IComponentIdentifier,java.lang.Process> platforms The started platforms.
 - 
futuresprotected java.util.Map<java.lang.String,Future<IComponentIdentifier>> futures The futures waiting for starting platforms.
 - 
listenersprotected java.util.List<IRemoteChangeListener<IComponentIdentifier>> listeners The listeners.
 
- 
 - 
Method Detail- 
startpublic void start() Start the service.
 - 
messageReceivedprotected void messageReceived(IComponentIdentifier cid, java.lang.String pid) Called from agent when a handshake message is recieved.
 - 
startPlatformpublic IFuture<java.lang.Void> startPlatform(StartOptions options) Start a platform using a configuration. Performs no checking if the new platform runs.- Specified by:
- startPlatformin interface- IDaemonService
- Parameters:
- options- The start arguments.
 
 - 
startPlatformpublic IFuture<java.lang.Void> startPlatform(StartOptions options, long wait) Start a platform using a configuration. Wait for some time to check if the platform doesn't fail. Only detects, if the new platform process exits during that time.- Specified by:
- startPlatformin interface- IDaemonService
- Parameters:
- options- The start arguments.
 
 - 
startPlatformAndWaitpublic IFuture<IComponentIdentifier> startPlatformAndWait(StartOptions options) Start a platform using a configuration. Wait for successful handshake and return the component identifier of the new platform. Successful handshake means that the init phase of the new platform, including starting of initial components, has completed successfully.- Specified by:
- startPlatformAndWaitin interface- IDaemonService
- Parameters:
- opt- The start arguments.
 
 - 
adjustOptionsprotected IFuture<StartOptions> adjustOptions(StartOptions opt) Create or adjust options (e.g. fill in classpath) if necessary.
 - 
shutdownPlatformpublic IFuture<java.lang.Void> shutdownPlatform(IComponentIdentifier cid) Shutdown a platform.- Specified by:
- shutdownPlatformin interface- IDaemonService
- Parameters:
- cid- The platform id.
 
 - 
getPlatformspublic IFuture<java.util.Set<IComponentIdentifier>> getPlatforms() Get the component identifiers of all (managed) platforms.- Specified by:
- getPlatformsin interface- IDaemonService
- Returns:
- Collection of platform ids.
 
 - 
addChangeListenerpublic IFuture<java.lang.Void> addChangeListener(IRemoteChangeListener<IComponentIdentifier> listener) Add a change listener.- Specified by:
- addChangeListenerin interface- IDaemonService
- Parameters:
- listener- The change listener.
 
 - 
removeChangeListenerpublic IFuture<java.lang.Void> removeChangeListener(IRemoteChangeListener<IComponentIdentifier> listener) Remove a change listener.- Specified by:
- removeChangeListenerin interface- IDaemonService
- Parameters:
- listener- The change listener.
 
 - 
notifyListenersprotected void notifyListeners(ChangeEvent<IComponentIdentifier> event) Notify the listeners.
 
- 
 
-