Examples of Topic


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

    topicProps.put("Joram#0:type=Destination,name=queue",
                   "NbMsgsDeliverSinceCreation,NbMsgsReceiveSinceCreation,PendingMessageCount,NbMsgsSentToDMQSinceCreation");
    topicProps.put("Joram#0:type=Destination,name=topic",
                   "NbMsgsDeliverSinceCreation,NbMsgsReceiveSinceCreation,NbMsgsSentToDMQSinceCreation");
   
    Topic mTopic = Topic.create(0, "MonitoringTopic", Topic.ACQUISITION_TOPIC, topicProps);
    mTopic.setFreeReading();
    mTopic.setFreeWriting();
    jndiCtx.bind("MonitoringTopic", mTopic);
   
    Properties queueProps = new Properties();
    queueProps.put("acquisition.className", "org.objectweb.joram.mom.dest.MonitoringAcquisition");
    Queue mQueue = Queue.create(0, "MonitoringQueue", Queue.ACQUISITION_QUEUE, queueProps);
View Full Code Here

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

      HATcpConnectionFactory.create("hajoram://localhost:2560,localhost:2561,localhost:2562");
    ((HATcpConnectionFactory) tcf).getParameters().connectingTimer = 30;
   
    AdminModule.connect(tcf, "root", "root");

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

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

    AdminModule.disconnect();
    System.out.println("Admin closed.");
  }
View Full Code Here

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

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

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

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

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

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

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

                                 String className,
                                 Properties prop) throws ConnectException, AdminException {
    CreateDestinationRequest cdr = new CreateDestinationRequest(serverId, name, className, prop, Topic.TOPIC_TYPE);
    CreateDestinationReply reply = (CreateDestinationReply) doRequest(cdr);
   
    Topic topic = Topic.createTopic(reply.getId(), name);

    if (AdminModule.wrapper != this)
      topic.setWrapper(this);

    return topic;
  }
View Full Code Here

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

    clusterCF.addConnectionFactory("server0", cf0);
    clusterCF.addConnectionFactory("server1", cf1);
    clusterCF.addConnectionFactory("server2", cf2);
    ictx.rebind("clusterCF", clusterCF);

    Topic topic0 = Topic.create(0);
    Topic topic1 = Topic.create(1);
    Topic topic2 = Topic.create(2);
   
    System.out.println("topic0 = " + topic0);
    System.out.println("topic1 = " + topic1);
    System.out.println("topic2 = " + topic2);
View Full Code Here

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

    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 =
      QueueTcpConnectionFactory.create("localhost", 16010);
View Full Code Here

Examples of org.objectweb.joram.client.jms.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);
          }
          cluster.clear();

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

          Topic root = null;
          for (int i=0; i<entries.length; i++) {
            Topic topic = (Topic) topics.get(entries[i].getKey());
            clusterTopic.addDestination((String) entries[i].getValue(), topic);
            if (i == 0)
              root = topic;
            else
              root.addClusteredTopic(topic);
View Full Code Here

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

    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);
    javax.jms.ConnectionFactory cf2 =
View Full Code Here

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

        "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");
    javax.jms.QueueConnectionFactory qcf =
View Full Code Here

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

    // Create a topic forwarding its messages to the configured email address.
    Properties prop = new Properties();
    prop.load(new FileInputStream("smtp.properties"));
    prop.put("distribution.className", "com.scalagent.joram.mom.dest.mail.MailDistribution");
    Topic topic = Topic.create(0, null, Destination.DISTRIBUTION_TOPIC, prop);

    // 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);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.