@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, unregisterSelf
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getObjectName, getType
public void setName(java.lang.String name)
public java.lang.String getName()
getName
in interface ManagedObjectMXBean
getName
in class AbstractManagedObject
public void setTransactionManager(UserTransactionProxy tm)
public UserTransactionProxy getTransactionManager()
public boolean isShareable()
isShareable
in interface ConnectionPoolMXBean
public void setShareable(boolean isShareable)
public boolean isLocalTransactionOptimization()
isLocalTransactionOptimization
in interface ConnectionPoolMXBean
public 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 ConnectionPoolMXBean
public void setMaxIdleTime(long maxIdleTime)
public int getMaxIdleCount()
getMaxIdleCount
in interface ConnectionPoolMXBean
public void setMaxIdleCount(int maxIdleCount)
public int getMinIdleCount()
getMinIdleCount
in interface ConnectionPoolMXBean
public void setMinIdleCount(int minIdleCount)
public long getMaxActiveTime()
getMaxActiveTime
in interface ConnectionPoolMXBean
public void setMaxActiveTime(long maxActiveTime)
public long getMaxPoolTime()
getMaxPoolTime
in interface ConnectionPoolMXBean
public void setMaxPoolTime(long maxPoolTime)
public void setMaxConnections(int maxConnections) throws ConfigException
ConfigException
public int getMaxConnections()
getMaxConnections
in interface ConnectionPoolMXBean
public void setConnectionWaitTime(Period waitTime)
public long getConnectionWaitTime()
getConnectionWaitTime
in interface ConnectionPoolMXBean
public void setMaxOverflowConnections(int maxOverflowConnections)
public int getMaxOverflowConnections()
getMaxOverflowConnections
in interface ConnectionPoolMXBean
public void setMaxCreateConnections(int maxConnections) throws ConfigException
ConfigException
public int getMaxCreateConnections()
getMaxCreateConnections
in interface ConnectionPoolMXBean
public ActiveTimeMeter getConnectionTimeProbe()
public ActiveTimeMeter getIdleTimeProbe()
public ActiveTimeMeter getActiveTimeProbe()
public int getConnectionCount()
getConnectionCount
in interface ConnectionPoolMXBean
public int getConnectionIdleCount()
getConnectionIdleCount
in interface ConnectionPoolMXBean
public int getConnectionCreateCount()
getConnectionCreateCount
in interface ConnectionPoolMXBean
public int getConnectionActiveCount()
getConnectionActiveCount
in interface ConnectionPoolMXBean
public long getConnectionCountTotal()
getConnectionCountTotal
in interface ConnectionPoolMXBean
public long getConnectionCreateCountTotal()
getConnectionCreateCountTotal
in interface ConnectionPoolMXBean
public long getConnectionFailCountTotal()
getConnectionFailCountTotal
in interface ConnectionPoolMXBean
public java.util.Date getLastFailTime()
getLastFailTime
in interface ConnectionPoolMXBean
public java.lang.Object init(ManagedConnectionFactory mcf) throws ConfigException, ResourceException
ConfigException
ResourceException
public void start()
public java.lang.Object allocateConnection(ManagedConnectionFactory mcf, ConnectionRequestInfo info) throws ResourceException
allocateConnection
in interface ConnectionManager
ResourceException
public void markForPoolRemoval(ManagedConnection mConn)
public void clear()
clear
in interface ConnectionPoolMXBean
public void handleAlarm(Alarm alarm)
handleAlarm
in interface AlarmListener
public void stop()
public void destroy()
public java.lang.String toString()
toString
in class AbstractManagedObject