org.picocontainer.gems.adapters
Class PoolingComponentAdapter.DefaultContext

java.lang.Object
  extended by org.picocontainer.gems.adapters.PoolingComponentAdapter.DefaultContext
All Implemented Interfaces:
PoolingComponentAdapter.Context
Enclosing class:
PoolingComponentAdapter

public static class PoolingComponentAdapter.DefaultContext
extends java.lang.Object
implements PoolingComponentAdapter.Context

The default context for a PoolingComponentAdapter.

Since:
1.2
Author:
Jörg Schaible

Constructor Summary
PoolingComponentAdapter.DefaultContext()
           
 
Method Summary
 boolean autostartGC()
          Allow the implementation to invoke the garbace collector manually if the pool is exhausted.
 int getMaxSize()
          Retrieve the maximum size of the pool.
 int getMaxWaitInMilliseconds()
          Retrieve the maximum number of milliseconds to wait for a returned element.
 com.thoughtworks.proxy.ProxyFactory getProxyFactory()
          Retrieve the ProxyFactory to use to create the pooling proxies.
 com.thoughtworks.proxy.kit.Resetter getResetter()
          Retrieve the Resetter of the objects returning to the pool.
 int getSerializationMode()
          Retrieve the serialization mode of the pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PoolingComponentAdapter.DefaultContext

public PoolingComponentAdapter.DefaultContext()
Method Detail

getMaxSize

public int getMaxSize()
Retrieve the maximum size of the pool. An implementation may return the maximum value or PoolingComponentAdapter.UNLIMITED_SIZE for unlimited growth. Returns PoolingComponentAdapter.DEFAULT_MAX_SIZE.

Specified by:
getMaxSize in interface PoolingComponentAdapter.Context
Returns:
the maximum pool size

getMaxWaitInMilliseconds

public int getMaxWaitInMilliseconds()
Retrieve the maximum number of milliseconds to wait for a returned element. An implementation may return alternatively PoolingComponentAdapter.BLOCK_ON_WAIT or PoolingComponentAdapter.FAIL_ON_WAIT. Returns PoolingComponentAdapter.FAIL_ON_WAIT.

Specified by:
getMaxWaitInMilliseconds in interface PoolingComponentAdapter.Context
Returns:
the maximum number of milliseconds to wait

autostartGC

public boolean autostartGC()
Allow the implementation to invoke the garbace collector manually if the pool is exhausted. Returns false.

Specified by:
autostartGC in interface PoolingComponentAdapter.Context
Returns:
true for an internal call to System.gc()

getProxyFactory

public com.thoughtworks.proxy.ProxyFactory getProxyFactory()
Retrieve the ProxyFactory to use to create the pooling proxies. Returns a StandardProxyFactory.

Specified by:
getProxyFactory in interface PoolingComponentAdapter.Context
Returns:
the ProxyFactory

getResetter

public com.thoughtworks.proxy.kit.Resetter getResetter()
Retrieve the Resetter of the objects returning to the pool. Returns the PoolingComponentAdapter.DEFAULT_RESETTER.

Specified by:
getResetter in interface PoolingComponentAdapter.Context
Returns:
the Resetter instance

getSerializationMode

public int getSerializationMode()
Retrieve the serialization mode of the pool. Following values are possible: Returns Pool.SERIALIZATION_STANDARD.

Specified by:
getSerializationMode in interface PoolingComponentAdapter.Context
Returns:
the serialization mode