Refine search
public static JMSException create(String msg, Throwable cause) { JMSException exception = new JMSException(msg); exception.initCause(cause); return exception; }
private static JMSException convertFromException(final Exception e) { JMSException jmse = new JMSException(e.getMessage()); jmse.initCause(e); return jmse; }
public static JMSException convertToJmsException(Exception e, String extra) { Preconditions.checkNotNull(extra); Preconditions.checkNotNull(e); JMSException jmsException = new JMSException(extra); jmsException.initCause(e); return jmsException; } }
private JMSException handleOutputException(final IOException e) { JMSException ex = new JMSException(e.getMessage()); ex.initCause(e); ex.setLinkedException(e); return ex; }
public static JMSException create(String msg, Exception cause) { JMSException exception = new JMSException(msg); exception.setLinkedException(cause); exception.initCause(cause); return exception; }
public static JMSException create(Throwable cause) { if (cause instanceof JMSException) { return (JMSException)cause; } String msg = cause.getMessage(); if (msg == null || msg.length() == 0) { msg = cause.toString(); } JMSException exception; if (cause instanceof SecurityException) { exception = new JMSSecurityException(msg); } else { exception = new JMSException(msg); } exception.initCause(cause); return exception; }
@Override public void setJMSCorrelationIDAsBytes(final byte[] correlationID) throws JMSException { try { MessageUtil.setJMSCorrelationIDAsBytes(message, correlationID); } catch (ActiveMQException e) { JMSException ex = new JMSException(e.getMessage()); ex.initCause(e); throw ex; } }
@Override public void setObject(final Serializable object) throws JMSException { checkWrite(); if (object != null) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(1024); ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(object); oos.flush(); data = baos.toByteArray(); } catch (Exception e) { JMSException je = new JMSException("Failed to serialize object"); je.setLinkedException(e); je.initCause(e); throw je; } } }
@Override public void clearBody() throws JMSException { super.clearBody(); try { getBuffer().clear(); } catch (RuntimeException e) { JMSException e2 = new JMSException(e.getMessage()); e2.initCause(e); throw e2; } }
public static JMSException create(Exception cause) { if (cause instanceof JMSException) { return (JMSException)cause; } String msg = cause.getMessage(); if (msg == null || msg.length() == 0) { msg = cause.toString(); } JMSException exception; if (cause instanceof SecurityException) { exception = new JMSSecurityException(msg); } else { exception = new JMSException(msg); } exception.setLinkedException(cause); exception.initCause(cause); return exception; }
@Override public synchronized void connectionFailed(final ActiveMQException me, boolean failedOver) { if (me == null) { return; } ActiveMQConnection conn = connectionRef.get(); if (conn != null) { try { final ExceptionListener exceptionListener = conn.getExceptionListener(); if (exceptionListener != null) { final JMSException je = new JMSException(me.toString(), failedOver ? EXCEPTION_FAILOVER : EXCEPTION_DISCONNECT); je.initCause(me); new Thread(new Runnable() { @Override public void run() { exceptionListener.onException(je); } }).start(); } } catch (JMSException e) { if (!conn.closed) { ActiveMQJMSClientLogger.LOGGER.errorCallingExcListener(e); } } } }
@Override public void writeUTF(final String value) throws JMSException { checkWrite(); try { bytesWriteUTF(message.getBodyBuffer(), value); } catch (Exception e) { JMSException je = new JMSException("Failed to write UTF"); je.setLinkedException(e); je.initCause(e); throw je; } }
@Override public String readUTF() throws JMSException { checkRead(); try { return bytesReadUTF(message.getBodyBuffer()); } catch (IndexOutOfBoundsException e) { throw new MessageEOFException(""); } catch (Exception e) { JMSException je = new JMSException("Failed to get UTF"); je.setLinkedException(e); je.initCause(e); throw je; } }
@Override public void setClientID(final String clientID) throws JMSException { checkClosed(); if (this.clientID != null) { throw new IllegalStateException("Client id has already been set"); } if (!justCreated) { throw new IllegalStateException("setClientID can only be called directly after the connection is created"); } validateClientID(initialSession, clientID); this.clientID = clientID; try { this.addSessionMetaData(initialSession); } catch (ActiveMQException e) { JMSException ex = new JMSException("Internal error setting metadata jms-client-id"); ex.setLinkedException(e); ex.initCause(e); throw ex; } justCreated = false; }
factory = serverLocator.createSessionFactory(); } catch (Exception e) { JMSException jmse = new JMSException("Failed to create session factory"); jmse.initCause(e); jmse.setLinkedException(e); throw new JMSException("Failed to create connection: invalid type " + type);
switch (me.getType()) { case CONNECTION_TIMEDOUT: je = new JMSException(me.getMessage()); break; je = new JMSException(me.getMessage()); break; je = new JMSException(me.getMessage()); break; je = new JMSException(me.getMessage()); je.initCause(me);
JMSException jmsException = new JMSException("Start consumer failed " + context.getConsumerId()); jmsException.initCause(mqe); throw jmsException;
activeMQJmsMessage.doBeforeSend(); } catch (Exception e) { JMSException je = new JMSException(e.getMessage()); je.initCause(e); JMSException jmsException = new JMSException(e.getMessage()); jmsException.initCause(e); throw jmsException; } catch (ActiveMQException e) { JMSException je = new IllegalStateException(e.getMessage()); je.setStackTrace(e.getStackTrace()); je.initCause(e); throw je;
public static JMSException create(String msg, Throwable cause) { JMSException exception = new JMSException(msg); exception.initCause(cause); return exception; }
private static JMSException convertFromException(final Exception e) { JMSException jmse = new JMSException(e.getMessage()); jmse.initCause(e); return jmse; }