org.jboss.web.loadbalancer.monitor
Class AbstractMonitor

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.web.loadbalancer.monitor.AbstractMonitor
All Implemented Interfaces:
MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , java.lang.Runnable, Service (src) , ServiceMBean (src)
Direct Known Subclasses:
ECVMonitorService (src) , SimpleMonitorService (src)

public abstract class AbstractMonitor
extends ServiceMBeanSupport (src)
implements java.lang.Runnable

A base class for loadbalancer-monitors.


Field Summary
protected  long interval
           
protected  boolean keepRunning
           
protected  Logger (src) log
           
protected  java.lang.Thread monitorThread
           
protected  java.lang.String path
           
protected  AbstractSchedulerMBean scheduler
           
protected  ObjectName (src) schedulerObjectName
           
protected  int timeout
           
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
AbstractMonitor()
           
 
Method Summary
protected  boolean checkHost(Host (src)  host)
          Check the given host.
protected abstract  boolean checkHostStatus(HttpMethod method)
          Override this method to create new monitors.
protected  void destroyService()
          Sub-classes should override this method to provide custum 'destroy' logic.
 long getInterval()
           
 java.lang.String getPath()
           
 ObjectName (src) getScheduler()
           
 int getTimeout()
           
 boolean isKeepRunning()
           
protected  void monitorHosts()
           
 void run()
           
 void setInterval(long interval)
           
 void setKeepRunning(boolean keepRunning)
           
 void setPath(java.lang.String path)
           
 void setScheduler(ObjectName (src)  schedulerObjectName)
           
 void setTimeout(int timeout)
           
protected  void startService()
          Sub-classes should override this method to provide custum 'start' logic.
protected  void stopService()
          Sub-classes should override this method to provide custum 'stop' logic.
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, createService, destroy, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keepRunning

protected boolean keepRunning

interval

protected long interval

scheduler

protected AbstractSchedulerMBean scheduler

log

protected Logger (src)  log

schedulerObjectName

protected ObjectName (src)  schedulerObjectName

timeout

protected int timeout

path

protected java.lang.String path

monitorThread

protected java.lang.Thread monitorThread
Constructor Detail

AbstractMonitor

public AbstractMonitor()
Method Detail

startService

protected void startService()
                     throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'start' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
startService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

stopService

protected void stopService()
                    throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'stop' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
stopService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

destroyService

protected void destroyService()
                       throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'destroy' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
destroyService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

checkHostStatus

protected abstract boolean checkHostStatus(HttpMethod method)
Override this method to create new monitors.

Parameters:
method -
Returns:

monitorHosts

protected void monitorHosts()

checkHost

protected boolean checkHost(Host (src)  host)
Check the given host.

Returns:

run

public void run()
Specified by:
run in interface java.lang.Runnable

isKeepRunning

public boolean isKeepRunning()

setKeepRunning

public void setKeepRunning(boolean keepRunning)

setPath

public void setPath(java.lang.String path)

getPath

public java.lang.String getPath()

setInterval

public void setInterval(long interval)

getInterval

public long getInterval()

getTimeout

public int getTimeout()

setTimeout

public void setTimeout(int timeout)

getScheduler

public ObjectName (src)  getScheduler()

setScheduler

public void setScheduler(ObjectName (src)  schedulerObjectName)