@Override public void encodeRest(final HornetQBuffer buffer) { buffer.writeInt(exception.getType().getCode()); buffer.writeNullableString(exception.getMessage()); }
private void checkClosed() throws HornetQException { if (closed) { throw new HornetQException(HornetQException.OBJECT_CLOSED, "Producer is closed"); } }
public void run() { long sequence = nextWritingSequence.getAndIncrement(); try { write(handler, sequence, position, size, directByteBuffer, aioCallback); } catch (HornetQException e) { callbackError(aioCallback, sequence, directByteBuffer, e.getCode(), e.getMessage()); } catch (RuntimeException e) { callbackError(aioCallback, sequence, directByteBuffer, HornetQException.INTERNAL_ERROR, e.getMessage()); } } });
if (e.getType() == HornetQExceptionType.NATIVE_ERROR_CANT_INITIALIZE_AIO) ex = new HornetQException(e.getType(), "Can't initialize AIO. Currently AIO in use = " + AsynchronousFileImpl.totalMaxIO.get() + ", trying to allocate more " +
@Override public String toString() { return "HornetQException[errorCode=" + code + " message=" + getMessage() + "]"; }
if (e.getCode() == HornetQException.NATIVE_ERROR_CANT_INITIALIZE_AIO) ex = new HornetQException(e.getCode(), "Can't initialize AIO. Currently AIO in use = " + AsynchronousFileImpl.totalMaxIO.get() + ", trying to allocate more " +
switch (me.getCode()) je = new JMSException(me.getMessage()); break; je = new javax.jms.IllegalStateException(me.getMessage()); break; je = new JMSException(me.getMessage()); break; je = new InvalidSelectorException(me.getMessage()); break; je = new JMSException(me.getMessage()); break; je = new javax.jms.IllegalStateException(me.getMessage()); break; je = new InvalidDestinationException(me.getMessage()); break; je = new InvalidDestinationException(me.getMessage()); break; je = new JMSSecurityException(me.getMessage()); break;
@Override public void exceptionCaught(final ChannelHandlerContext ctx, final ExceptionEvent e) 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 HornetQException initial cause HornetQException me = new HornetQException(HornetQException.INTERNAL_ERROR, "Netty exception"); me.initCause(e.getCause()); synchronized (listener) { try { listener.connectionException(e.getChannel().getId(), me); active = false; } catch (Exception ex) { HornetQChannelHandler.log.error("failed to notify the listener:", ex); } } }
public void connectionFailed(HornetQException exception, boolean failedOver) { if (exception.getType() == HornetQExceptionType.DISCONNECTED) { flowRecord.serverDisconnected(); clusterManager.removeClusterLocator(serverLocator); } } });
throw new HornetQException(HornetQException.NOT_CONNECTED, "Connection is destroyed"); throw new HornetQException(HornetQException.CONNECTION_TIMEDOUT, "Timed out waiting for response when sending packet " + packet.getType()); e.fillInStackTrace();
public void connectionFailed(HornetQException exception, boolean failedOver) { if (clusterConnection && exception.getCode() == HornetQException.DISCONNECTED) { try { ServerLocatorImpl.this.start(startExecutor); } catch (Exception e) { // There isn't much to be done if this happens here log.warn(e.getMessage()); } } } });
/** * Closes the passed-in {@link ClientConsumer}. * * @param consumer the {@link ClientConsumer} instance to close. */ public static void closeClientConsumer(final ClientConsumer consumer) { if (consumer != null) { try { consumer.close(); } catch (final HornetQException ignore) { ignore.printStackTrace(); } } }
@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 HornetQException initial cause HornetQException me = HornetQClientMessageBundle.BUNDLE.nettyError(); me.initCause(cause); synchronized (listener) { try { listener.connectionException(channelId(ctx.channel()), me); active = false; } catch (Exception ex) { HornetQClientLogger.LOGGER.errorCallingLifeCycleListener(ex); } } }
@Override public String toString() { return this.getClass().getSimpleName() + "[errorType=" + type + " message=" + getMessage() + "]"; }
if (e.getType() == HornetQExceptionType.NATIVE_ERROR_CANT_INITIALIZE_AIO) ex = new HornetQException(e.getType(), "Can't initialize AIO. Currently AIO in use = " + AsynchronousFileImpl.totalMaxIO.get() + ", trying to allocate more " +
throw new HornetQException(HornetQException.CONNECTION_TIMEDOUT, "Timed out waiting to receive initial broadcast from cluster"); if (e.getCode() == HornetQException.NOT_CONNECTED) throw new HornetQException(HornetQException.NOT_CONNECTED, "Cannot connect to server(s). Tried with all available servers."); throw new HornetQException(HornetQException.NOT_CONNECTED, "Cannot connect to server(s). Tried with all available servers."); throw new HornetQException(HornetQException.CONNECTION_TIMEDOUT, "Timed out waiting to receive cluster topology. Group:" + discoveryGroup);
response = new HornetQExceptionMessage(new HornetQException(HornetQException.DUPLICATE_METADATA, "Metadata " + message.getKey() + "=" + HornetQException hqe = new HornetQException(HornetQException.INTERNAL_ERROR); hqe.initCause(t); response = new HornetQExceptionMessage(hqe);
public void connectionFailed(HornetQException exception, boolean failedOver) { if (clusterConnection && exception.getType() == HornetQExceptionType.DISCONNECTED) { try { ServerLocatorImpl.this.start(startExecutor); } catch (Exception e) { // There isn't much to be done if this happens here HornetQClientLogger.LOGGER.errorStartingLocator(e); } } }