Examples of MomExceptionReply


Examples of org.objectweb.joram.shared.client.MomExceptionReply

    queue.push(msg);
    outputCounter++;
  }
 
  public void pushError(MomException exc) {
    queue.push(new ProxyMessage(-1, -1, new MomExceptionReply(exc)));
  }
View Full Code Here

Examples of org.objectweb.joram.shared.client.MomExceptionReply

    }
    return request;
  }
 
  public void pushError(MomException exc) {
    queue.push(new MomExceptionReply(exc));
  }
View Full Code Here

Examples of org.objectweb.joram.shared.client.MomExceptionReply

   
    int requestId = reply.getCorrelationId();
    Integer requestKey = new Integer(requestId);
    ReplyListener rl = (ReplyListener)requestsTable.get(requestKey);
    if (reply instanceof MomExceptionReply) {
      MomExceptionReply excReply = (MomExceptionReply) reply;
      if (rl instanceof ErrorListener) {
        ((ErrorListener) rl).errorReceived(requestId, excReply);
      } else {
        // The listener is null or doesn't implement ErrorListener
        if (exceptionListener != null) {
View Full Code Here

Examples of org.objectweb.joram.shared.client.MomExceptionReply

      }
    } catch (IllegalArgumentException iE) {
      // Catching an exception due to an invalid agent identifier to
      // forward the request to:
      DestinationException dE = new DestinationException("Incorrect destination identifier: " + iE);
      sendToClient(key, new MomExceptionReply(request.getRequestId(), dE));
    } catch (RequestException exc) {
      sendToClient(key, new MomExceptionReply(request.getRequestId(), exc));
    }
  }
View Full Code Here

Examples of org.objectweb.joram.shared.client.MomExceptionReply

        doReact(key, (CommitRequest)request);
    } catch (MomException mE) {
      logger.log(BasicLevel.ERROR, this + " - error during request: " + request, mE);

      // Sending the exception to the client:
      doReply(new MomExceptionReply(request.getRequestId(), mE));
    } catch (Exception exc) {
      logger.log(BasicLevel.FATAL, this + " - unexpected error during request: " + request, exc);

      // Sending the exception to the client:
      doReply(new MomExceptionReply(request.getRequestId(), new MomException(exc.getMessage())));
    }
  }
View Full Code Here

Examples of org.objectweb.joram.shared.client.MomExceptionReply

          sub.delete();

          try {
            setCtx(sub.getContextId());
            activeCtx.removeSubName(name);
            doReply(new MomExceptionReply(rep.getCorrelationId(), exc));
          } catch (StateException pExc) {}
        }
        return;
      }
    }
    // Forwarding the exception to the client.
    try {
      setCtx(rep.getClientContext());
      doReply(new MomExceptionReply(rep.getCorrelationId(), exc));
    } catch (StateException pExc) {}
  }
View Full Code Here

Examples of org.objectweb.joram.shared.client.MomExceptionReply

        sub.delete();

        try {
          setCtx(sub.getContextId());
          activeCtx.removeSubName(name);
          doReply(new MomExceptionReply(sub.getSubRequestId(), exc));
        } catch (StateException pExc) {}
      }
      return;
    }

    if (not instanceof AbstractRequestNot) {
      AbstractRequestNot req = (AbstractRequestNot) not;

      // If the wrapped request is messages sending,forwarding them to the DMQ:
      if (req instanceof ClientMessages) {
        // If the queue actually was a dead message queue, updating its
        // identifier:
        if (dmqId != null && agId.equals(dmqId)) {
          // state change, so save.
          setSave();
          dmqId = null;
          for (Iterator subs = subsTable.values().iterator(); subs.hasNext();)
            ((ClientSubscription) subs.next()).setDMQId(null);
        }
        // Sending the messages again if not coming from the default DMQ:
        if (Queue.getDefaultDMQId() != null && !agId.equals(Queue.getDefaultDMQId())) {
          DMQManager dmqManager = new DMQManager(dmqId, null);
          Iterator msgs = ((ClientMessages) req).getMessages().iterator();
          while (msgs.hasNext()) {
            org.objectweb.joram.shared.messages.Message msg = (org.objectweb.joram.shared.messages.Message) msgs.next();
            nbMsgsSentToDMQSinceCreation++;
            dmqManager.addDeadMessage(msg, MessageErrorConstants.DELETED_DEST);
          }
          dmqManager.sendToDMQ();
        }

        DestinationException exc;
        exc = new DestinationException("Destination " + agId + " does not exist.");
        MomExceptionReply mer = new MomExceptionReply(req.getRequestId(), exc);
        try {
          setCtx(req.getClientContext());
          // Contrary to a receive, send the error even if the
          // connection is not started.
          doReply(mer);
        } catch (StateException se) {
          if (logger.isLoggable(BasicLevel.DEBUG))
            logger.log(BasicLevel.DEBUG, "", se);         
          // Do nothing (the context doesn't exist any more).
        }
      } else if (req instanceof ReceiveRequest) {
        DestinationException exc = new DestinationException("Destination " + agId + " does not exist.");
        MomExceptionReply mer = new MomExceptionReply(req.getRequestId(), exc);
        try {
          setCtx(req.getClientContext());
          if (activeCtx.getActivated()) {
            doReply(mer);
          } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.