Package com.sun.enterprise.resource.pool
Class PoolLifeCycleRegistry
- java.lang.Object
-
- com.sun.enterprise.resource.pool.PoolLifeCycleRegistry
-
- All Implemented Interfaces:
PoolLifeCycle
@Singleton public class PoolLifeCycleRegistry extends Object implements PoolLifeCycle
Implementation of PoolLifeCycle to listen to events related to a connection pool creation or destroy. The registry allows multiple listeners (ex: pool monitoring or self management) to listen to the pool's lifecyle. Maintains a list of listeners for this pool identified by poolName.- Author:
- Shalini M
-
-
Field Summary
Fields Modifier and Type Field Description protected List<PoolLifeCycle>
lifeCycleListeners
-
Constructor Summary
Constructors Constructor Description PoolLifeCycleRegistry()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PoolLifeCycleRegistry
getRegistry()
void
poolCreated(PoolInfo poolInfo)
Invoke poolCreated for all listeners of this pool.void
poolDestroyed(PoolInfo poolInfo)
Invoke poolDestroyed for all listeners of this pool.void
registerPoolLifeCycle(PoolLifeCycle listener)
Add a listener to the list of pool life cycle listeners maintained by this registry for thepoolName
.void
unRegisterPoolLifeCycle(PoolLifeCycle listener)
Clear the list of pool lifecycle listeners maintained by the registry.
-
-
-
Field Detail
-
lifeCycleListeners
protected List<PoolLifeCycle> lifeCycleListeners
-
-
Method Detail
-
getRegistry
public static PoolLifeCycleRegistry getRegistry()
-
registerPoolLifeCycle
public void registerPoolLifeCycle(PoolLifeCycle listener)
Add a listener to the list of pool life cycle listeners maintained by this registry for thepoolName
.- Parameters:
poolName
-listener
-
-
unRegisterPoolLifeCycle
public void unRegisterPoolLifeCycle(PoolLifeCycle listener)
Clear the list of pool lifecycle listeners maintained by the registry. This happens when a pool is destroyed so the information about its listeners need not be stored.
-
poolCreated
public void poolCreated(PoolInfo poolInfo)
Invoke poolCreated for all listeners of this pool.- Specified by:
poolCreated
in interfacePoolLifeCycle
- Parameters:
poolInfo
-
-
poolDestroyed
public void poolDestroyed(PoolInfo poolInfo)
Invoke poolDestroyed for all listeners of this pool.- Specified by:
poolDestroyed
in interfacePoolLifeCycle
- Parameters:
poolInfo
-
-
-