use of org.glassfish.resourcebase.resources.api.PoolInfo in project Payara by payara.
the class JdbcConnPoolStatsProvider method connectionRequestServedEvent.
/**
* Event that a connection request is served in timeTakenInMillis.
*
* @param poolName
* @param timeTakenInMillis
*/
@ProbeListener(JDBC_PROBE_LISTENER + "connectionRequestServedEvent")
public void connectionRequestServedEvent(@ProbeParam("poolName") String poolName, @ProbeParam("appName") String appName, @ProbeParam("moduleName") String moduleName, @ProbeParam("timeTakenInMillis") long timeTakenInMillis) {
PoolInfo poolInfo = new PoolInfo(poolName, appName, moduleName);
if (this.poolInfo.equals(poolInfo)) {
if (logger.isLoggable(Level.FINEST)) {
logger.finest("Connection request served event received - " + "poolName = " + poolName);
}
connRequestWaitTime.setCurrent(timeTakenInMillis);
totalConnRequestWaitTime.increment(timeTakenInMillis);
}
}
use of org.glassfish.resourcebase.resources.api.PoolInfo in project Payara by payara.
the class JdbcConnectionPoolDeployer method handlePoolRecreationForExistingProxies.
private void handlePoolRecreationForExistingProxies(ConnectorConnectionPool connConnPool) {
recreatePool(connConnPool);
Collection<BindableResource> resourcesList;
if (!connConnPool.isApplicationScopedResource()) {
resourcesList = JdbcResourcesUtil.getResourcesOfPool(domain.getResources(), connConnPool.getName());
} else {
PoolInfo poolInfo = connConnPool.getPoolInfo();
Resources resources = ResourcesUtil.createInstance().getResources(poolInfo);
resourcesList = JdbcResourcesUtil.getResourcesOfPool(resources, connConnPool.getName());
}
for (BindableResource bindableResource : resourcesList) {
ResourceInfo resourceInfo = ConnectorsUtil.getResourceInfo(bindableResource);
ConnectorRegistry.getInstance().updateResourceInfoVersion(resourceInfo);
}
}
use of org.glassfish.resourcebase.resources.api.PoolInfo in project Payara by payara.
the class JdbcConnectionPoolDeployer method undeployResource.
/**
* {@inheritDoc}
*/
@Override
public void undeployResource(Object resource, String applicationName, String moduleName) throws Exception {
JdbcConnectionPool jdbcConnPool = (JdbcConnectionPool) resource;
PoolInfo poolInfo = new PoolInfo(jdbcConnPool.getName(), applicationName, moduleName);
if (_logger.isLoggable(Level.FINE)) {
_logger.fine(" JdbcConnectionPoolDeployer - unDeployResource : " + "calling actualUndeploy of " + poolInfo);
}
actualUndeployResource(poolInfo);
}
use of org.glassfish.resourcebase.resources.api.PoolInfo in project Payara by payara.
the class JdbcConnectionPoolDeployer method redeployResource.
/**
* {@inheritDoc}
*/
@Override
public synchronized void redeployResource(Object resource) throws Exception {
final JdbcConnectionPool adminPool = (JdbcConnectionPool) resource;
PoolInfo poolInfo = ConnectorsUtil.getPoolInfo(adminPool);
if (!runtime.isConnectorConnectionPoolDeployed(poolInfo)) {
if (_logger.isLoggable(Level.FINE)) {
_logger.fine("The JDBC connection pool " + poolInfo + " is not referred or not yet created in this server " + "instance and hence pool redeployment is ignored");
}
return;
}
final ConnectorConnectionPool connConnPool = createConnectorConnectionPool(adminPool, poolInfo);
if (connConnPool == null) {
throw new ConnectorRuntimeException("Unable to create ConnectorConnectionPool" + "from JDBC connection pool");
}
// now do internal book keeping
HashSet excludes = new HashSet();
// add MCF config props to the set that need to be excluded
// in checking for the equality of the props with old pool
excludes.add("TransactionIsolation");
excludes.add("GuaranteeIsolationLevel");
excludes.add("ValidationTableName");
excludes.add("ConnectionValidationRequired");
excludes.add("ValidationMethod");
excludes.add("StatementWrapping");
excludes.add("StatementTimeout");
excludes.add("ValidationClassName");
excludes.add("StatementCacheSize");
excludes.add("StatementCacheType");
excludes.add("StatementLeakTimeoutInSeconds");
excludes.add("StatementLeakReclaim");
try {
if (_logger.isLoggable(Level.FINEST)) {
_logger.finest("Calling reconfigure pool");
}
boolean requirePoolRecreation = runtime.reconfigureConnectorConnectionPool(connConnPool, excludes);
if (requirePoolRecreation) {
if (runtime.isServer() || runtime.isEmbedded()) {
handlePoolRecreation(connConnPool);
} else {
recreatePool(connConnPool);
}
}
} catch (ConnectorRuntimeException cre) {
Object[] params = new Object[] { poolInfo, cre };
_logger.log(Level.WARNING, "error.redeploying.jdbc.pool", params);
throw cre;
}
}
use of org.glassfish.resourcebase.resources.api.PoolInfo in project Payara by payara.
the class JdbcConnectionPoolDeployer method deployResource.
/**
* {@inheritDoc}
*/
@Override
public void deployResource(Object resource) throws Exception {
JdbcConnectionPool jcp = (JdbcConnectionPool) resource;
PoolInfo poolInfo = ConnectorsUtil.getPoolInfo(jcp);
actualDeployResource(resource, poolInfo);
}
Aggregations