Rio Project 4.2 API Documentation



org.rioproject.cybernode
Interface ServiceBeanContainer

All Known Implementing Classes:
JSBContainer

public interface ServiceBeanContainer

The ServiceBeanContainer defines the semantics required to instantiate service instances described by a ServiceElement

Author:
Dennis Reedy

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 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()
          This will terminate all ServiceBeans running in the ServiceBeanContainer
 void update(ServiceElement[] sElems, OperationalStringManager opStringMgr)
          Invoked to update instantiated service instances of changes in their ServiceElement objects and OperationalStringManager references.
 

Method Detail

getSharedConfiguration

Configuration getSharedConfiguration()
Get the shared configuration which can be used to delegate Configuration information to

Returns:
The Configuration object that can be used to resolve system set attributes
See Also:
AggregateConfig

setComputeResource

void setComputeResource(ComputeResource computeResource)
Set the computeResource property. The computeResource attribute represents the qualitative and quantitative capabilities of the compute resource on which the ServiceBeanContainer is running.

Parameters:
computeResource - The ComputeResource Object to use

getComputeResource

ComputeResource getComputeResource()
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.

Returns:
The ComputeResource Object

started

void started(Object identifier)
Informs the ServiceBeanContainer that a service has been started

Parameters:
identifier - Object which can be used by the ServiceBeanContainer to identify the service

discarded

void discarded(Object identifier)
Informs the ServiceBeanContainer that a service has been discarded

Parameters:
identifier - Object which can be used by the ServiceBeanContainer to identify the service

remove

void remove(Object identifier)
Informs the ServiceBeanContainer to remove a service

Parameters:
identifier - Object which can be used by the ServiceBeanContainer to identify the service

getServiceCounter

int getServiceCounter()
Get the amount of active services for this ServiceBeanContainer

Returns:
The number of active services

activate

ServiceBeanInstance activate(ServiceElement sElem,
                             OperationalStringManager opStringMgr,
                             EventHandler slaEventHandler)
                             throws JSBInstantiationException
Load and start a service defined by provided attributes

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

update

void update(ServiceElement[] sElems,
            OperationalStringManager opStringMgr)
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.

Parameters:
sElems - Array of ServiceElement instances to update
opStringMgr - The OperationalStringManager which is performing the update

getServiceRecords

ServiceRecord[] getServiceRecords()
Get all ServiceRecord instances for service instances that have been activated by the 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

getServiceBeanInstances

ServiceBeanInstance[] getServiceBeanInstances(ServiceElement element)
Get all ServiceBeanInstance objects for a ServiceElement

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

setUuid

void setUuid(Uuid uuid)
Set the Uuid

Parameters:
uuid - The Uuid for the ServiceBeanContainer

getUuid

Uuid getUuid()
Get the Uuid

Returns:
The Uuid for the ServiceBeanContainer

getActivationInProcessCount

int getActivationInProcessCount()
Get the number of services that are currently being activated

Returns:
The number of services currently being activated

addListener

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. The order in which notifications will be delivered to multiple listener is not specified.

Parameters:
l - A ServiceBeanContainerListener to be added.

removeListener

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

Parameters:
l - A ServiceBeanContainerListener to be removed.

getServiceBeanDelegate

ServiceBeanDelegate getServiceBeanDelegate(Uuid serviceUuid)
Get the ServiceBeanDelegate for a service Uuid

Parameters:
serviceUuid - The identifier of the service
Returns:
The ServiceBeanDelegate for the identified service or null if not found

terminate

void terminate()
Terminate the ServiceBeanContainer. This will terminate all ServiceBeans running in the ServiceBeanContainer, and shutdown all resources created by the host and exit. After this call is invoked, attempts to start new ServiceBean instances are undefined


terminateServices

void terminateServices()
This will terminate all ServiceBeans running in the ServiceBeanContainer


Copyright © Rio Project.

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