Refine search
/** * 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; }
@Override public void afterPropertiesSet() throws ResourceException { if (this.managedConnectionFactory == null) { throw new IllegalArgumentException("Property 'managedConnectionFactory' is required"); } if (this.connectionManager != null) { this.connectionFactory = this.managedConnectionFactory.createConnectionFactory(this.connectionManager); } else { this.connectionFactory = this.managedConnectionFactory.createConnectionFactory(); } }
@Override public Object allocateConnection(ManagedConnectionFactory managedConnectionFactory, ConnectionRequestInfo connectionRequestInfo) throws ResourceException { // connectionRequestInfo unused ManagedConnection managedConnection = managedConnectionFactory.createManagedConnection(null, null); return managedConnection.getConnection(null, null); } }
ManagedConnection managedConnection = connectionFactory.createManagedConnection(null, null); javax.resource.cci.Connection connection = null; try { connection = (javax.resource.cci.Connection) managedConnection.getConnection(null, null); XAResource xares = managedConnection.getXAResource(); logger.warn(ex.getMessage(), ex); XAResource xares = managedConnection.getXAResource();
ManagedConnection mConn = mcf.createManagedConnection(subject, null); XAResource xa = mConn.getXAResource(); log.log(Level.FINER, e.toString(), e); } finally { mConn.destroy(); return mcf.createConnectionFactory(this);
public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException { return mcf.createManagedConnection(subject, cxRequestInfo); }
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); }
/** * Create a connection event listener * * @param subject the subject * @param cri the connection request information * @return the new listener * @throws ResourceException for any error */ private ConnectionListener createConnectionEventListener(Subject subject, ConnectionRequestInfo cri) throws ResourceException { ManagedConnection mc = mcf.createManagedConnection(subject, cri); connectionCounter.inc(); try { return clf.createConnectionListener(mc, this); } catch (ResourceException re) { connectionCounter.dec(); mc.destroy(); throw re; } }
subject.getPrivateCredentials().add(pc); ManagedConnection mc = mcfs[i]. createManagedConnection(subject, null); connList.add(mc); try { XAResource xares = mc.getXAResource(); if (xares != null) { xaresList.add(xares); subject.getPrincipals().add(prin); subject.getPrivateCredentials().add(pc); ManagedConnection mc = mcf.createManagedConnection(subject, null); connList.add(mc); try { XAResource xares = mc.getXAResource(); if (xares != null) { xaresList.add(xares);
if (!pool.getManagedConnectionFactory().equals(mcf)) try connection = cl.getManagedConnection().getConnection(subject, cri);
mConn = mcf.matchManagedConnections(_idlePool, subject, info); mConn.destroy(); } catch (Exception e) { log.log(Level.FINE, e.toString(), e);
public ManagedConnection matchManagedConnections(java.util.Set connectionSet, Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException { return mcf.matchManagedConnections(connectionSet, subject, cxRequestInfo); }
public Object run() { Set creds = subject.getPrivateCredentials(PasswordCredential.class); PasswordCredential pwdc = null; Iterator credentials = creds.iterator(); while (credentials.hasNext()) { PasswordCredential curCred = (PasswordCredential) credentials.next(); if (curCred.getManagedConnectionFactory().equals(mcf)) { pwdc = curCred; break; } } return pwdc; }
if (!pool.getManagedConnectionFactory().equals(mcf)) cl.getManagedConnection().associateConnection(connection); registerAssociation(cl, connection);
/** * No pooling is done for non-managed connections, just get a new MC and * connection to the database. * */ public Object allocateConnection(ManagedConnectionFactory mcf, ConnectionRequestInfo info) throws ResourceException { ManagedConnection mc = mcf.createManagedConnection(null, info); return mc.getConnection(null, info); } }
ManagedConnection managedConnection = connectionFactory.createManagedConnection(null, null); javax.resource.cci.Connection connection = null; try { connection = (javax.resource.cci.Connection) managedConnection.getConnection(null, null); XAResource xares = managedConnection.getXAResource(); logger.warn(ex.getMessage(), ex); XAResource xares = managedConnection.getXAResource();
public ManagedConnection createManagedConnection(javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException { return mcf.createManagedConnection(subject, cxRequestInfo); }
ManagedConnection mc = mcf.createManagedConnection(defaultSubject, null); mc.addConnectionEventListener(new UnpooledConnectionEventListener()); return returnConnectionHandle ? mc.getConnection(defaultSubject, null) : mc;
ManagedConnection mc = mcf.createManagedConnection(subject, cri); mc.destroy(); throw re;
subject.getPrincipals().add(prin); subject.getPrivateCredentials().add(pc); ManagedConnection mc = fac.createManagedConnection(subject, null); connList.add(mc); try { XAResource xares = mc.getXAResource(); if (xares != null) {