private void writeFailedResponse(final int invId, final Throwable e) { try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) { os.writeByte(Protocol.APPLICATION_EXCEPTION); os.writeShort(invId); final Marshaller marshaller = marshallerFactory.createMarshaller(configuration); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); marshaller.writeObject(new RequestSendFailedException(e.getMessage() + "@" + channel.getConnection().getPeerURI(), e)); marshaller.writeByte(0); marshaller.finish(); } catch (IOException e2) { // nothing to do at this point; the client doesn't want the response Logs.REMOTING.trace("EJB response write failed", e2); } }
marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); marshaller.writeObject(result); attachments.remove(EJBClient.SOURCE_ADDRESS_KEY);
protected void writeFailure(Exception reason) { try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) { os.writeByte(Protocol.APPLICATION_EXCEPTION); os.writeShort(invId); if (version >= 3) os.writeByte(getEnlistmentStatus()); final Marshaller marshaller = marshallerFactory.createMarshaller(configuration); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); marshaller.writeObject(reason); marshaller.writeByte(0); marshaller.finish(); } catch (IOException e) { // nothing to do at this point; the client doesn't want the response Logs.REMOTING.trace("EJB response write failed", e); } finally { invocations.removeKey(invId); } }
marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(out)));
void handleTxnRecoverRequest(final int invId, final MessageInputStream message) throws IOException { final String parentName = message.readUTF(); final int flags = message.readInt(); final Xid[] xids; try { xids = transactionServer.getTransactionService().getTransactionContext().getRecoveryInterface().recover(flags, parentName); } catch (XAException e) { writeFailedResponse(invId, e); return; } try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) { os.writeByte(Protocol.TXN_RECOVERY_RESPONSE); os.writeShort(invId); PackedInteger.writePackedInteger(os, xids.length); final Marshaller marshaller = marshallerFactory.createMarshaller(configuration); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); for (Xid xid : xids) { marshaller.writeObject(new XidTransactionID(xid)); } marshaller.finish(); } catch (IOException e) { // nothing to do at this point; the client doesn't want the response Logs.REMOTING.trace("EJB transaction response write failed", e); } }
public void writeWrongViewType() { final String message = Logs.REMOTING.remoteMessageBadViewType(getEJBIdentifier()); try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) { if (version >= 3) { os.writeByte(Protocol.BAD_VIEW_TYPE); os.writeShort(invId); os.writeUTF(message); } else { os.writeByte(Protocol.APPLICATION_EXCEPTION); os.writeShort(invId); final Marshaller marshaller = marshallerFactory.createMarshaller(configuration); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); marshaller.writeObject(Logs.REMOTING.invalidViewTypeForInvocation(message)); marshaller.writeByte(0); marshaller.finish(); } } catch (IOException e) { // nothing to do at this point; the client doesn't want the response Logs.REMOTING.trace("EJB response write failed", e); } finally { invocations.removeKey(invId); } }
if (1 <= version && version <= 2) { final Marshaller marshaller = marshallerFactory.createMarshaller(configuration); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); if (strongAffinityUpdate != null) { marshaller.writeObject(strongAffinityUpdate);
private void writeFailedResponse(final int invId, final Throwable e) { try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) { os.writeByte(Protocol.APPLICATION_EXCEPTION); os.writeShort(invId); final Marshaller marshaller = marshallerFactory.createMarshaller(configuration); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); marshaller.writeObject(new RequestSendFailedException(e.getMessage() + "@" + channel.getConnection().getPeerURI(), e)); marshaller.writeByte(0); marshaller.finish(); } catch (IOException e2) { // nothing to do at this point; the client doesn't want the response Logs.REMOTING.trace("EJB response write failed", e2); } }
marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); marshaller.writeObject(result); attachments.remove(EJBClient.SOURCE_ADDRESS_KEY);
private void writeFailedResponse(final int invId, final Throwable e) { try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) { os.writeByte(Protocol.APPLICATION_EXCEPTION); os.writeShort(invId); final Marshaller marshaller = marshallerFactory.createMarshaller(configuration); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); marshaller.writeObject(new RequestSendFailedException(e.getMessage() + "@" + channel.getConnection().getPeerURI(), e)); marshaller.writeByte(0); marshaller.finish(); } catch (IOException e2) { // nothing to do at this point; the client doesn't want the response Logs.REMOTING.trace("EJB response write failed", e2); } }
marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); marshaller.writeObject(result); attachments.remove(EJBClient.SOURCE_ADDRESS_KEY);
protected void writeFailure(Exception reason) { try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) { os.writeByte(Protocol.APPLICATION_EXCEPTION); os.writeShort(invId); if (version >= 3) os.writeByte(getEnlistmentStatus()); final Marshaller marshaller = marshallerFactory.createMarshaller(configuration); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); marshaller.writeObject(reason); marshaller.writeByte(0); marshaller.finish(); } catch (IOException e) { // nothing to do at this point; the client doesn't want the response Logs.REMOTING.trace("EJB response write failed", e); } finally { invocations.removeKey(invId); } }
protected void writeFailure(Exception reason) { try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) { os.writeByte(Protocol.APPLICATION_EXCEPTION); os.writeShort(invId); if (version >= 3) os.writeByte(getEnlistmentStatus()); final Marshaller marshaller = marshallerFactory.createMarshaller(configuration); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); marshaller.writeObject(reason); marshaller.writeByte(0); marshaller.finish(); } catch (IOException e) { // nothing to do at this point; the client doesn't want the response Logs.REMOTING.trace("EJB response write failed", e); } finally { invocations.removeKey(invId); } }
marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(out)));
marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(out)));
public void writeWrongViewType() { final String message = Logs.REMOTING.remoteMessageBadViewType(getEJBIdentifier()); try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) { if (version >= 3) { os.writeByte(Protocol.BAD_VIEW_TYPE); os.writeShort(invId); os.writeUTF(message); } else { os.writeByte(Protocol.APPLICATION_EXCEPTION); os.writeShort(invId); final Marshaller marshaller = marshallerFactory.createMarshaller(configuration); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); marshaller.writeObject(Logs.REMOTING.invalidViewTypeForInvocation(message)); marshaller.writeByte(0); marshaller.finish(); } } catch (IOException e) { // nothing to do at this point; the client doesn't want the response Logs.REMOTING.trace("EJB response write failed", e); } finally { invocations.removeKey(invId); } }
void handleTxnRecoverRequest(final int invId, final MessageInputStream message) throws IOException { final String parentName = message.readUTF(); final int flags = message.readInt(); final Xid[] xids; try { xids = transactionServer.getTransactionService().getTransactionContext().getRecoveryInterface().recover(flags, parentName); } catch (XAException e) { writeFailedResponse(invId, e); return; } try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) { os.writeByte(Protocol.TXN_RECOVERY_RESPONSE); os.writeShort(invId); PackedInteger.writePackedInteger(os, xids.length); final Marshaller marshaller = marshallerFactory.createMarshaller(configuration); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); for (Xid xid : xids) { marshaller.writeObject(new XidTransactionID(xid)); } marshaller.finish(); } catch (IOException e) { // nothing to do at this point; the client doesn't want the response Logs.REMOTING.trace("EJB transaction response write failed", e); } }
public void writeWrongViewType() { final String message = Logs.REMOTING.remoteMessageBadViewType(getEJBIdentifier()); try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) { if (version >= 3) { os.writeByte(Protocol.BAD_VIEW_TYPE); os.writeShort(invId); os.writeUTF(message); } else { os.writeByte(Protocol.APPLICATION_EXCEPTION); os.writeShort(invId); final Marshaller marshaller = marshallerFactory.createMarshaller(configuration); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); marshaller.writeObject(Logs.REMOTING.invalidViewTypeForInvocation(message)); marshaller.writeByte(0); marshaller.finish(); } } catch (IOException e) { // nothing to do at this point; the client doesn't want the response Logs.REMOTING.trace("EJB response write failed", e); } finally { invocations.removeKey(invId); } }
void handleTxnRecoverRequest(final int invId, final MessageInputStream message) throws IOException { final String parentName = message.readUTF(); final int flags = message.readInt(); final Xid[] xids; try { xids = transactionServer.getTransactionService().getTransactionContext().getRecoveryInterface().recover(flags, parentName); } catch (XAException e) { writeFailedResponse(invId, e); return; } try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) { os.writeByte(Protocol.TXN_RECOVERY_RESPONSE); os.writeShort(invId); PackedInteger.writePackedInteger(os, xids.length); final Marshaller marshaller = marshallerFactory.createMarshaller(configuration); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); for (Xid xid : xids) { marshaller.writeObject(new XidTransactionID(xid)); } marshaller.finish(); } catch (IOException e) { // nothing to do at this point; the client doesn't want the response Logs.REMOTING.trace("EJB transaction response write failed", e); } }
if (1 <= version && version <= 2) { final Marshaller marshaller = marshallerFactory.createMarshaller(configuration); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); if (strongAffinityUpdate != null) { marshaller.writeObject(strongAffinityUpdate);