| Method from org.jboss.resource.connectionmanager.JBossManagedConnectionPool Detail: |
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 long getBackGroundValidationMillis() {
return poolParams.backgroundInterval;
}
|
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 String getCriteria() {
return criteria;
}
|
public long getIdleTimeout() {
return poolParams.idleTimeout;
}
Get the IdleTimeout value. |
public long getIdleTimeoutMinutes() {
return poolParams.idleTimeout / (1000 * 60);
}
|
public long getInUseConnectionCount() {
return (poolingStrategy == null) ? 0 : poolingStrategy.getInUseConnectionCount();
}
|
public 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 String getName() {
return "JBossManagedConnectionPool";
}
|
public boolean getNoTxSeparatePools() {
return noTxSeparatePools;
}
|
public String getPoolJndiName() {
return this.poolJndiName;
}
The connection factory jndi name. This is used to tie the pool
ManagedObject back to the ManagedConnectionFactoryDeploymentMetaData |
ManagedConnectionPool getPoolingStrategy() {
return poolingStrategy;
}
|
public boolean getPreFill() {
return poolParams.prefill;
}
|
public String getStatisticsFormatter() {
return statisticsFormatter;
}
|
public boolean getStrictMin() {
return poolParams.stictMin;
}
|
public boolean getUseFastFail() {
return this.poolParams.useFastFail;
}
|
public void handleNotification(Notification notification,
Object handback) {
log.trace("Flushing pool due to notification from ManagedConnectionFactory" + notification);
flush();
}
|
public Object listFormattedSubPoolStatistics() {
Object formatted = listFormattedSubPoolStatistics(statisticsFormatter);
return formatted;
}
|
public Object listFormattedSubPoolStatistics(String formatClassName) {
final JBossStatistics stats = (JBossStatistics)listStatistics();
final ClassLoader cl = Thread.currentThread().getContextClassLoader();
Class clazz;
StatisticsFormatter formatter = null;
try
{
clazz = cl.loadClass(formatClassName);
formatter = (StatisticsFormatter)clazz.newInstance();
}
catch (Exception e)
{
log.warn("warn: statistics formatter not found, setting to " + statisticsFormatter);
formatter = new JBossDefaultSubPoolStatisticFormatter();
}
return formatter.formatStatistics(stats);
}
|
public Object listStatistics() {
ManagedConnectionPoolStatistics stats = null;
if (poolingStrategy instanceof StatisticsReporter)
{
StatisticsReporter reporter = (StatisticsReporter) poolingStrategy;
stats = (ManagedConnectionPoolStatistics)reporter.listStatistics();
stats.setCriteria(getCriteria());
stats.setName(getManagedConnectionFactoryName().toString());
}
return stats;
}
|
public Object listUnderlyingNativeConnectionStatistics() {
return poolingStrategy.listUnderlyingNativeConnectionStatistics();
}
|
public void setBackGroundValidationMillis(long backgroundValidationInterval) {
poolParams.backgroundInterval = backgroundValidationInterval;
}
|
public void setBlockingTimeoutMillis(int newBlockingTimeout) {
poolParams.blockingTimeout = newBlockingTimeout;
}
|
public void setCriteria(String newCriteria) {
this.criteria = newCriteria;
}
|
public void setIdleTimeout(long newIdleTimeout) {
poolParams.idleTimeout = newIdleTimeout;
}
Set the IdleTimeout value. |
public void setIdleTimeoutMinutes(long newIdleTimeoutMinutes) {
poolParams.idleTimeout = newIdleTimeoutMinutes * 1000 * 60;
}
|
public void setManagedConnectionFactoryName(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(String poolName) {
this.poolJndiName = poolName;
}
|
public void setPreFill(boolean prefill) {
poolParams.prefill = prefill;
}
|
public void setStatisticsFormatter(String statisticsFormatter) {
this.statisticsFormatter = statisticsFormatter;
}
|
public void setStrictMin(boolean strictMin) {
poolParams.stictMin = strictMin;
}
|
public void setUseFastFail(boolean useFastFail) {
this.poolParams.useFastFail = useFastFail;
}
|
protected void startService() throws Exception {
ManagedConnectionFactory mcf = null;
if(managedConnectionFactoryName == null)
{
throw new org.jboss.deployers.spi.DeploymentException("ManagedConnectionFactory is 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, poolParams, noTxSeparatePools, this, log);
else if ("ByContainer".equals(criteria))
poolingStrategy = new PoolBySubject(mcf, poolParams, noTxSeparatePools, this, log);
else if ("ByApplication".equals(criteria))
poolingStrategy = new PoolByCri(mcf, poolParams, noTxSeparatePools, this, log);
else if ("ByNothing".equals(criteria))
poolingStrategy = new OnePool(mcf, poolParams, noTxSeparatePools, this, log);
else
throw new DeploymentException("Unknown pooling criteria: " + criteria);
}
|
protected void stopService() throws Exception {
if (poolingStrategy != null)
{
poolingStrategy.shutdown();
}
getServer().removeNotificationListener(managedConnectionFactoryName, this);
poolingStrategy = null;
}
|