Class AbstractRunnablesService
java.lang.Object
de.iip_ecosphere.platform.services.environment.AbstractService
de.iip_ecosphere.platform.services.environment.AbstractRunnablesService
- All Implemented Interfaces:
ParameterConfigurerProvider,Service,ServiceBase
- Direct Known Subclasses:
AbstractProcessService,AbstractPythonProcessService
A basic service that holds and stops runnables.
- Author:
- Holger Eichelberger, SSE
-
Field Summary
FieldsFields inherited from interface de.iip_ecosphere.platform.services.environment.switching.ServiceBase
APPLICATION_SEPARATOR, DEFAULT_APPLICATION_INSTANCE_ID -
Constructor Summary
ConstructorsConstructorDescriptionCreates a service from YAML information.AbstractRunnablesService(String serviceId, InputStream ymlFile) Creates a service from a service id and a YAML artifact. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidRegisters a runnable that shall be stopped instop().protected ServiceStatestop()Stops the service and the background process.Methods inherited from class de.iip_ecosphere.platform.services.environment.AbstractService
activate, addConfigurer, addConfigurer, addConfigurer, addTypeSubstitution, createGenericInstance, createGenericInstanceByPlugin, createGenericMultiInstance, createGenericMultiInstanceByPlugin, createInstance, createInstance, createInstance, createInstanceByPlugin, getArg, getDescription, getId, getKind, getName, getNetMgtKeyAddress, getResourceAsStream, getState, getStringArg, getSubstitutedType, getTypeCreator, getTypeSubstitutions, getVersion, initializeFrom, isDeployable, isTopLevel, notifyReconfigured, passivate, reconf, reconfigure, reconfigure, rollbackReconfigurationOnFailure, setLibJars, setState, start, transferDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.iip_ecosphere.platform.services.environment.Service
createType, createType, getParameterConfigurer, getParameterNames, migrate, switchTo, update
-
Field Details
-
runnables
-
-
Constructor Details
-
AbstractRunnablesService
Creates a service from a service id and a YAML artifact.- Parameters:
serviceId- the service idymlFile- the YML file containing the YAML artifact with the service descriptor
-
AbstractRunnablesService
Creates a service from YAML information.- Parameters:
yaml- the service information as read from YAML. By default, the Python executable is "ServiceEnvironment.py", which can be overridden byYamlProcess.getExecutable().YamlProcess.getHomePath()is set to the home path where the executable was extracted to. Further,YamlProcess.getCmdArg()are taken over if given.
-
-
Method Details
-
register
Registers a runnable that shall be stopped instop().- Parameters:
runnable- the runnable, ignored if null
-
stop
Description copied from class:AbstractServiceStops the service and the background process.- Overrides:
stopin classAbstractService- Returns:
- the state to transition to, may be null for none
-