Package org.objectweb.joram.shared.excepts

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


      if (properties != null) {
        acquisitionClassName = properties.getProperty(AcquisitionModule.CLASS_NAME);
        properties.remove(AcquisitionModule.CLASS_NAME);
      }
      if (acquisitionClassName == null) {
        throw new RequestException("Acquisition class name not found: " + AcquisitionModule.CLASS_NAME
            + " property must be set on queue creation.");
      }
      try {
        AcquisitionModule.checkAcquisitionClass(acquisitionClassName);
      } catch (Exception exc) {
        logger.log(BasicLevel.ERROR, "AcquisitionQueue: error with acquisition class.", exc);
        throw new RequestException(exc.getMessage());
      }
    } else {
      acquisitionModule.setProperties(properties);
    }
  }
View Full Code Here


      if (properties != null) {
        distributionClassName = properties.getProperty(DistributionModule.CLASS_NAME);
        properties.remove(DistributionModule.CLASS_NAME);
      }
      if (distributionClassName == null) {
        throw new RequestException("Distribution class name not found: " + DistributionModule.CLASS_NAME
            + " property must be set on queue creation.");
      }

      // Check the existence of the distribution class and the presence of a no-arg constructor.
      try {
        String className = distributionClassName;
        Class.forName(className).getConstructor();
      } catch (Exception exc) {
        logger.log(BasicLevel.ERROR, "DistributionQueue: error with distribution class.", exc);
        throw new RequestException(exc.getMessage());
      }
    } else {
      distributionModule.setProperties(properties);
    }
  }
View Full Code Here

    }
  }

  protected void processSetRight(AgentId user, int right) throws RequestException {
    if (right == READ) {
      throw new RequestException("A distribution queue can't be set readable.");
    }
    super.processSetRight(user, right);
  }
View Full Code Here

      if (properties != null) {
        acquisitionClassName = properties.getProperty(AcquisitionModule.CLASS_NAME);
        properties.remove(AcquisitionModule.CLASS_NAME);
      }
      if (acquisitionClassName == null) {
        throw new RequestException("Acquisition class name not found: " + AcquisitionModule.CLASS_NAME
            + " property must be set on topic creation.");
      }
      try {
        AcquisitionModule.checkAcquisitionClass(acquisitionClassName);
      } catch (Exception exc) {
        logger.log(BasicLevel.ERROR, "AcquisitionTopic: error with acquisition class.", exc);
        throw new RequestException(exc.getMessage());
      }
    }

    if (!firstTime) {
      acquisitionModule.setProperties(properties);
View Full Code Here

      if (properties != null) {
        distributionClassName = properties.getProperty(DistributionModule.CLASS_NAME);
        properties.remove(DistributionModule.CLASS_NAME);
      }
      if (distributionClassName == null) {
        throw new RequestException("Distribution class name not found: " + DistributionModule.CLASS_NAME
            + " property must be set on queue creation.");
      }

      // Check the existence of the distribution class and the presence of a no-arg constructor.
      try {
        String className = distributionClassName;
        Class.forName(className).getConstructor();
      } catch (Exception exc) {
        logger.log(BasicLevel.ERROR, "DistributionQueue: error with distribution class.", exc);
        throw new RequestException(exc.getMessage());
      }
    } else {
      distributionModule.setProperties(properties);
    }
  }
View Full Code Here

      else if (right == -READ)
        freeReading = false;
      else if (right == -WRITE)
        freeWriting = false;
      else
        throw new RequestException("Invalid right value: " + right);
    } else {
      // Setting a specific user right:
      Integer currentRight = (Integer) clients.get(user);
      if (right == READ) {
        if (currentRight != null && currentRight.intValue() == WRITE)
          clients.put(user, new Integer(READWRITE));
        else
          clients.put(user, new Integer(READ));
      } else if (right == WRITE) {
        if (currentRight != null && currentRight.intValue() == READ)
          clients.put(user, new Integer(READWRITE));
        else
          clients.put(user, new Integer(WRITE));
      } else if (right == -READ) {
        if (currentRight != null && currentRight.intValue() == READWRITE)
          clients.put(user, new Integer(WRITE));
        else if (currentRight != null && currentRight.intValue() == READ)
          clients.remove(user);
      } else if (right == -WRITE) {
        if (currentRight != null && currentRight.intValue() == READWRITE)
          clients.put(user, new Integer(READ));
        else if (currentRight != null && currentRight.intValue() == WRITE)
          clients.remove(user);
      } else
        throw new RequestException("Invalid right value: " + right);
    }
  }
View Full Code Here

    if (logger.isLoggable(BasicLevel.DEBUG))
      logger.log(BasicLevel.DEBUG, "UserAgent.reactToClientRequest(" + key + ',' + req + ')');

    AgentId destId = AgentId.fromString(req.getTarget());
    if (destId == null)
      throw new RequestException("Request to an undefined destination (null).");

    ProducerMessages pm = req;
    if (interceptorsIN != null && !interceptorsIN.isEmpty()) {
      org.objectweb.joram.shared.messages.Message m = null;
      Vector msgs = ((ProducerMessages) req).getMessages();
View Full Code Here

    if (req.getQueueMode()) {
      ReceiveRequest not = new ReceiveRequest(key, req.getRequestId(), req.getSelector(),
          req.getTimeToLive(), req.getReceiveAck(), null, 1);
      AgentId destId = AgentId.fromString(req.getTarget());
      if (destId == null)
        throw new RequestException("Request to an undefined destination (null).");

      if (destId.getTo() == getId().getTo()) {
        if (logger.isLoggable(BasicLevel.DEBUG))
          logger.log(BasicLevel.DEBUG, " -> local receiving");
        not.setPersistent(false);
View Full Code Here

                                              false,
                                              req.getMessageIdsToAck(),
                                              req.getMessageCount());   
      AgentId destId = AgentId.fromString(req.getTarget());
      if (destId == null)
        throw new RequestException("Request to an undefined destination (null).");

      if (destId.getTo() == getId().getTo()) {
        if (logger.isLoggable(BasicLevel.DEBUG))
          logger.log(BasicLevel.DEBUG, " -> local sending");
        not.setPersistent(false);
View Full Code Here

   * @throws RequestException Undefined (null) destination
   */
  private void reactToClientRequest(int key, QBrowseRequest req) throws RequestException {
    AgentId destId = AgentId.fromString(req.getTarget());
    if (destId == null)
      throw new RequestException("Request to an undefined destination (null).");
   
    sendNot(destId, new BrowseRequest(key, req.getRequestId(), req.getSelector()));
  }
View Full Code Here

TOP

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

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.