org.jboss.messaging.util
Class RotatingPool

java.lang.Object
  extended byorg.jboss.messaging.util.RotatingPool
Direct Known Subclasses:
QueuedExecutorPool

public abstract class RotatingPool
extends java.lang.Object

A RotatingPool This class makes sure requests on the same key always get the same value, and values for a specific key are obtained from a fixed size array of instances in a rotating fashion

Version:
$Revision: 1174 $ $Id: RotatingPool.java 1174 2006-08-02 14:14:32Z timfox $
Author:
Tim Fox

Field Summary
protected  java.lang.Object[] entries
           
protected  java.util.Map keyMappings
           
protected  int maxSize
           
protected  int pos
           
 
Constructor Summary
RotatingPool(int maxSize)
           
 
Method Summary
protected abstract  java.lang.Object createEntry()
           
 java.lang.Object get(java.lang.Object key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxSize

protected int maxSize

pos

protected int pos

entries

protected java.lang.Object[] entries

keyMappings

protected java.util.Map keyMappings
Constructor Detail

RotatingPool

public RotatingPool(int maxSize)
Method Detail

get

public java.lang.Object get(java.lang.Object key)

createEntry

protected abstract java.lang.Object createEntry()


Copyright © 2006 JBoss Inc. All Rights Reserved.