org.codehaus.xfire.util.factory
Interface Pool

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
CachingPool, SimplePool, SingletonPool, ThreadSingletonPool

public interface Pool
extends java.io.Serializable

Represents a pooling strategy for certain object instance.

Author:
Ben Yu

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?
 

Method Detail

getInstance

java.lang.Object getInstance(Factory factory)
                             throws java.lang.Throwable
Apply the pooling strategy and return an instance from either the pool or the factory.

Parameters:
factory - the factory to create the object instance.
Returns:
the object instance.
Throws:
java.lang.Throwable

getPooledInstance

java.lang.Object getPooledInstance(java.lang.Object def)
Get the instance that's already pooled.

Parameters:
def - the default value to return if there's no pooled instance.
Returns:
the pooled instance or the default object.

isPooled

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



Copyright © 2004-2010. All Rights Reserved.