Rio Project 4.2 API Documentation



org.rioproject.cybernode
Class JSBContainer

java.lang.Object
  extended by org.rioproject.cybernode.JSBContainer
All Implemented Interfaces:
ServiceBeanContainer

public class JSBContainer
extends Object
implements ServiceBeanContainer

The JSBContainer implements support for a ServiceBeanContainer

Author:
Dennis Reedy

Constructor Summary
JSBContainer(Configuration config)
          Create a new ServiceBeanContainer
 
Method Summary
 ServiceBeanInstance activate(ServiceElement sElem, OperationalStringManager opStringMgr, EventHandler slaEventHandler)
          Load and start a service defined by provided attributes
 void addListener(ServiceBeanContainerListener l)
          Adds a listener to the set of listeners for this ServiceBeanContainer, provided that it is not the same as some listener already in the set.
 void discarded(Object identifier)
          Informs the ServiceBeanContainer that a service has been discarded
 int getActivationInProcessCount()
          Get the number of services that are currently being activated
 ComputeResource getComputeResource()
          This method is used to get the computeResource attribute.
 ServiceBeanDelegate[] getDelegates(ServiceElement sElem)
           
 ServiceBeanDelegate getServiceBeanDelegate(Uuid serviceUuid)
          Get the ServiceBeanDelegate for a service Uuid
 ServiceBeanInstance[] getServiceBeanInstances(ServiceElement element)
          Get all ServiceBeanInstance objects for a ServiceElement
 int getServiceCounter()
          Get the amount of active services for this ServiceBeanContainer
 ServiceRecord[] getServiceRecords()
          Get all ServiceRecord instances for service instances that have been activated by the ServiceBeanContainer
 Configuration getSharedConfiguration()
          Get the shared configuration which can be used to delegate Configuration information to
 Uuid getUuid()
          Get the Uuid
 void remove(Object identifier)
          Informs the ServiceBeanContainer to remove a service
 void removeListener(ServiceBeanContainerListener l)
          Removes a listener from the set of listeners for this ServiceBeanContainer, provided that the listener is in the set of known listeners
 void setComputeResource(ComputeResource computeResource)
          Set the computeResource property.
 void setUuid(Uuid uuid)
          Set the Uuid
 void started(Object identifier)
          Informs the ServiceBeanContainer that a service has been started
 void terminate()
          Terminate the ServiceBeanContainer
 void terminateServices()
          Terminate the ServiceBeanContainer
 void update(ServiceElement[] sElems, OperationalStringManager opStringMgr)
          Invoked to update instantiated service instances of changes in their ServiceElement objects and OperationalStringManager references.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSBContainer

public JSBContainer(Configuration config)
Create a new ServiceBeanContainer

Parameters:
config - The Configuration to use
Method Detail

getSharedConfiguration

public Configuration getSharedConfiguration()
Description copied from interface: ServiceBeanContainer
Get the shared configuration which can be used to delegate Configuration information to

Specified by:
getSharedConfiguration in interface ServiceBeanContainer
Returns:
The Configuration object that can be used to resolve system set attributes
See Also:
ServiceBeanContainer.getSharedConfiguration()

setComputeResource

public void setComputeResource(ComputeResource computeResource)
Set the computeResource property.

Specified by:
setComputeResource in interface ServiceBeanContainer
Parameters:
computeResource - The ComputeResource to use

getComputeResource

public ComputeResource getComputeResource()
Description copied from interface: ServiceBeanContainer
This method is used to get the computeResource attribute. The computeResource attribute represents the qualitative and quantitative capabilities of the compute resource on which the ServiceBeanContainer is running.

Specified by:
getComputeResource in interface ServiceBeanContainer
Returns:
The ComputeResource Object
See Also:
ServiceBeanContainer.getComputeResource()

terminate

public void terminate()
Terminate the ServiceBeanContainer

Specified by:
terminate in interface ServiceBeanContainer

terminateServices

public void terminateServices()
Terminate the ServiceBeanContainer

Specified by:
terminateServices in interface ServiceBeanContainer

getServiceRecords

public ServiceRecord[] getServiceRecords()
Description copied from interface: ServiceBeanContainer
Get all ServiceRecord instances for service instances that have been activated by the ServiceBeanContainer

Specified by:
getServiceRecords in interface ServiceBeanContainer
Returns:
Array of ServiceRecord instances. A new array is allocated each time. If there are no active ServiceBean instances, return a zero-length array
See Also:
ServiceBeanContainer.getServiceRecords()

getServiceCounter

public int getServiceCounter()
Description copied from interface: ServiceBeanContainer
Get the amount of active services for this ServiceBeanContainer

Specified by:
getServiceCounter in interface ServiceBeanContainer
Returns:
The number of active services
See Also:
ServiceBeanContainer.getServiceCounter()

getActivationInProcessCount

public int getActivationInProcessCount()
Description copied from interface: ServiceBeanContainer
Get the number of services that are currently being activated

Specified by:
getActivationInProcessCount in interface ServiceBeanContainer
Returns:
The number of services currently being activated
See Also:
ServiceBeanContainer.getActivationInProcessCount()

activate

public ServiceBeanInstance activate(ServiceElement sElem,
                                    OperationalStringManager opStringMgr,
                                    EventHandler slaEventHandler)
                             throws JSBInstantiationException
Description copied from interface: ServiceBeanContainer
Load and start a service defined by provided attributes

Specified by:
activate in interface ServiceBeanContainer
Parameters:
sElem - The ServiceElement
opStringMgr - The OperationalStringManager that has deployed and is managing the service
slaEventHandler - The EventHandler which is used to send SLAThresholdEvent notifications for SLAs that have been declared by the service which match quantitative resources the Cybernode has created
Returns:
ServiceBeanInstance
Throws:
JSBInstantiationException - If there are problems loading or instantiating the ServiceBean
See Also:
ServiceBeanContainer.activate(org.rioproject.core.ServiceElement, org.rioproject.core.OperationalStringManager, org.rioproject.event.EventHandler)

update

public void update(ServiceElement[] sElems,
                   OperationalStringManager opStringMgr)
Description copied from interface: ServiceBeanContainer
Invoked to update instantiated service instances of changes in their ServiceElement objects and OperationalStringManager references. This method invoked is typically triggered when the OperationalString has been updated, or the OperationalStringManager has been changed, and provides somewhat of batch update mechanism.

Specified by:
update in interface ServiceBeanContainer
Parameters:
sElems - Array of ServiceElement instances to update
opStringMgr - The OperationalStringManager which is performing the update
See Also:
ServiceBeanContainer.update(org.rioproject.core.ServiceElement[], org.rioproject.core.OperationalStringManager)

getServiceBeanInstances

public ServiceBeanInstance[] getServiceBeanInstances(ServiceElement element)
Description copied from interface: ServiceBeanContainer
Get all ServiceBeanInstance objects for a ServiceElement

Specified by:
getServiceBeanInstances in interface ServiceBeanContainer
Parameters:
element - The ServiceElement to obtain ServiceBeanInstance objects for.
Returns:
An array of ServiceBeanInstance objects. If the element parameter is null return all ServiceBeanInstance objects. A new array is allocated each time. If there are no matching ServiceBeanInstance objects a zero-length array is returned
See Also:
ServiceBeanContainer.getServiceBeanInstances(org.rioproject.core.ServiceElement)

setUuid

public void setUuid(Uuid uuid)
Description copied from interface: ServiceBeanContainer
Set the Uuid

Specified by:
setUuid in interface ServiceBeanContainer
Parameters:
uuid - The Uuid for the ServiceBeanContainer

getUuid

public Uuid getUuid()
Description copied from interface: ServiceBeanContainer
Get the Uuid

Specified by:
getUuid in interface ServiceBeanContainer
Returns:
The Uuid for the ServiceBeanContainer

getDelegates

public ServiceBeanDelegate[] getDelegates(ServiceElement sElem)

started

public void started(Object identifier)
Description copied from interface: ServiceBeanContainer
Informs the ServiceBeanContainer that a service has been started

Specified by:
started in interface ServiceBeanContainer
Parameters:
identifier - Object which can be used by the ServiceBeanContainer to identify the service
See Also:
ServiceBeanContainer.started(Object)

discarded

public void discarded(Object identifier)
Description copied from interface: ServiceBeanContainer
Informs the ServiceBeanContainer that a service has been discarded

Specified by:
discarded in interface ServiceBeanContainer
Parameters:
identifier - Object which can be used by the ServiceBeanContainer to identify the service
See Also:
ServiceBeanContainer.discarded(Object)

remove

public void remove(Object identifier)
Description copied from interface: ServiceBeanContainer
Informs the ServiceBeanContainer to remove a service

Specified by:
remove in interface ServiceBeanContainer
Parameters:
identifier - Object which can be used by the ServiceBeanContainer to identify the service
See Also:
ServiceBeanContainer.remove(Object)

addListener

public void addListener(ServiceBeanContainerListener l)
Description copied from interface: ServiceBeanContainer
Adds a listener to the set of listeners for this ServiceBeanContainer, provided that it is not the same as some listener already in the set. The order in which notifications will be delivered to multiple listener is not specified.

Specified by:
addListener in interface ServiceBeanContainer
Parameters:
l - A ServiceBeanContainerListener to be added.
See Also:
ServiceBeanContainer.addListener(org.rioproject.cybernode.ServiceBeanContainerListener)

removeListener

public void removeListener(ServiceBeanContainerListener l)
Description copied from interface: ServiceBeanContainer
Removes a listener from the set of listeners for this ServiceBeanContainer, provided that the listener is in the set of known listeners

Specified by:
removeListener in interface ServiceBeanContainer
Parameters:
l - A ServiceBeanContainerListener to be removed.
See Also:
ServiceBeanContainer.addListener(org.rioproject.cybernode.ServiceBeanContainerListener)

getServiceBeanDelegate

public ServiceBeanDelegate getServiceBeanDelegate(Uuid serviceUuid)
Description copied from interface: ServiceBeanContainer
Get the ServiceBeanDelegate for a service Uuid

Specified by:
getServiceBeanDelegate in interface ServiceBeanContainer
Parameters:
serviceUuid - The identifier of the service
Returns:
The ServiceBeanDelegate for the identified service or null if not found

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.