public class SOSService extends AbstractModule<SOSServiceConfig> implements IServiceModule<SOSServiceConfig>, IEventListener
Implementation of SensorHub generic SOS service. This service is automatically configured (mostly) from information obtained from the selected data sources (sensors, storages, processes, etc).
config, eventHandler, lastError, logger, securityHandler, startRequested, state, stateLock, statusMsg
Constructor and Description |
---|
SOSService() |
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Cleans up all ressources used by the module when deleted
All persistent resources created by the module should be cleaned
when this is called
|
protected void |
deploy() |
void |
handleEvent(Event<?> e) |
void |
requestStart()
Requests the module to start.
Implementations of this method may block until the module is started or return immediately while they wait for the proper start conditions. When this method returns without error the module state is guaranteed to be ModuleEvent.ModuleState.STARTING |
void |
setConfiguration(SOSServiceConfig config)
Sets the module configuration
|
void |
start()
Starts the module synchronously with the current configuration.
Implementations of this method must block until the module is successfully started or send an exception. Module lifecycle events may not be generated when calling this method directly. init() should always be called before start(). |
void |
stop()
Stops the module.
All temporary resources created by the module should be cleaned when this is called (ex: memory, files, connections, etc.) Implementations of this method must block until the module is successfully stopped or send an exception. Module lifecycle events may not be generated when calling this method directly. stop() can be called right after init() even if start() hasn't been called. |
protected void |
undeploy() |
canInit, canStart, canStop, clearError, clearStatus, getConfiguration, getCurrentError, getCurrentState, getLocalID, getLogger, getName, getStatusMessage, init, init, isInitialized, isStarted, loadState, notifyConnectionStatus, registerListener, reportError, reportError, reportStatus, requestInit, requestStop, saveState, setState, toString, unregisterListener, updateConfig, waitForState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getConfiguration, getCurrentError, getCurrentState, getLocalID, getName, getStatusMessage, init, init, isInitialized, isStarted, loadState, registerListener, requestInit, requestStop, saveState, unregisterListener, updateConfig, waitForState
public void requestStart() throws SensorHubException
IModule
ModuleEvent.ModuleState.STARTING
requestStart
in interface IModule<SOSServiceConfig>
requestStart
in class AbstractModule<SOSServiceConfig>
SensorHubException
- if startup could not be initiatedpublic void setConfiguration(SOSServiceConfig config)
IModule
setConfiguration
in interface IModule<SOSServiceConfig>
setConfiguration
in class AbstractModule<SOSServiceConfig>
public void start() throws SensorHubException
IModule
start
in interface IModule<SOSServiceConfig>
SensorHubException
public void stop()
IModule
stop
in interface IModule<SOSServiceConfig>
protected void deploy() throws SensorHubException
SensorHubException
protected void undeploy()
public void cleanup() throws SensorHubException
IModule
cleanup
in interface IModule<SOSServiceConfig>
SensorHubException
public void handleEvent(Event<?> e)
handleEvent
in interface IEventListener
Copyright © 2016 Sensia Software LLC. All rights reserved.