FileDocCategorySizeDatePackage
PoolProperties.javaAPI DocGlassfish v2 API7241Fri May 04 22:32:16 BST 2007com.sun.enterprise.util.pool

PoolProperties

public class PoolProperties extends Object

$Source: /cvs/glassfish/appserv-commons/src/java/com/sun/enterprise/util/pool/PoolProperties.java,v $
author
$Author: tcfujii $
version
$Revision: 1.4 $ $Date: 2007/05/05 05:32:16 $

Fields Summary
public static final String
FACTORY_CLASS_NAME
The factory class name property. Not used now.
public static final String
MINIMUM_SIZE
Minimum pool size property.
public static final String
INITIAL_SIZE
public static final String
LOW_WATER_MARK
public static final String
HI_WATER_MARK
public static final String
MAX_STRONG_REFERENCES
public static final String
POOL_LIMIT
public static final String
MAX_IDLE_TIME
public long
key
public String
factoryClassName
public int
minimumSize
The minimum pool size. Default 0.
public int
initialSize
The initial pool size. Default 0.
public int
lowWaterMark
Low water mark. Pool implementation may interpret this property accordingly.
public int
hiWaterMark
High water mark. Pool implementation may interpret this property accordingly.
public int
maxStrongRefs
Maximum strong References. SoftObjectPools uses this property. This property tells the maximum number of strong reference that can be maintained in the pool. This must be less than the pool limit and difference indicates the number of SoftReferences that will be used to hold the objects in the pool.
public int
poolLimit
The maximum size of the pool. If this value is less than or equal to zero, then this pool will be treated as an UnBounded pool.
public long
maxIdleTime
Constructors Summary
public PoolProperties()


	  
	
public PoolProperties(int minimumSize, int poolLimit)

		this.minimumSize = minimumSize;
		this.poolLimit = poolLimit;
	
public PoolProperties(Properties props)

		factoryClassName = props.getProperty(FACTORY_CLASS_NAME);
		minimumSize = getIntProperty(props, MINIMUM_SIZE, 0);
		initialSize = getIntProperty(props, INITIAL_SIZE, 0);
		lowWaterMark = getIntProperty(props, LOW_WATER_MARK, 0);
		hiWaterMark = getIntProperty(props, HI_WATER_MARK, 0);
		poolLimit = getIntProperty(props, POOL_LIMIT, 0);
		maxIdleTime = getLongProperty(props, MAX_IDLE_TIME, 60 * 1000);
	
Methods Summary
public java.lang.StringgetFactoryClassName()

		return this.factoryClassName;
	
public intgetHiWaterMark()

		return this.hiWaterMark;
	
public intgetInitialSize()

		return this.initialSize;
	
private intgetIntProperty(java.util.Properties props, java.lang.String name, int defaultValue)

    	try {
    		return Integer.parseInt(props.getProperty(name));
    	} catch (Throwable th) {
	    	return defaultValue;
    	}
    
private longgetLongProperty(java.util.Properties props, java.lang.String name, long defaultValue)

    	try {
    		return Long.parseLong(props.getProperty(name));
    	} catch (Throwable th) {
	    	return defaultValue;
    	}
    
public intgetLowWaterMark()

		return this.lowWaterMark;
	
public longgetMaxIdleTime()

		return this.maxIdleTime;
	
public intgetMaxStrongRefs()

		return this.maxStrongRefs;
	
public intgetMinimumSize()

		return this.minimumSize;
	
public intgetPoolLimit()

		return this.poolLimit;
	
public voidsetFactoryClassName(java.lang.String name)

		this.factoryClassName = name;
	
public voidsetHiWaterMark(int val)

		this.hiWaterMark = val;
	
public voidsetInitialSize(int val)

		this.initialSize = val;
	
public voidsetLowWaterMark(int val)

		this.lowWaterMark = val;
	
public voidsetMaxIdleTime(long val)

		this.maxIdleTime = val;
	
public voidsetMaxStrongRefs(int val)

		this.maxStrongRefs = val;
	
public voidsetMinimumSize(int val)

		this.minimumSize = val;
	
public voidsetPoolLimit(int val)

		this.poolLimit = val;
	
public java.lang.StringtoString()

    	StringBuffer sbuf = new StringBuffer();
    	sbuf.append("key: ").append(key)
    		.append("; min: ").append(minimumSize)
    		.append("; init: ").append(initialSize)
    		.append("; lowWM: ").append(lowWaterMark)
    		.append("; hiWM: ").append(hiWaterMark)
    		.append("; maxSRefs: ").append(maxStrongRefs)
    		.append("; limit: ").append(poolLimit);
    	return sbuf.toString();