use of com.sun.appserv.connectors.internal.api.PoolingException in project Payara by payara.
the class PoolManagerImpl method createEmptyConnectionPool.
public void createEmptyConnectionPool(PoolInfo poolInfo, PoolType pt, Hashtable env) throws PoolingException {
// Create and initialise the connection pool
createAndInitPool(poolInfo, pt, env);
if (listener != null) {
try {
listener.poolCreated(poolInfo);
} catch (Exception ex) {
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "Exception thrown on pool listener");
}
}
}
// notify mcf-create
ManagedConnectionFactory mcf = ConnectorRegistry.getInstance().getManagedConnectionFactory(poolInfo);
if (mcf != null) {
if (mcf instanceof MCFLifecycleListener) {
((MCFLifecycleListener) mcf).mcfCreated();
}
}
}
use of com.sun.appserv.connectors.internal.api.PoolingException in project Payara by payara.
the class RWLockDataStructure method addResource.
/**
* {@inheritDoc}
*/
public int addResource(ResourceAllocator allocator, int count) throws PoolingException {
int numResAdded = 0;
writeLock.lock();
// for now, coarser lock. finer lock needs "resources.size() < maxSize()" once more.
try {
for (int i = 0; i < count && resources.size() < maxSize; i++) {
ResourceHandle handle = handler.createResource(allocator);
resources.add(handle);
numResAdded++;
}
} catch (Exception e) {
PoolingException pe = new PoolingException(e.getMessage());
pe.initCause(e);
throw pe;
} finally {
writeLock.unlock();
}
return numResAdded;
}
Aggregations