Package org.objectweb.joram.client.jms

Examples of org.objectweb.joram.client.jms.Destination


  }

  /** return the appropriate destination of cluster */
  protected Destination getDestination() {
    if ((cluster != null) && ! cluster.isEmpty()) {
      Destination dest = null;
      String location = System.getProperty("location");
      if (location == null || location.equals("")) {
        int idx = new Random().nextInt(cluster.size());

        Object key[] = cluster.keySet().toArray();
View Full Code Here


    return getDestination().getType();
  }

  public void setReader(User user) throws ConnectException, AdminException {
    for (Enumeration dests = cluster.elements(); dests.hasMoreElements();) {
      Destination dest = (Destination) dests.nextElement();
      getWrapper().doRequest(new SetReader(user.getProxyId(), dest.getName()));
    }
  }
View Full Code Here

    }
  }

  public void setWriter(User user) throws ConnectException, AdminException {
    for (Enumeration dests = cluster.elements(); dests.hasMoreElements();) {
      Destination dest = (Destination) dests.nextElement();
      getWrapper().doRequest(new SetWriter(user.getProxyId(), dest.getName()));
    }
  }
View Full Code Here

    }
  }
 
  public void setFreeReading() throws ConnectException, AdminException {
    for (Enumeration dests = cluster.elements(); dests.hasMoreElements();) {
      Destination dest = (Destination) dests.nextElement();
      getWrapper().doRequest(new SetReader(null, dest.getName()));
    }
  }
View Full Code Here

    }
  }

  public void setFreeWriting() throws ConnectException, AdminException {
    for (Enumeration dests = cluster.elements(); dests.hasMoreElements();) {
      Destination dest = (Destination) dests.nextElement();
      getWrapper().doRequest(new SetWriter(null, dest.getName()));
    }
  }
View Full Code Here

    for (int i=0; i<entries.length; i++) {
      strbuf.setLength(0);
      strbuf.append("cluster#").append(i).append(".key");
      ref.add(new StringRefAddr(strbuf.toString(),
                                (String) entries[i].getKey()));
      Destination dest = (Destination) entries[i].getValue();

      strbuf.setLength(0);
      strbuf.append("cluster#").append(i).append(".destName");
      ref.add(new StringRefAddr(strbuf.toString(), dest.getName()));
    }
  }
View Full Code Here

  /** Restores the administered object from a naming reference. */
  public void fromReference(Reference ref) throws NamingException {
    cluster = new Hashtable();
    int i = 0;
    Destination dest = null;
    StringBuffer strbuf = new StringBuffer(20);

    while (true) {
      strbuf.setLength(0);
      strbuf.append("cluster#").append(i).append(".key");
View Full Code Here

    for (int i=0; i<entries.length; i++) {
      strbuf.setLength(0);
      strbuf.append("cluster#").append(i).append(".key");
      h.put(strbuf.toString(), (String) entries[i].getKey());

      Destination dest = (Destination) entries[i].getValue();

      strbuf.setLength(0);
      strbuf.append("cluster#").append(i).append(".destName");
      h.put(strbuf.toString(), dest.getName());
    }

    return h;
  }
View Full Code Here

  public void decode(Hashtable h) {
    cluster = new Hashtable();

    int i = 0;
    Destination dest = null;
    StringBuffer strbuf = new StringBuffer(20);

    while (true) {
      strbuf.setLength(0);
      strbuf.append("cluster#").append(i).append(".key");
View Full Code Here

                         "User.create(), unknown DMQ: " + dmq);
            }
          }
          properties = null;
        } else if (rawName.equals(ELT_DESTINATION)) {
          Destination dest = null;
          if (logger.isLoggable(BasicLevel.DEBUG))
            logger.log(BasicLevel.DEBUG, "dest type =" + type);

          if (type.equals("queue")) {
            if (className == null)
              className = "org.objectweb.joram.mom.dest.Queue";
           
            if (logger.isLoggable(BasicLevel.DEBUG))
              logger.log(BasicLevel.DEBUG,
                         "Queue.create(" + serverId + "," + name + "," + className + "," + properties + ")");
           
            dest = getWrapper().createQueue(serverId, name, className, properties);
          } else if (type.equals("topic")) {
            if (className == null)
              className = "org.objectweb.joram.mom.dest.Topic";
           
            if (logger.isLoggable(BasicLevel.DEBUG))
              logger.log(BasicLevel.DEBUG,
                         "Topic.create(" + serverId + "," + name + "," + className + "," + properties + ")");
           
            dest = getWrapper().createTopic(serverId, name, className, properties);
          } else
            throw new Exception("type " + type + " bad value. (queue or topic)");

          if (logger.isLoggable(BasicLevel.DEBUG))
            logger.log(BasicLevel.DEBUG, "destination = " + dest);

          properties = null;

          configureDestination(dest);

          // Bind the destination in JNDI.
          // Be Careful, currently only one binding is handled.
          if (isSet(jndiName))
            toBind.put(jndiName, dest);
          jndiName = null;
          // Register the destination in order to handle it later.
          String name = dest.getAdminName();
          if (! isSet(name))
            name = dest.getName();
          if (dest instanceof Queue) {
            queues.put(name, dest);
          } else {
            // It's a Topic
            topics.put(name, dest);
View Full Code Here

TOP

Related Classes of org.objectweb.joram.client.jms.Destination

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.