org.picocontainer.gems.behaviors
Class Pooled.DefaultContext

java.lang.Object
  extended by org.picocontainer.gems.behaviors.Pooled.DefaultContext
All Implemented Interfaces:
Pooled.Context
Enclosing class:
Pooled<T>

public static class Pooled.DefaultContext
extends Object
implements Pooled.Context

The default context for a Pooled.

Author:
Jörg Schaible

Constructor Summary
Pooled.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.
 ProxyFactory getProxyFactory()
          Retrieve the ProxyFactory to use to create the pooling proxies.
 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

Pooled.DefaultContext

public Pooled.DefaultContext()
Method Detail

getMaxSize

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

Specified by:
getMaxSize in interface Pooled.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 Pooled.BLOCK_ON_WAIT or Pooled.FAIL_ON_WAIT. Returns Pooled.FAIL_ON_WAIT.

Specified by:
getMaxWaitInMilliseconds in interface Pooled.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 Pooled.Context
Returns:
true for an internal call to System.gc()

getProxyFactory

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

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

getResetter

public Resetter getResetter()
Retrieve the Resetter of the objects returning to the pool. Returns the Pooled.DEFAULT_RESETTER.

Specified by:
getResetter in interface Pooled.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 Pooled.Context
Returns:
the serialization mode


Copyright © 2003-2010 Codehaus. All Rights Reserved.