Package org.objectweb.joram.shared.excepts

Examples of org.objectweb.joram.shared.excepts.StateException


      logger.log(BasicLevel.DEBUG,
                 "--- " + this + " forwards request " + request + " with id " + request.getRequestId());

    ProxyConnectionContext ctx = (ProxyConnectionContext) connections.get(new ConnectionKey(name, cnxId));
    if (ctx == null)
      throw new StateException("Connection " + name + ':' + cnxId + " closed.");

    ConnectionManager.sendToProxy(ctx.proxyId, cnxId, request, request);
  }
View Full Code Here


   */
  public java.util.Hashtable getReply(String name, int cnxId) throws Exception {
    ConnectionKey ckey = new ConnectionKey(name, cnxId);
    ProxyConnectionContext ctx = (ProxyConnectionContext) connections.get(ckey);
    if (ctx == null)
      throw new StateException("Connection " + name + ':' + cnxId + " closed.");

    Object obj = ctx.replyQueue.get();
    if (obj instanceof Exception) {
      connections.remove(ckey);
      throw (Exception)obj;
View Full Code Here

      sent = updateSubscriptionToTopic(topicId, activeCtxId, req.getRequestId(), req.isAsyncSubscription());
    } else { // Existing durable subscription...
      cSub = (ClientSubscription) subsTable.get(subName);

      if (cSub.getActive())
        throw new StateException("The durable subscription " + subName + " has already been activated.");

      // Updated topic: updating the subscription to the previous topic.
      boolean updatedTopic = ! topicId.equals(cSub.getTopicId());
      if (updatedTopic) {
        TopicSubscription oldTSub =
View Full Code Here

    try {
      Xid xid = new Xid(req.getBQ(), req.getFI(), req.getGTI());
      activeCtx.registerTxPrepare(xid, req);
      doReply(new ServerReply(req));
    } catch (Exception exc) {
      throw new StateException(exc.getMessage());
    }
  }
View Full Code Here

    Xid xid = new Xid(req.getBQ(), req.getFI(), req.getGTI());

    XACnxPrepare prepare = activeCtx.getTxPrepare(xid);

    if (prepare == null)
      throw new StateException("Unknown transaction identifier.");

    Vector sendings = prepare.getSendings();
    Vector acks = prepare.getAcks();

    ProducerMessages pM;
View Full Code Here

        try {
          txs.remove();
          activeCtx.registerTxPrepare(xid, (XACnxPrepare) txEntry.getValue());
        }
        catch (Exception exc) {
          throw new StateException("Recovered transaction branch has already been prepared by the RM.");
        }
      }
    }
    recoveredTransactions = null;
    doReply(new XACnxRecoverReply(req, bqs, fis, gtis));
View Full Code Here

   */
  private void setCtx(int key) throws StateException {
    if (logger.isLoggable(BasicLevel.DEBUG))
      logger.log(BasicLevel.DEBUG, "UserAgent.setCtx(" + key + ')');

    if (key < 0) throw new StateException("Invalid context: " + key);

    // If the required context is the last used, no need to update the
    // references:
    if (key == activeCtxId) return;

    // Else, updating the activeCtx reference:
    setActiveCtxId(key);
    activeCtx = (ClientContext) contexts.get(new Integer(key));

    // If context not found, throwing an exception:
    if (activeCtx == null) {
      setActiveCtxId(-1);
      activeCtx = null;
      throw new StateException("Context " + key + " is closed or broken.");
    }
  }
View Full Code Here

TOP

Related Classes of org.objectweb.joram.shared.excepts.StateException

Copyright © 2018 www.massapicom. 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.