Package org.objectweb.joram.client.jms

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


      catch (AdminException e){
    throw new HermesException(e);
      }
  }else {

      Topic topic = (Topic) getHermes().getSession().createTopic(dConfig.getName());
      try{
    checkConnected();
     
    rval.put("Name", topic.getName());
    rval.put("AdminName", topic.getAdminName());
    rval.put("number of subscription",topic.getSubscriptions());

    String[] ids = topic.getSubscriberIds();
    for(int i=0;i< ids.length;i++){
        User u = new User("user"+i,ids[i]);
        final Subscription[] subs = u.getSubscriptions() ;
        for (int j = 0 ; j < subs.length ; j++) {
      rval.put("subscriber "+j,ids[i]+" : "+subs[j].getName()+"; Durable:"+subs[j].isDurable());
View Full Code Here


      if (dConfig.getDomain() == Domain.QUEUE.getId()){
    Queue queue = (Queue) getHermes().getSession().createQueue(dConfig.getName());
    fin = queue.getPendingMessages();
    queue.clear();
      }else{
    Topic topic = (Topic) getHermes().getSession().createTopic(dConfig.getName());
 
    String[] ids = topic.getSubscriberIds();
    for(int i=0;i< ids.length && fin == 0 ;i++){
        if(dConfig.getShortName() !=null && (dConfig.getShortName()).equals(ids[i])){
      User u = new User("user"+i,ids[i]);
      final Subscription[] subs = u.getSubscriptions() ;
      for (int j = 0 ; j < subs.length && fin == 0 ; j++) {
View Full Code Here

    Queue queue = (Queue) getHermes().getSession().createQueue(dConfig.getName());
    for (Iterator iter = messageIds.iterator(); iter.hasNext();) {
        queue.deleteMessage((String)iter.next());
    }
      }else if ( dConfig.isDurable()){
    Topic topic = (Topic) getHermes().getSession().createTopic(dConfig.getName());
    int fin =0;
    String[] ids = topic.getSubscriberIds();
    for(int i=0;i< ids.length && fin == 0 ;i++){
        if(dConfig.getShortName() !=null && (dConfig.getShortName()).equals(ids[i])){
      User u = new User("user"+i,ids[i]);
      final Subscription[] subs = u.getSubscriptions() ;
      for (int j = 0 ; j < subs.length && fin == 0 ; j++) {
View Full Code Here

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

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

    Topic news = Topic.create(0);
    Topic business = Topic.create(0);
    Topic sports = Topic.create(0);
    Topic tennis = Topic.create(0);

    business.setParent(news);
    sports.setParent(news);
    tennis.setParent(sports);

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

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

    news.setFreeReading();
    news.setFreeWriting();
    business.setFreeReading();
    business.setFreeWriting();
    sports.setFreeReading();
    sports.setFreeWriting();
    tennis.setFreeReading();
    tennis.setFreeWriting();

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

    Queue queue = Queue.create("queue");
    queue.setFreeReading();
    queue.setFreeWriting();
   
    Topic topic = Topic.create("topic");
    topic.setFreeReading();
    topic.setFreeWriting();

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

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

    prop.setProperty("connectionFactoryName", "cf"); // Foreign QueueConnectionFactory JNDI name
    prop.setProperty("destinationName", "topic"); // Foreign Queue JNDI name: foreignDest
    prop.setProperty("acquisition.className", "org.objectweb.joram.mom.dest.jms.JMSAcquisition");

    // Creating a Topic bridge on server 0:
    Topic bridgeTopic = Topic.create(1, Topic.ACQUISITION_TOPIC, prop);
    bridgeTopic.setFreeReading();
    bridgeTopic.setFreeWriting();
    System.out.println("joram topic = " + bridgeTopic);
   
    // bind foreign destination and connectionFactory
    javax.naming.Context jndiCtx = new javax.naming.InitialContext();
    jndiCtx.rebind("bridgeQueue", bridgeQueue);
View Full Code Here

TOP

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

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.