org.mule.config
Class PoolingProfile

java.lang.Object
  extended byorg.mule.config.PoolingProfile

public class PoolingProfile
extends java.lang.Object

PoolingProfile is a configuration object used to define the object pooling parameters for the component it is associated with.

Version:
$Revision: 1.3 $
Author:
Ross Mason

Field Summary
static int DEFAULT_MAX_POOL_ACTIVE
          Controls the maximum number of Mule UMOs that can be borrowed from a component pool at one time.
static int DEFAULT_MAX_POOL_IDLE
          Controls the maximum number of Mule UMOs that can sit idle in the pool at any time.
static long DEFAULT_MAX_POOL_WAIT
          When the threadPoolExhaustedAction is setto 2 (WHEN_EXHAUSTED_BLOCK) this can specify the maximum milliseconds the pool should block before throwing a NoSuchElementException
static int DEFAULT_POOL_EXHAUSTED_ACTION
          Specifies the behaviour of the Mule UMO pool when the pool is exhausted:

0 (WHEN_EXHAUSTED_FAIL) : will throw a NoSuchElementException 1 (WHEN_EXHAUSTED_BLOCK): will block (invoke Object.wait(long) until a new or idle object is available.

static int DEFAULT_POOL_INITIALISATION_POLICY
          Determines how components in a pool should be initialised.
static int POOL_INITIALISE_ALL_COMPONENTS
          Tells the object pool not to initialise any components on startup
static int POOL_INITIALISE_NO_COMPONENTS
          Tells the object pool not to initialise any components on startup
static int POOL_INITIALISE_ONE_COMPONENT
          Tells the object pool only to initialise one component on startup
 
Constructor Summary
PoolingProfile()
           
PoolingProfile(int maxActive, int maxIdle, long maxWait, int exhaustedAction, int initialisationPolicy)
           
PoolingProfile(PoolingProfile pp)
           
 
Method Summary
 int getExhaustedAction()
           
 int getInitialisationPolicy()
           
 int getMaxActive()
           
 int getMaxIdle()
           
 long getMaxWait()
           
 UMOPoolFactory getPoolFactory()
           
 void setExhaustedAction(int exhaustedAction)
           
 void setExhaustedActionString(java.lang.String poolExhaustedAction)
           
 void setInitialisationPolicy(int policy)
           
 void setInitialisationPolicyString(java.lang.String policy)
           
 void setMaxActive(int maxActive)
           
 void setMaxIdle(int maxIdle)
           
 void setMaxWait(long maxWait)
           
 void setPoolFactory(UMOPoolFactory poolFactory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

POOL_INITIALISE_NO_COMPONENTS

public static final int POOL_INITIALISE_NO_COMPONENTS
Tells the object pool not to initialise any components on startup

See Also:
Constant Field Values

POOL_INITIALISE_ONE_COMPONENT

public static final int POOL_INITIALISE_ONE_COMPONENT
Tells the object pool only to initialise one component on startup

See Also:
Constant Field Values

POOL_INITIALISE_ALL_COMPONENTS

public static final int POOL_INITIALISE_ALL_COMPONENTS
Tells the object pool not to initialise any components on startup

See Also:
Constant Field Values

DEFAULT_MAX_POOL_ACTIVE

public static final int DEFAULT_MAX_POOL_ACTIVE
Controls the maximum number of Mule UMOs that can be borrowed from a component pool at one time. When non-positive, there is no limit to the number of components that may be active at one time. When maxActive is exceeded, the pool is said to be exhausted. You can specify this value on the descriptor declaration. If none is set this value will be used.

See Also:
Constant Field Values

DEFAULT_MAX_POOL_IDLE

public static final int DEFAULT_MAX_POOL_IDLE
Controls the maximum number of Mule UMOs that can sit idle in the pool at any time. When non-positive, there is no limit to the number of Mule UMOs that may be idle at one time. You can specify this value on the descriptor declaration. If none is set this value will be used. If this value is not set then a system default of '5' will be used.

See Also:
Constant Field Values

DEFAULT_MAX_POOL_WAIT

public static final long DEFAULT_MAX_POOL_WAIT
When the threadPoolExhaustedAction is setto 2 (WHEN_EXHAUSTED_BLOCK) this can specify the maximum milliseconds the pool should block before throwing a NoSuchElementException

See Also:
Constant Field Values

DEFAULT_POOL_EXHAUSTED_ACTION

public static final int DEFAULT_POOL_EXHAUSTED_ACTION
Specifies the behaviour of the Mule UMO pool when the pool is exhausted:

0 (WHEN_EXHAUSTED_FAIL) : will throw a NoSuchElementException 1 (WHEN_EXHAUSTED_BLOCK): will block (invoke Object.wait(long) until a new or idle object is available. 2 (WHEN_EXHAUSTED_GROW) : will create a new Mule and return it(essentially making maxActive meaningless.)

If a positive maxWait value is supplied, it will block for at most that many milliseconds, after which a NoSuchElementException will be thrown. If maxThraedWait is non-positive, it will block indefinitely.

See Also:
Constant Field Values

DEFAULT_POOL_INITIALISATION_POLICY

public static final int DEFAULT_POOL_INITIALISATION_POLICY
Determines how components in a pool should be initialised. the possible values are -

See Also:
Constant Field Values
Constructor Detail

PoolingProfile

public PoolingProfile()

PoolingProfile

public PoolingProfile(PoolingProfile pp)

PoolingProfile

public PoolingProfile(int maxActive,
                      int maxIdle,
                      long maxWait,
                      int exhaustedAction,
                      int initialisationPolicy)
Method Detail

getMaxIdle

public int getMaxIdle()
Returns:
max number of Mule UMOs that can be idle in a component

getMaxActive

public int getMaxActive()
Returns:
max number of Mule UMOs that can be active in a component

getMaxWait

public long getMaxWait()
Returns:
time in miilisconds to wait for a Mule UMO to be available in a component when the pool of Mule UMOs is exhausted and the PoolExhaustedAction is set to WHEN_EXHAUSTED_BLOCK

getExhaustedAction

public int getExhaustedAction()
Returns:
the action when the Mule UMO pool is exhaused for a component

getInitialisationPolicy

public int getInitialisationPolicy()

setInitialisationPolicy

public void setInitialisationPolicy(int policy)

setMaxIdle

public void setMaxIdle(int maxIdle)

setMaxActive

public void setMaxActive(int maxActive)

setMaxWait

public void setMaxWait(long maxWait)

setExhaustedAction

public void setExhaustedAction(int exhaustedAction)

setExhaustedActionString

public void setExhaustedActionString(java.lang.String poolExhaustedAction)

setInitialisationPolicyString

public void setInitialisationPolicyString(java.lang.String policy)

getPoolFactory

public UMOPoolFactory getPoolFactory()

setPoolFactory

public void setPoolFactory(UMOPoolFactory poolFactory)


Copyright © 2003-2005 SymphonySoft Limited. All Rights Reserved.