public LocalTxConnectionEventListener(ResourceHandle resource) { this.resource = resource; this.associatedHandles = new IdentityHashMap(10); this.poolMgr = ConnectorRuntime.getRuntime().getPoolManager(); }
/** * Kills a specific pool * * @param poolInfo poolName to kill */ public void killPool(PoolInfo poolInfo) { _runtime.getPoolManager().killPool(poolInfo); }
/** * Add a listener to the list of pool life cycle listeners maintained by * this registry for the <code>poolName</code>. * @param poolName * @param listener */ public void registerPoolLifeCycle(PoolLifeCycle listener) { lifeCycleListeners.add(listener); //Check if lifecycleListeners has already been set to this. There //could be multiple listeners. if(!(lifeCycleListeners.size() > 1)) { //If the pool is already created, set this registry object to the pool. PoolManager poolMgr = ConnectorRuntime.getRuntime().getPoolManager(); poolMgr.registerPoolLifeCycleListener(this); } }
public void lazyEnlist( javax.resource.spi.ManagedConnection mc ) throws ResourceException { ConnectorRuntime.getRuntime().getPoolManager().lazyEnlist( mc ); } }
/** * Matching will be switched off in the pool, by default. This will be * switched on if the connections with different resource principals reach the pool. * * @param poolInfo Name of the pool to switchOn matching. * @param rarName Name of the resource adater. */ public void switchOnMatching(String rarName, PoolInfo poolInfo) { // At present it is applicable to only JDBC resource adapters // Later other resource adapters also become applicable. if (rarName.equals(ConnectorConstants.JDBCDATASOURCE_RA_NAME) || rarName.equals(ConnectorConstants.JDBCCONNECTIONPOOLDATASOURCE_RA_NAME) || rarName.equals(ConnectorConstants.JDBCXA_RA_NAME)) { PoolManager poolMgr = _runtime.getPoolManager(); boolean result = poolMgr.switchOnMatching(poolInfo); if (!result) { try { _runtime.switchOnMatchingInJndi(poolInfo); } catch (ConnectorRuntimeException cre) { // This will never happen. } } } }
public void enlistedInTransaction(Transaction tran) throws IllegalStateException { ConnectorRuntime.getRuntime().getPoolManager().resourceEnlisted(tran, this); }
/** * Add a listener to the list of pool life cycle listeners maintained by * this registry. * @param listener */ public void registerPoolLifeCycleListener(PoolLifeCycleListener listener) { poolListenersList.add(listener); //Check if poolLifeCycleListener has already been set to this. There //could be multiple listeners. if(!(poolListenersList.size() > 1)) { //If the pool is already created, set this registry object to the pool. PoolManager poolMgr = ConnectorRuntime.getRuntime().getPoolManager(); ResourcePool pool = poolMgr.getPool(poolInfo); pool.setPoolLifeCycleListener(this); } }
public ConnectorXAResource(ResourceHandle handle, ResourceSpec spec, com.sun.enterprise.resource.allocator.ResourceAllocator alloc, ClientSecurityInfo info ) { // initially userHandle is associated with mc this.poolMgr = ConnectorRuntime.getRuntime().getPoolManager(); this.userHandle = null; this.spec = spec; this.poolInfo = spec.getPoolInfo(); this.alloc = alloc; this.info = info; localConnection = (ManagedConnection) handle.getResource(); localHandle_ = handle; }
/** * Flush Connection pool by reinitializing the connections * established in the pool. * @param poolInfo * @throws com.sun.appserv.connectors.internal.api.ConnectorRuntimeException */ public boolean flushConnectionPool(PoolInfo poolInfo) throws ConnectorRuntimeException { PoolManager poolMgr = _runtime.getPoolManager(); try { return poolMgr.flushConnectionPool( poolInfo ); } catch (PoolingException ex) { throw new ConnectorRuntimeException(ex.getMessage()); } }
/** * create an empty connection pool * * @param poolInfo pool to be created * @param pt type of pool * @throws ConnectorRuntimeException */ private void createAndAddPool(PoolInfo poolInfo, PoolType pt, Hashtable env) throws ConnectorRuntimeException { PoolManager poolMgr = _runtime.getPoolManager(); try { poolMgr.createEmptyConnectionPool(poolInfo, pt, env); } catch (PoolingException pe) { String i18nMsg = localStrings.getString("ccp_adm.failed_to_create_pool_object"); ConnectorRuntimeException cre = new ConnectorRuntimeException(i18nMsg); cre.initCause(pe); throw cre; } }
PoolManager mgr = ConnectorRuntime.getRuntime().getPoolManager(); mgr.putbackDirectToPool( h, h.getResourceSpec().getPoolInfo()); _logger.log(Level.WARNING,
throws ResourceException { try { PoolManager poolmgr = ConnectorRuntime.getRuntime().getPoolManager(); ConnectorRegistry registry = ConnectorRegistry.getInstance(); PoolMetaData pmd = registry.getPoolMetaData(poolInfo);
throws ResourceException { validateResourceAndPool(); PoolManager poolmgr = ConnectorRuntime.getRuntime().getPoolManager(); boolean resourceShareable = true;
/** * Reset pool statistics. * When annotated with @Reset, this method is invoked whenever monitoring * is turned to HIGH from OFF, thereby setting the statistics to * appropriate values. */ @Reset public void reset() { if(logger.isLoggable(Level.FINEST)) { logger.finest("Reset event received - poolInfo = " + poolInfo); } PoolStatus status = ConnectorRuntime.getRuntime().getPoolManager().getPoolStatus(poolInfo); numConnUsed.setCurrent(status.getNumConnUsed()); numConnFree.setCurrent(status.getNumConnFree()); numConnCreated.reset(); numConnDestroyed.reset(); numConnFailedValidation.reset(); numConnTimedOut.reset(); numConnAcquired.reset(); numConnReleased.reset(); connRequestWaitTime.reset(); numConnSuccessfullyMatched.reset(); numConnNotSuccessfullyMatched.reset(); numPotentialConnLeak.reset(); averageConnWaitTime.reset(); totalConnRequestWaitTime.reset(); waitQueueLength.reset(); }
/** * Reset pool statistics * When annotated with @Reset, this method is invoked whenever monitoring * is turned to HIGH from OFF, thereby setting the statistics to * appropriate values. */ @Reset public void reset() { if(logger.isLoggable(Level.FINEST)) { logger.finest("Reset event received - poolName = " + poolInfo); } PoolStatus status = ConnectorRuntime.getRuntime().getPoolManager().getPoolStatus(poolInfo); numConnUsed.setCurrent(status.getNumConnUsed()); numConnFree.setCurrent(status.getNumConnFree()); numConnCreated.reset(); numConnDestroyed.reset(); numConnFailedValidation.reset(); numConnTimedOut.reset(); numConnAcquired.reset(); numConnReleased.reset(); connRequestWaitTime.reset(); numConnSuccessfullyMatched.reset(); numConnNotSuccessfullyMatched.reset(); numPotentialConnLeak.reset(); averageConnWaitTime.reset(); totalConnRequestWaitTime.reset(); waitQueueLength.reset(); }
PoolInfo poolInfo = new PoolInfo(connConnPool.getName(), connConnPool.getApplicationName(), connConnPool.getModuleName()); final ResourcePool oldPool = runtime.getPoolManager().getPool(poolInfo);
PoolManager poolMgr = _runtime.getPoolManager(); try { poolMgr.reconfigPoolProperties(ccp);