@Override public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { if (!active) { return; } // We don't want to log this - since it is normal for this to happen during failover/reconnect // and we don't want to spew out stack traces in that event // The user has access to this exeception anyway via the ActiveMQException initial cause ActiveMQException me = new ActiveMQException(cause.getMessage()); me.initCause(cause); synchronized (listener) { try { listenerExecutor.execute(() -> listener.connectionException(channelId(ctx.channel()), me)); active = false; } catch (Exception ex) { ActiveMQClientLogger.LOGGER.errorCallingLifeCycleListener(ex); } } }
/** * @throws ActiveMQException */ private void checkException() throws ActiveMQException { // it's not needed to copy it as we never set it back to null // once the exception is set, the controller is pretty much useless if (handledException != null) { if (handledException instanceof ActiveMQException) { ActiveMQException nestedException; // This is just to be user friendly and give the user a proper exception trace, // instead to just where it was canceled. if (handledException instanceof ActiveMQLargeMessageInterruptedException) { nestedException = new ActiveMQLargeMessageInterruptedException(handledException.getMessage()); } else { nestedException = new ActiveMQException(((ActiveMQException) handledException).getType(), handledException.getMessage()); } nestedException.initCause(handledException); throw nestedException; } else { throw new ActiveMQException(ActiveMQExceptionType.LARGE_MESSAGE_ERROR_BODY, "Error on saving LargeMessageBufferImpl", handledException); } } }
@Override public void markTXFailed(Throwable e) { Transaction currentTX = this.tx; if (currentTX != null) { if (e instanceof ActiveMQException) { currentTX.markAsRollbackOnly((ActiveMQException) e); } else { ActiveMQException exception = new ActiveMQException(e.getMessage()); exception.initCause(e); currentTX.markAsRollbackOnly(exception); } } }
@Override public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { if (!active) { return; } // We don't want to log this - since it is normal for this to happen during failover/reconnect // and we don't want to spew out stack traces in that event // The user has access to this exeception anyway via the ActiveMQException initial cause ActiveMQException me = new ActiveMQException(cause.getMessage()); me.initCause(cause); synchronized (listener) { try { listenerExecutor.execute(() -> listener.connectionException(channelId(ctx.channel()), me)); active = false; } catch (Exception ex) { ActiveMQClientLogger.LOGGER.errorCallingLifeCycleListener(ex); } } }
@Override public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { if (!active) { return; } // We don't want to log this - since it is normal for this to happen during failover/reconnect // and we don't want to spew out stack traces in that event // The user has access to this exeception anyway via the ActiveMQException initial cause ActiveMQException me = new ActiveMQException(cause.getMessage()); me.initCause(cause); synchronized (listener) { try { listenerExecutor.execute(() -> listener.connectionException(channelId(ctx.channel()), me)); active = false; } catch (Exception ex) { ActiveMQClientLogger.LOGGER.errorCallingLifeCycleListener(ex); } } }
@Override public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { if (!active) { return; } // We don't want to log this - since it is normal for this to happen during failover/reconnect // and we don't want to spew out stack traces in that event // The user has access to this exeception anyway via the ActiveMQException initial cause ActiveMQException me = new ActiveMQException(cause.getMessage()); me.initCause(cause); synchronized (listener) { try { listenerExecutor.execute(() -> listener.connectionException(channelId(ctx.channel()), me)); active = false; } catch (Exception ex) { ActiveMQClientLogger.LOGGER.errorCallingLifeCycleListener(ex); } } }
@Override public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { if (!active) { return; } // We don't want to log this - since it is normal for this to happen during failover/reconnect // and we don't want to spew out stack traces in that event // The user has access to this exeception anyway via the ActiveMQException initial cause ActiveMQException me = new ActiveMQException(cause.getMessage()); me.initCause(cause); synchronized (listener) { try { listenerExecutor.execute(() -> listener.connectionException(channelId(ctx.channel()), me)); active = false; } catch (Exception ex) { ActiveMQClientLogger.LOGGER.errorCallingLifeCycleListener(ex); } } }
@Override public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { if (!active) { return; } // We don't want to log this - since it is normal for this to happen during failover/reconnect // and we don't want to spew out stack traces in that event // The user has access to this exeception anyway via the ActiveMQException initial cause ActiveMQException me = new ActiveMQException(cause.getMessage()); me.initCause(cause); synchronized (listener) { try { listenerExecutor.execute(() -> listener.connectionException(channelId(ctx.channel()), me)); active = false; } catch (Exception ex) { ActiveMQClientLogger.LOGGER.errorCallingLifeCycleListener(ex); } } }
/** * @throws ActiveMQException */ private void checkException() throws ActiveMQException { // it's not needed to copy it as we never set it back to null // once the exception is set, the controller is pretty much useless if (handledException != null) { if (handledException instanceof ActiveMQException) { ActiveMQException nestedException; // This is just to be user friendly and give the user a proper exception trace, // instead to just where it was canceled. if (handledException instanceof ActiveMQLargeMessageInterruptedException) { nestedException = new ActiveMQLargeMessageInterruptedException(handledException.getMessage()); } else { nestedException = new ActiveMQException(((ActiveMQException) handledException).getType(), handledException.getMessage()); } nestedException.initCause(handledException); throw nestedException; } else { throw new ActiveMQException(ActiveMQExceptionType.LARGE_MESSAGE_ERROR_BODY, "Error on saving LargeMessageBufferImpl", handledException); } } }
/** * @throws ActiveMQException */ private void checkException() throws ActiveMQException { // it's not needed to copy it as we never set it back to null // once the exception is set, the controller is pretty much useless if (handledException != null) { if (handledException instanceof ActiveMQException) { ActiveMQException nestedException; // This is just to be user friendly and give the user a proper exception trace, // instead to just where it was canceled. if (handledException instanceof ActiveMQLargeMessageInterruptedException) { nestedException = new ActiveMQLargeMessageInterruptedException(handledException.getMessage()); } else { nestedException = new ActiveMQException(((ActiveMQException) handledException).getType(), handledException.getMessage()); } nestedException.initCause(handledException); throw nestedException; } else { throw new ActiveMQException(ActiveMQExceptionType.LARGE_MESSAGE_ERROR_BODY, "Error on saving LargeMessageBufferImpl", handledException); } } }
/** * @throws ActiveMQException */ private void checkException() throws ActiveMQException { // it's not needed to copy it as we never set it back to null // once the exception is set, the controller is pretty much useless if (handledException != null) { if (handledException instanceof ActiveMQException) { ActiveMQException nestedException; // This is just to be user friendly and give the user a proper exception trace, // instead to just where it was canceled. if (handledException instanceof ActiveMQLargeMessageInterruptedException) { nestedException = new ActiveMQLargeMessageInterruptedException(handledException.getMessage()); } else { nestedException = new ActiveMQException(((ActiveMQException) handledException).getType(), handledException.getMessage()); } nestedException.initCause(handledException); throw nestedException; } else { throw new ActiveMQException(ActiveMQExceptionType.LARGE_MESSAGE_ERROR_BODY, "Error on saving LargeMessageBufferImpl", handledException); } } }
/** * @throws ActiveMQException */ private void checkException() throws ActiveMQException { // it's not needed to copy it as we never set it back to null // once the exception is set, the controller is pretty much useless if (handledException != null) { if (handledException instanceof ActiveMQException) { ActiveMQException nestedException; // This is just to be user friendly and give the user a proper exception trace, // instead to just where it was canceled. if (handledException instanceof ActiveMQLargeMessageInterruptedException) { nestedException = new ActiveMQLargeMessageInterruptedException(handledException.getMessage()); } else { nestedException = new ActiveMQException(((ActiveMQException) handledException).getType(), handledException.getMessage()); } nestedException.initCause(handledException); throw nestedException; } else { throw new ActiveMQException(ActiveMQExceptionType.LARGE_MESSAGE_ERROR_BODY, "Error on saving LargeMessageBufferImpl", handledException); } } }
/** * @throws ActiveMQException */ private void checkException() throws ActiveMQException { // it's not needed to copy it as we never set it back to null // once the exception is set, the controller is pretty much useless if (handledException != null) { if (handledException instanceof ActiveMQException) { ActiveMQException nestedException; // This is just to be user friendly and give the user a proper exception trace, // instead to just where it was canceled. if (handledException instanceof ActiveMQLargeMessageInterruptedException) { nestedException = new ActiveMQLargeMessageInterruptedException(handledException.getMessage()); } else { nestedException = new ActiveMQException(((ActiveMQException) handledException).getType(), handledException.getMessage()); } nestedException.initCause(handledException); throw nestedException; } else { throw new ActiveMQException(ActiveMQExceptionType.LARGE_MESSAGE_ERROR_BODY, "Error on saving LargeMessageBufferImpl", handledException); } } }
/** * @throws ActiveMQException */ private void checkException() throws ActiveMQException { // it's not needed to copy it as we never set it back to null // once the exception is set, the controller is pretty much useless if (handledException != null) { if (handledException instanceof ActiveMQException) { ActiveMQException nestedException; // This is just to be user friendly and give the user a proper exception trace, // instead to just where it was canceled. if (handledException instanceof ActiveMQLargeMessageInterruptedException) { nestedException = new ActiveMQLargeMessageInterruptedException(handledException.getMessage()); } else { nestedException = new ActiveMQException(((ActiveMQException) handledException).getType(), handledException.getMessage()); } nestedException.initCause(handledException); throw nestedException; } else { throw new ActiveMQException(ActiveMQExceptionType.LARGE_MESSAGE_ERROR_BODY, "Error on saving LargeMessageBufferImpl", handledException); } } }
@Override public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { if (!active) { return; } // We don't want to log this - since it is normal for this to happen during failover/reconnect // and we don't want to spew out stack traces in that event // The user has access to this exeception anyway via the ActiveMQException initial cause ActiveMQException me = new ActiveMQException(cause.getMessage()); me.initCause(cause); synchronized (listener) { try { listenerExecutor.execute(() -> listener.connectionException(channelId(ctx.channel()), me)); active = false; } catch (Exception ex) { ActiveMQClientLogger.LOGGER.errorCallingLifeCycleListener(ex); } } }
private static Packet onCatchThrowableWhileHandlePacket(Packet packet, Throwable t, boolean requiresResponse, Packet response, ServerSession session) { session.markTXFailed(t); if (requiresResponse) { ActiveMQServerLogger.LOGGER.sendingUnexpectedExceptionToClient(t); ActiveMQException activeMQInternalErrorException = new ActiveMQInternalErrorException(); activeMQInternalErrorException.initCause(t); response = convertToExceptionPacket(packet, activeMQInternalErrorException); } else { ActiveMQServerLogger.LOGGER.caughtException(t); } return response; }