use of javax.resource.spi.ConnectionRequestInfo in project cxf by apache.
the class AbstractManagedConnectionFactoryImpl method isMatch.
private boolean isMatch(final AbstractManagedConnectionImpl candidateConn, final ConnectionRequestInfo crInfo, final Subject subject) throws ResourceAdapterInternalException {
boolean result = false;
final ConnectionRequestInfo candidate = candidateConn.getConnectionRequestInfo();
if (candidate.equals(crInfo) && (subject == null || subject.equals(candidateConn.getSubject()))) {
try {
validateReference(candidateConn, subject);
result = true;
} catch (Exception thrown) {
result = false;
}
}
return result;
}
use of javax.resource.spi.ConnectionRequestInfo in project cxf by apache.
the class DummyManagedConnectionFactoryImpl method testMatchConnectionSameConnectioRequestInfoNotBound.
@Test
public void testMatchConnectionSameConnectioRequestInfoNotBound() throws Exception {
Subject subject = null;
Set<AbstractManagedConnectionImpl> connectionSet = new HashSet<>();
ConnectionRequestInfo cri = new DummyConnectionRequestInfo();
DummyManagedConnectionImpl con1 = new DummyManagedConnectionImpl(mcf, cri, subject);
connectionSet.add(con1);
ManagedConnection mcon = mcf.matchManagedConnections(connectionSet, subject, cri);
assertEquals(con1, mcon);
}
Aggregations