Package org.objectweb.joram.mom.dest.AdminTopic

Examples of org.objectweb.joram.mom.dest.AdminTopic.DestinationDesc


      byte type,
      Properties properties,
      boolean freerw) throws Exception {
    AgentId destId = null;
    StringBuffer strbuf = new StringBuffer();
    DestinationDesc destDesc = null;

    try {
      destDesc = AdminTopic.createDestinationAndSave(destName, adminId, properties,
                                                     type, destClassName,
                                                     "JoramHelper", strbuf);
    } catch (Exception exc) {
      logger.log(BasicLevel.ERROR, "JoramHelper.createDestination, Cannot create destination " + destName, exc);
      throw exc;
    }
   
    destId = destDesc.getId();
    if (logger.isLoggable(BasicLevel.DEBUG))
      logger.log(BasicLevel.DEBUG, "JoramHelper.createDestination info = " + strbuf.toString());
    strbuf.setLength(0);    

    if (freerw) {
View Full Code Here


   */
  private void doReact(SessCreateDestRequest req) throws RequestException {
    AgentId destId = null;

    // Verify if the destination exists
    DestinationDesc desc = AdminTopic.lookupDest(req.getName(), req.getType());
    if (desc == null) {
      Destination dest = null;
      if (DestinationConstants.isQueue(req.getType())) {
        // Create a local queue.
        dest = new Queue();
      } else if (DestinationConstants.isTopic(req.getType())) {
        // Create a local topic.
        dest = new Topic();
      } else {
        throw new RequestException("Could not create destination, unknown type:" + req.getType());
      }
      dest.setName(req.getName());
      dest.setAdminId(getId());
      dest.setFreeWriting(true); // Setting free WRITE right on the destination
      if (! DestinationConstants.isTemporary(req.getType()))
        dest.setFreeReading(true); // Setting free READ right on the destination
      destId = dest.getId();
      try {
        dest.deploy();
      } catch (IOException exc) {
        throw new RequestException("Could not create destination:" + exc.getMessage());
      }
      // Registers the newly created destination
      AdminTopic.registerDest(destId, (req.getName() == null) ? destId.toString() : req.getName(),
          req.getType());

      if (DestinationConstants.isTemporary(req.getType())) {
        // Registers the temporary destination in order to clean it at the end of the connection
        activeCtx.addTemporaryDestination(destId);
      }

      if (logger.isLoggable(BasicLevel.DEBUG))
        logger.log(BasicLevel.DEBUG, "UserAgent, new destination created: " + destId);
    } else {
      destId = desc.getId();
    }

    SessCreateDestReply reply = new SessCreateDestReply(req, destId.toString());
    sendNot(getId(), new SyncReply(activeCtxId, reply));
  }
View Full Code Here

TOP

Related Classes of org.objectweb.joram.mom.dest.AdminTopic.DestinationDesc

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.