Package hermes

Examples of hermes.Hermes


  }

  public Hermes getHermesAsMessageFactory() throws HermesException {
    if (!TextUtils.isEmpty(HermesBrowser.getBrowser().getConfig().getMessageStoreMessageFactory())) {
      try {
        Hermes hermes = (Hermes) HermesBrowser.getBrowser().getContext().lookup(HermesBrowser.getBrowser().getConfig().getMessageStoreMessageFactory());

        if (hermes != null) {
          return hermes;
        }
      } catch (NamingException ex) {
View Full Code Here


      return false;
    }

    if (transferData.getDestinations().size() > 0) {
      Hermes hermes = null;

      if (transferData.getHermesId() != null) {
        hermes = (Hermes) HermesBrowser.getBrowser().getContext().lookup(transferData.getHermesId());
      } else if (getSelectedHermesNode() != null) {
        hermes = getSelectedHermesNode().getHermes();
      }

      if (hermes != null) {
        StringBuffer question = new StringBuffer();

        if (transferData.getDestinations().size() == 1) {
          question.append("Do you want to add this destination to " + hermes.getId() + " ?");
        } else {
          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();
View Full Code Here

   private void addWatch(String hermesId, DestinationConfig dConfig, int depthAlert, long ageAlert)
   {
      try
      {
         final WatchInfo info = new WatchInfo(hermesId, dConfig);
         final Hermes hermes = (Hermes) HermesBrowser.getBrowser().getContext().lookup(hermesId);

         info.setAgeAlert(ageAlert);
         info.setDepthAlert(depthAlert);

         watchManager.addWatch(hermes, dConfig, this);
View Full Code Here

         if (info != null)
         {
            if (info.getE() == null)
            {
               Hermes hermes = null;

               try
               {
                  hermes = (Hermes) HermesBrowser.getBrowser().getContext().lookup(info.getHermesId());
               }
View Full Code Here

            int row = table.getSelectedRows()[i];
            WatchInfo info = (WatchInfo) model.getRow(table.getActualRowAt(row));

            try
            {
               Hermes hermes = (Hermes) HermesBrowser.getBrowser().getContext().lookup(info.getHermesId());

               HermesBrowser.getBrowser().getActionFactory().createTruncateAction(hermes, info.getConfig(), null);
            }
            catch (Throwable t)
            {
View Full Code Here

         model.removeRow(rows[i]);

         try
         {
            final Hermes hermes = (Hermes) HermesBrowser.getBrowser().getContext().lookup(wInfo.getHermesId());

            log.debug("removing watch entry hermes=" + hermes.getId() + ", destination=" + wInfo.getConfig().getName());

            watchManager.removeWatch(hermes, wInfo.getConfig().getName(), this);
         }
         catch (Exception e)
         {
View Full Code Here

                try
                {
                    ClassLoaderManager classLoaderManager = (ClassLoaderManager) SingletonManager.get(ClassLoaderManager.class) ;
                    Thread.currentThread().setContextClassLoader(classLoaderManager.getClassLoaderByHermes(info.getHermesId())) ;
                   
                    Hermes hermes = null;

                    if (!hermesToClose.keySet().contains(info.getHermesId()))
                    {
                        hermes = (Hermes) HermesBrowser.getBrowser().getContext().lookup(info.getHermesId());
                        hermesToClose.put(info.getHermesId(), hermes);
                    }
                    else
                    {
                        hermes = (Hermes) hermesToClose.get(info.getHermesId());
                    }

                    if (updateWatchInfo(hermes, info))
                    {
                        localHasAlert = true;
                    }

                    info.setE(null);
                }
                catch (Throwable e)
                {
                    log.error(e.getMessage(), e);

                    info.setE(e);
                }
            }

            for (Iterator iter = hermesToClose.entrySet().iterator(); iter.hasNext();)
            {
                Map.Entry entry = (Map.Entry) iter.next();
                Hermes hermes = (Hermes) entry.getValue();

                try
                {
                    if (hermes != null)
                    {
                        hermes.close();
                    }
                }
                catch (JMSException e1)
                {
                    log.error("closing " + hermes.getId() + ": " + e1.getMessage(), e1);
                }
            }
        }
        catch (Throwable t)
        {
View Full Code Here

      for (NamingEnumeration iter = oldContext.listBindings(""); iter.hasMoreElements();) {
        Binding binding = (Binding) iter.next();

        try {
          if (oldContext.lookup(binding.getName()) instanceof Hermes) {
            Hermes hermes = (Hermes) oldContext.lookup(binding.getName());
            Hermes newHermes = null;

            try {
              newHermes = (Hermes) context.lookup(hermes.getId());
            } catch (NamingException e) {
              // NOP
View Full Code Here

      return null;
    }
  }

  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

                  item.setEnabled(isEnabled);
                  item.addActionListener(new ActionListener()
                  {
                     public void actionPerformed(ActionEvent e)
                     {
                        final Hermes hermes = HermesBrowser.getBrowser().getBrowserTree().getSelectedHermesNode().getHermes();
                        final DestinationConfigTreeNode node = HermesBrowser.getBrowser().getBrowserTree().getFirstSelectedDestinationNode();

                        if (node != null)
                        {
                           HermesBrowser.getBrowser().getThreadPool().invokeLater(new RecordDestinationTask(hermes, node, store));
View Full Code Here

TOP

Related Classes of hermes.Hermes

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.