Class FamilyServiceStub
java.lang.Object
de.iip_ecosphere.platform.services.environment.AbstractService
de.iip_ecosphere.platform.services.environment.DefaultServiceImpl
de.iip_ecosphere.platform.services.environment.FamilyServiceStub
- All Implemented Interfaces:
ParameterConfigurerProvider,Service,ServiceBase
Family service implementations are supposed to delegate their operations to the (alternative) active family member.
Thus, there may not be a fully fledged service implementation for the family and management operations may just not
work. This class is a basis for a no-operation service (stub) that delegates relevant operations to its active
service. To not further interfere with the switching mechanism, the active service is provided via a supplier.
Currently, not all management operations are supported, e.g., migrate, switch etc. are missing (in the
ServiceBase interface).- 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
ConstructorsConstructorDescriptionFamilyServiceStub(String serviceId, InputStream ymlFile) Creates a family service stub from a service id and a YAML artifact. -
Method Summary
Modifier and TypeMethodDescriptiongetState()Returns the state the service is currently in.voidsetActiveMemberSupplier(Supplier<ServiceBase> active) Changes the active service member.voidsetState(ServiceState state) Changes the state.Methods inherited from class de.iip_ecosphere.platform.services.environment.DefaultServiceImpl
migrate, switchTo, updateMethods inherited from class de.iip_ecosphere.platform.services.environment.AbstractService
activate, addConfigurer, addConfigurer, addConfigurer, addTypeSubstitution, createGenericInstance, createGenericInstance, createGenericInstanceByPlugin, createGenericMultiInstance, createGenericMultiInstance, createGenericMultiInstanceByPlugin, createInstance, createInstance, createInstance, createInstanceByPlugin, getArg, getDescription, getId, getKind, getName, getNetMgtKeyAddress, getResourceAsStream, getStringArg, getSubstitutedType, getTypeCreator, getTypeSubstitutions, getVersion, initializeFrom, isDeployable, isTopLevel, notifyReconfigured, passivate, reconf, reconfigure, reconfigure, rollbackReconfigurationOnFailure, setLibJars, start, stop, 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
-
Field Details
-
active
-
-
Constructor Details
-
FamilyServiceStub
Creates a family service stub from a service id and a YAML artifact.- Parameters:
serviceId- the service idymlFile- the YML file containing the YAML artifact with the service descriptor
-
-
Method Details
-
setActiveMemberSupplier
Changes the active service member.- Parameters:
active- the new active member
-
setState
Description copied from class:AbstractServiceChanges the state. [R133c]- Specified by:
setStatein interfaceServiceBase- Overrides:
setStatein classAbstractService- Parameters:
state- the new state- Throws:
ExecutionException- if changing the state fails for some reason- See Also:
-
getState
Description copied from interface:ServiceBaseReturns the state the service is currently in. [R4c]- Specified by:
getStatein interfaceServiceBase- Overrides:
getStatein classAbstractService- Returns:
- the state
-