Fields Summary |
---|
public static final String | FACTORY_CLASS_NAMEThe factory class name property. Not used now. |
public static final String | MINIMUM_SIZEMinimum 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 | minimumSizeThe minimum pool size. Default 0. |
public int | initialSizeThe initial pool size. Default 0. |
public int | lowWaterMarkLow water mark. Pool implementation may interpret this property accordingly. |
public int | hiWaterMarkHigh water mark. Pool implementation may interpret this property accordingly. |
public int | maxStrongRefsMaximum 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 | poolLimitThe 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.String | getFactoryClassName()
return this.factoryClassName;
|
public int | getHiWaterMark()
return this.hiWaterMark;
|
public int | getInitialSize()
return this.initialSize;
|
private int | getIntProperty(java.util.Properties props, java.lang.String name, int defaultValue)
try {
return Integer.parseInt(props.getProperty(name));
} catch (Throwable th) {
return defaultValue;
}
|
private long | getLongProperty(java.util.Properties props, java.lang.String name, long defaultValue)
try {
return Long.parseLong(props.getProperty(name));
} catch (Throwable th) {
return defaultValue;
}
|
public int | getLowWaterMark()
return this.lowWaterMark;
|
public long | getMaxIdleTime()
return this.maxIdleTime;
|
public int | getMaxStrongRefs()
return this.maxStrongRefs;
|
public int | getMinimumSize()
return this.minimumSize;
|
public int | getPoolLimit()
return this.poolLimit;
|
public void | setFactoryClassName(java.lang.String name)
this.factoryClassName = name;
|
public void | setHiWaterMark(int val)
this.hiWaterMark = val;
|
public void | setInitialSize(int val)
this.initialSize = val;
|
public void | setLowWaterMark(int val)
this.lowWaterMark = val;
|
public void | setMaxIdleTime(long val)
this.maxIdleTime = val;
|
public void | setMaxStrongRefs(int val)
this.maxStrongRefs = val;
|
public void | setMinimumSize(int val)
this.minimumSize = val;
|
public void | setPoolLimit(int val)
this.poolLimit = val;
|
public java.lang.String | toString()
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();
|