Methods Summary |
---|
public void | flush()
if (poolingStrategy == null)
throw new IllegalStateException("The connection pool is not started");
poolingStrategy.flush();
if (poolingStrategy instanceof PreFillPoolSupport)
{
final PreFillPoolSupport pfs = (PreFillPoolSupport) poolingStrategy;
if (pfs.shouldPreFill())
pfs.prefill(noTxSeparatePools);
}
|
public long | getAvailableConnectionCount()
return (poolingStrategy == null) ? 0 : poolingStrategy.getAvailableConnectionCount();
|
public boolean | getBackGroundValidation()
return poolParams.backgroundValidation;
|
public long | getBackGroundValidationMinutes()
return poolParams.backgroundInterval / (1000 * 60);
|
public int | getBlockingTimeoutMillis()
return poolParams.blockingTimeout;
|
public int | getConnectionCount()
return (poolingStrategy == null) ? 0 : poolingStrategy.getConnectionCount();
|
public int | getConnectionCreatedCount()
return (poolingStrategy == null) ? 0 : poolingStrategy.getConnectionCreatedCount();
|
public int | getConnectionDestroyedCount()
return (poolingStrategy == null) ? 0 : poolingStrategy.getConnectionDestroyedCount();
|
public java.lang.String | getCriteria()
return criteria;
|
public long | getIdleTimeout()Get the IdleTimeout value.
return poolParams.idleTimeout;
|
public long | getIdleTimeoutMinutes()
return poolParams.idleTimeout / (1000 * 60);
|
public long | getInUseConnectionCount()
return (poolingStrategy == null) ? 0 : poolingStrategy.getInUseConnectionCount();
|
public javax.management.ObjectName | getManagedConnectionFactoryName()
return managedConnectionFactoryName;
|
public ManagedConnectionPool | getManagedConnectionPool()
return poolingStrategy;
|
public long | getMaxConnectionsInUseCount()
return (poolingStrategy == null) ? 0 : poolingStrategy.getMaxConnectionsInUseCount();
|
public int | getMaxSize()
return poolParams.maxSize;
|
public int | getMinSize()
return poolParams.minSize;
|
public java.lang.String | getName()
return "JBossManagedConnectionPool";
|
public boolean | getNoTxSeparatePools()
return noTxSeparatePools;
|
public java.lang.String | getPoolJndiName()
return this.poolJndiName;
|
public boolean | getPreFill()
return this.poolParams.prefill;
|
public boolean | getUseFastFail()
return this.poolParams.useFastFail;
|
public void | handleNotification(javax.management.Notification notification, java.lang.Object handback)
flush();
|
public void | setBackGroundValidation(boolean backgroundValidation)
poolParams.backgroundValidation = backgroundValidation;
|
public void | setBackGroundValidationMinutes(long backgroundValidationInterval)
poolParams.backgroundInterval = backgroundValidationInterval * 1000 * 60;
|
public void | setBlockingTimeoutMillis(int newBlockingTimeout)
poolParams.blockingTimeout = newBlockingTimeout;
|
public void | setCriteria(java.lang.String newCriteria)
this.criteria = newCriteria;
|
public void | setIdleTimeout(long newIdleTimeout)Set the IdleTimeout value.
poolParams.idleTimeout = newIdleTimeout;
|
public void | setIdleTimeoutMinutes(long newIdleTimeoutMinutes)
poolParams.idleTimeout = newIdleTimeoutMinutes * 1000 * 60;
|
public void | setManagedConnectionFactoryName(javax.management.ObjectName newManagedConnectionFactoryName)
this.managedConnectionFactoryName = newManagedConnectionFactoryName;
|
public void | setMaxSize(int newMaxSize)
poolParams.maxSize = newMaxSize;
|
public void | setMinSize(int newMinSize)
poolParams.minSize = newMinSize;
|
public void | setNoTxSeparatePools(boolean value)
this.noTxSeparatePools = value;
|
public void | setPoolJndiName(java.lang.String poolName)
this.poolJndiName = poolName;
|
public void | setPreFill(boolean prefill)
this.poolParams.prefill = prefill;
|
public void | setUseFastFail(boolean useFastFail)
this.poolParams.useFastFail = useFastFail;
|
protected void | startService()
ManagedConnectionFactory mcf = null;
if (managedConnectionFactoryName == null)
throw new DeploymentException("ManagedConnectionFactory not set!");
try
{
//We are getting the actual mcf instance itself. This will require
//some work if the mcf is an xmbean of itself.
mcf = (ManagedConnectionFactory) server.getAttribute(managedConnectionFactoryName, "McfInstance");
}
catch (Exception e)
{
JMXExceptionDecoder.rethrow(e);
}
getServer().addNotificationListener(managedConnectionFactoryName, this, new NotificationFilter()
{
private static final long serialVersionUID = -9211456539783257343L;
public boolean isNotificationEnabled(Notification n)
{
return RARDeployment.MCF_ATTRIBUTE_CHANGED_NOTIFICATION.equals(n.getType())
&& managedConnectionFactoryName.equals(n.getSource());
}
}, null);
if ("ByContainerAndApplication".equals(criteria))
poolingStrategy = new PoolBySubjectAndCri(mcf, poolJndiName, poolParams, noTxSeparatePools, log);
else if ("ByContainer".equals(criteria))
poolingStrategy = new PoolBySubject(mcf, poolJndiName, poolParams, noTxSeparatePools, log);
else if ("ByApplication".equals(criteria))
poolingStrategy = new PoolByCri(mcf, poolJndiName, poolParams, noTxSeparatePools, log);
else if ("ByNothing".equals(criteria))
poolingStrategy = new OnePool(mcf, poolJndiName, poolParams, noTxSeparatePools, log);
else
throw new DeploymentException("Unknown pooling criteria: " + criteria);
|
protected void | stopService()
if (poolingStrategy != null)
poolingStrategy.shutdown();
getServer().removeNotificationListener(managedConnectionFactoryName, this);
poolingStrategy = null;
|