org.jmx4odp.pool
Class RoundRobbinContextPool

java.lang.Object
  extended by org.jmx4odp.pool.AbstractContextPool
      extended by org.jmx4odp.pool.RoundRobbinContextPool
All Implemented Interfaces:
ContextPool

public class RoundRobbinContextPool
extends AbstractContextPool

This pool is the ROUND ROBIN implementation.

Author:
Lucas McGregor

Field Summary
 
Fields inherited from interface org.jmx4odp.pool.ContextPool
DOWN_SERVICE_RETRY_WAIT, INSTANCE_ID, SERVICE_NAME, SERVICE_STATUS, STATUS_DOWN, STATUS_DOWN_DATE, STATUS_UNKOWN, STATUS_UP
 
Constructor Summary
RoundRobbinContextPool()
          Creates a new instance of RoundRobinedServicePool
 
Method Summary
 javax.naming.Context getAvailableContext()
          This is a ROUND ROBIN pool.
 
Methods inherited from class org.jmx4odp.pool.AbstractContextPool
addContext, checkIfContextIsUp, getContext, getContext, getContext, getNumberOfServices, getServiceName, getStatus, getStatus, getStatus, markContextDown, markContextUp, markDown, markDown, markDown, markUp, markUp, markUp, setServiceName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoundRobbinContextPool

public RoundRobbinContextPool()
Creates a new instance of RoundRobinedServicePool

Method Detail

getAvailableContext

public javax.naming.Context getAvailableContext()
                                         throws NoObjectsInPoolException
This is a ROUND ROBIN pool. So it will cycle thru the contexts by order returning the next UP one.

It will skip over DOWN instances. But it will not cycle forever. It will only try as many times as their are instances in the pool. So a pool of 10 instances will result in 10 tries to find an UP instance.

Specified by:
getAvailableContext in interface ContextPool
Specified by:
getAvailableContext in class AbstractContextPool
Throws:
NoObjectsInPoolException