|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rioproject.sla.SLAPolicyHandler
public class SLAPolicyHandler
A SLAPolicyHandler handles thresholds for a ThresholdWatch, registering to a ThresholdManager. If a threshold is crossed (breached or cleared), the SLAPolicyHandler will fire a SLAThresholdEvent using an EventHandler provided The SLAPolicyHandler should be extended to provide logic on how to process specific policy (if-then-else logic) on how to manage SLA Thresholds produced by ThresholdWatch instantiations
| Field Summary | |
|---|---|
protected ServiceBeanContext |
context
ServiceBeanContext for the ServiceBean |
protected Object |
eventSource
Event source object |
protected boolean |
initialized
Flag which indicates the SLAPolicyHandler has initialized |
protected ThresholdManager |
thresholdManager
The ThresholdManager the SLA is for |
| Constructor Summary | |
|---|---|
SLAPolicyHandler(SLA sla)
Construct a SLAPolicyHandler |
|
| Method Summary | |
|---|---|
void |
disconnect()
Disconnect from the ThresholdManager |
Configuration |
getConfiguration()
Get the Configuration object |
String |
getDescription()
Get the description |
protected Object |
getEventSource()
Get the source property |
String |
getID()
Get the ID of the ThresholdWatch the ThresholdListener is associated to |
protected String |
getName()
|
SLA |
getSLA()
Get the SLA |
ThresholdManager |
getThresholdManager()
|
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 |
protected void |
notifyListeners(SLAPolicyEvent event)
Notify all registered SLAPolicyEventListener instances |
void |
registerListener(SLAPolicyEventListener listener)
Register for SLAPolicyEvent notifications |
protected void |
sendSLAThresholdEvent(Calculable calculable,
ThresholdValues tValues,
int type)
Set up a SLAThresholdEvent and send it |
protected void |
setName(String name,
long iID)
|
void |
setSLA(SLA sla)
Set or update the SLA |
void |
setThresholdManager(ThresholdManager thresholdManager)
Set the ThresholdManager and connect to the ThresholdManager |
void |
unregisterListener(SLAPolicyEventListener listener)
Unregister for SLAPolicyEvent notifications |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Object eventSource
protected ServiceBeanContext context
protected ThresholdManager thresholdManager
protected boolean initialized
| Constructor Detail |
|---|
public SLAPolicyHandler(SLA sla)
sla - The SLA for the SLAPolicyHandler| Method Detail |
|---|
public void initialize(Object eventSource,
EventHandler eventHandler,
ServiceBeanContext context)
eventSource - The object to be used as the remote event sourceeventHandler - Handler which sends eventscontext - The ServiceBeanContext
IllegalArgumentException - if any of the parameters are nullprotected Object getEventSource()
public String getDescription()
public void setSLA(SLA sla)
sla - The SLApublic SLA getSLA()
public Configuration getConfiguration()
throws ConfigurationException
ServiceBeanContext. If
the ServiceBeanContext is null, return an empty configuration
ConfigurationException - If the configuration cannot be createdpublic String getID()
ThresholdListener
getID in interface ThresholdListenerThresholdListener.getID()
protected void setName(String name,
long iID)
protected String getName()
public void setThresholdManager(ThresholdManager thresholdManager)
ThresholdListener
setThresholdManager in interface ThresholdListenerthresholdManager - The ThresholdManager to connect toThresholdListener.setThresholdManager(org.rioproject.watch.ThresholdManager)public ThresholdManager getThresholdManager()
public void disconnect()
public void notify(Calculable calculable,
ThresholdValues thresholdValues,
int type)
ThresholdListener
notify in interface ThresholdListenercalculable - 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 registerListener(SLAPolicyEventListener listener)
listener - The SLAPolicyEventListenerpublic void unregisterListener(SLAPolicyEventListener listener)
listener - The SLAPolicyEventListenerprotected void notifyListeners(SLAPolicyEvent event)
event - The SLAPolicyEvent
protected void sendSLAThresholdEvent(Calculable calculable,
ThresholdValues tValues,
int type)
calculable - The current metrictValues - The current thresholdstype - The type of threshold event, breached or cleared
|
Copyright © Rio Project. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||