|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rioproject.sla.SLAPolicyHandler
org.rioproject.sla.ScalingPolicyHandler
public class ScalingPolicyHandler
The ScalingPolicyHandler will increment and optionally decrement instances of the ServiceBean it is associated to based on limits set for the SLA. The ScalingPolicyHandler will look for attributes set that can control it's operational behavior,.
The ScalingPolicyHandler supports the following configuration entries; where
each configuration entry name is associated with the component name
scalingPolicyHandler
| Type: |
Exporter |
| Default: |
A new BasicJeriExporter with
|
| Description: |
The Exporter used to export the ProvisionListener server. A new exporter is obtained every time a ScalablePolicyHandler needs to export itself. |
| Field Summary | |
|---|---|
static String |
DECREMENT_DESTROY_SENT
Action that indicates that a decrement command with destroy set to true has been sent |
static String |
DECREMENT_FAILED
Action that indicates that a decrement command failed to be sent |
static String |
INCREMENT_FAILURE
Action that indicates an increment request has failed |
static String |
INCREMENT_PENDING
Action that indicates an increment request is pending |
static String |
INCREMENT_SUCCEEDED
Action that indicates an increment request has succeeded. |
protected Calculable |
lastCalculable
The last calculable |
protected ThresholdValues |
lastThresholdValues
The last ThresholdValue |
protected int |
maxServices
The maximum number of services to increment. |
| Fields inherited from class org.rioproject.sla.SLAPolicyHandler |
|---|
context, eventSource, initialized, thresholdManager |
| Constructor Summary | |
|---|---|
ScalingPolicyHandler(SLA sla)
Construct a ScalingPolicyHandler |
|
| Method Summary | |
|---|---|
void |
disconnect()
Disconnect from the ThresholdManager |
protected boolean |
doDecrement()
Do the decrement |
protected void |
doIncrement()
Do the increment |
void |
failed(ServiceElement sElem,
boolean resubmitted)
Notify listener that the Service described by the ServiceElement has not been provision succesfully |
String |
getDescription()
Get the description |
protected int |
getPendingRequestCount(OperationalStringManager opMgr)
|
TrustVerifier |
getProxyVerifier()
Returns a TrustVerifier which can be used to verify that a
given proxy to this policy handler can be trusted |
protected ServiceElement |
getServiceElement()
|
protected int |
getTotalKnownServices()
|
void |
initialize(Object eventSource,
EventHandler eventHandler,
ServiceBeanContext context)
Prepare the SLAPolicyHandler for processing. |
void |
notify(Calculable calculable,
ThresholdValues thresholdValues,
int type)
Notify for a threshold event |
void |
setSLA(SLA sla)
Set or update the SLA |
void |
setThresholdManager(ThresholdManager thresholdManager)
Set the ThresholdManager and connect to the ThresholdManager |
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, unregisterListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String INCREMENT_PENDING
public static final String INCREMENT_FAILURE
public static final String INCREMENT_SUCCEEDED
public static final String DECREMENT_DESTROY_SENT
public static final String DECREMENT_FAILED
protected int maxServices
protected Calculable lastCalculable
protected ThresholdValues lastThresholdValues
| Constructor Detail |
|---|
public ScalingPolicyHandler(SLA sla)
sla - The SLA for the ScalingPolicyHandler| Method Detail |
|---|
public String getDescription()
SLAPolicyHandler
getDescription in class SLAPolicyHandlerpublic void setThresholdManager(ThresholdManager thresholdManager)
ThresholdListener
setThresholdManager in interface ThresholdListenersetThresholdManager in class SLAPolicyHandlerthresholdManager - The ThresholdManager to connect toThresholdListener.setThresholdManager(org.rioproject.watch.ThresholdManager)public void disconnect()
SLAPolicyHandler
disconnect in class SLAPolicyHandlerpublic void setSLA(SLA sla)
SLAPolicyHandler
setSLA in class SLAPolicyHandlersla - The SLA
public void initialize(Object eventSource,
EventHandler eventHandler,
ServiceBeanContext context)
SLAPolicyHandler
initialize in class SLAPolicyHandlereventSource - The object to be used as the remote event sourceeventHandler - Handler which sends eventscontext - The ServiceBeanContextprotected ServiceElement getServiceElement()
public void notify(Calculable calculable,
ThresholdValues thresholdValues,
int type)
ThresholdListener
notify in interface ThresholdListenernotify in class SLAPolicyHandlercalculable - The current metricthresholdValues - The current thresholdstype - The type of threshold event, breached or clearedThresholdListener.notify(org.rioproject.watch.Calculable, org.rioproject.watch.ThresholdValues, int)
public void succeeded(ServiceBeanInstance jsbInstance)
throws RemoteException
ServiceProvisionListener
succeeded in interface ServiceProvisionListenerjsbInstance - The ServiceBeanInstance
RemoteException - If communication errors occurServiceProvisionListener.succeeded(org.rioproject.core.ServiceBeanInstance)
public void failed(ServiceElement sElem,
boolean resubmitted)
throws RemoteException
ServiceProvisionListener
failed in interface ServiceProvisionListenersElem - The ServiceElementresubmitted - Whether the Service described by the ServiceElement
has been resubmitted for provisioning
RemoteException - If communication errors occurServiceProvisionListener.failed(org.rioproject.core.ServiceElement, boolean)public TrustVerifier getProxyVerifier()
TrustVerifier which can be used to verify that a
given proxy to this policy handler can be trusted
getProxyVerifier in interface ServerProxyTrustprotected int getPendingRequestCount(OperationalStringManager opMgr)
protected int getTotalKnownServices()
throws Exception
Exceptionprotected void doIncrement()
protected boolean doDecrement()
|
Copyright © Rio Project. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||