public void processInvocation(final EJBReceiverInvocationContext receiverContext, final ConnectionPeerIdentity peerIdentity) { MethodInvocation invocation = invocationTracker.addInvocation(id -> new MethodInvocation(id, receiverContext)); final EJBClientInvocationContext invocationContext = receiverContext.getClientInvocationContext(); invocationContext.putAttachment(INV_KEY, invocation); try { out.write(Protocol.INVOCATION_REQUEST); out.writeShort(invocation.getIndex()); invocation.setOutflowHandle(writeTransaction(invocationContext.getTransaction(), marshaller));
private void handleResponse(final int id, final DataInputStream inputStream) { switch (id) { case Protocol.INVOCATION_RESPONSE: { free(); final EJBClientInvocationContext context = receiverInvocationContext.getClientInvocationContext(); if (version >= 3) try { final int cmd = inputStream.readUnsignedByte(); final XAOutflowHandle outflowHandle = getOutflowHandle(); if (outflowHandle != null) { if (cmd == 0) { free(); if (version >= 3) { final XAOutflowHandle outflowHandle = getOutflowHandle(); if (outflowHandle != null) outflowHandle.forgetEnlistment(); free(); receiverInvocationContext.resultReady(new ExceptionResultProducer(inputStream, id)); break; free(); try { if (version >= 3) { final XAOutflowHandle outflowHandle = getOutflowHandle(); if (outflowHandle != null) outflowHandle.forgetEnlistment(); free(); try { if (version >= 3) { final XAOutflowHandle outflowHandle = getOutflowHandle();
@Override public void handleResponse(int parameter, MessageInputStream inputStream) { handleResponse(parameter, new DataInputStream(inputStream)); }
private void handleResponse(final int id, final DataInputStream inputStream) { switch (id) { case Protocol.INVOCATION_RESPONSE: { free(); final EJBClientInvocationContext context = receiverInvocationContext.getClientInvocationContext(); if (version >= 3) try { final int cmd = inputStream.readUnsignedByte(); final XAOutflowHandle outflowHandle = getOutflowHandle(); if (outflowHandle != null) { if (cmd == 0) { free(); if (version >= 3) { final XAOutflowHandle outflowHandle = getOutflowHandle(); if (outflowHandle != null) outflowHandle.forgetEnlistment(); free(); receiverInvocationContext.resultReady(new ExceptionResultProducer(inputStream, id)); break; free(); try { if (version >= 3) { final XAOutflowHandle outflowHandle = getOutflowHandle(); if (outflowHandle != null) outflowHandle.forgetEnlistment(); free(); try { if (version >= 3) { final XAOutflowHandle outflowHandle = getOutflowHandle();
private void handleResponse(final int id, final DataInputStream inputStream) { switch (id) { case Protocol.INVOCATION_RESPONSE: { free(); final EJBClientInvocationContext context = receiverInvocationContext.getClientInvocationContext(); if (version >= 3) try { final int cmd = inputStream.readUnsignedByte(); final XAOutflowHandle outflowHandle = getOutflowHandle(); if (outflowHandle != null) { if (cmd == 0) { free(); if (version >= 3) { final XAOutflowHandle outflowHandle = getOutflowHandle(); if (outflowHandle != null) outflowHandle.forgetEnlistment(); free(); receiverInvocationContext.resultReady(new ExceptionResultProducer(inputStream, id)); break; free(); try { if (version >= 3) { final XAOutflowHandle outflowHandle = getOutflowHandle(); if (outflowHandle != null) outflowHandle.forgetEnlistment(); free(); try { if (version >= 3) { final XAOutflowHandle outflowHandle = getOutflowHandle();
public void processInvocation(final EJBReceiverInvocationContext receiverContext, final ConnectionPeerIdentity peerIdentity) { MethodInvocation invocation = invocationTracker.addInvocation(id -> new MethodInvocation(id, receiverContext)); final EJBClientInvocationContext invocationContext = receiverContext.getClientInvocationContext(); invocationContext.putAttachment(INV_KEY, invocation); try { out.write(Protocol.INVOCATION_REQUEST); out.writeShort(invocation.getIndex()); invocation.setOutflowHandle(writeTransaction(invocationContext.getTransaction(), marshaller));
public void processInvocation(final EJBReceiverInvocationContext receiverContext, final ConnectionPeerIdentity peerIdentity) { MethodInvocation invocation = invocationTracker.addInvocation(id -> new MethodInvocation(id, receiverContext)); final EJBClientInvocationContext invocationContext = receiverContext.getClientInvocationContext(); invocationContext.putAttachment(INV_KEY, invocation); try { out.write(Protocol.INVOCATION_REQUEST); out.writeShort(invocation.getIndex()); invocation.setOutflowHandle(writeTransaction(invocationContext.getTransaction(), marshaller));
if (version >= 3) { final int cmd = response.readUnsignedByte(); final XAOutflowHandle outflowHandle = getOutflowHandle(); if (outflowHandle != null) { if (cmd == 0) {
if (version >= 3) { final int cmd = response.readUnsignedByte(); final XAOutflowHandle outflowHandle = getOutflowHandle(); if (outflowHandle != null) { if (cmd == 0) {
boolean cancelInvocation(final EJBReceiverInvocationContext receiverContext, boolean cancelIfRunning) { if (version < 3 && ! cancelIfRunning) { // keep legacy behavior return false; } final MethodInvocation invocation = receiverContext.getClientInvocationContext().getAttachment(INV_KEY); if (invocation == null) { // lost it somehow return false; } if (invocation.alloc()) try { final int index = invocation.getIndex(); try (MessageOutputStream out = invocationTracker.allocateMessage()) { out.write(Protocol.CANCEL_REQUEST); out.writeShort(index); if (version >= 3) { out.writeBoolean(cancelIfRunning); } } catch (IOException ignored) {} } finally { invocation.free(); } // now await the result return invocation.receiverInvocationContext.getClientInvocationContext().awaitCancellationResult(); }
boolean cancelInvocation(final EJBReceiverInvocationContext receiverContext, boolean cancelIfRunning) { if (version < 3 && ! cancelIfRunning) { // keep legacy behavior return false; } final MethodInvocation invocation = receiverContext.getClientInvocationContext().getAttachment(INV_KEY); if (invocation == null) { // lost it somehow return false; } if (invocation.alloc()) try { final int index = invocation.getIndex(); try (MessageOutputStream out = invocationTracker.allocateMessage()) { out.write(Protocol.CANCEL_REQUEST); out.writeShort(index); if (version >= 3) { out.writeBoolean(cancelIfRunning); } } catch (IOException ignored) {} } finally { invocation.free(); } // now await the result return invocation.receiverInvocationContext.getClientInvocationContext().awaitCancellationResult(); }
@Override public void handleResponse(int parameter, MessageInputStream inputStream) { handleResponse(parameter, new DataInputStream(inputStream)); }
@Override public void handleResponse(int parameter, MessageInputStream inputStream) { handleResponse(parameter, new DataInputStream(inputStream)); }
if (version >= 3) { final int cmd = response.readUnsignedByte(); final XAOutflowHandle outflowHandle = getOutflowHandle(); if (outflowHandle != null) { if (cmd == 0) {
boolean cancelInvocation(final EJBReceiverInvocationContext receiverContext, boolean cancelIfRunning) { if (version < 3 && ! cancelIfRunning) { // keep legacy behavior return false; } final MethodInvocation invocation = receiverContext.getClientInvocationContext().getAttachment(INV_KEY); if (invocation == null) { // lost it somehow return false; } if (invocation.alloc()) try { final int index = invocation.getIndex(); try (MessageOutputStream out = invocationTracker.allocateMessage()) { out.write(Protocol.CANCEL_REQUEST); out.writeShort(index); if (version >= 3) { out.writeBoolean(cancelIfRunning); } } catch (IOException ignored) {} } finally { invocation.free(); } // now await the result return invocation.receiverInvocationContext.getClientInvocationContext().awaitCancellationResult(); }