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.Service
START_COMPARATORFields 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.voidUpdates the service by the service in the givenlocation.Methods inherited from class de.iip_ecosphere.platform.services.environment.DefaultServiceImpl
migrate, switchToMethods 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, getArtifact, getDescription, getId, getKind, getName, getNetMgtKeyAddress, getResourceAsStream, getStringArg, getSubstitutedType, getTypeCreator, getTypeSubstitutions, getVersion, initializeFrom, isDeployable, isTopLevel, notifyReconfigured, passivate, reconf, reconfigure, reconfigure, rollbackReconfigurationOnFailure, setLibJars, start, stop, transferData, transferStateMethods 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, startData, stopData
-
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
-
update
Description copied from interface:ServiceUpdates the service by the service in the givenlocation. This operation is responsible for stopping the running service (if needed), replacing it, starting the new service.- Specified by:
updatein interfaceService- Overrides:
updatein classDefaultServiceImpl- Parameters:
location- the location of the new service, e.g., an URL- Throws:
ExecutionException- if the given service cannot be updated for some reason, e.g., because the replacement service is not an evolved version of the running service
-