@Override public String toString() { return "HornetQException[errorCode=" + code + " message=" + getMessage() + "]"; }
@Override public String toString() { return this.getClass().getSimpleName() + "[errorType=" + type + " message=" + getMessage() + "]"; }
@Override public HornetQBuffer getBodyBuffer() { try { checkBuffer(); } catch (HornetQException e) { throw new RuntimeException(e.getMessage(), e); } return bodyBuffer; }
public Map<String, Object>[] listMessages(final String filterStr) throws Exception { try { String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr); Map<String, Object>[] coreMessages = coreQueueControl.listMessages(filter); Map<String, Object>[] jmsMessages = new Map[coreMessages.length]; int i = 0; for (Map<String, Object> coreMessage : coreMessages) { Map<String, Object> jmsMessage = HornetQMessage.coreMaptoJMSMap(coreMessage); jmsMessages[i++] = jmsMessage; } return jmsMessages; } catch (HornetQException e) { throw new IllegalStateException(e.getMessage()); } }
@Override public void encodeRest(final HornetQBuffer buffer) { buffer.writeInt(exception.getCode()); buffer.writeNullableString(exception.getMessage()); }
public boolean removeMessage(final long messageID) throws Exception { checkStarted(); clearIO(); try { return queue.deleteReference(messageID); } catch (HornetQException e) { throw new IllegalStateException(e.getMessage()); } finally { blockOnIO(); } }
public boolean removeMessage(final long messageID) throws Exception { checkStarted(); clearIO(); try { return queue.deleteReference(messageID); } catch (HornetQException e) { throw new IllegalStateException(e.getMessage()); } finally { blockOnIO(); } }
@Override public void encodeRest(final HornetQBuffer buffer) { buffer.writeInt(exception.getType().getCode()); buffer.writeNullableString(exception.getMessage()); }
public synchronized void open(final int maxIO, final boolean useExecutor) throws Exception { opened = true; aioFile = new AsynchronousFileImpl(useExecutor ? writerExecutor : null, pollerExecutor, this); try { aioFile.open(getFile().getAbsolutePath(), maxIO); } catch (HornetQException e) { factory.onIOError(HornetQException.IO_ERROR, e.getMessage(), this); throw e; } position.set(0); aioFile.setBufferCallback(bufferCallback); fileSize = aioFile.size(); }
public int expireMessages(final String filterStr) throws Exception { checkStarted(); clearIO(); try { Filter filter = FilterImpl.createFilter(filterStr); return queue.expireReferences(filter); } catch (HornetQException e) { throw new IllegalStateException(e.getMessage()); } finally { blockOnIO(); } }
public synchronized void open(final int maxIO, final boolean useExecutor) throws HornetQException { opened = true; aioFile = new AsynchronousFileImpl(useExecutor ? writerExecutor : null, pollerExecutor, this); try { aioFile.open(getFile().getAbsolutePath(), maxIO); } catch (HornetQException e) { factory.onIOError(e, e.getMessage(), this); throw e; } position.set(0); aioFile.setBufferCallback(bufferCallback); fileSize = aioFile.size(); }
public synchronized void open(final int maxIO, final boolean useExecutor) throws HornetQException { opened = true; aioFile = new AsynchronousFileImpl(useExecutor ? writerExecutor : null, pollerExecutor, this); try { aioFile.open(getFile().getAbsolutePath(), maxIO); } catch (HornetQException e) { factory.onIOError(e, e.getMessage(), this); throw e; } position.set(0); aioFile.setBufferCallback(bufferCallback); fileSize = aioFile.size(); }
public int expireMessages(final String filterStr) throws Exception { checkStarted(); clearIO(); try { Filter filter = FilterImpl.createFilter(filterStr); return queue.expireReferences(filter); } catch (HornetQException e) { throw new IllegalStateException(e.getMessage()); } finally { blockOnIO(); } }
public void writeInternal(long positionToWrite, long size, ByteBuffer bytes) throws HornetQException { try { writeInternal(handler, positionToWrite, size, bytes); } catch (HornetQException e) { fireExceptionListener(e.getCode(), e.getMessage()); throw e; } if (bufferCallback != null) { bufferCallback.bufferDone(bytes); } }
public void fill(final long position, final int blocks, final long size, final byte fillChar) throws HornetQException { checkOpened(); try { Native.fill(handler, position, blocks, size, fillChar); } catch (HornetQException e) { fireExceptionListener(e.getType().getCode(), e.getMessage()); throw e; } }
public void fill(final long position, final int blocks, final long size, final byte fillChar) throws HornetQException { checkOpened(); try { Native.fill(handler, position, blocks, size, fillChar); } catch (HornetQException e) { fireExceptionListener(e.getType().getCode(), e.getMessage()); throw e; } }
public void writeInternal(long positionToWrite, long size, ByteBuffer bytes) throws HornetQException { try { Native.writeInternal(handler, positionToWrite, size, bytes); } catch (HornetQException e) { fireExceptionListener(e.getType().getCode(), e.getMessage()); throw e; } if (bufferCallback != null) { bufferCallback.bufferDone(bytes); } }
public void writeInternal(long positionToWrite, long size, ByteBuffer bytes) throws HornetQException { try { Native.writeInternal(handler, positionToWrite, size, bytes); } catch (HornetQException e) { fireExceptionListener(e.getType().getCode(), e.getMessage()); throw e; } if (bufferCallback != null) { bufferCallback.bufferDone(bytes); } }
public void fail(final HornetQException me) { synchronized (failLock) { if (destroyed) { return; } destroyed = true; } log.warn("Connection failure has been detected: " + me.getMessage() + " [code=" + me.getCode() + "]"); // Then call the listeners callFailureListeners(me); callClosingListeners(); internalClose(); }
@Override public void onMessage(ClientMessage message) { try { message.acknowledge(); } catch (HornetQException exp) { logError(MODULE_NAME, exp.getMessage(), exp); } String command = message.getStringProperty("command"); String result = CommandLineParser.parse(command); ClientMessage response = MessageBusServer.getSession().createMessage(false); response.putStringProperty("response", result); response.putObjectProperty("receiver", "iofog.commandline.response"); try { synchronized (messageBusSessionLock) { MessageBusServer.getCommandlineProducer().send(response); } } catch (Exception exp) { logError(MODULE_NAME, exp.getMessage(), exp); } }