@Module public class ConnectionPool extends AbstractManagedObject implements ConnectionManager, AlarmListener, ConnectionPoolMXBean
| Constructor and Description |
|---|
ConnectionPool() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
allocateConnection(ManagedConnectionFactory mcf,
ConnectionRequestInfo info)
Allocates the connection.
|
boolean |
allowLocalTransactionOptimization()
Returns true if the local transaction optimization is enabled
|
void |
clear()
Clears the idle connections in the pool.
|
void |
destroy()
Destroys the manager.
|
ActiveTimeMeter |
getActiveTimeProbe()
Returns the active time probe
|
int |
getConnectionActiveCount()
Returns the active connections.
|
int |
getConnectionCount()
Returns the total connections.
|
long |
getConnectionCountTotal()
Returns the total connections.
|
int |
getConnectionCreateCount()
Current number of connections being created.
|
long |
getConnectionCreateCountTotal()
Returns the total connections.
|
long |
getConnectionFailCountTotal()
Returns the total failed connections.
|
int |
getConnectionIdleCount()
Returns the idle connections.
|
ActiveTimeMeter |
getConnectionTimeProbe()
Returns the connection time probe
|
long |
getConnectionWaitTime()
Sets the time to wait for connections
|
ActiveTimeMeter |
getIdleTimeProbe()
Returns the idle time probe
|
java.util.Date |
getLastFailTime()
Returns the last fail time
|
long |
getMaxActiveTime()
Returns the max active time.
|
int |
getMaxConnections()
Gets the maximum number of connections
|
int |
getMaxCreateConnections()
Gets the maximum number of connections simultaneously creating
|
int |
getMaxIdleCount()
Returns the max idle count.
|
long |
getMaxIdleTime()
Returns the max idle time.
|
int |
getMaxOverflowConnections()
Gets the max number of overflow connections
|
long |
getMaxPoolTime()
Returns the max pool time.
|
int |
getMinIdleCount()
Returns the min idle count.
|
java.lang.String |
getName()
Gets the connection pool name.
|
boolean |
getSaveAllocationStackTrace()
Returns true if a stack trace should be shared on allocation
|
UserTransactionProxy |
getTransactionManager()
Returns the transaction manager.
|
void |
handleAlarm(Alarm alarm)
Alarm listener.
|
java.lang.Object |
init(ManagedConnectionFactory mcf)
Initialize the connection manager.
|
boolean |
isCloseDanglingConnections()
Returns true if dangling connections should be closed
|
boolean |
isLocalTransaction()
Set true for local transaction support.
|
boolean |
isLocalTransactionOptimization()
Returns true if the local transaction optimization is enabled
|
boolean |
isShareable()
Returns true if shared connections are allowed.
|
boolean |
isXATransaction()
Set true for XA transaction support.
|
void |
markForPoolRemoval(ManagedConnection mConn) |
void |
setCloseDanglingConnections(boolean isClose)
True if dangling connections should be closed.
|
void |
setConnectionWaitTime(Period waitTime)
Sets the time to wait for connections
|
void |
setLocalTransaction(boolean localTransaction)
Set true for local transaction support.
|
void |
setLocalTransactionOptimization(boolean enable)
Returns true if the local transaction optimization is enabled
|
void |
setMaxActiveTime(long maxActiveTime)
Sets the max active time.
|
void |
setMaxConnections(int maxConnections)
Sets the max number of connections
|
void |
setMaxCreateConnections(int maxConnections)
Sets the max number of connections simultaneously creating
|
void |
setMaxIdleCount(int maxIdleCount)
Sets the max idle count.
|
void |
setMaxIdleTime(long maxIdleTime)
Sets the max idle time.
|
void |
setMaxOverflowConnections(int maxOverflowConnections)
Sets the max number of overflow connections
|
void |
setMaxPoolTime(long maxPoolTime)
Sets the max pool time.
|
void |
setMinIdleCount(int minIdleCount)
Sets the max idle count.
|
void |
setName(java.lang.String name)
Sets the connection pool name.
|
void |
setSaveAllocationStackTrace(boolean save)
Returns true if a stack trace should be shared on allocation
|
void |
setShareable(boolean isShareable)
Returns true if shared connections are allowed.
|
void |
setTransactionManager(UserTransactionProxy tm)
Sets the transaction manager.
|
void |
setXATransaction(boolean enable)
Set true for XA transaction support.
|
void |
start()
start the connection manager.
|
void |
stop()
Stops the manager.
|
java.lang.String |
toString() |
addObjectNameProperties, getObjectName, getType, registerSelf, unregisterSelfclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetObjectName, getTypepublic void setName(java.lang.String name)
public java.lang.String getName()
getName in interface ManagedObjectMXBeangetName in class AbstractManagedObjectpublic void setTransactionManager(UserTransactionProxy tm)
public UserTransactionProxy getTransactionManager()
public boolean isShareable()
isShareable in interface ConnectionPoolMXBeanpublic void setShareable(boolean isShareable)
public boolean isLocalTransactionOptimization()
isLocalTransactionOptimization in interface ConnectionPoolMXBeanpublic void setLocalTransactionOptimization(boolean enable)
public boolean allowLocalTransactionOptimization()
public boolean getSaveAllocationStackTrace()
public void setSaveAllocationStackTrace(boolean save)
public boolean isCloseDanglingConnections()
public void setCloseDanglingConnections(boolean isClose)
public void setLocalTransaction(boolean localTransaction)
public boolean isLocalTransaction()
public void setXATransaction(boolean enable)
public boolean isXATransaction()
public long getMaxIdleTime()
getMaxIdleTime in interface ConnectionPoolMXBeanpublic void setMaxIdleTime(long maxIdleTime)
public int getMaxIdleCount()
getMaxIdleCount in interface ConnectionPoolMXBeanpublic void setMaxIdleCount(int maxIdleCount)
public int getMinIdleCount()
getMinIdleCount in interface ConnectionPoolMXBeanpublic void setMinIdleCount(int minIdleCount)
public long getMaxActiveTime()
getMaxActiveTime in interface ConnectionPoolMXBeanpublic void setMaxActiveTime(long maxActiveTime)
public long getMaxPoolTime()
getMaxPoolTime in interface ConnectionPoolMXBeanpublic void setMaxPoolTime(long maxPoolTime)
public void setMaxConnections(int maxConnections)
throws ConfigException
ConfigExceptionpublic int getMaxConnections()
getMaxConnections in interface ConnectionPoolMXBeanpublic void setConnectionWaitTime(Period waitTime)
public long getConnectionWaitTime()
getConnectionWaitTime in interface ConnectionPoolMXBeanpublic void setMaxOverflowConnections(int maxOverflowConnections)
public int getMaxOverflowConnections()
getMaxOverflowConnections in interface ConnectionPoolMXBeanpublic void setMaxCreateConnections(int maxConnections)
throws ConfigException
ConfigExceptionpublic int getMaxCreateConnections()
getMaxCreateConnections in interface ConnectionPoolMXBeanpublic ActiveTimeMeter getConnectionTimeProbe()
public ActiveTimeMeter getIdleTimeProbe()
public ActiveTimeMeter getActiveTimeProbe()
public int getConnectionCount()
getConnectionCount in interface ConnectionPoolMXBeanpublic int getConnectionIdleCount()
getConnectionIdleCount in interface ConnectionPoolMXBeanpublic int getConnectionCreateCount()
getConnectionCreateCount in interface ConnectionPoolMXBeanpublic int getConnectionActiveCount()
getConnectionActiveCount in interface ConnectionPoolMXBeanpublic long getConnectionCountTotal()
getConnectionCountTotal in interface ConnectionPoolMXBeanpublic long getConnectionCreateCountTotal()
getConnectionCreateCountTotal in interface ConnectionPoolMXBeanpublic long getConnectionFailCountTotal()
getConnectionFailCountTotal in interface ConnectionPoolMXBeanpublic java.util.Date getLastFailTime()
getLastFailTime in interface ConnectionPoolMXBeanpublic java.lang.Object init(ManagedConnectionFactory mcf) throws ConfigException, ResourceException
ConfigExceptionResourceExceptionpublic void start()
public java.lang.Object allocateConnection(ManagedConnectionFactory mcf, ConnectionRequestInfo info) throws ResourceException
allocateConnection in interface ConnectionManagerResourceExceptionpublic void markForPoolRemoval(ManagedConnection mConn)
public void clear()
clear in interface ConnectionPoolMXBeanpublic void handleAlarm(Alarm alarm)
handleAlarm in interface AlarmListenerpublic void stop()
public void destroy()
public java.lang.String toString()
toString in class AbstractManagedObject