Exemplo n.º 1
0
 public void close(AMQConstant cause, String message) throws AMQException {
   closeSubscriptions();
   ConnectionCloseCode replyCode = ConnectionCloseCode.NORMAL;
   try {
     replyCode = ConnectionCloseCode.get(cause.getCode());
   } catch (IllegalArgumentException iae) {
     // Ignore
   }
   close(replyCode, message);
 }
Exemplo n.º 2
0
  public void closeSession(AMQSessionModel session, AMQConstant cause, String message)
      throws AMQException {
    ExecutionException ex = new ExecutionException();
    ExecutionErrorCode code = ExecutionErrorCode.INTERNAL_ERROR;
    try {
      code = ExecutionErrorCode.get(cause.getCode());
    } catch (IllegalArgumentException iae) {
      // Ignore, already set to INTERNAL_ERROR
    }
    ex.setErrorCode(code);
    ex.setDescription(message);
    ((ServerSession) session).invoke(ex);

    ((ServerSession) session).close();
  }