/** * Creates a new connection for the managed connection pool. * * @return the managed connection from the EIS as ManagedConnection object. */ @Override public Object getNewPoolConnection() throws PoolException { ManagedConnection manConn = null; try { manConn = connFactory.createManagedConnection(sub, connReqInfo); } catch (ResourceException rex) { rex.printStackTrace(); throw new PoolException( "ManagedPoolCacheImpl::getNewConnection: Exception in creating new Managed PooledConnection", rex); } manConn .addConnectionEventListener((javax.resource.spi.ConnectionEventListener) connEventListner); return manConn; }
public ConnectionListener createConnectionListener(ManagedConnection mc, Object context) { ConnectionListener cli = new NoTxConnectionEventListener(mc, poolingStrategy, context, log); mc.addConnectionEventListener(cli); return cli; }
public void allocate(final ConnectionManagementContext context) throws ResourceException { final ManagedConnection mc = context.allocateManagedConnection(); mc.addConnectionEventListener(listener); }
public Object allocateConnection(ManagedConnectionFactory mcf, ConnectionRequestInfo cxRequestInfo) throws ResourceException { if (LOG.isLoggable(Level.FINEST)) { LOG.finest("allocateConnection cxRequestInfo = " + cxRequestInfo); } ManagedConnection mc = mcf.createManagedConnection(null, cxRequestInfo); mc.addConnectionEventListener(this); return mc.getConnection(null, cxRequestInfo); }
/** * {@inheritDoc} */ public ConnectionListener createConnectionListener(ManagedConnection managedConnection, ManagedConnectionPool mcp) throws ResourceException { ConnectionListener cli = new NoTxConnectionListener(this, managedConnection, getPool(), mcp, getFlushStrategy(), getTracking()); managedConnection.addConnectionEventListener(cli); return cli; }
public ResourceHandle createResource() throws PoolingException { try { ManagedConnection mc = mcf.createManagedConnection(subject, reqInfo); ResourceHandle resource = createResourceHandle(mc, spec, this, info); ConnectionEventListener l = new ConnectionListenerImpl(resource); mc.addConnectionEventListener(l); return resource; } catch (ResourceException ex) { Object[] params = new Object[]{spec.getPoolInfo(), ex.toString()}; _logger.log(Level.WARNING,"poolmgr.create_resource_error",params); if(_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE,"Resource Exception while creating resource",ex); } if (ex.getLinkedException() != null) { _logger.log(Level.WARNING, "poolmgr.create_resource_linked_error", ex .getLinkedException().toString()); } throw new PoolingException(ex); } }
public ResourceHandle createResource() throws PoolingException { try { ManagedConnection mc = mcf.createManagedConnection(subject, reqInfo); ResourceHandle resource = createResourceHandle(mc, spec, this, info); ConnectionEventListener l = new ConnectionListenerImpl(resource); mc.addConnectionEventListener(l); return resource; } catch (ResourceException ex) { Object[] params = new Object[]{spec.getPoolInfo(), ex.toString()}; _logger.log(Level.WARNING,"poolmgr.create_resource_error",params); if(_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE,"Resource Exception while creating resource",ex); } if (ex.getLinkedException() != null) { _logger.log(Level.WARNING, "poolmgr.create_resource_linked_error", ex .getLinkedException().toString()); } throw new PoolingException(ex); } }
/** * Creates a new connection for the managed connection pool. * * @return the managed connection from the EIS as ManagedConnection object. * @throws PoolException */ @Override public Object getNewPoolConnection() throws PoolException { ManagedConnection manConn = null; try { manConn = connFactory.createManagedConnection(sub, connReqInfo); } catch (ResourceException rex) { rex.printStackTrace(); throw new PoolException(LocalizedStrings.ManagedPoolCacheImpl_MANAGEDPOOLCACHEIMPLGETNEWCONNECTION_EXCEPTION_IN_CREATING_NEW_MANAGED_POOLEDCONNECTION.toLocalizedString(), rex); } manConn .addConnectionEventListener((javax.resource.spi.ConnectionEventListener) connEventListner); return manConn; }
/** * Creates a new connection for the managed connection pool. * * @return the managed connection from the EIS as ManagedConnection object. * @throws PoolException */ @Override public Object getNewPoolConnection() throws PoolException { ManagedConnection manConn = null; try { manConn = connFactory.createManagedConnection(sub, connReqInfo); } catch (ResourceException rex) { rex.printStackTrace(); throw new PoolException(LocalizedStrings.ManagedPoolCacheImpl_MANAGEDPOOLCACHEIMPLGETNEWCONNECTION_EXCEPTION_IN_CREATING_NEW_MANAGED_POOLEDCONNECTION.toLocalizedString(), rex); } manConn .addConnectionEventListener((javax.resource.spi.ConnectionEventListener) connEventListner); return manConn; }
public ResourceHandle createResource() throws PoolingException { try { ManagedConnection mc = mcf.createManagedConnection(subject, reqInfo); ResourceHandle resource = createResourceHandle(mc, spec, this, info); ConnectionEventListener l = new LocalTxConnectionEventListener(resource); mc.addConnectionEventListener(l); resource.setListener(l); XAResource xares = new ConnectorXAResource(resource, spec, this, info); resource.fillInResourceObjects(null, xares); return resource; } catch (ResourceException ex) { Object[] params = new Object[]{spec.getPoolInfo(), ex.toString()}; _logger.log(Level.WARNING, "poolmgr.create_resource_error", params); if(_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Resource Exception while creating resource", ex); } if (ex.getLinkedException() != null) { _logger.log(Level.WARNING, "poolmgr.create_resource_linked_error", ex .getLinkedException().toString()); } throw new PoolingException(ex); } }
_mConn.addConnectionEventListener(this);
public void getConnection(ConnectionInfo connectionInfo) throws ResourceException { ManagedConnectionInfo mci = connectionInfo.getManagedConnectionInfo(); if (mci.getManagedConnection() != null) { return; } try { ManagedConnection mc = mci.getManagedConnectionFactory().createManagedConnection( mci.getSubject(), mci.getConnectionRequestInfo()); mci.setManagedConnection(mc); GeronimoConnectionEventListener listener = new GeronimoConnectionEventListener(stack, mci); mci.setConnectionEventListener(listener); mc.addConnectionEventListener(listener); } catch (ResourceException re) { log.error("Error occurred creating ManagedConnection for " + connectionInfo, re); throw re; } }
mc.addConnectionEventListener(cli); return cli;
mc.addConnectionEventListener(new UnpooledConnectionEventListener()); return returnConnectionHandle ? mc.getConnection(defaultSubject, null) : mc;
getEnlistmentTrace() == null ? null : getEnlistmentTrace().getEnlistmentTrace(), xaResource, explicitXAResourceTimeout); mc.addConnectionEventListener(cli); return cli;