org.modeshape.jboss.managed
Class ManagedConnectionPool

java.lang.Object
  extended by org.modeshape.jboss.managed.ManagedConnectionPool
All Implemented Interfaces:
ModeShapeManagedObject

public final class ManagedConnectionPool
extends Object
implements ModeShapeManagedObject

A ManagedConnectionPool instance is a JBoss managed object for a repository connection pool.


Constructor Summary
ManagedConnectionPool(RepositoryConnectionPool connectionPool)
          Creates a JBoss managed object for the specified connection pool.
 
Method Summary
 boolean flush()
          Removes all connections.
 int getAvailableCount()
          Obtains the number of connections available for use.
 long getCreatedCount()
          Obtains the number of connections that have been created.
 long getDestroyedCount()
          Obtains the number of connections that have been destroyed.
 int getInUseCount()
          Obtains the total number of times connections have been used.
 int getInUseHighWaterMark()
           
 long getKeepAliveTime()
          Obtains the time a connection can remain idle before being closed.
 int getMaxFailedAttemptsBeforeError()
          Obtains the number of failed attempts at trying to a connection before throwing an error.
 int getMaxSize()
          Obtains the maximum size of the pool.
 int getMinSize()
           
 long getPingTimeout()
          Obtains the time to wait for a ping to complete.
 int getSize()
          Obtains the current number of connections.
 boolean getValidateConnectionBeforeUse()
          Indicates if connections should be validated before being used.
 void setKeepAliveTime(long nanos)
          Sets the time a connection can remain idle before being closed.
 void setMaxFailedAttemptsBeforeError(int attempts)
          Sets the maximum number of attempts to try and establish a connection.
 void setPingTimout(long nanos)
          Sets the time a ping will wait to complete.
 void setSize(int size)
          Sets the maximum size of the number of connections allowed.
 void setValidateConnectionBeforeUse(boolean validate)
          Sets the flag indicating if the connection should be validated before being used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagedConnectionPool

public ManagedConnectionPool(RepositoryConnectionPool connectionPool)
Creates a JBoss managed object for the specified connection pool.

Parameters:
connectionPool - the connection pool being managed (never null)
Method Detail

flush

public boolean flush()
Removes all connections. This is a JBoss managed operation.

Returns:
true if successful

getAvailableCount

public int getAvailableCount()
Obtains the number of connections available for use. This is a JBoss managed readonly property.

Returns:
the number of available connections

getCreatedCount

public long getCreatedCount()
Obtains the number of connections that have been created. This is a JBoss managed readonly property.

Returns:
the number of connections created

getDestroyedCount

public long getDestroyedCount()
Obtains the number of connections that have been destroyed. This is a JBoss managed readonly property.

Returns:
the number of connections destroyed

getInUseCount

public int getInUseCount()
Obtains the total number of times connections have been used. This is a JBoss managed readonly property.

Returns:
the number of times

getInUseHighWaterMark

public int getInUseHighWaterMark()

getKeepAliveTime

public long getKeepAliveTime()
Obtains the time a connection can remain idle before being closed. This is a JBoss managed writable property.

Returns:
the new connection max idle time

getMaxFailedAttemptsBeforeError

public int getMaxFailedAttemptsBeforeError()
Obtains the number of failed attempts at trying to a connection before throwing an error. This is a JBoss managed writable property.

Returns:
the number of failed attempts to connect

getMaxSize

public int getMaxSize()
Obtains the maximum size of the pool. This is a JBoss managed writable property.

Returns:
the maximum pool size

getMinSize

public int getMinSize()

getPingTimeout

public long getPingTimeout()
Obtains the time to wait for a ping to complete. This is a JBoss managed writable property.

Returns:
the time in nanoseconds

getSize

public int getSize()
Obtains the current number of connections. This is a JBoss managed readonly property.

Returns:
the number of connections

getValidateConnectionBeforeUse

public boolean getValidateConnectionBeforeUse()
Indicates if connections should be validated before being used. This is a JBoss managed writable property.

Returns:
true if connections are validated before being used

setKeepAliveTime

public void setKeepAliveTime(long nanos)
Sets the time a connection can remain idle before being closed. This is a JBoss managed property.

Parameters:
nanos - the new connection max idle time (must be non-negative)

setMaxFailedAttemptsBeforeError

public void setMaxFailedAttemptsBeforeError(int attempts)
Sets the maximum number of attempts to try and establish a connection. This is a JBoss managed property.

Parameters:
attempts - the new maximum number of attempts (must be non-negative)

setSize

public void setSize(int size)
Sets the maximum size of the number of connections allowed. This is a JBoss managed property.

Parameters:
size - the new maximum pool size (must be positive)

setPingTimout

public void setPingTimout(long nanos)
Sets the time a ping will wait to complete. This is a JBoss managed property.

Parameters:
nanos - the new time to wait in nanoseconds (must be non-negative)

setValidateConnectionBeforeUse

public void setValidateConnectionBeforeUse(boolean validate)
Sets the flag indicating if the connection should be validated before being used. This is a JBoss managed property.

Parameters:
validate - the new value validate flag value


Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.