public class SPSService extends AbstractModule<SPSServiceConfig> implements IServiceModule<SPSServiceConfig>, IEventListener
Implementation of SensorHub generic SPS service. The service can manage any of the sensors installed on the SensorHub instance and is configured automatically from the information generated by the sensors interfaces.
config, eventHandler, lastError, logger, securityHandler, startRequested, state, stateLock, statusMsg
Constructor and Description |
---|
SPSService() |
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(SPSServiceConfig 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<SPSServiceConfig>
requestStart
in class AbstractModule<SPSServiceConfig>
SensorHubException
- if startup could not be initiatedpublic void setConfiguration(SPSServiceConfig config)
IModule
setConfiguration
in interface IModule<SPSServiceConfig>
setConfiguration
in class AbstractModule<SPSServiceConfig>
public void start() throws SensorHubException
IModule
start
in interface IModule<SPSServiceConfig>
SensorHubException
public void stop()
IModule
stop
in interface IModule<SPSServiceConfig>
protected void deploy() throws SensorHubException
SensorHubException
protected void undeploy()
public void cleanup() throws SensorHubException
IModule
cleanup
in interface IModule<SPSServiceConfig>
SensorHubException
public void handleEvent(Event<?> e)
handleEvent
in interface IEventListener
Copyright © 2016 Sensia Software LLC. All rights reserved.