站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 varia API Documentation 英文版文档

AbstractScheduler (Various API) - JBoss 4.0.1 sp1 varia API Documentation 英文版文档


org.jboss.web.loadbalancer.scheduler
Class AbstractScheduler

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended byorg.jboss.system.ServiceMBeanSupport
          extended byorg.jboss.web.loadbalancer.scheduler.AbstractScheduler
All Implemented Interfaces:
AbstractSchedulerMBean, EventListener, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, javax.management.NotificationListener, SchedulerMBean, org.jboss.system.Service, org.jboss.system.ServiceMBean
Direct Known Subclasses:
MinAvgSchedulerService, RoundRobinSchedulerService, WeightedLeastConnectionSchedulerService

public abstract class AbstractScheduler
extends org.jboss.system.ServiceMBeanSupport
implements AbstractSchedulerMBean, javax.management.NotificationListener

Base-class for Scheduler

Version:
$Revision: 1.6 $
Author:
Thomas Peuss

Field Summary
protected  Element config
           
protected  ArrayList hostsDown
           
protected  ArrayList hostsUp
           
protected  String stickyCookieName
           
protected  boolean useStickySession
           
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.web.loadbalancer.scheduler.AbstractSchedulerMBean
OBJECT_NAME
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
AbstractScheduler()
           
 
Method Summary
 Host addHost(String hostString)
          Add a host to the up list.
protected  void addHostsFromConfig(Element config)
           
protected  void createService()
           
protected  void deregisterHostMBean(Host host)
           
protected  void deregisterHostMBeans()
           
protected  Host findStickyHost(Request schedRequest)
          Find the sticky host for the given request
protected  javax.management.ObjectName genObjectNameForHost(Host host)
           
 void getHost(Request schedRequest)
           
 ArrayList getHostsDown()
          Get the list of all hosts that have been marked down.
 ArrayList getHostsUp()
          Get the list of all hosts that have been marked up.
protected abstract  Host getNextHost()
          Override this method to create a new scheduler.
 void handleNotification(javax.management.Notification notification, Object handback)
           
protected  void markNodeDown(Host host)
           
protected  void markNodeUp(Host host)
           
protected  void registerHostMBean(Host host)
           
 void removeHost(URL url)
          Remove a host from the up list.
 void setConfig(Element config)
           
protected  void setStickyCookie(Request schedRequest)
          Set the sticky session cookie.
protected  void stopService()
           
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, startService, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Field Detail

hostsUp

protected ArrayList hostsUp

hostsDown

protected ArrayList hostsDown

stickyCookieName

protected String stickyCookieName

useStickySession

protected boolean useStickySession

config

protected Element config
Constructor Detail

AbstractScheduler

public AbstractScheduler()
Method Detail

getNextHost

protected abstract Host getNextHost()
Override this method to create a new scheduler.

Returns:

stopService

protected void stopService()
                    throws Exception
Throws:
Exception

setConfig

public void setConfig(Element config)
Specified by:
setConfig in interface AbstractSchedulerMBean
Parameters:
config -

createService

protected void createService()
                      throws Exception
Throws:
Exception

addHostsFromConfig

protected void addHostsFromConfig(Element config)
                           throws Exception
Throws:
Exception

genObjectNameForHost

protected javax.management.ObjectName genObjectNameForHost(Host host)
                                                    throws Exception
Throws:
Exception

registerHostMBean

protected void registerHostMBean(Host host)

deregisterHostMBean

protected void deregisterHostMBean(Host host)

deregisterHostMBeans

protected void deregisterHostMBeans()
                             throws Exception
Throws:
Exception

getHost

public void getHost(Request schedRequest)
             throws NoHostAvailableException
Specified by:
getHost in interface SchedulerMBean
Throws:
NoHostAvailableException

setStickyCookie

protected void setStickyCookie(Request schedRequest)
Set the sticky session cookie.


findStickyHost

protected Host findStickyHost(Request schedRequest)
Find the sticky host for the given request

Returns:
null=host not found, otherwise the sticky host URL for this request

markNodeDown

protected void markNodeDown(Host host)

markNodeUp

protected void markNodeUp(Host host)

getHostsDown

public ArrayList getHostsDown()
Get the list of all hosts that have been marked down.

Specified by:
getHostsDown in interface AbstractSchedulerMBean

getHostsUp

public ArrayList getHostsUp()
Get the list of all hosts that have been marked up.

Specified by:
getHostsUp in interface AbstractSchedulerMBean

addHost

public Host addHost(String hostString)
             throws MalformedURLException
Add a host to the up list.

Specified by:
addHost in interface AbstractSchedulerMBean
Throws:
MalformedURLException

removeHost

public void removeHost(URL url)
Remove a host from the up list.

Specified by:
removeHost in interface AbstractSchedulerMBean

handleNotification

public void handleNotification(javax.management.Notification notification,
                               Object handback)
Specified by:
handleNotification in interface javax.management.NotificationListener


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.