use of org.glassfish.resourcebase.resources.api.PoolInfo in project Payara by payara.
the class ConnectorConnectionPoolDeployer method deployResource.
/**
* {@inheritDoc}
*/
public void deployResource(Object resource) throws Exception {
org.glassfish.connectors.config.ConnectorConnectionPool ccp = (org.glassfish.connectors.config.ConnectorConnectionPool) resource;
PoolInfo poolInfo = ConnectorsUtil.getPoolInfo(ccp);
deployResource(resource, poolInfo.getApplicationName(), poolInfo.getModuleName());
}
use of org.glassfish.resourcebase.resources.api.PoolInfo in project Payara by payara.
the class ConnectorConnectionPoolDeployer method redeployResource.
/**
* {@inheritDoc}
*/
public synchronized void redeployResource(Object resource) throws Exception {
// Connector connection pool reconfiguration or
// change in security maps
org.glassfish.connectors.config.ConnectorConnectionPool domainCcp = (org.glassfish.connectors.config.ConnectorConnectionPool) resource;
List<SecurityMap> securityMaps = domainCcp.getSecurityMap();
// Since 8.1 PE/SE/EE, only if pool has already been deployed in this
// server-instance earlier, reconfig this pool
PoolInfo poolInfo = ConnectorsUtil.getPoolInfo(domainCcp);
if (!runtime.isConnectorConnectionPoolDeployed(poolInfo)) {
if (_logger.isLoggable(Level.FINE)) {
_logger.fine("The connector connection pool " + poolInfo + " is either not referred or not yet created in " + "this server instance and pool and hence " + "redeployment is ignored");
}
return;
}
String rarName = domainCcp.getResourceAdapterName();
String connDefName = domainCcp.getConnectionDefinitionName();
List<Property> props = domainCcp.getProperty();
ConnectorConnectionPool ccp = getConnectorConnectionPool(domainCcp, poolInfo);
populateConnectorConnectionPool(ccp, connDefName, rarName, props, securityMaps);
boolean poolRecreateRequired = false;
try {
if (_logger.isLoggable(Level.FINE)) {
_logger.fine("Calling reconfigure pool");
}
poolRecreateRequired = runtime.reconfigureConnectorConnectionPool(ccp, new HashSet());
} catch (ConnectorRuntimeException cre) {
Object[] params = new Object[] { poolInfo, cre };
_logger.log(Level.WARNING, "error.reconfiguring.pool", params);
}
if (poolRecreateRequired) {
if (_logger.isLoggable(Level.FINE)) {
_logger.fine("Pool recreation required");
}
runtime.recreateConnectorConnectionPool(ccp);
if (_logger.isLoggable(Level.FINE)) {
_logger.fine("Pool recreation done");
}
}
}
use of org.glassfish.resourcebase.resources.api.PoolInfo in project Payara by payara.
the class ConnectorConnectionPoolDeployer method undeployResource.
/**
* {@inheritDoc}
*/
public synchronized void undeployResource(Object resource) throws Exception {
if (_logger.isLoggable(Level.FINE)) {
_logger.fine("ConnectorConnectionPoolDeployer : undeployResource : ");
}
final org.glassfish.connectors.config.ConnectorConnectionPool domainCcp = (org.glassfish.connectors.config.ConnectorConnectionPool) resource;
PoolInfo poolInfo = ConnectorsUtil.getPoolInfo(domainCcp);
actualUndeployResource(domainCcp, poolInfo);
}
use of org.glassfish.resourcebase.resources.api.PoolInfo in project Payara by payara.
the class ConnectorConnectionPoolDeployer method deployResource.
/**
* {@inheritDoc}
*/
public void deployResource(Object resource, String applicationName, String moduleName) throws Exception {
if (_logger.isLoggable(Level.FINE)) {
_logger.fine("ConnectorConnectionPoolDeployer : deployResource ");
}
final org.glassfish.connectors.config.ConnectorConnectionPool domainCcp = (org.glassfish.connectors.config.ConnectorConnectionPool) resource;
// redirect call to redeployResource
if (ConnectionPoolObjectsUtils.isPoolSystemPool(domainCcp)) {
this.redeployResource(resource);
return;
}
PoolInfo poolInfo = new PoolInfo(domainCcp.getName(), applicationName, moduleName);
final ConnectorConnectionPool ccp = getConnectorConnectionPool(domainCcp, poolInfo);
String rarName = domainCcp.getResourceAdapterName();
String connDefName = domainCcp.getConnectionDefinitionName();
List<Property> props = domainCcp.getProperty();
List<SecurityMap> securityMaps = domainCcp.getSecurityMap();
populateConnectorConnectionPool(ccp, connDefName, rarName, props, securityMaps);
final String defName = domainCcp.getConnectionDefinitionName();
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "Calling backend to add connectorConnectionPool", domainCcp.getResourceAdapterName());
}
runtime.createConnectorConnectionPool(ccp, defName, domainCcp.getResourceAdapterName(), domainCcp.getProperty(), domainCcp.getSecurityMap());
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "Added connectorConnectionPool in backend", domainCcp.getResourceAdapterName());
}
}
use of org.glassfish.resourcebase.resources.api.PoolInfo in project Payara by payara.
the class ConnectorConnPoolStatsProvider method connectionsFreedEvent.
/**
* Connections freed event
* @param poolName
* @param count number of connections freed to the pool
*/
@ProbeListener(JCA_PROBE_LISTENER + "connectionsFreedEvent")
public void connectionsFreedEvent(@ProbeParam("poolName") String poolName, @ProbeParam("appName") String appName, @ProbeParam("moduleName") String moduleName, @ProbeParam("count") int count) {
// handle the connections freed event
PoolInfo poolInfo = new PoolInfo(poolName, appName, moduleName);
if (this.poolInfo.equals(poolInfo)) {
if (logger.isLoggable(Level.FINEST)) {
logger.finest("Connections Freed event received - poolName = " + poolName);
logger.finest("numConnUsed =" + numConnUsed.getCurrent() + " numConnFree=" + numConnFree.getCurrent() + " Number of connections freed =" + count);
}
// set numConnFree to the count value
synchronized (numConnFree) {
numConnFree.setCurrent(count);
}
}
}
Aggregations