Rio Project 4.2 API Documentation



org.rioproject.cybernode
Class JSBDelegate

java.lang.Object
  extended by org.rioproject.cybernode.JSBDelegate
All Implemented Interfaces:
ServiceBeanDelegate

public class JSBDelegate
extends Object
implements ServiceBeanDelegate

The JSBDelegate provides loading and management services for a service which has been instantiated by a ServiceBeanContainer

Author:
Dennis Reedy

Field Summary
protected  ServiceBeanLoader.Result loadResult
          Result from loading the service
 
Constructor Summary
JSBDelegate(Object identifier, Uuid serviceID, ServiceBeanContainer container)
          Create a JSBDelegate
 
Method Summary
 void advertise()
          Advertise the ServiceBean, making it available to all clients
 ComputeResourceUtilization getComputeResourceUtilization()
          Get the ComputeResourceUtilization
 ServiceBeanInstance getServiceBeanInstance()
          Get the ServiceBeanInstance
 ServiceElement getServiceElement()
          Get the ServiceElement
 ServiceRecord getServiceRecord()
          Get the ServiceRecord
 ServiceBeanInstance load()
          Loads and starts a service, blocking until the service has been started
 void setEventHandler(EventHandler slaEventHandler)
          Set the EventHandler
 void setOperationalStringManager(OperationalStringManager opStringMgr)
          Set the OperationalStringManager
 void setServiceElement(ServiceElement sElem)
          Set the ServiceElement
protected  void startServiceBean(ServiceElement sElem, OperationalStringManager opStringMgr)
          Load, instantiate and start the ServiceBean
 void terminate()
          Terminate the ServiceBeanDelegate.
 boolean update(ServiceElement newElem, OperationalStringManager opMgr)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loadResult

protected ServiceBeanLoader.Result loadResult
Result from loading the service

Constructor Detail

JSBDelegate

public JSBDelegate(Object identifier,
                   Uuid serviceID,
                   ServiceBeanContainer container)
Create a JSBDelegate

Parameters:
identifier - A cookie for internal accounting
serviceID - Unique identifier for the ServiceBean
container - The ServiceBeanContainer
Method Detail

setOperationalStringManager

public void setOperationalStringManager(OperationalStringManager opStringMgr)
Description copied from interface: ServiceBeanDelegate
Set the OperationalStringManager

Specified by:
setOperationalStringManager in interface ServiceBeanDelegate
Parameters:
opStringMgr - The OperationalStringManager that has deployed and is managing the service

setServiceElement

public void setServiceElement(ServiceElement sElem)
Description copied from interface: ServiceBeanDelegate
Set the ServiceElement

Specified by:
setServiceElement in interface ServiceBeanDelegate
Parameters:
sElem - The ServiceElement detailing the service and it's properties

setEventHandler

public void setEventHandler(EventHandler slaEventHandler)
Description copied from interface: ServiceBeanDelegate
Set the EventHandler

Specified by:
setEventHandler in interface ServiceBeanDelegate
Parameters:
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

getServiceRecord

public ServiceRecord getServiceRecord()
Get the ServiceRecord

Specified by:
getServiceRecord in interface ServiceBeanDelegate
Returns:
ServiceRecord

getServiceElement

public ServiceElement getServiceElement()
Get the ServiceElement

Specified by:
getServiceElement in interface ServiceBeanDelegate
Returns:
The ServiceElement used by this JSBDelegate

update

public boolean update(ServiceElement newElem,
                      OperationalStringManager opMgr)
Specified by:
update in interface ServiceBeanDelegate

load

public ServiceBeanInstance load()
                         throws JSBInstantiationException
Loads and starts a service, blocking until the service has been started

Specified by:
load in interface ServiceBeanDelegate
Returns:
The ServiceBeanInstance
Throws:
JSBInstantiationException - if there are erros loading the service bean

getServiceBeanInstance

public ServiceBeanInstance getServiceBeanInstance()
Get the ServiceBeanInstance

Specified by:
getServiceBeanInstance in interface ServiceBeanDelegate
Returns:
The ServiceBeanInstance

advertise

public void advertise()
               throws JSBControlException
Advertise the ServiceBean, making it available to all clients

Specified by:
advertise in interface ServiceBeanDelegate
Throws:
JSBControlException - if the service bean cannot be advertised

getComputeResourceUtilization

public ComputeResourceUtilization getComputeResourceUtilization()
Description copied from interface: ServiceBeanDelegate
Get the ComputeResourceUtilization

Specified by:
getComputeResourceUtilization in interface ServiceBeanDelegate
Returns:
The ComputeResourceUtilization for the represented service. If the service is contained within the CYbernode, return the ComputeResourceUtilization of the Cybernode. Oherwise reetun the ComputeResourceUtilization of the process hosting the represented service

terminate

public void terminate()
Terminate the ServiceBeanDelegate. This calls the destroy method of the ServiceBean

Specified by:
terminate in interface ServiceBeanDelegate

startServiceBean

protected void startServiceBean(ServiceElement sElem,
                                OperationalStringManager opStringMgr)
                         throws JSBInstantiationException
Load, instantiate and start the ServiceBean

Parameters:
sElem - The ServiceElement
opStringMgr - The OperationalStringManager
Throws:
JSBInstantiationException - if there are errors creating the service bean

Copyright © Rio Project.

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