Package hermes.config

Examples of hermes.config.DestinationConfig


  private void extractDestinations( Hermes hermes, List<Destination> destinationList )
  {
    Iterator<?> hermesDestionations = hermes.getDestinations();
    while( hermesDestionations.hasNext() )
    {
      DestinationConfig dest = ( DestinationConfig )hermesDestionations.next();
      Destination temp = new Destination( dest.getName(), Domain.getDomain( dest.getDomain() ) );
      destinationList.add( temp );
    }
  }
View Full Code Here


      TreePath currentPath = HermesBrowser.getBrowser().getBrowserTree().getSelectionModel().getSelectionPath();

      if (currentPath.getLastPathComponent() instanceof DestinationConfigTreeNode) {
        final DestinationConfigTreeNode destinationNode = HermesBrowser.getBrowser().getBrowserTree().getSelectedDestinationNodes().get(0);
        final DestinationConfig destinationConfig = destinationNode.getConfig();
        h = ((HermesTreeNode) destinationNode.getParent()).getHermes();
        task = new BrowseDestinationTask(h, destinationConfig);
        f = destinationConfig.getName();
      } else {
        MessageStore messageStore = HermesBrowser.getBrowser().getBrowserTree().getSelectedMessageStore();
        h = getMyHermes();
        task = new BrowseMessageStoreTask(h, messageStore, null, null);
        f = messageStore.getId();
View Full Code Here

    // cat.debug("new destination, domain=" +
    // Domain.getDomain(destConfig.getDomain()).toString() + ", name=" +
    // destConfig.getName());

    if (destinationConfigs.containsKey(key)) {
      DestinationConfig old = destinationConfigs.remove(key);
      destinationConfigsAsList.remove(old);

      log.debug("removed duplicate reference, reference domain=" + Domain.getDomain(destConfig.getDomain()).toString());
    }
View Full Code Here

    }
  }

  public DestinationConfig getDestinationConfig(String id, Domain domain) {
    DestinationConfigKeyWrapper key = new DestinationConfigKeyWrapper(id, domain);
    DestinationConfig rval = destinationConfigs.get(key);

    if (rval == null) {
      rval = HermesBrowser.getConfigDAO().createDestinationConfig();
      rval.setName(id);
      rval.setDomain(domain.getId());
    }

    return rval;
  }
View Full Code Here

      enableOnBrowserTreeSelection(new Class[] { HermesTreeNode.class }, this, true);
   }

   protected DestinationConfig createDestinationConfig()
   {
      return new DestinationConfig();
   }
View Full Code Here

   public void actionPerformed(ActionEvent arg0)
   {
      try
      {
         final HermesTreeNode hermesNode = HermesBrowser.getBrowser().getBrowserTree().getSelectedHermesNode();
         final DestinationConfig config = createDestinationConfig() ;

         config.setDomain(domain.getId());

         final DestinationConfigDialog dialog = new DestinationConfigDialog(HermesBrowser.getBrowser(), hermesNode.getHermes().getId(), null, config);

         dialog.addOKAction(new Runnable()
         {
            public void run()
            {
               try
               {
                  if (config.getName() != null)
                  {
                     HermesBrowser.getBrowser().addDestinationConfig(hermesNode.getHermes(), config);
                     HermesBrowser.getBrowser().saveConfig();                   
                  }
               }
View Full Code Here

   * Get a JMS destination.
   */
  public final Destination getDestination(String name, Domain domain) throws JMSException, NamingException {
    Thread.currentThread().setContextClassLoader(contextClassLoader);

    final DestinationConfig dConfig = getDestinationConfig(name, domain);

    if (dConfig != null) {
      if (dConfig.getUsername() != null) {
        reconnect(dConfig.getUsername(), dConfig.getPassword());
      }

      return sessionManager.getDestination(name, Domain.getDomain(dConfig.getDomain()));
    } else {
      if (getConnectionFactory() instanceof QueueConnectionFactory) {
        return sessionManager.getDestination(name, Domain.QUEUE);
      } else {
        return sessionManager.getDestination(name, Domain.TOPIC);
View Full Code Here

  /**
   * Get the domain from any static configuration, falling back to instanceof
   * if that does not exist.
   */
  public Domain getDomain(Destination destination) throws JMSException {
    final DestinationConfig dConfig = getDestinationConfig(getDestinationName(destination), Domain.UNKNOWN);

    if (dConfig != null) {
      if (dConfig.getDomain() == Domain.QUEUE.getId()) {
        return Domain.QUEUE;
      } else {
        return Domain.TOPIC;
      }
    }
View Full Code Here

         {
            try
            {
               final DestinationConfigTreeNode tNode = (DestinationConfigTreeNode) node;
               final HermesTreeNode hNode = (HermesTreeNode) tNode.getHermesTreeNode();
               final DestinationConfig dConfig = tNode.getConfig();

               if (dConfig.isDurable())
               {
                  if (JOptionPane.showConfirmDialog(HermesBrowser.getBrowser(), "Would you like to unsubscribe from durable subscription clientID="
                        + dConfig.getClientID() + " on " + tNode.getDestinationName(), "Please confirm", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)
                  {
                     Hermes.ui.getThreadPool().invokeLater(new Runnable()
                     {
                        public void run()
                        {
                           try
                           {
                              hNode.getHermes().unsubscribe(dConfig.getClientID());
                              Hermes.ui.getDefaultMessageSink().add("Unsubscribed");
                           }
                           catch (Throwable e)
                           {
                              HermesBrowser.getBrowser().showErrorDialog("Unable to unsubscribe", e);
                           }
                           finally
                           {
                              try
                              {
                                 hNode.getHermes().close();
                              }
                              catch (Throwable t)
                              {
                                 log.error(t.getMessage(), t);
                              }
                           }
                        }
                     });
                  }
                  else
                  {
                     Hermes.ui.getDefaultMessageSink().add("Unsubscribe cancelled.");
                  }
               }
               else
               {
                  HermesBrowser.getBrowser().showErrorDialog("Topic " + dConfig.getName() + " is not configured as durable.") ;
               }
            }

            catch (Throwable t)
            {
View Full Code Here

      {
         FactoryConfig factoryConfig = iter.next();

         for (Iterator<?> iter2 = factoryConfig.getDestination().iterator(); iter2.hasNext();)
         {
            DestinationConfig destinationConfig = (DestinationConfig) iter2.next();
         }

         for (Iterator<ConnectionConfig> iter3 = factoryConfig.getConnection().iterator(); iter3.hasNext();)
         {
            ConnectionConfig connectionConfig = iter3.next();
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.