Rio Project 4.2 API Documentation



org.rioproject.jsb
Class JSBManager

java.lang.Object
  extended by org.rioproject.jsb.JSBManager
All Implemented Interfaces:
ServiceBeanManager

public class JSBManager
extends Object
implements ServiceBeanManager

Implement ServiceBeanManager support

Author:
Dennis Reedy
See Also:
ServiceBeanManager

Field Summary
protected  NotificationBroadcasterSupport notificationBroadcasterSupport
           
 
Constructor Summary
JSBManager(ServiceElement sElem, OperationalStringManager opStringManager, String hostAddress, Uuid cybernodeUuid)
          Create a JSBManager
JSBManager(ServiceElement sElem, String hostAddress, Uuid cybernodeUuid)
          Create a JSBManager
 
Method Summary
 void addListener(ServiceElementChangeListener l)
          Register for notification of ServiceElement changes.
 void decrement(boolean destroy)
          Decrement (decrease the number of) and remove this ServiceBean instance from the OperationalString.
 DiscardManager getDiscardManager()
          Get the DiscardManager for the ServiceBean.
 NotificationBroadcasterSupport getNotificationBroadcasterSupport()
          Get the class that can be used as the class that sends JMX notifications for the MBean
 OperationalStringManager getOperationalStringManager()
          Get the OperationalStringManager instance which is managing the OperationalString the ServiceBean is a part of
 ServiceBeanInstance getServiceBeanInstance()
          Get the ServiceBeanInstance for the ServiceBean
 Uuid getServiceID()
          Get the universally unique identifier for the ServiceBean
 void increment()
           
 void increment(ServiceProvisionListener listener)
          Increment (increase the number of) instances of the ServiceBean by one.
 void relocate(ServiceProvisionListener listener, Uuid uuid)
          Relocate (move) a ServiceBean instance to another compute resource
 void removeListener(ServiceElementChangeListener l)
          Remove a currently registered ServiceElementChangeListener instance from the set of listeners currently registered with the ServiceBeanManager.
 void setDiscardManager(DiscardManager discardManager)
          Set the DiscardManager for the ServiceBean
 void setMarshalledInstance(MarshalledInstance mi)
          Set the Object that can be used to communicate to the ServiceBean
 void setOperationalStringManager(OperationalStringManager opStringManager)
          Set the OperationalStringManager
 void setServiceElement(ServiceElement newElem)
          Set the ServiceElement for the ServiceBean
 void setServiceID(Uuid serviceID)
          Set the ServiceID for the ServiceBean
 void update(ServiceBeanConfig sbConfig)
          Update a ServiceBean's ServiceBeanConfig to known OperationalStringManager instance(s)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

notificationBroadcasterSupport

protected final NotificationBroadcasterSupport notificationBroadcasterSupport
Constructor Detail

JSBManager

public JSBManager(ServiceElement sElem,
                  String hostAddress,
                  Uuid cybernodeUuid)
Create a JSBManager

Parameters:
sElem - The ServiceElement
hostAddress - The host address the service bean was instantiated on
cybernodeUuid - The Uuuid of the Cybernode
Throws:
IllegalArgumentException - if the sElem or hostAddress parameters are null

JSBManager

public JSBManager(ServiceElement sElem,
                  OperationalStringManager opStringManager,
                  String hostAddress,
                  Uuid cybernodeUuid)
Create a JSBManager

Parameters:
sElem - The ServiceElement
opStringManager - The OperationalStringManager
hostAddress - The host address the service bean was instantiated on
cybernodeUuid - The Uuuid of the Cybernode
Throws:
IllegalArgumentException - if the sElem or hostAddress parameters are null
Method Detail

setServiceElement

public void setServiceElement(ServiceElement newElem)
Set the ServiceElement for the ServiceBean

Parameters:
newElem - The ServiceElement for the ServiceBean

setServiceID

public void setServiceID(Uuid serviceID)
Set the ServiceID for the ServiceBean

Parameters:
serviceID - The Service Identifier for the ServiceBean

getServiceID

public Uuid getServiceID()
Description copied from interface: ServiceBeanManager
Get the universally unique identifier for the ServiceBean

Specified by:
getServiceID in interface ServiceBeanManager
Returns:
The universally unique identifier for the ServiceBean
See Also:
ServiceBeanManager.getServiceID()

setMarshalledInstance

public void setMarshalledInstance(MarshalledInstance mi)
Set the Object that can be used to communicate to the ServiceBean

Parameters:
mi - The MarshalledInstance containing the proxy that can be used to communicate to the ServiceBean

setDiscardManager

public void setDiscardManager(DiscardManager discardManager)
Set the DiscardManager for the ServiceBean

Parameters:
discardManager - The DiscardManager for the ServiceBean

getDiscardManager

public DiscardManager getDiscardManager()
Description copied from interface: ServiceBeanManager
Get the DiscardManager for the ServiceBean. A ServiceBean must obtain the DiscardManager upon termination. The DiscardManager performs necessary cleanup tasks associated with the termination of a ServiceBean

Specified by:
getDiscardManager in interface ServiceBeanManager
Returns:
DiscardManager
See Also:
ServiceBeanManager.getDiscardManager()

setOperationalStringManager

public void setOperationalStringManager(OperationalStringManager opStringManager)
Set the OperationalStringManager

Parameters:
opStringManager - The OperationalStringManager

getOperationalStringManager

public OperationalStringManager getOperationalStringManager()
Description copied from interface: ServiceBeanManager
Get the OperationalStringManager instance which is managing the OperationalString the ServiceBean is a part of

Specified by:
getOperationalStringManager in interface ServiceBeanManager
Returns:
The OperationalStringManager instance which is managing the OperationalString the ServiceBean is a part of
See Also:
ServiceBeanManager.getOperationalStringManager()

update

public void update(ServiceBeanConfig sbConfig)
            throws Exception
Description copied from interface: ServiceBeanManager
Update a ServiceBean's ServiceBeanConfig to known OperationalStringManager instance(s)

Specified by:
update in interface ServiceBeanManager
Parameters:
sbConfig - The updated ServiceBeanConfig instance
Throws:
Exception - if any errors occur communicating with the OperationalStringManager, or with the OperationalStringManager's processing of the request
See Also:
ServiceBeanManager.update(org.rioproject.core.ServiceBeanConfig)

increment

public void increment()
               throws Exception
Throws:
Exception - if the increment fails for any reason
See Also:
ServiceBeanManager.increment(org.rioproject.core.ServiceProvisionListener)

increment

public void increment(ServiceProvisionListener listener)
               throws Exception
Description copied from interface: ServiceBeanManager
Increment (increase the number of) instances of the ServiceBean by one. This will cause the provisioning of a ServiceBean to an available compute resource which meets the operational criteria specified by the ServiceElement.

Specified by:
increment in interface ServiceBeanManager
Parameters:
listener - A ServiceProvisionListener that will be notified of the result of the increment request
Throws:
Exception - if any errors occur communicating with the OperationalStringManager, or with the OperationalStringManager's processing of the request
See Also:
ServiceBeanManager.increment(org.rioproject.core.ServiceProvisionListener)

decrement

public void decrement(boolean destroy)
               throws Exception
Description copied from interface: ServiceBeanManager
Decrement (decrease the number of) and remove this ServiceBean instance from the OperationalString.

Specified by:
decrement in interface ServiceBeanManager
Parameters:
destroy - If true, destroy the ServiceBean upon removal, otherwise just remove
Throws:
Exception - if any errors occur communicating with the OperationalStringManager, or with the OperationalStringManager's processing of the request
See Also:
ServiceBeanManager.decrement(boolean)

relocate

public void relocate(ServiceProvisionListener listener,
                     Uuid uuid)
              throws Exception
Description copied from interface: ServiceBeanManager
Relocate (move) a ServiceBean instance to another compute resource

Specified by:
relocate in interface ServiceBeanManager
Parameters:
listener - A ServiceProvisionListener that will be notified of the result of the relocate request
uuid - The uuid of a ServiceBeanInstantiator to relocate to. If null, the OperationalStringManager will determine a suitable resource
Throws:
Exception - if any errors occur communicating with the OperationalStringManager, or with the OperationalStringManager's processing of the request
See Also:
ServiceBeanManager.relocate(org.rioproject.core.ServiceProvisionListener, net.jini.id.Uuid)

getServiceBeanInstance

public ServiceBeanInstance getServiceBeanInstance()
Description copied from interface: ServiceBeanManager
Get the ServiceBeanInstance for the ServiceBean

Specified by:
getServiceBeanInstance in interface ServiceBeanManager
Returns:
The ServiceBeanInstance for the ServiceBean
See Also:
ServiceBeanManager.getServiceBeanInstance()

addListener

public void addListener(ServiceElementChangeListener l)
Description copied from interface: ServiceBeanManager
Register for notification of ServiceElement changes. The ServiceElementChangeListener will be notified each time the ServiceElement is changed. If the parameter value duplicates (using equals) another element in the set of listeners, no action is taken. If the parameter value is null, a NullPointerException is thrown

Specified by:
addListener in interface ServiceBeanManager
Parameters:
l - A ServiceElementChangeListener instance to add.
See Also:
ServiceBeanManager.addListener(org.rioproject.core.jsb.ServiceElementChangeListener)

removeListener

public void removeListener(ServiceElementChangeListener l)
Description copied from interface: ServiceBeanManager
Remove a currently registered ServiceElementChangeListener instance from the set of listeners currently registered with the ServiceBeanManager. If the parameter value is null, or if the parameter value does not exist in the managed set of listeners, no action is taken

Specified by:
removeListener in interface ServiceBeanManager
Parameters:
l - A ServiceElementChangeListener instance to remove.
See Also:
ServiceBeanManager.removeListener(org.rioproject.core.jsb.ServiceElementChangeListener)

getNotificationBroadcasterSupport

public NotificationBroadcasterSupport getNotificationBroadcasterSupport()
Description copied from interface: ServiceBeanManager
Get the class that can be used as the class that sends JMX notifications for the MBean

Specified by:
getNotificationBroadcasterSupport in interface ServiceBeanManager
Returns:
A NotificationBroadcasterSupport
See Also:
ServiceBeanManager.getNotificationBroadcasterSupport()

Copyright © Rio Project.

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