|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.services.discovery.ServiceDiscoveryConfiguration
public class ServiceDiscoveryConfiguration
Service discovery configuration. This configuration is used to specify information related to how a service is described in the context of the Discovery service. Each service that can be discovered is assigned a unique ID which allows another service to re-acquire a previously discovered service. Additionally, a service may specify attributes that are used to distinguish it from other services satisfying the same service types.
Refer to
ServiceDiscoveryConfigurationInterface
for details on the interface this class implements including an example
that illustrates how to access a service's service discovery configuration.
Note that a service will only have a service discovery configuration if it was deployed in the context of a Discovery service. Some services may be used outside of the context of a discovery service, in which case they will not have a service discovery configuration.
ServiceAttributeInterface
,
Serialized FormField Summary |
---|
Fields inherited from interface com.sas.services.ServiceConfigurationInterface |
---|
CONFIGURATION_METADATA_SOURCE, CONFIGURATION_SERVICE_DISCOVERY |
Constructor Summary | |
---|---|
ServiceDiscoveryConfiguration()
Constructs a default instance. |
|
ServiceDiscoveryConfiguration(boolean isRegistrationEnabled,
java.lang.Class[] serviceTypes,
ServiceAttributeInterface[] serviceAttributes,
java.lang.String repositoryId)
Constructs an instance using the specified registration policy. |
Method Summary | |
---|---|
boolean |
addRMIBinding(RMIBinding rmiBinding)
Adds an RMI binding. |
boolean |
addServiceAttribute(ServiceAttributeInterface serviceAttribute)
Adds a service lookup attribute. |
void |
addServiceAttributes(java.util.List serviceAttributesList)
Adds attributes of a service that may be used to distinguish among several services that satisfy the same service types. |
void |
addServiceAttributes(ServiceAttributeInterface[] serviceAttributes)
Adds attributes of a service that may be used to distinguish among several services that satisfy the same service types. |
void |
destroy()
Destroys this configuration by removing any RMI bindings that are associated with an RMI registry. |
java.lang.String |
getDiscoveryId()
Gets an ID which may be used to locate a service using FindServiceInterface.findServiceUsingId(String) . |
java.lang.String |
getJVMId()
Gets an identifier used to represent the JVM in which the service was deployed. |
java.lang.String |
getRepositoryId()
Gets the repository ID. |
ServiceAttributeInterface[] |
getServiceAttributes()
Gets attributes of a service that may be used to refine a service lookup based upon attributes. |
ServiceComponentAttribute |
getServiceComponentAttribute()
Get the ServiceComponent attribute. |
ServiceDeploymentAttribute |
getServiceDeploymentAttribute()
Get the SoftwareComponent attribute. |
java.lang.String |
getServiceFactory()
Gets the service factory. |
java.lang.String |
getServiceGroup()
Gets the service's group. |
java.lang.Class[] |
getServiceTypes()
Gets the service types by which a service wants to be advertised to clients of the Discovery service. |
boolean |
isDelegateRegistrationEnabled()
Determines whether or not a service may be registered with discovery delegates. |
boolean |
removeServiceAttribute(ServiceAttributeInterface serviceAttribute)
Removes a service lookup attribute. |
void |
setDelegateRegistrationEnabled(boolean isRegistrationEnabled)
Specifies whether or not the service should be registered with discovery delegates. |
void |
setRepositoryId(java.lang.String repositoryId)
Sets the service's repository ID. |
void |
setServiceAttributes(ServiceAttributeInterface[] serviceAttributes)
Sets attributes of a service that may be used to distinguish among several services that satisfy the same service types. |
void |
setServiceComponentAttribute(ServiceComponentAttribute serviceComponentAttribute)
Sets the ServiceComponent attribute. |
void |
setServiceDeploymentAttribute(ServiceDeploymentAttribute serviceDeploymentAttribute)
Set the SoftwareComponent attribute. |
void |
setServiceFactory(java.lang.String serviceFactory)
Sets the service factory. |
void |
setServiceGroup(java.lang.String serviceGroup)
Set the ServiceGroup attribute. |
void |
setServiceTypes(java.lang.Class[] serviceTypes)
Sets the service types a service is, extends, or implements. |
java.lang.String |
toString()
Gets a string representation of this instance. |
void |
unbindFromRMIRegistry()
Unbinds all RMI name bindings from the RMI registry. |
Methods inherited from class com.sas.services.ServiceConfiguration |
---|
addServiceConfiguration, getEnvironment, getInitializationObject, getServiceConfiguration, getServiceConfigurations, removeServiceConfiguration, setEnvironment, setInitializationObject |
Constructor Detail |
---|
public ServiceDiscoveryConfiguration() throws ServiceException
ServiceException
- if unable to initialize.public ServiceDiscoveryConfiguration(boolean isRegistrationEnabled, java.lang.Class[] serviceTypes, ServiceAttributeInterface[] serviceAttributes, java.lang.String repositoryId) throws ServiceException
isRegistrationEnabled
- Whether to expose service
to other clients outside of this JVM.serviceTypes
- Types of services supported.serviceAttributes
- Optional attributes that describe the service.repositoryId
- Repository ID for the service.
ServiceException
- if unable to initialize.Method Detail |
---|
public final java.lang.String getDiscoveryId()
FindServiceInterface.findServiceUsingId(String)
.
getDiscoveryId
in interface ServiceDiscoveryConfigurationInterface
null
if undefined.public final java.lang.String getRepositoryId()
getRepositoryId
in interface ServiceDiscoveryConfigurationInterface
public final void setRepositoryId(java.lang.String repositoryId)
repositoryId
- Repository ID.public final boolean isDelegateRegistrationEnabled()
isDelegateRegistrationEnabled
in interface ServiceDiscoveryConfigurationInterface
true
if the service should be registered with
discovery delegates or false
if it isn't.public final void setDelegateRegistrationEnabled(boolean isRegistrationEnabled)
setDelegateRegistrationEnabled
in interface ServiceDiscoveryConfigurationInterface
isRegistrationEnabled
- true
if delegate registration is to be
enabled or false
if it is to be disabled.public final java.lang.Class[] getServiceTypes()
getServiceTypes
in interface ServiceDiscoveryConfigurationInterface
public final void setServiceTypes(java.lang.Class[] serviceTypes)
setServiceTypes
in interface ServiceDiscoveryConfigurationInterface
serviceTypes
- The service types that define a service. Typically
this is expressed in terms of the Java interface(s)
that the service implements, but may also include
classes that the service is or extends.public final ServiceAttributeInterface[] getServiceAttributes()
getServiceAttributes
in interface ServiceDiscoveryConfigurationInterface
null
if no attributes are
associated with this service.public final void setServiceAttributes(ServiceAttributeInterface[] serviceAttributes)
setServiceAttributes
in interface ServiceDiscoveryConfigurationInterface
serviceAttributes
- Attributes that may be used to describe
characteristics of a service in order to distinguish it from other
services that satisfy the same service types.public final void addServiceAttributes(ServiceAttributeInterface[] serviceAttributes)
serviceAttributes
- Attributes that may be used to describe
characteristics of a service in order to distinguish it from other
services that satisfy the same service types.public final void addServiceAttributes(java.util.List serviceAttributesList)
addServiceAttributes
in interface ServiceDiscoveryConfigurationInterface
serviceAttributesList
- Attributes that may be used to describe
characteristics of a service in order to distinguish it from other
services that satisfy the same service types.public final boolean addServiceAttribute(ServiceAttributeInterface serviceAttribute)
addServiceAttribute
in interface ServiceDiscoveryConfigurationInterface
serviceAttribute
- Service lookup attribute.
true
if the service lookup attribute was added or
false
if it wasn't.public final boolean removeServiceAttribute(ServiceAttributeInterface serviceAttribute)
removeServiceAttribute
in interface ServiceDiscoveryConfigurationInterface
serviceAttribute
- Service lookup attribute to be removed.
true
if the service lookup attribute was removed
or false
if it wasn't.public void setServiceComponentAttribute(ServiceComponentAttribute serviceComponentAttribute)
setServiceComponentAttribute
in interface ServiceDiscoveryConfigurationInterface
serviceComponentAttribute
- The ServiceComponent attribute.public final ServiceComponentAttribute getServiceComponentAttribute()
getServiceComponentAttribute
in interface ServiceDiscoveryConfigurationInterface
null
if
no ServiceComponent attribute is associated with this service.public final void setServiceGroup(java.lang.String serviceGroup)
setServiceGroup
in interface ServiceDiscoveryConfigurationInterface
serviceGroup
- The ServiceGroup attribute.public final java.lang.String getServiceGroup()
getServiceGroup
in interface ServiceDiscoveryConfigurationInterface
public final java.lang.String getJVMId()
getJVMId
in interface ServiceDiscoveryConfigurationInterface
null
if serialized from a 9.1.3 code base
since JVMAttribute
was introduced at 9.2.public void setServiceDeploymentAttribute(ServiceDeploymentAttribute serviceDeploymentAttribute)
setServiceDeploymentAttribute
in interface ServiceDiscoveryConfigurationInterface
serviceDeploymentAttribute
- The SoftwareComponent attribute.public final ServiceDeploymentAttribute getServiceDeploymentAttribute()
getServiceDeploymentAttribute
in interface ServiceDiscoveryConfigurationInterface
null
if
no SoftwareComponent attribute is associated with this service.public final java.lang.String getServiceFactory()
getServiceFactory
in interface ServiceDiscoveryConfigurationInterface
public final void setServiceFactory(java.lang.String serviceFactory) throws InitializationException
setServiceFactory
in interface ServiceDiscoveryConfigurationInterface
serviceFactory
- Service factory
InitializationException
- if an invalid factory is specified.public final boolean addRMIBinding(RMIBinding rmiBinding)
rmiBinding
- RMI binding
true
if the set did not already contain
this object.public final void unbindFromRMIRegistry()
unbindFromRMIRegistry
in interface ServiceDiscoveryConfigurationInterface
public final void destroy()
destroy
in interface ServiceDiscoveryConfigurationInterface
public final java.lang.String toString()
toString
in class java.lang.Object
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |