Package hermes.config

Examples of hermes.config.DestinationConfig


          question.append("Do you want to add these " + transferData.getDestinations().size() + " destinations to " + hermes.getId() + " ?");
        }

        if (JOptionPane.showConfirmDialog(HermesBrowser.getBrowser(), question.toString(), "Please confirm.", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
          for (Iterator iter = transferData.getDestinations().iterator(); iter.hasNext();) {
            DestinationConfig dConfig = (DestinationConfig) iter.next();

            if (dConfig.getDomain() == Domain.UNKNOWN.getId()) {
              Object options[] = { "Queue", "Topic" };

              int n = JOptionPane.showOptionDialog(HermesBrowser.getBrowser(), "The destination " + dConfig.getName()
                  + " implements both Queue and Topic interfaces, please select the domain you wish to use it in.", "Select domain",
                  JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[1]);

              if (n == JOptionPane.YES_OPTION) {
                dConfig.setDomain(Domain.QUEUE.getId());
                HermesBrowser.getBrowser().addDestinationConfig(hermes, dConfig);
              } else if (n == JOptionPane.NO_OPTION) {
                dConfig.setDomain(Domain.TOPIC.getId());
                HermesBrowser.getBrowser().addDestinationConfig(hermes, dConfig);
              } else {
                // NOP
              }
            } else {
View Full Code Here


    */
   public void addWatch(final Hermes hermes)
   {
      for (Iterator iter = hermes.getDestinations(); iter.hasNext();)
      {
         DestinationConfig dConfig = (DestinationConfig) iter.next();

         addWatch(hermes.getId(), dConfig);
      }
   }
View Full Code Here

      for (Iterator iter = config.getDestination().iterator(); iter.hasNext();)
      {
         try
         {
            final DestinationConfig dConfig = (DestinationConfig) iter.next();

            if (dConfig.getMyHermes() != null)
            {
               addWatch(dConfig.getMyHermes(), dConfig, config.getDefaultDepthAlertThreshold(), config.getDefaultAgeAlertThreshold());
            }
            else
            {
               log.error("Discarded watch with a null Hermes") ;
            }
View Full Code Here

    try {

      final ArrayList<DestinationConfig> destinations = new ArrayList<DestinationConfig>(hermes.discoverDestinationConfigs());

      for (Iterator iter = destinations.iterator(); iter.hasNext();) {
        DestinationConfig dConfig = (DestinationConfig) iter.next();

        log.info("found name=" + dConfig.getName() + ", domain=" + Domain.getDomain(dConfig.getDomain()) + (dConfig.isDurable() ? " durableName=" + dConfig.getClientID() : ""));
      }

      if (isRunning()) {
        final StringBuffer msg = new StringBuffer();
View Full Code Here

            {
               AbstractTreeNode node = (AbstractTreeNode) component;

               if (node instanceof QueueTopicTreeNode || node instanceof QueueTreeNode || node instanceof TopicTreeNode)
               {
                  DestinationConfig config = HermesBrowser.getConfigDAO().createDestinationConfig();
                  String binding = getAbsoluteBinding(node);

                  config.setName(binding);
                  config.setDomain(Domain.getDomain((Destination) node.getBean()).getId());

                  rval.add(config);
               }
            }
         }
View Full Code Here

    }
  }

  public void invoke() throws Exception {
    while (iter.hasNext()) {
      final DestinationConfig dConfig = (DestinationConfig) iter.next();
      final boolean shouldBrowse = queuesOnly ? Domain.getDomain(dConfig.getDomain()).equals(Domain.QUEUE) : true ;
      int nmessages = 0;

      try {
        if (shouldBrowse) {
          final Destination destination = hermes.getDestination(dConfig.getName(), Domain.getDomain(dConfig.getDomain()));
          browser = createBrowser(destination, dConfig);

          notifyStatus("Running...");

          for (final Enumeration messageIter = browser.getEnumeration(); messageIter.hasMoreElements() && isRunning();) {
            final Message message = (Message) messageIter.nextElement();

            if (message != null) {
              notifyMessage(message);
              nmessages++;
            } else {
              // @TODO May be a bug here, keep an eye out for this
              // message recurring!

              log.error("Got a null message!");
              Thread.sleep(500);
            }
          }

          if (!isRunning()) {
            log.debug("user requested stop browse of " + dConfig.getName());
          }
        }
      } catch (BrowseInterruptedException ex) {
        log.info("browse of " + getTitle() + " interrupted after " + nmessages);
      } catch (InterruptedException ex) {
View Full Code Here

      wConfig.setId(watchId);

      frame = createWatch(wConfig);
    }

    DestinationConfig dConfig = HermesBrowser.getConfigDAO().duplicateForWatch(destination, hermes);

    frame.addWatch(hermes.getId(), dConfig);
  }
View Full Code Here

    }
  }

  public static void browseQueue(String hermesId, String queue) throws NamingException, JMSException {
    Hermes hermes = (Hermes) HermesBrowser.getBrowser().getContext().lookup(hermesId);
    DestinationConfig config = hermes.getDestinationConfig(queue, Domain.QUEUE);

    HermesBrowser.getBrowser().getActionFactory().createQueueBrowseAction(hermes, config);
  }
View Full Code Here

        try
        {
          
            final Hermes myHermes = HermesFactory.createHermes(getConfig(), getHermes()) ;
            final DestinationConfig destination = myHermes.getDestinationConfig(getQueue(), Domain.QUEUE) ;
            final Collection<Message> messages = new ArrayList<Message>() ;
            final FileOutputStream ostream = new FileOutputStream(new File(getFile())) ;        
            final QueueBrowser browser = myHermes.createBrowser(destination) ;
           
            for (Enumeration iter = browser.getEnumeration() ; iter.hasMoreElements() ; )
View Full Code Here

         for (final DurableSubscriptionID id : durableSubs)
         {
            if (getHermes().getConnection().getClientID() != null && getHermes().getConnection().getClientID().equals(id.getClientID()))
            {
               final DestinationConfig dConfig = HermesBrowser.getConfigDAO().createDestinationConfig();

               dConfig.setClientID(id.getSubscriptionName());
               dConfig.setName(jndiName == null ? topicName : jndiName);
               dConfig.setDomain(Domain.TOPIC.getId());
               dConfig.setSelector(id.getSelector());
               dConfig.setDurable(true);

               rval.add(dConfig);
            }
            else
            {
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.