Package com.sun.enterprise.resource.pool
Interface ResourcePool
-
- All Known Implementing Classes:
AssocWithThreadResourcePool,ConnectionPool,UnpooledResource
public interface ResourcePool- Author:
- Tony Ng
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidblockRequests(long waitTimeout)block any new requests to the pool Used for transparent dynamic reconfiguration of the poolvoidcancelResizerTask()voidemptyFreeConnectionsInPool()voidemptyPool()booleanflushConnectionPool()Flush Connection pool by reinitializing the connections established in the pool.intgetMaxPoolSize()Gets the max-pool-size attribute of this pool.PoolInfogetPoolInfo()PoolStatusgetPoolStatus()PoolWaitQueuegetPoolWaitQueue()returns pool-wait-queuePoolWaitQueuegetReconfigWaitQueue()returns wait-queue used during transparent dynamic reconfigurationlonggetReconfigWaitTime()returns the reconfig-wait-timeResourceHandlegetResource(ResourceSpec spec, ResourceAllocator alloc, jakarta.transaction.Transaction tran)intgetSteadyPoolSize()Gets the steady-pool-size attribute of this pool.voidreconfigurePool(ConnectorConnectionPool ccp)voidremovePoolLifeCycleListener()remove pool life cycle listenervoidresizePool(boolean forced)voidresourceClosed(ResourceHandle resource)voidresourceEnlisted(jakarta.transaction.Transaction tran, ResourceHandle resource)voidresourceErrorOccurred(ResourceHandle resource)voidsetMaxPoolSize(int size)Sets the max-pool-size value for this pool.voidsetPoolLifeCycleListener(PoolLifeCycleListener listener)set pool life cycle listenervoidsetSelfManaged(boolean selfManaged)Sets/Resets the flag indicating if this pool is self managed.voidsetSteadyPoolSize(int size)Sets the steady-pool-size value for this pool.voidswitchOnMatching()voidtransactionCompleted(jakarta.transaction.Transaction tran, int status)
-
-
-
Method Detail
-
getResource
ResourceHandle getResource(ResourceSpec spec, ResourceAllocator alloc, jakarta.transaction.Transaction tran) throws PoolingException, jakarta.resource.spi.RetryableUnavailableException
- Throws:
PoolingExceptionjakarta.resource.spi.RetryableUnavailableException
-
resourceClosed
void resourceClosed(ResourceHandle resource)
-
resourceErrorOccurred
void resourceErrorOccurred(ResourceHandle resource)
-
resourceEnlisted
void resourceEnlisted(jakarta.transaction.Transaction tran, ResourceHandle resource)
-
getPoolStatus
PoolStatus getPoolStatus()
-
transactionCompleted
void transactionCompleted(jakarta.transaction.Transaction tran, int status)
-
resizePool
void resizePool(boolean forced)
-
emptyPool
void emptyPool()
-
reconfigurePool
void reconfigurePool(ConnectorConnectionPool ccp) throws PoolingException
- Throws:
PoolingException
-
cancelResizerTask
void cancelResizerTask()
-
switchOnMatching
void switchOnMatching()
-
getPoolInfo
PoolInfo getPoolInfo()
-
emptyFreeConnectionsInPool
void emptyFreeConnectionsInPool()
-
getMaxPoolSize
int getMaxPoolSize()
Gets the max-pool-size attribute of this pool. Envisaged to be used by the Self management framework to query the pool size attribute for tweaking it using the setMaxPoolSize method- Returns:
- max-pool-size value for this pool
- See Also:
setMaxPoolSize(int)
-
getSteadyPoolSize
int getSteadyPoolSize()
Gets the steady-pool-size attribute of this pool. Envisaged to be used by the Self management framework to query the pool size attribute for tweaking it using the setSteadyPoolSize method- Returns:
- steady-pool-size value for this pool
- See Also:
setSteadyPoolSize(int)
-
setMaxPoolSize
void setMaxPoolSize(int size)
Sets the max-pool-size value for this pool. This attribute is expected to be set by the self-management framework for an optimum max-pool-size. The corresponding accessor gets this value.- Parameters:
size- - The new max-pool-size value- See Also:
getMaxPoolSize()
-
setSteadyPoolSize
void setSteadyPoolSize(int size)
Sets the steady-pool-size value for this pool. This attribute is expected to be set by the self-management framework for an optimum steady-pool-size. The corresponding accessor gets this value.- Parameters:
size- - The new steady-pool-size value- See Also:
getSteadyPoolSize()
-
setSelfManaged
void setSelfManaged(boolean selfManaged)
Sets/Resets the flag indicating if this pool is self managed. This method would be typically called by the self management framework to indicate to the world (and this pool) that this pool is self managed. Its very important that the self mgmt framework properly sets this flag to control the dynamic reconfig behavior of this pool. If this flag is set to true, all dynamic reconfigs affecting the max/steady pool size of this pool will be ignored.- Parameters:
selfManaged- - true to switch on self management, false otherwise
-
setPoolLifeCycleListener
void setPoolLifeCycleListener(PoolLifeCycleListener listener)
set pool life cycle listener- Parameters:
listener-
-
removePoolLifeCycleListener
void removePoolLifeCycleListener()
remove pool life cycle listener
-
flushConnectionPool
boolean flushConnectionPool() throws PoolingExceptionFlush Connection pool by reinitializing the connections established in the pool.- Returns:
- boolean indicating whether flush operation was successful or not
- Throws:
PoolingException
-
blockRequests
void blockRequests(long waitTimeout)
block any new requests to the pool Used for transparent dynamic reconfiguration of the pool- Parameters:
waitTimeout- time for which the new requests will wait
-
getPoolWaitQueue
PoolWaitQueue getPoolWaitQueue()
returns pool-wait-queue- Returns:
- wait-queue
-
getReconfigWaitQueue
PoolWaitQueue getReconfigWaitQueue()
returns wait-queue used during transparent dynamic reconfiguration- Returns:
- PoolWaitQueue
-
getReconfigWaitTime
long getReconfigWaitTime()
returns the reconfig-wait-time- Returns:
- long
-
-