Package org.objectweb.joram.client.jms

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


    System.out.println();
    System.out.println("Classic administration...");

    AdminModule.connect("root", "root", 60);

    Queue queue = Queue.create("queue");
    Topic topic = Topic.create("topic");
   
    User.create("anonymous", "anonymous");

    queue.setFreeReading();
    topic.setFreeReading();
    queue.setFreeWriting();
    topic.setFreeWriting();

    javax.jms.ConnectionFactory cf =
      TcpConnectionFactory.create("localhost", 16010);
    javax.jms.QueueConnectionFactory qcf =
View Full Code Here


    String host = args[6];
    int port = new Integer(args[7]).intValue();

    AdminModule.connect(host, port, "root", "root", 60);

    Queue queue = Queue.create(
      id,
      null,
      "org.objectweb.joram.mom.dest.ClusterQueue",
      prop);
   
View Full Code Here

  public static void main(String[] args) throws Exception {
    Session session = null;
    Connection cnx = null;
    MessageProducer  producer = null;
    TextMessage message = null;
    Queue queue = null;
    ConnectionFactory cf = null;

    Context initialContext = new InitialContext();
    cf = (ConnectionFactory) initialContext.lookup("cf");
    queue = (Queue) initialContext.lookup("queue");
View Full Code Here

          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 + ")");
          Queue queue = (Queue) getWrapper().createQueue(serverId, name, className, properties);
          properties = null;

          configureDestination(queue);

          if (threshold > 0)
            queue.setThreshold(threshold);

          if (nbMaxMsg > 0)
            queue.setNbMaxMsg(nbMaxMsg);

          // Bind the queue in JNDI.
          // Be Careful, currently only one binding is handled.
          if (isSet(jndiName))
            toBind.put(jndiName, queue);
          jndiName = null;
          // Register the queue in order to handle it later (cluster, etc.)
          String name = queue.getAdminName();
          if (! isSet(name)) name = queue.getName();
          queues.put(name, queue);
          // Fix DMQ if any
          setDestinationDMQ(queue, dmq);
        } else if (rawName.equals(ELT_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 + ")");
          Topic topic = (Topic) getWrapper().createTopic(serverId, name, className, properties);
          properties = null;

          configureDestination(topic);

          if (isSet(parent)) {
            // TODO (AF): may be we should search the parent topic: JNDI? Joram?
            if (topics.containsKey(parent)) {
              topic.setParent((Topic) topics.get(parent));
            } else {
              logger.log(BasicLevel.ERROR,
                   "Topic.create(): Unknown parent: " + parent);
            }
          }
          // Bind the topic in JNDI.
          // Be Careful, currently only one binding is handled.
          if (isSet(jndiName))
            toBind.put(jndiName, topic);
          jndiName = null;
          // Register the topic in order to handle it later (cluster, etc.)
          String name = topic.getAdminName();
          if (! isSet(name)) name = topic.getName();
          topics.put(name, topic);
          // Fix DMQ if any
          setDestinationDMQ(topic, dmq);
        } else if (rawName.equals(ELT_DMQUEUE)) {
          className = "org.objectweb.joram.mom.dest.Queue";
          if (logger.isLoggable(BasicLevel.DEBUG))
            logger.log(BasicLevel.DEBUG,
                       "DeadMQueue.create(" + serverId + "," + name + ")");

          DeadMQueue dmq = (DeadMQueue) getWrapper().createDeadMQueue(serverId, name);

          configureDestination(dmq);

          // Bind the destination in JNDI.
          // Be Careful, currently only one binding is handled.
          if (isSet(jndiName))
            toBind.put(jndiName, dmq);
          jndiName = null;
          // Register the DMQ in order to handle it later.
          if (isSet(name))
            dmqs.put(name, dmq);
        } else if (rawName.equals(ELT_PROPERTY)) {
        } else if (rawName.equals(ELT_READER)) {
          readers.add(user);
        } else if (rawName.equals(ELT_WRITER)) {
          writers.add(user);
        } else if (rawName.equals(ELT_FREEREADER)) {
        } else if (rawName.equals(ELT_FREEWRITER)) {
        } else if (rawName.equals(ELT_INITIALCONTEXT)) {
          try {
            jndiCtx = new javax.naming.InitialContext(properties);
          } catch (NamingException exc) {
            logger.log(BasicLevel.ERROR,"",exc);
          }
        } else if (rawName.equals(ELT_CLUSTER_ELEMENT)) {
        } else if (rawName.equals(ELT_CLUSTER_CF)) {
          Map.Entry entries[] = new Map.Entry [cluster.size()];
          cluster.entrySet().toArray(entries);
          ClusterConnectionFactory clusterCF = new ClusterConnectionFactory();

          for (int i=0; i<entries.length; i++) {
            ConnectionFactory cf = (ConnectionFactory) cfs.get(entries[i].getKey());
            clusterCF.addConnectionFactory((String) entries[i].getValue(), cf);
          }
          cluster.clear();

          // Bind the destination in JNDI.
          // Be Careful, currently only one binding is handled.
          if (isSet(jndiName))
            toBind.put(jndiName, clusterCF);
          jndiName = null;
        } else if (rawName.equals(ELT_CLUSTER_QUEUE)) {
          Map.Entry entries[] = new Map.Entry [cluster.size()];
          cluster.entrySet().toArray(entries);
          ClusterQueue clusterQueue = new ClusterQueue();
          clusterQueue.setWrapper(getWrapper());

          Queue root = null;
          for (int i=0; i<entries.length; i++) {
            Queue queue = (Queue) queues.get(entries[i].getKey());
            clusterQueue.addDestination((String) entries[i].getValue(), queue);
            if (i == 0)
              root = queue;
            else
              root.addClusteredQueue(queue);
View Full Code Here

   * @exception ConnectException  If the administration connection is closed or broken.
   * @exception AdminException  If the request fails.
   */
  public Queue getDMQ() throws ConnectException, AdminException {
    String dmqId = getDMQId();
    Queue dmq = null;
    if (dmqId != null) {
      dmq = new Queue(dmqId);
      if (wrapper != null)
        dmq.setWrapper(wrapper);
    }
    return dmq;
  }
View Full Code Here

      System.out.println("or        : FtpAdmin <user> <pass> <path>");
    }
   
    AdminModule.connect("root", "root", 60);

    Queue queue = Queue.create(0, "ftpQueue", "com.scalagent.joram.mom.dest.ftp.FtpQueue", prop);
   
    javax.jms.ConnectionFactory cf =
      TcpConnectionFactory.create("localhost", 16010);

    User.create("anonymous", "anonymous", 0);

    queue.setFreeReading();
    queue.setFreeWriting();

    javax.naming.Context jndiCtx = new javax.naming.InitialContext();
    jndiCtx.bind("cf", cf);
    jndiCtx.bind("ftpQueue", queue);
    jndiCtx.close();
View Full Code Here

        "localhost", 8080, 60);
    soapCf.getParameters().connectingTimer = 60;

    AdminModule.connect(soapCf, "root", "root");

    Queue queue = Queue.create(0);

    User.create("anonymous", "anonymous", 1);

    queue.setFreeReading();
    queue.setFreeWriting();

    AdminModule.disconnect();

    javax.naming.Context jndiCtx = new javax.naming.InitialContext();
    jndiCtx.bind("soapCf", soapCf);
View Full Code Here

    // Creating access for user anonymous on servers 0 and 2:
    User.create("anonymous", "anonymous", 0);
    User.create("anonymous", "anonymous", 2);

    // Creating the destinations on server 1:
    Queue queue = Queue.create(1);
    Topic topic = Topic.create(1);

    // Setting free access to the destinations:
    queue.setFreeReading();
    topic.setFreeReading();
    queue.setFreeWriting();
    topic.setFreeWriting();

    // Creating the connection factories for connecting to the servers 0 and 2:
    javax.jms.ConnectionFactory cf0 =
      TcpConnectionFactory.create("localhost", 16010);
View Full Code Here

        "localhost", 16010,
        "root", "root", 60,
        "org.objectweb.joram.client.jms.tcp.ReliableTcpClient",
        "org.objectweb.joram.shared.security.jaas.JonasIdentity");

    Queue queue = Queue.create("queue");
    Topic topic = Topic.create("topic");
   
    User user = User.create("anonymous", null, 0, "org.objectweb.joram.shared.security.jaas.JonasIdentity");

    queue.setReader(user);
    topic.setReader(user);
    queue.setWriter(user);
    topic.setWriter(user);

    javax.jms.ConnectionFactory cf =
      TcpConnectionFactory.create("localhost", 16010);
    ((org.objectweb.joram.client.jms.admin.AbstractConnectionFactory) cf).setIdentityClassName("org.objectweb.joram.shared.security.jaas.JonasIdentity");
View Full Code Here

    // Create a queue getting its messages from the configured email address.
    prop = new Properties();
    prop.load(new FileInputStream("pop.properties"));
    prop.put("acquisition.className", "com.scalagent.joram.mom.dest.mail.MailAcquisition");
    Queue queue = Queue.create(0, null, Destination.ACQUISITION_QUEUE, prop);

    javax.jms.ConnectionFactory cf = TcpConnectionFactory.create("localhost", 16010);

    User.create("anonymous", "anonymous", 0);

    topic.setFreeWriting();

    queue.setFreeReading();

    javax.naming.Context jndiCtx = new javax.naming.InitialContext();
    jndiCtx.bind("cf", cf);
    jndiCtx.bind("receiveMailQueue", queue);
    jndiCtx.bind("sendMailTopic", topic);
View Full Code Here

TOP

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

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.