Rio Project 4.2 API Documentation



org.rioproject.sla
Class RelocationPolicyHandler

java.lang.Object
  extended by org.rioproject.sla.SLAPolicyHandler
      extended by org.rioproject.sla.RelocationPolicyHandler
All Implemented Interfaces:
Remote, ServerProxyTrust, ServiceProvisionListener, ThresholdListener

public class RelocationPolicyHandler
extends SLAPolicyHandler
implements ServiceProvisionListener, ServerProxyTrust

The RelocationPolicyHandler will inform the OperationalStringManager to relocate the ServiceBean that uses this policy handler. The RelocationPolicyHandler will look for attributes set that can control it's operational behavior.

The RelocationPolicyHandler supports the following configuration entries; where each configuration entry name is associated with the component name relocationPolicyHandler


Author:
Dennis Reedy

Field Summary
static String RELOCATION_FAILURE
          Action that indicates an relocation request has failed
static String RELOCATION_PENDING
          Action that indicates an relocation request is pending
static String RELOCATION_SUCCEEDED
          Action that indicates an relocation request has succeeded.
 
Fields inherited from class org.rioproject.sla.SLAPolicyHandler
context, eventSource, initialized, thresholdManager
 
Constructor Summary
RelocationPolicyHandler(SLA sla)
          Construct a RelocationPolicyHandler
 
Method Summary
 void disconnect()
          Override parent's method to unexport
 void failed(ServiceElement sElem, boolean resubmitted)
          Notify listener that the Service described by the ServiceElement has not been provision succesfully
 String getDescription()
          Override parent's method to return description for this SLA Handler
 TrustVerifier getProxyVerifier()
          Returns a TrustVerifier which can be used to verify that a given proxy to this policy handler can be trusted
 void initialize(Object eventSource, EventHandler eventHandler, ServiceBeanContext context)
          Override parent's initialize method to initialize operational attributes
 void notify(Calculable calculable, ThresholdValues thresholdValues, int type)
          Notify for a threshold event
 void setThresholdManager(ThresholdManager thresholdManager)
          Override parent's method to export the object to the RMI runtime
 void succeeded(ServiceBeanInstance jsbInstance)
          Notify listener that the Service described by the ServiceBeanInstance has been provisioned succesfully
 
Methods inherited from class org.rioproject.sla.SLAPolicyHandler
getConfiguration, getEventSource, getID, getName, getSLA, getThresholdManager, notifyListeners, registerListener, sendSLAThresholdEvent, setName, setSLA, unregisterListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RELOCATION_PENDING

public static final String RELOCATION_PENDING
Action that indicates an relocation request is pending

See Also:
Constant Field Values

RELOCATION_FAILURE

public static final String RELOCATION_FAILURE
Action that indicates an relocation request has failed

See Also:
Constant Field Values

RELOCATION_SUCCEEDED

public static final String RELOCATION_SUCCEEDED
Action that indicates an relocation request has succeeded. The resultant Object in the SLAPolicyEvent will be the proxy of the new service

See Also:
Constant Field Values
Constructor Detail

RelocationPolicyHandler

public RelocationPolicyHandler(SLA sla)
Construct a RelocationPolicyHandler

Parameters:
sla - The SLA for the RelocationPolicyHandler
Method Detail

getDescription

public String getDescription()
Override parent's method to return description for this SLA Handler

Overrides:
getDescription in class SLAPolicyHandler
Returns:
The descriptive attribute for this SLA Handler

setThresholdManager

public void setThresholdManager(ThresholdManager thresholdManager)
Override parent's method to export the object to the RMI runtime

Specified by:
setThresholdManager in interface ThresholdListener
Overrides:
setThresholdManager in class SLAPolicyHandler
Parameters:
thresholdManager - The ThresholdManager to connect to
See Also:
ThresholdListener.setThresholdManager(org.rioproject.watch.ThresholdManager)

disconnect

public void disconnect()
Override parent's method to unexport

Overrides:
disconnect in class SLAPolicyHandler

initialize

public void initialize(Object eventSource,
                       EventHandler eventHandler,
                       ServiceBeanContext context)
Override parent's initialize method to initialize operational attributes

Overrides:
initialize in class SLAPolicyHandler
Parameters:
eventSource - The object to be used as the remote event source
eventHandler - Handler which sends events
context - The ServiceBeanContext

notify

public void notify(Calculable calculable,
                   ThresholdValues thresholdValues,
                   int type)
Description copied from interface: ThresholdListener
Notify for a threshold event

Specified by:
notify in interface ThresholdListener
Overrides:
notify in class SLAPolicyHandler
Parameters:
calculable - The current metric
thresholdValues - The current thresholds
type - The type of threshold event, breached or cleared
See Also:
ThresholdListener.notify(org.rioproject.watch.Calculable, org.rioproject.watch.ThresholdValues, int)

succeeded

public void succeeded(ServiceBeanInstance jsbInstance)
               throws RemoteException
Description copied from interface: ServiceProvisionListener
Notify listener that the Service described by the ServiceBeanInstance has been provisioned succesfully

Specified by:
succeeded in interface ServiceProvisionListener
Parameters:
jsbInstance - The ServiceBeanInstance
Throws:
RemoteException - If communication errors occur
See Also:
ServiceProvisionListener.succeeded(org.rioproject.core.ServiceBeanInstance)

failed

public void failed(ServiceElement sElem,
                   boolean resubmitted)
            throws RemoteException
Description copied from interface: ServiceProvisionListener
Notify listener that the Service described by the ServiceElement has not been provision succesfully

Specified by:
failed in interface ServiceProvisionListener
Parameters:
sElem - The ServiceElement
resubmitted - Whether the Service described by the ServiceElement has been resubmitted for provisioning
Throws:
RemoteException - If communication errors occur
See Also:
ServiceProvisionListener.failed(org.rioproject.core.ServiceElement, boolean)

getProxyVerifier

public TrustVerifier getProxyVerifier()
Returns a TrustVerifier which can be used to verify that a given proxy to this policy handler can be trusted

Specified by:
getProxyVerifier in interface ServerProxyTrust

Copyright © Rio Project.

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