public class ServiceInformation extends AbstractRegistry.InstanceInformation
AbstractRegistry. It encapsulates additional properties from the
configuration relevant for a service instance:
These attributes and the ones from InstanceInformation are
closely related and have interdependencies. They are assured when creating
information objects via the static factory methods.
Local services must have a valid implementation class or an implementation
object. If an implementation class is configured or the implementation object
is provided, no service URI may be present. Contrary, if no implementation
class or is configured or implementation object is provided, a service URI
may be present but does not have to. If neither an implementation class nor
an implementation object nor a service URI is configured, the service is
expected to be published at the global registry.
Only a local service may be exported, therefore
exportServiceInstances is only present (!= null) for local
services.
The following constraints are respected when creating the objects via the
static factory methods and thus can be relied on when using the object:
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String[] |
exportServiceInstances
A list of service names that export this service or an empty list
in case of a remote service.
|
protected boolean |
publish
Whether a local service that is exported is to be published.
|
protected java.net.URI |
serviceURI
The service URI of the service or
null in case of a local or
indirectly addressed service. |
componentType, implementation, implementationClass, implInitialised, instantiationMode| Modifier and Type | Method and Description |
|---|---|
protected static ServiceInformation |
createExportedLocalService(java.lang.String serviceType,
AbstractRegistry.InstantiationMode instantiationMode,
java.lang.String implementationClass,
java.lang.String[] exportServiceInstances,
boolean publish)
Creates a new service information instance for an exported local service
with the designated attributes.
|
protected static ServiceInformation |
createExportedLocalServiceForObject(java.lang.String serviceType,
ADEPT2Service implementation,
java.lang.String[] exportServiceInstances,
boolean publish)
Creates a new service information instance for an exported local service
provided as object with the designated attributes.
|
protected static ServiceInformation |
createNonExportedLocalService(java.lang.String serviceType,
AbstractRegistry.InstantiationMode instantiationMode,
java.lang.String implementationClass)
Creates a new service information instance for a non-exported local service
with the designated attributes.
|
protected static ServiceInformation |
createNonExportedLocalServiceForObject(java.lang.String serviceType,
ADEPT2Service implementation)
Creates a new service information instance for a non-exported local service
provided as object with the designated attributes.
|
protected static ServiceInformation |
createPrivateRemoteService(java.lang.String serviceType,
java.net.URI serviceURI)
Creates a new service information instance for a private remote service
with the designated attributes.
|
protected static ServiceInformation |
createPublicRemoteService(java.lang.String serviceType)
Creates a new service information instance for a public remote service with
the designated attributes.
|
protected boolean |
isExportedLocal()
Returns whether this is a local and exported service (instead of a remote
or a non-exported local service).
|
protected boolean |
isPublic()
Returns whether this is a public remote service (instead of a private
remote or a local service).
|
protected boolean |
isRemote()
Returns whether this is a remote service (instead of a local service).
|
getImplementationClass, instantiatedInitialised, instantiatedInitRequired, isInstantiatedprotected final java.net.URI serviceURI
null in case of a local or
indirectly addressed service.protected final java.lang.String[] exportServiceInstances
protected final boolean publish
protected static ServiceInformation createExportedLocalService(java.lang.String serviceType, AbstractRegistry.InstantiationMode instantiationMode, java.lang.String implementationClass, java.lang.String[] exportServiceInstances, boolean publish)
serviceType a valid name for a registered interface (c.
f. AbstractRegistry.InstanceInformation.componentType)instantiationMode: the configuration instantiation mode implementationClass: name of a valid class implementation: null serviceURI: null exportServiceInstances: instance names for
ADEPT2ServiceExports publish: TRUE or FALSE
serviceType - The name of the service (component) type.instantiationMode - The instantiation mode of the service. This is
usually AbstractRegistry.InstantiationMode.SINGLETON.implementationClass - The implementation (class name) to use for the
service instance which conforms to the corresponding service type
interface.exportServiceInstances - The name of service instances of type
ADEPT2ServiceExport.publish - Whether the local exported service is to be published.protected static ServiceInformation createExportedLocalServiceForObject(java.lang.String serviceType, ADEPT2Service implementation, java.lang.String[] exportServiceInstances, boolean publish)
serviceType a valid name for a registered interface (c. f.
AbstractRegistry.InstanceInformation.componentType)instantiationMode: InstantiationMode.SINGLETONimplementationClass: nullimplementation: the provided objectserviceURI: nullexportServiceInstances: instance names for
ADEPT2ServiceExportspublish: TRUE or FALSEserviceType - The name of the service (component) type.implementation - The implementation (object) to use for the service
instance which conforms to the corresponding service type
interface.exportServiceInstances - The name of service instances of type
ADEPT2ServiceExport.publish - Whether the local exported service is to be published.protected static ServiceInformation createNonExportedLocalService(java.lang.String serviceType, AbstractRegistry.InstantiationMode instantiationMode, java.lang.String implementationClass)
serviceType a valid name for a registered interface (c.
f. AbstractRegistry.InstanceInformation.componentType)instantiationMode: the configuration instantiation mode implementationClass: name of a valid class implementation: null serviceURI: null exportServiceInstances: null publish: FALSE
serviceType - The name of the service (component) type.instantiationMode - The instantiation mode of the service. This is
usually AbstractRegistry.InstantiationMode.SINGLETON.implementationClass - The implementation (class name) to use for the
service instance which conforms to the corresponding service type
interface.protected static ServiceInformation createNonExportedLocalServiceForObject(java.lang.String serviceType, ADEPT2Service implementation)
serviceType a valid name for a registered interface (c. f.
AbstractRegistry.InstanceInformation.componentType)instantiationMode: the configuration instantiation modeimplementationClass: nullimplementation: the provided objectserviceURI: nullexportServiceInstances: nullpublish: FALSEserviceType - The name of the service (component) type.implementation - The implementation (object) to use for the service
instance which conforms to the corresponding service type
interface.protected static ServiceInformation createPublicRemoteService(java.lang.String serviceType)
serviceType a valid name for a registered interface (c.
f. AbstractRegistry.InstanceInformation.componentType)instantiationMode: InstantiationMode.SINGLETON implementationClass: null implementation: null serviceURI: null exportServiceInstances: null publish: FALSE serviceType - The name of the service (component) type.protected static ServiceInformation createPrivateRemoteService(java.lang.String serviceType, java.net.URI serviceURI)
serviceType a valid name for a registered interface (c.
f. AbstractRegistry.InstanceInformation.componentType)instantiationMode: InstantiationMode.SINGLETON implementationClass: null implementation: null serviceURI: a valid URI of a service exportServiceInstances: null publish: FALSE
serviceType - The name of the service (component) type.serviceURI - A valid service URI for a private remote service.protected boolean isRemote()
protected boolean isPublic()
protected boolean isExportedLocal()