|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.atomikos.util.SynchronizedObjectPool
public class SynchronizedObjectPool
Copyright © 2001, Atomikos. All rights reserved. A pool wrapper that makes any pool thread safe.
| Field Summary | |
|---|---|
protected ObjectPool |
pool_
|
| Constructor Summary | |
|---|---|
SynchronizedObjectPool(ObjectPool pool)
Constructor. |
|
| Method Summary | |
|---|---|
Identifiable |
add(Identifiable obj)
Add an identifiable instance to the pool. |
Enumeration |
elements()
Retrieve an enummeration of all elements in the pool. |
long |
getMaxSize()
Get the maximum size of the pool. |
long |
getSize()
Get the current size of the pool. |
boolean |
isEmpty()
Test if pool is empty. |
boolean |
isFull()
Test if pool is full. |
Identifiable |
remove()
Remove an arbitrary element from the pool. |
Identifiable |
remove(Object id)
Remove an object from the pool. |
Identifiable |
retrieve()
Get an arbitrary element from the pool. |
Identifiable |
retrieve(Object id)
Retrieve an object from the pool. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ObjectPool pool_
| Constructor Detail |
|---|
public SynchronizedObjectPool(ObjectPool pool)
pool - The pool to wrap.| Method Detail |
|---|
public long getSize()
ObjectPool
getSize in interface ObjectPoolObjectPoolpublic long getMaxSize()
ObjectPool
getMaxSize in interface ObjectPoolObjectPoolpublic Identifiable add(Identifiable obj)
ObjectPool
add in interface ObjectPoolObjectPool
public Identifiable retrieve(Object id)
throws ObjectNotFoundException
ObjectPool
retrieve in interface ObjectPoolid - The id of the object wanted.
ObjectNotFoundException - If not found.ObjectPool
public Identifiable remove(Object id)
throws ObjectNotFoundException
ObjectPool
remove in interface ObjectPoolid - The identifier for the object.
ObjectNotFoundException - If the id was not in the pool.ObjectPool
public Identifiable retrieve()
throws ObjectNotFoundException
ObjectPool
retrieve in interface ObjectPoolObjectNotFoundException - If empty.ObjectPool
public Identifiable remove()
throws ObjectNotFoundException
ObjectPool
remove in interface ObjectPoolObjectNotFoundException - If empty.ObjectPool
public Enumeration elements()
throws ObjectNotFoundException
ObjectPool
elements in interface ObjectPoolObjectNotFoundException - If empty.ObjectPoolpublic boolean isFull()
ObjectPool
isFull in interface ObjectPoolObjectPoolpublic boolean isEmpty()
ObjectPool
isEmpty in interface ObjectPoolObjectPool
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||