org.apache.cxf.common.util.factory
Class CachingPool

java.lang.Object
  extended by org.apache.cxf.common.util.factory.CachingPool
All Implemented Interfaces:
java.io.Serializable, Pool

public class CachingPool
extends java.lang.Object
implements Pool

A thread-unsafe implementation of Pool that does simple caching.

Author:
Ben Yu Feb 2, 2006 12:13:08 PM
See Also:
Serialized Form

Constructor Summary
CachingPool()
           
 
Method Summary
 java.lang.Object getInstance(Factory factory)
          Apply the pooling strategy and return an instance from either the pool or the factory.
 java.lang.Object getPooledInstance(java.lang.Object def)
          Get the instance that's already pooled.
 boolean isPooled()
          Is this pool currently having something in cache?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingPool

public CachingPool()
Method Detail

getInstance

public java.lang.Object getInstance(Factory factory)
                             throws java.lang.Throwable
Description copied from interface: Pool
Apply the pooling strategy and return an instance from either the pool or the factory.

Specified by:
getInstance in interface Pool
Parameters:
factory - the factory to create the object instance.
Returns:
the object instance.
Throws:
java.lang.Throwable

getPooledInstance

public java.lang.Object getPooledInstance(java.lang.Object def)
Description copied from interface: Pool
Get the instance that's already pooled.

Specified by:
getPooledInstance in interface Pool
Parameters:
def - the default value to return if there's no pooled instance.
Returns:
the pooled instance or the default object.

isPooled

public boolean isPooled()
Is this pool currently having something in cache?

Specified by:
isPooled in interface Pool


Apache CXF