org.jmx4odp.pool
Class OrderedContextPool

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

public class OrderedContextPool
extends AbstractContextPool

This pool is the ORDERED 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
OrderedContextPool()
           
 
Method Summary
 javax.naming.Context getAvailableContext()
          This is an ORDERED 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

OrderedContextPool

public OrderedContextPool()
Method Detail

getAvailableContext

public javax.naming.Context getAvailableContext()
                                         throws NoObjectsInPoolException
This is an ORDERED pool. So it will grab the FIRST UP context. So if there are 10 possible contexts in the pool, and instance 1 never goes down, the other 9 will NEVER be used. This is good for failover only situations. Once it finds a good one, it stays there until it goes down. So if it fails from 0 to 1, it will stay there even if 1 goes back up. This will only cycle through all the instances once before giving up.

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