protected Connection convert(final ConnectionPeerIdentity arg) throws IOException { return arg.getConnection(); } }
public void setRollbackOnly(final Xid xid, final ConnectionPeerIdentity peerIdentity) throws XAException { assert peerIdentity.getId() == 0; // no operation }
ConnectionPeerIdentityContext(final ConnectionImpl connection, final Collection<String> offeredMechanisms, final String peerSaslServer, final String saslProtocol) { this.connection = connection; this.offeredMechanisms = offeredMechanisms == null ? Collections.emptySet() : offeredMechanisms; connectionIdentity = constructIdentity(conf -> new ConnectionPeerIdentity(conf, connection.getPrincipal(), 0, connection)); connectionIdentityFuture = new FinishedIoFuture<>(connectionIdentity); anonymousIdentity = constructIdentity(conf -> new ConnectionPeerIdentity(conf, AnonymousPrincipal.getInstance(), 1, connection)); anonymousIdentityFuture = new FinishedIoFuture<>(anonymousIdentity); this.factoryOperator = d -> new ServerNameSaslClientFactory(new ProtocolSaslClientFactory(d, saslProtocol), peerSaslServer); }
final int peerIdentityId; if (version >= 3) { peerIdentityId = peerIdentity.getId(); } else { peerIdentityId = 0; // unused receiverContext.requestFailed(new RequestSendFailedException(e.getMessage() + " @ " + peerIdentity.getConnection().getPeerURI(), e, true), getRetryExecutor()); } catch (RollbackException | SystemException | RuntimeException e) { receiverContext.requestFailed(new EJBException(e.getMessage(), e), getRetryExecutor());
public int getPeerIdentityId() { return getPeerIdentityContext().getCurrentIdentity().getIndex(); }
final int peerIdentityId; if (version >= 3) { peerIdentityId = peerIdentity.getId(); } else { peerIdentityId = 0; // unused receiverContext.requestFailed(new RequestSendFailedException(e.getMessage() + " @ " + peerIdentity.getConnection().getPeerURI(), e, true), getRetryExecutor()); } catch (RollbackException | SystemException | RuntimeException e) { receiverContext.requestFailed(new EJBException(e.getMessage(), e), getRetryExecutor());
public int getPeerIdentityId() { return getPeerIdentityContext().getCurrentIdentity().getIndex(); }
public SimpleTransactionControl begin(final ConnectionPeerIdentity peerIdentity) throws SystemException { assert peerIdentity.getId() == 0; return new EJBSimpleTransactionControl(channel); } }
public void end(final int flags) throws XAException { if (flags == XAResource.TMFAIL && rollbackOnlyXids.add(xid)) try { final ConnectionPeerIdentity peerIdentity = getPeerIdentityXA(); getOperationsXA(peerIdentity.getConnection()).setRollbackOnly(xid, peerIdentity); } catch (Throwable t) { rollbackOnlyXids.remove(xid); throw t; } }
final int peerIdentityId; if (version >= 3) { peerIdentityId = peerIdentity.getId(); } else { peerIdentityId = 0; // unused receiverContext.requestFailed(new RequestSendFailedException(e.getMessage() + " @ " + peerIdentity.getConnection().getPeerURI(), e, true), getRetryExecutor()); } catch (RollbackException | SystemException | RuntimeException e) { receiverContext.requestFailed(new EJBException(e.getMessage(), e), getRetryExecutor());
return new ConnectionPeerIdentity(conf, principalObj instanceof Principal ? (Principal) principalObj : principal, finalId, connection); })); return;
public int prepare(final Xid xid, final ConnectionPeerIdentity peerIdentity) throws XAException { assert peerIdentity.getId() == 0; return executeSimpleInvocation(new XidTransactionID(xid), Protocol.TXN_PREPARE_REQUEST, true, false, false); }
public void rollback() throws XAException { try { final ConnectionPeerIdentity peerIdentity = getPeerIdentityXA(); getOperationsXA(peerIdentity.getConnection()).rollback(xid, peerIdentity); } finally { rollbackOnlyXids.remove(xid); } }
ConnectionPeerIdentityContext(final ConnectionImpl connection, final Collection<String> offeredMechanisms, final String peerSaslServer, final String saslProtocol) { this.connection = connection; this.offeredMechanisms = offeredMechanisms == null ? Collections.emptySet() : offeredMechanisms; connectionIdentity = constructIdentity(conf -> new ConnectionPeerIdentity(conf, connection.getPrincipal(), 0, connection)); connectionIdentityFuture = new FinishedIoFuture<>(connectionIdentity); anonymousIdentity = constructIdentity(conf -> new ConnectionPeerIdentity(conf, AnonymousPrincipal.getInstance(), 1, connection)); anonymousIdentityFuture = new FinishedIoFuture<>(anonymousIdentity); this.factoryOperator = d -> new ServerNameSaslClientFactory(new ProtocolSaslClientFactory(d, saslProtocol), peerSaslServer); }
public void beforeCompletion(final Xid xid, final ConnectionPeerIdentity peerIdentity) throws XAException { assert peerIdentity.getId() == 0; executeSimpleInvocation(new XidTransactionID(xid), Protocol.TXN_BEFORE_COMPLETION_REQUEST, false, false, false); }
public int prepare() throws XAException { try { final ConnectionPeerIdentity peerIdentity = getPeerIdentityXA(); return getOperationsXA(peerIdentity.getConnection()).prepare(xid, peerIdentity); } finally { rollbackOnlyXids.remove(xid); } }
return new ConnectionPeerIdentity(conf, principalObj instanceof Principal ? (Principal) principalObj : principal, finalId, connection); })); return;
public void forget(final Xid xid, final ConnectionPeerIdentity peerIdentity) throws XAException { assert peerIdentity.getId() == 0; executeSimpleInvocation(new XidTransactionID(xid), Protocol.TXN_FORGET_REQUEST, false, false, false); }
public void forget() throws XAException { try { final ConnectionPeerIdentity peerIdentity = getPeerIdentityXA(); getOperationsXA(peerIdentity.getConnection()).forget(xid, peerIdentity); } finally { rollbackOnlyXids.remove(xid); } }
public void commit(final Xid xid, final boolean onePhase, final ConnectionPeerIdentity peerIdentity) throws XAException { assert peerIdentity.getId() == 0; executeSimpleInvocation(new XidTransactionID(xid), Protocol.TXN_COMMIT_REQUEST, false, true, onePhase); }