ManagedConnectionFactory managedConnectionFactory = mci.getManagedConnectionFactory(); ManagedConnection matchedMC = managedConnectionFactory
public FillTask(ConnectionInfo connectionInfo) { managedConnectionFactory = connectionInfo.getManagedConnectionInfo().getManagedConnectionFactory(); subject = connectionInfo.getManagedConnectionInfo().getSubject(); cri = connectionInfo.getManagedConnectionInfo().getConnectionRequestInfo(); }
public void getConnection(ConnectionInfo connectionInfo) throws ResourceException { if (connectionInfo.isUnshareable()) { next.getConnection(connectionInfo); return; } ManagedConnectionInfo managedConnectionInfo = connections.get(); if (managedConnectionInfo != null) { if (matchConnections) { ManagedConnectionInfo mciRequest = connectionInfo.getManagedConnectionInfo(); if (null != managedConnectionInfo.getManagedConnectionFactory().matchManagedConnections( Collections.singleton(managedConnectionInfo.getManagedConnection()), mciRequest.getSubject(), mciRequest.getConnectionRequestInfo() )) { connectionInfo.setManagedConnectionInfo(managedConnectionInfo); return; } else { //match failed, get a new cx after returning this one connections.set(null); next.returnConnection(connectionInfo, ConnectionReturnAction.RETURN_HANDLE); } } else { connectionInfo.setManagedConnectionInfo(managedConnectionInfo); return; } } //nothing for this thread or match failed next.getConnection(connectionInfo); connections.set(connectionInfo.getManagedConnectionInfo()); }
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; } }
try { ManagedConnectionInfo mci = connectionInfo.getManagedConnectionInfo(); matchedMC = newMCI.getManagedConnectionFactory().matchManagedConnections(Collections.singleton(newMCI.getManagedConnection()), mci.getSubject(), mci.getConnectionRequestInfo());
originalManagedConnectionInfo.getManagedConnectionFactory(), originalManagedConnectionInfo.getConnectionRequestInfo()); newManagedConnectionInfo.setSubject(currentSubject);