Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jini.rio.core
Class ServiceElement

    java.lang.Object
      org.jini.rio.core.ServiceElement

All Implemented Interfaces:
  Serializable

    public class ServiceElement

extends Object
implements Serializable

The ServiceElement object provides context on how to provision and instantiate services in the Rio architecture.

See Also:
  Serialized Form

Field Summary
`static int` | `DYNAMIC` The DYNAMIC type indicates that the ServiceElement will be provisioned to available ServiceBeanInstantiator instances that support the service's operational criteria up to the amount specified by the number of planned instances.
`static int` | `EXTERNAL` The EXTERNAL type indicates that the ServiceElement is not a provisionable component and must be instantiated using external mechanisms
`static int` | `FIXED` The FIXED type indicates that the ServiceElement will be provisioned to every ServiceBeanInstantiator instance that supports the ServiceBean operational criteria
`static int` | `PHYSICAL` Declares that the macine boundary between service instances is at the physical (machine) level
`static int` | `VIRTUAL` Declares that the macine boundary between service instances is at the JVM

Constructor Summary
`ServiceElement(int provisionType, ServiceBeanConfig sbConfig, ServiceLevelAgreements slAgreements, ClassBundle[] exports, ClassBundle fdhBundle)` Construct a ServiceElement
`ServiceElement(int provisionType, ServiceBeanConfig sbConfig, ServiceLevelAgreements slAgreements, ClassBundle[] exports, ClassBundle fdhBundle, ClassBundle componentBundle)` Construct a ServiceElement
`ServiceElement(ServiceBeanConfig sbConfig, ClassBundle[] exports, ClassBundle fdhBundle)` Construct a ServiceElement

Method Summary
`void` | `decrementPlanned()` Decrement the number of instances of this service that should exist on the network by one.
`boolean` | `equals(Object obj)` Override equals
`int` | `getActual()` Get the actual amount of services discovered
`AssociationDescriptor[]` | `getAssociationDescriptors()` Get the associations for the service
`boolean` | `getAutoAdvertise()` Get whether to automatically advertise the service as part of service instantiation
`String[]` | `getCluster()` Get the cluster of targeted machine(s) to provision the ServiceBean to.
`ClassBundle` | `getComponentBundle()` Get the component ClassBundle
`boolean` | `getDiscoveryManagementPooling()` Get whether to acquire the DiscoveryManagement for the service from a shared pool of DiscoveryManagement instances.
`ClassBundle[]` | `getExportBundles()` Get the the Array of ClassBundle objects for the public interfaces the service implements
`URL[]` | `getExportURLs()` Get the export URLs.
`ClassBundle` | `getFaultDetectionHandlerBundle()` Get the FaultDetectionHandler ClassBundle
`int` | `getMachineBoundary()` Get the machine boundary
`boolean` | `getMatchOnName()` If this method returns true then the name of the service is used in addition to the interfaces implemented by the service or service proxy to track service instances.
`int` | `getMaxPerMachine()` Get the maximum number of instances of this service that should exist on any given machine
`String` | `getName()` Get the name of the ServiceElement
`String` | `getOperationalStringName()` Get the name of the OperationalString
`int` | `getPlanned()` Get the number of instances of this service that should exist on the network.
`Collection` | `getProvisionablePlatformCapabilities()` Get the provisionable SystemRequirement instances
`int` | `getProvisionType()` Get the provision type set for this service.
`ServiceBeanConfig` | `getServiceBeanConfig()` This method returns an instance of the `ServiceBeanConfig` object created for this service as part of this Operational String
`ServiceLevelAgreements` | `getServiceLevelAgreements()` Returns the ServiceLevelAgreements object.
`int` | `hashCode()` Override hashCode
`void` | `incrementPlanned()` Increment the number of instances of this service that should exist on the network by one
`static void` | `main(String[] args)`
`void` | `recomputeMessageDigests()` Deprecated.
`void` | `setActual(int actual)` Set the actual
`void` | `setAssociationDescriptors(AssociationDescriptor[] assocDescs)` Set the associations for the service
`void` | `setAutoAdvertise(boolean autoAdvertise)` Set whether to automatically advertise the service as part of service instantiation
`void` | `setCluster(String[] machineCluster)` Set the machineCluster property
`void` | `setComponentBundle(ClassBundle componentBundle)` Set the component ClassBundle
`void` | `setDiscoveryManagementPooling(boolean discoPool)` Set whether to acquire the DiscoveryManagement for the service from a shared pool of DiscoveryManagement instances.
`void` | `setMachineBoundary(int boundary)` Set the machine boundary.
`void` | `setMatchOnName(boolean matchOnName)` Set whether to use the name of the service is used in addition to the interfaces implemented by the service or service proxy to track service instances.
`void` | `setMaxPerMachine(int maxPerMachine)` Set the maximum number of instances of this service that should exist on any given machine
`void` | `setPlanned(int planned)` Set the number of instances of this service that should exist on the network.
`void` | `setProvisionablePlatformCapabilities(Collection<ServiceLevelAgreements.SystemRequirement> downloadableCapabilities)` Set the SystemRequirement downloads for a resource.
`void` | `setServiceBeanConfig(ServiceBeanConfig sbConfig)` This method sets the instance of `ServiceBeanConfig` as an attribute of the `ServiceElement` object.
`String` | `toString()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### EXTERNAL

    public static final int EXTERNAL

  The EXTERNAL type indicates that the ServiceElement is not a provisionable component and must be instantiated using external mechanisms

  See Also:
    Constant Field Values

### DYNAMIC

    public static final int DYNAMIC

  The DYNAMIC type indicates that the ServiceElement will be provisioned to available ServiceBeanInstantiator instances that support the service's operational criteria up to the amount specified by the number of planned instances.

  See Also:
    Constant Field Values

### FIXED

    public static final int FIXED

  The FIXED type indicates that the ServiceElement will be provisioned to every ServiceBeanInstantiator instance that supports the ServiceBean operational criteria

  See Also:
    Constant Field Values

### VIRTUAL

    public static final int VIRTUAL

  Declares that the macine boundary between service instances is at the JVM

  See Also:
    Constant Field Values

### PHYSICAL

    public static final int PHYSICAL

  Declares that the macine boundary between service instances is at the physical (machine) level

  See Also:
    Constant Field Values

Constructor Detail

### ServiceElement

    public ServiceElement(ServiceBeanConfig sbConfig,
                          ClassBundle[] exports,
                          ClassBundle fdhBundle)

  Construct a ServiceElement

  Parameters:
    `sbConfig` - The ServiceBeanConfig to set
    `exports` - ClassBundle[] of JARs to use as the export codebase
    `fdhBundle` - ClassBundle for the FaultDetectionHandler

### ServiceElement

    public ServiceElement(int provisionType,
                          ServiceBeanConfig sbConfig,
                          ServiceLevelAgreements slAgreements,
                          ClassBundle[] exports,
                          ClassBundle fdhBundle)

  Construct a ServiceElement

  Parameters:
    `provisionType` - EXTERNAL, DYNAMIC or FIXED
    `sbConfig` - The ServiceBeanConfig to set
    `slAgreements` - Attributes relating to SLAs
    `exports` - ClassBundle[] of JARs to use as the export codebase
    `fdhBundle` - ClassBundle for the FaultDetectionHandler

### ServiceElement

    public ServiceElement(int provisionType,
                          ServiceBeanConfig sbConfig,
                          ServiceLevelAgreements slAgreements,
                          ClassBundle[] exports,
                          ClassBundle fdhBundle,
                          ClassBundle componentBundle)

  Construct a ServiceElement

  Parameters:
    `provisionType` - EXTERNAL, DYNAMIC or FIXED
    `sbConfig` - The ServiceBeanConfig to set
    `slAgreements` - Attributes relating to SLAs
    `exports` - ClassBundle[] of JARs to use as the export codebase
    `fdhBundle` - ClassBundle for the FaultDetectionHandler
    `componentBundle` - The ClassBundle for the ServiceBean component

Method Detail

### getProvisionType

    public int getProvisionType()

  Get the provision type set for this service. The provision type will either be EXTERNAL, DYNAMIC or FIXED

  Returns:
    The provison type

### getName

    public String getName()

  Get the name of the ServiceElement

  Returns:
    The name of the ServiceElement

### setPlanned

    public void setPlanned(int planned)

  Set the number of instances of this service that should exist on the network.

  Parameters:
    `planned` - The number of planned instances
  Throws:
    `IllegalArgumentException` - if planned is less then 0

### incrementPlanned

    public void incrementPlanned()

  Increment the number of instances of this service that should exist on the network by one

### decrementPlanned

    public void decrementPlanned()

  Decrement the number of instances of this service that should exist on the network by one. If the planned attribute is zero, this operational does nothing

### getPlanned

    public int getPlanned()

  Get the number of instances of this service that should exist on the network.

  Returns:
    int The number of instances of this service that should exist on the network

### setActual

    public void setActual(int actual)

  Set the actual

  Parameters:
    `actual` - The amount of services discovered

### getActual

    public int getActual()

  Get the actual amount of services discovered

  Returns:
    The actualt number of discovered instances

### setMaxPerMachine

    public void setMaxPerMachine(int maxPerMachine)

  Set the maximum number of instances of this service that should exist on any given machine

  Parameters:
    `maxPerMachine` - The maximum number of service that should exist on any given machine
  Throws:
    `IllegalArgumentException` - if maxPerMachine is less then -1

### getMaxPerMachine

    public int getMaxPerMachine()

  Get the maximum number of instances of this service that should exist on any given machine

  Returns:
    The maximum number of service that should exist on any given machine. If the maxPerMachine value has not been set, the value will be -1

### setMachineBoundary

    public void setMachineBoundary(int boundary)

  Set the machine boundary. This property, when used in conjunction with the `maxPerMachine` property, sets the boundary affinity between servce instances to be either at the virtual machine or the physical machine

  Parameters:
    `boundary` - The machine boundary.
  Throws:
    `IllegalArgumentException` - If the boundary is not `VIRTUAL` or `PHYSICAL`

### getMachineBoundary

    public int getMachineBoundary()

  Get the machine boundary

  Returns:
    The machine boundary. Only used in conjunction with the `maxPerMachine` property

### setCluster

    public void setCluster(String[] machineCluster)

  Set the machineCluster property

  Parameters:
    `machineCluster` - The cluster of targeted machine(s) to provision the ServiceBean to. Array elements will be either the hostname or an IP Address of a machine.

### getCluster

    public String[] getCluster()

  Get the cluster of targeted machine(s) to provision the ServiceBean to. Array elements will be either the hostname or an IP Address of a machine.

  Returns:
    An array of machines to provision the ServiceBean to

### getFaultDetectionHandlerBundle

    public ClassBundle getFaultDetectionHandlerBundle()

  Get the FaultDetectionHandler ClassBundle

  Returns:
    The ClassBundle providing attributes on the FaultDetectionHandler to use

### setServiceBeanConfig

    public void setServiceBeanConfig(ServiceBeanConfig sbConfig)

  This method sets the instance of `ServiceBeanConfig` as an attribute of the `ServiceElement` object.

  Parameters:
    `sbConfig` - The ServiceBeanConfig to set

### getServiceBeanConfig

    public ServiceBeanConfig getServiceBeanConfig()

  This method returns an instance of the `ServiceBeanConfig` object created for this service as part of this Operational String

  Returns:
    The ServiceBeanConfig object for this ServiceElement

### getOperationalStringName

    public String getOperationalStringName()

  Get the name of the OperationalString

  Returns:
    Name of the OperationalString

### setAutoAdvertise

    public void setAutoAdvertise(boolean autoAdvertise)

  Set whether to automatically advertise the service as part of service instantiation

  Parameters:
    `autoAdvertise` - If true, automatically advertise the ServiceBean when instantiated

### getAutoAdvertise

    public boolean getAutoAdvertise()

  Get whether to automatically advertise the service as part of service instantiation

  Returns:
    If true, automatically advertise the ServiceBean when instantiated

### setDiscoveryManagementPooling

    public void setDiscoveryManagementPooling(boolean discoPool)

  Set whether to acquire the DiscoveryManagement for the service from a shared pool of DiscoveryManagement instances. Sharing DiscoveryManagement instances results in optimizing the creation of DiscoveryManagement instances Note: Use of shared (pooled) DiscoveryManagement instances must be used with care as changing the settings of the returned DiscoveryManagement instance may present problems for other users of DiscoveryManagement instance and is not advised.

  Parameters:
    `discoPool` - If true, get the DiscoveryManagement instance for the service from a pool of available DiscoveryManagement instances

### getDiscoveryManagementPooling

    public boolean getDiscoveryManagementPooling()

  Get whether to acquire the DiscoveryManagement for the service from a shared pool of DiscoveryManagement instances. Sharing DiscoveryManagement instances results in optimizing the creation of DiscoveryManagement instances Note: Use of shared (pooled) DiscoveryManagement instances must be used with care as changing the settings of the returned DiscoveryManagement instance may present problems for other users of DiscoveryManagement instance and is not advised.

  Returns:
    If true, get the DiscoveryManagement instance for the service from a pool of available DiscoveryManagement instances

### setMatchOnName

    public void setMatchOnName(boolean matchOnName)

  Set whether to use the name of the service is used in addition to the interfaces implemented by the service or service proxy to track service instances.

  Parameters:
    `matchOnName` - If true to use the name returned by the `getName` method in addition to the interfaces implemented by the service or service proxy to track service instances.

### getMatchOnName

    public boolean getMatchOnName()

  If this method returns true then the name of the service is used in addition to the interfaces implemented by the service or service proxy to track service instances. If this method returns false, then only the interfaces will be used.

  Returns:
    boolean true to use the name returned by the `getName` method

### setComponentBundle

    public void setComponentBundle(ClassBundle componentBundle)

  Set the component ClassBundle

  Parameters:
    `componentBundle` - The ClassBundle identifying the class and required resources to load the ServiceBean

### getComponentBundle

    public ClassBundle getComponentBundle()

  Get the component ClassBundle

  Returns:
    The ClassBundle identifying the class and required resources to load the ServiceBean

### getExportBundles

    public ClassBundle[] getExportBundles()

  Get the the Array of ClassBundle objects for the public interfaces the service implements

  Returns:
    Array of ClassBundle objects for the public interfaces the service implements

### getExportURLs

    public URL[] getExportURLs()
                        throws MalformedURLException

  Get the export URLs. Helper method to get the array of URLs from the array of ClassBundle objcts representing the export class(es) and searchpaths for those classes

  Returns:
    Array of URLs of the export classes. A new array is allocate each time this method is called
  Throws:
    `MalformedURLException` - If the URLs are incorrect

### getServiceLevelAgreements

    public ServiceLevelAgreements getServiceLevelAgreements()

  Returns the ServiceLevelAgreements object.

  Returns:
    The ServiceLevelAgreements object defines system and service level objectives that are to be monitored, metered and acted on by policy handlers

### setAssociationDescriptors

    public void setAssociationDescriptors(AssociationDescriptor[] assocDescs)

  Set the associations for the service

  Parameters:
    `assocDescs` - An Array of AssociationDescriptor objects

### getAssociationDescriptors

    public AssociationDescriptor[] getAssociationDescriptors()

  Get the associations for the service

  Returns:
    Array of AssociationDescriptor objects. If there are no AssociationDescriptor objects, this method returns a zero-length array

### setProvisionablePlatformCapabilities

    public void setProvisionablePlatformCapabilities(Collection<ServiceLevelAgreements.SystemRequirement> downloadableCapabilities)

  Set the SystemRequirement downloads for a resource.

  Parameters:
    `downloadableCapabilities` - The downloadableCapabilities

### getProvisionablePlatformCapabilities

    public Collection getProvisionablePlatformCapabilities()

  Get the provisionable SystemRequirement instances

  Returns:
    A Collection of SystemRequirement instances which need to be provisioned in order for the ServiceBean to be instantiated. A new Collection is created each time this method is called. If there are no provisionable SystemRequirement instances, this method returns an empty Collection.

### recomputeMessageDigests

    public void recomputeMessageDigests()
                                 throws Exception

  Deprecated.

  Recompute message digests for contained ClassBundle instances

  Throws:
    `Exception` - If there are erros recomputing the message digest

### hashCode

    public int hashCode()

  Override hashCode

  Overrides:
    `hashCode` in class `Object`

### equals

    public boolean equals(Object obj)

  Override equals

  Overrides:
    `equals` in class `Object`

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### main

    public static void main(String[] args)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © Project Rio.