@Override public final RequestSendFailedException noMoreDestinations() { final RequestSendFailedException result = new RequestSendFailedException(String.format(getLoggingLocale(), noMoreDestinations$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String mismatchedMethodLocation = "EJBCLIENT000500: Protocol error: mismatched method location";
break; } catch (RequestSendFailedException r) { if (! r.canBeRetried()) { throw r; } catch (Throwable o) { if (! context.shouldRetry()) { Exception e = new RequestSendFailedException(o.getClass().getSimpleName() + ": " + o.getMessage(), o.getCause()); e.setStackTrace(o.getStackTrace()); throw e; throw new RequestSendFailedException(t.getMessage() + " (maximum retries exceeded)", t);
/** * Constructs a new {@code RequestSendFailedException} instance with an initial cause. If a non-{@code null} cause * is specified, its message is used to initialize the message of this {@code RequestSendFailedException}; otherwise * the message is left blank ({@code null}). * * @param cause the cause */ public RequestSendFailedException(final Throwable cause) { super(); initCause(cause); }
protected SessionID createSession(final EJBReceiverSessionCreationContext context) throws Exception { final StatelessEJBLocator<?> statelessLocator = context.getClientInvocationContext().getLocator().asStateless(); final AuthenticationContext authenticationContext = context.getAuthenticationContext(); try { IoFuture<ConnectionPeerIdentity> futureConnection = getConnection(context.getClientInvocationContext(), context.getClientInvocationContext().getDestination(), authenticationContext); final ConnectionPeerIdentity identity = futureConnection.getInterruptibly(); final EJBClientChannel ejbClientChannel = getClientChannel(identity.getConnection()); final StatefulEJBLocator<?> result = ejbClientChannel.openSession(statelessLocator, identity, context.getClientInvocationContext()); return result.getSessionId(); } catch (IOException e) { final RequestSendFailedException failed = new RequestSendFailedException("Failed to create stateful EJB: " + e.getMessage(), true); failed.initCause(e); throw failed; } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new CreateException("Stateful EJB creation interrupted"); } }
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); } }
protected SessionID createSession(final EJBReceiverSessionCreationContext context) throws Exception { final StatelessEJBLocator<?> statelessLocator = context.getClientInvocationContext().getLocator().asStateless(); final AuthenticationContext authenticationContext = context.getAuthenticationContext(); try { IoFuture<ConnectionPeerIdentity> futureConnection = getConnection(context.getClientInvocationContext(), context.getClientInvocationContext().getDestination(), authenticationContext); final ConnectionPeerIdentity identity = futureConnection.getInterruptibly(); final EJBClientChannel ejbClientChannel = getClientChannel(identity.getConnection()); final StatefulEJBLocator<?> result = ejbClientChannel.openSession(statelessLocator, identity, context.getClientInvocationContext()); return result.getSessionId(); } catch (IOException e) { final RequestSendFailedException failed = new RequestSendFailedException("Failed to create stateful EJB: " + e.getMessage(), true); failed.initCause(e); throw failed; } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new CreateException("Stateful EJB creation interrupted"); } }
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());
@Override public final RequestSendFailedException noMoreDestinations() { final RequestSendFailedException result = new RequestSendFailedException(String.format(getLoggingLocale(), noMoreDestinations$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String mismatchedMethodLocation = "EJBCLIENT000500: Protocol error: mismatched method location";
/** * Constructs a new {@code RequestSendFailedException} instance with an initial message and cause. * * @param message the message * @param cause the cause * @param canBeRetried the value of the can-be-retried flag */ public RequestSendFailedException(final String message, final Throwable cause, final boolean canBeRetried) { super(message); initCause(cause); this.canBeRetried = canBeRetried; }
protected SessionID createSession(final EJBReceiverSessionCreationContext context) throws Exception { final StatelessEJBLocator<?> statelessLocator = context.getClientInvocationContext().getLocator().asStateless(); final AuthenticationContext authenticationContext = context.getAuthenticationContext(); try { IoFuture<ConnectionPeerIdentity> futureConnection = getConnection(context.getClientInvocationContext(), context.getClientInvocationContext().getDestination(), authenticationContext); final ConnectionPeerIdentity identity = futureConnection.getInterruptibly(); final EJBClientChannel ejbClientChannel = getClientChannel(identity.getConnection()); final StatefulEJBLocator<?> result = ejbClientChannel.openSession(statelessLocator, identity, context.getClientInvocationContext()); return result.getSessionId(); } catch (IOException e) { final RequestSendFailedException failed = new RequestSendFailedException("Failed to create stateful EJB: " + e.getMessage(), true); failed.initCause(e); throw failed; } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new CreateException("Stateful EJB creation interrupted"); } }
break; } catch (RequestSendFailedException r) { if (! r.canBeRetried()) { throw r; } catch (Throwable o) { if (! context.shouldRetry()) { Exception e = new RequestSendFailedException(o.getClass().getSimpleName() + ": " + o.getMessage(), o.getCause()); e.setStackTrace(o.getStackTrace()); throw e; throw new RequestSendFailedException(t.getMessage() + " (maximum retries exceeded)", t);
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); } }
@Override public final RequestSendFailedException noMoreDestinations() { final RequestSendFailedException result = new RequestSendFailedException(String.format(getLoggingLocale(), noMoreDestinations$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String mismatchedMethodLocation = "EJBCLIENT000500: Protocol error: mismatched method location";
/** * Constructs a new {@code RequestSendFailedException} instance with an initial message and cause. * * @param msg the message * @param cause the cause */ public RequestSendFailedException(final String msg, final Throwable cause) { super(msg); initCause(cause); }
break; } catch (RequestSendFailedException r) { if (! r.canBeRetried()) { throw r; } catch (Throwable o) { if (! context.shouldRetry()) { Exception e = new RequestSendFailedException(o.getClass().getSimpleName() + ": " + o.getMessage(), o.getCause()); e.setStackTrace(o.getStackTrace()); throw e; throw new RequestSendFailedException(t.getMessage() + " (maximum retries exceeded)", t);
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); } }
/** * Constructs a new {@code RequestSendFailedException} instance with an initial cause. If a non-{@code null} cause * is specified, its message is used to initialize the message of this {@code RequestSendFailedException}; otherwise * the message is left blank ({@code null}). * * @param cause the cause * @param canBeRetried the value of the can-be-retried flag */ public RequestSendFailedException(final Throwable cause, final boolean canBeRetried) { super(); initCause(cause); this.canBeRetried = canBeRetried; }
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());
/** * Constructs a new {@code RequestSendFailedException} instance with an initial cause. If a non-{@code null} cause * is specified, its message is used to initialize the message of this {@code RequestSendFailedException}; otherwise * the message is left blank ({@code null}). * * @param cause the cause * @param canBeRetried the value of the can-be-retried flag */ public RequestSendFailedException(final Throwable cause, final boolean canBeRetried) { super(); initCause(cause); this.canBeRetried = canBeRetried; }
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());