@Override public void encodeRest(final ActiveMQBuffer buffer) { buffer.writeInt(exception.getType().getCode()); buffer.writeNullableString(exception.getMessage()); }
@Override public void decodeRest(final ActiveMQBuffer buffer) { int code = buffer.readInt(); String msg = buffer.readNullableString(); exception = ActiveMQExceptionType.createException(code, msg); }
public static ActiveMQException createException(int code, String msg) { return getType(code).createException(msg); }
public ActiveMQException(int code, String msg) { super(msg); this.type = ActiveMQExceptionType.getType(code); }
public ActiveMQException(int code, String msg) { super(msg); this.type = ActiveMQExceptionType.getType(code); }
@Override public void writeDirect(final ByteBuffer bytes, final boolean sync, final IOCallback callback) { if (callback == null) { throw new NullPointerException("callback parameter need to be set"); } try { internalWrite(bytes, sync, callback, true); } catch (Exception e) { callback.onError(ActiveMQExceptionType.GENERIC_EXCEPTION.getCode(), e.getMessage()); } }
@Override public void waitCompletion() throws InterruptedException, ActiveMQException { while (true) { if (latch.await(2, TimeUnit.SECONDS)) break; } if (errorMessage != null) { throw ActiveMQExceptionType.createException(errorCode, errorMessage); } return; }
public static ActiveMQException createException(int code, String msg) { return getType(code).createException(msg); }
public ActiveMQException(int code, String msg) { super(msg); this.type = ActiveMQExceptionType.getType(code); }
@Override public void writeDirect(final ByteBuffer bytes, final boolean sync, final IOCallback callback) { if (callback == null) { throw new NullPointerException("callback parameter need to be set"); } try { internalWrite(bytes, sync, callback, true); } catch (Exception e) { callback.onError(ActiveMQExceptionType.GENERIC_EXCEPTION.getCode(), e.getMessage()); } }
public boolean waitCompletion(final long timeout) throws InterruptedException, ActiveMQException { boolean retValue = latch.await(timeout, TimeUnit.MILLISECONDS); if (errorMessage != null) { throw ActiveMQExceptionType.createException(errorCode, errorMessage); } return retValue; }
public static ActiveMQException createException(int code, String msg) { return getType(code).createException(msg); }
public ActiveMQException(int code, String msg) { super(msg); this.type = ActiveMQExceptionType.getType(code); }
private void setErrorCondition(IOCallback otherCallback, JournalTransaction jt, Throwable t) { TransactionCallback callback = null; if (jt != null) { callback = jt.getCurrentCallback(); if (callback != null && callback.getErrorMessage() != null) { callback.onError(ActiveMQExceptionType.IO_ERROR.getCode(), t.getMessage()); } } if (otherCallback != null && otherCallback != callback) { otherCallback.onError(ActiveMQExceptionType.IO_ERROR.getCode(), t.getMessage()); } }
@Override public void waitCompletion() throws InterruptedException, ActiveMQException { while (true) { if (latch.await(2, TimeUnit.SECONDS)) break; } if (errorMessage != null) { throw ActiveMQExceptionType.createException(errorCode, errorMessage); } return; }
public static ActiveMQException createException(int code, String msg) { return getType(code).createException(msg); }
public ActiveMQException(int code, String msg) { super(msg); this.type = ActiveMQExceptionType.getType(code); }
private void setErrorCondition(IOCallback otherCallback, JournalTransaction jt, Throwable t) { TransactionCallback callback = null; if (jt != null) { callback = jt.getCurrentCallback(); if (callback != null && callback.getErrorMessage() != null) { callback.onError(ActiveMQExceptionType.IO_ERROR.getCode(), t.getMessage()); } } if (otherCallback != null && otherCallback != callback) { otherCallback.onError(ActiveMQExceptionType.IO_ERROR.getCode(), t.getMessage()); } }
public boolean waitCompletion(final long timeout) throws InterruptedException, ActiveMQException { boolean retValue = latch.await(timeout, TimeUnit.MILLISECONDS); if (errorMessage != null) { throw ActiveMQExceptionType.createException(errorCode, errorMessage); } return retValue; }
public static ActiveMQException createException(int code, String msg) { return getType(code).createException(msg); }