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 void
blockRequests(long waitTimeout)
block any new requests to the pool Used for transparent dynamic reconfiguration of the poolvoid
cancelResizerTask()
void
emptyFreeConnectionsInPool()
void
emptyPool()
boolean
flushConnectionPool()
Flush Connection pool by reinitializing the connections established in the pool.int
getMaxPoolSize()
Gets the max-pool-size attribute of this pool.PoolInfo
getPoolInfo()
PoolStatus
getPoolStatus()
PoolWaitQueue
getPoolWaitQueue()
returns pool-wait-queuePoolWaitQueue
getReconfigWaitQueue()
returns wait-queue used during transparent dynamic reconfigurationlong
getReconfigWaitTime()
returns the reconfig-wait-timeResourceHandle
getResource(ResourceSpec spec, ResourceAllocator alloc, jakarta.transaction.Transaction tran)
int
getSteadyPoolSize()
Gets the steady-pool-size attribute of this pool.void
reconfigurePool(ConnectorConnectionPool ccp)
void
removePoolLifeCycleListener()
remove pool life cycle listenervoid
resizePool(boolean forced)
void
resourceClosed(ResourceHandle resource)
void
resourceEnlisted(jakarta.transaction.Transaction tran, ResourceHandle resource)
void
resourceErrorOccurred(ResourceHandle resource)
void
setMaxPoolSize(int size)
Sets the max-pool-size value for this pool.void
setPoolLifeCycleListener(PoolLifeCycleListener listener)
set pool life cycle listenervoid
setSelfManaged(boolean selfManaged)
Sets/Resets the flag indicating if this pool is self managed.void
setSteadyPoolSize(int size)
Sets the steady-pool-size value for this pool.void
switchOnMatching()
void
transactionCompleted(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:
PoolingException
jakarta.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 PoolingException
Flush 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
-
-