org.codehaus.xfire.util.factory
Interface Pool

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

public interface Pool
extends Serializable

Represents a pooling strategy for certain object instance.

Author:
Ben Yu

Method Summary
 Object getInstance(Factory factory)
          Apply the pooling strategy and return an instance from either the pool or the factory.
 Object getPooledInstance(Object def)
          Get the instance that's already pooled.
 boolean isPooled()
          Is this pool currently having something in cache?
 

Method Detail

getInstance

Object getInstance(Factory factory)
                   throws 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:
Throwable

getPooledInstance

Object getPooledInstance(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-2013. All Rights Reserved.