Package hermes.config

Examples of hermes.config.DestinationConfig


    }

   
    private DestinationConfig createDestinationConfig(Hashtable info, Domain domain)
    {
      DestinationConfig dConfig = new DestinationConfig();
      String name = (String) info.get(NAME);
     
      dConfig.setName(name);
        dConfig.setDomain(domain.getId());
       
      return dConfig ;
    }
View Full Code Here


        String queueName = queue.toString();
        if (queueName.startsWith("STCMS.") || queueName.startsWith("STCTemporary.")) {
          continue;
        }
        log.debug("Adding queue " + queueName);
        DestinationConfig dConfig = HermesBrowser.getConfigDAO().createDestinationConfig();
        dConfig.setDomain(Domain.QUEUE.getId());
        dConfig.setName(queueName);
        rval.add(dConfig);
      }
    log.info("Adding destination queues.");
    if (addTopics)
      for (Object topic : seeBeyondAdmin.getTopics()) {
        String topicName = topic.toString();
        if (topicName.startsWith("STCMS.") || topicName.startsWith("STCTemporary.")) {
          continue;
        }
        log.debug("Adding topic " + topicName);
        DestinationConfig dConfig = HermesBrowser.getConfigDAO().createDestinationConfig();
        dConfig.setDomain(Domain.TOPIC.getId());
        dConfig.setName(topicName);
        rval.add(dConfig);
        log.debug("Fetching durable subscriptions for topic " + topicName);
        rval.addAll(discoverDurableSubscriptions(topicName, null));
      }
    return rval;
View Full Code Here

    List subscribers = seeBeyondAdmin.getSubscribers(topicName);
    log.debug("Durable subscriptions for " + topicName + " are " + subscribers);
    for (final Object subscriber : subscribers) {
      Properties subscriberProps = (Properties) subscriber;

      final DestinationConfig dConfig = HermesBrowser.getConfigDAO().createDestinationConfig();

      dConfig.setClientID(subscriberProps.getProperty("SUBSCRIBER_NAME"));
      dConfig.setName(jndiName == null ? "topics/" + topicName : jndiName);
      dConfig.setDomain(Domain.TOPIC.getId());
      dConfig.setSelector(null);// Not Available
      dConfig.setDurable(true);

      rval.add(dConfig);

    }
    return rval;
View Full Code Here

  public Collection getStatistics(Collection destinations) throws JMSException {
    List rval = new ArrayList();

    for (Iterator iter = destinations.iterator(); iter.hasNext();) {
      DestinationConfig d = (DestinationConfig) iter.next();
      rval.add(getStatistics(d));
    }

    return rval;
  }
View Full Code Here

      for (final NamingEnumeration iter = ctx.list(""); iter.hasMore();) {
        final NameClassPair entry = (NameClassPair) iter.next();

        try {
          final Object object = ctx.lookup(entry.getName());
          DestinationConfig config = null;

          if (object instanceof Destination) {
            final Domain domain = Domain.getDomain((Destination) object);

            if (domain == Domain.QUEUE) {
              config = HermesBrowser.getConfigDAO().createDestinationConfig();
              config.setDomain(Domain.QUEUE.getId());
            } else if (domain == Domain.TOPIC) {
              config = HermesBrowser.getConfigDAO().createDestinationConfig();
              config.setDomain(Domain.TOPIC.getId());

              rval.addAll(discoverDurableSubscriptions(JMSUtils.getDestinationName((Topic) object), path == null ? entry.getName() : path + "/" + entry.getName()));

            } else {
              config = HermesBrowser.getConfigDAO().createDestinationConfig();
              config.setDomain(Domain.UNKNOWN.getId());
            }
          } else if (object instanceof Context) {
            String ctxPath;

            if (path == null) {
              ctxPath = entry.getName();
            } else {
              ctxPath = path + "/" + entry.getName();
            }

            discoverDestinationConfigsFromContext(ctxPath, (Context) object, rval, visited);
          }

          if (config != null) {
            String binding = null;

            if (path == null) {
              binding = entry.getName();
            } else {
              binding = path + "/" + entry.getName();
            }

            config.setName(binding);
            rval.add(config);
          }
        } catch (Throwable ex) {
          log.error("discoverDestinationConfig binding=" + entry.getName() + ": " + ex.getMessage(), ex);
        }
View Full Code Here

         final Collection<DestinationConfig> rval = new ArrayList<DestinationConfig>();

         for (final Object o : durables)
         {
            final String durableName = (String) o;
            final DestinationConfig dConfig = HermesBrowser.getConfigDAO().createDestinationConfig();

            dConfig.setClientID(durableName);
            dConfig.setName(jndiName == null ? topicName : jndiName);
            dConfig.setDomain(Domain.TOPIC.getId());
            dConfig.setDurable(true);

            rval.add(dConfig);
         }

         return rval;
View Full Code Here

  checkConnected();
  final Collection rval = new ArrayList();
  try{
      for (Destination d : AdminModule.getDestinations())
    {
        final DestinationConfig dConfig = new DestinationConfig();
       
        dConfig.setName(d.getName());
        dConfig.setShortName(d.getAdminName());
      
        if (d.getType() == Destination.QUEUE_TYPE){
      dConfig.setDomain(Domain.QUEUE.getId());
      rval.add(dConfig);
        else if(d.getType()==Destination.TOPIC_TYPE){
      dConfig.setDomain(Domain.TOPIC.getId());
      rval.add(dConfig);
      rval.addAll(discoverDurableSubscriptions(dConfig.getName(),dConfig.getName()));
        }      
    }
  }
  catch (Exception ex){
      throw new HermesException(ex) ;
View Full Code Here

    if(u.getName() != factory.getUsername()){
        final Subscription[] subs = u.getSubscriptions() ;
           
        for (int i = 0 ; i < subs.length ; i++) {
      if (subs[i].getTopicId().equals(topicName)) {
          DestinationConfig dConfig = HermesBrowser.getConfigDAO().createDestinationConfig() ;
                 
          dConfig.setName(jndiName) ;
          dConfig.setShortName(u.getProxyId()) ;
          dConfig.setDurable(true) ;
          dConfig.setClientID(subs[i].getName()) ;
          dConfig.setDomain(Domain.TOPIC.getId()) ;
                 
          rval.add(dConfig) ;
      }
        }           
    }
View Full Code Here

         consumer = (MessageConsumer) map.get(d);
      
      }
      else
      {
         final DestinationConfig dConfig = getDestinationConfig(d);
         Domain domain;

         if (dConfig != null)
         {
            domain = Domain.getDomain(dConfig.getDomain());
         }
         else
         {
            domain = Domain.getDomain(d);
         }

         if (domain == Domain.QUEUE)
         {
            try
            {
               if (selector == null)
               {
                  consumer = getSession().createConsumer(d);
               }
               else
               {
                  consumer = getSession().createConsumer(d, selector, true);
               }
            }
            catch (NoSuchMethodError ex)
            {
               log.debug("JMS 1.1 interface failed, trying 1.0.2b");
            }
            catch (AbstractMethodError ex)
            {
               log.debug("JMS 1.1 interface failed, trying 1.0.2b");
            }
            catch (JMSException t)
            {
               //
               // WebSphereMQ hack, it does not correctly support JMS 1.1

               if (d.getClass().getName().equals("com.ibm.mq.jms.MQQueue"))
               {
                  log.debug("createConsumer() failed with WMQ via JMS 1.1 call, falling back to 1.0.2b call") ;
               }
               else
               {
                  throw t;
               }
            }

            if (consumer == null)
            {
               if (selector == null)
               {
                  consumer = ((QueueSession) getSession()).createReceiver((Queue) d);
               }
               else
               {
                  consumer = ((QueueSession) getSession()).createReceiver((Queue) d, selector);
               }
            }
         }
         else
         {
            if (dConfig != null && dConfig.isDurable())
            {
               try
               {
                  if (selector == null)
                  {
                     consumer = getSession().createDurableSubscriber((Topic) d, dConfig.getClientID());
                  }
                  else
                  {
                     consumer = getSession().createDurableSubscriber((Topic) d, dConfig.getClientID(), selector, true);
                  }
               }
               catch (NoSuchMethodError ex)
               {
                  log.debug("JMS 1.1 interface failed, trying 1.0.2b");
               }
               catch (AbstractMethodError ex)
               {
                  log.debug("JMS 1.1 interface failed, trying 1.0.2b");
               }

               if (consumer == null)
               {
                  if (selector == null)
                  {
                     consumer = ((TopicSession) getSession()).createDurableSubscriber((Topic) d, dConfig.getClientID());
                  }
                  else
                  {
                     consumer = ((TopicSession) getSession()).createDurableSubscriber((Topic) d, dConfig.getClientID(), selector, true);
                  }
               }
            }
            else
            {
View Full Code Here

        if ( !keepRunning)
        {
            throw new HermesException("WatchManager is not running");
        }

        final DestinationConfig dConfig = HermesBrowser.getConfigDAO().duplicateForWatch(destination, hermes) ;
              
        synchronized (watchStatistics)
        {
            final DestinationConfigKeyWrapper key = new DestinationConfigKeyWrapper(dConfig) ;
            State stats;
View Full Code Here

TOP

Related Classes of hermes.config.DestinationConfig

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.