Package hermes.browser.model

Examples of hermes.browser.model.WatchInfo


      }
   }

   public void removeWatch(String hermesId, String destinationName)
   {
      final WatchInfo info = model.findWatchInfo(hermesId, destinationName);

      if (info != null)
      {
         log.debug("removing hermesId=" + hermesId + " destinationName=" + destinationName);
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);

         SwingRunner.invokeLater(new Runnable()
         {
View Full Code Here

   public boolean doBrowse()
   {
      try
      {
         WatchInfo info = model.getRow(table.getActualRowAt(table.getSelectedRows()[0]));

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

               try
               {
                  hermes = (Hermes) HermesBrowser.getBrowser().getContext().lookup(info.getHermesId());
               }
               catch (NamingException e)
               {
                  log.error(e.getMessage(), e);

                  HermesBrowser.getBrowser().showErrorDialog("Cannot browse: ", e);
               }

               HermesBrowser.getBrowser().getActionFactory().createQueueBrowseAction(hermes, info.getConfig());
               return true;
            }
            else
            {
               JOptionPane.showMessageDialog(HermesBrowser.getBrowser(), "Cannot watch: " + info.getE().getClass().getName() + "\n" + info.getE().getMessage(),
                     "Error", JOptionPane.ERROR_MESSAGE);
               return false;
            }
         }
      }
View Full Code Here

      if (table.getSelectedRows().length > 0)
      {
         for (int i = 0; i < table.getSelectedRows().length; i++)
         {
            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)
            {
               log.error(t.getMessage(), t);

               HermesBrowser.getBrowser().showErrorDialog("Truncating " + info.getConfig().getName(), t);
            }
         }
      }
   }
View Full Code Here

         rows[i] = table.getActualRowAt(rows[i]);
      }

      for (int i = 0; i < rows.length; i++)
      {
         final WatchInfo wInfo = model.getRow(rows[i]);

         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)
         {
            log.error(e.getMessage(), e);
         }
View Full Code Here

   public void onDepthChange(Hermes hermes, DestinationConfig dConfig, long depth)
   {
      try
      {
         WatchInfo info = getWatchInfo(hermes, dConfig);

         info.setDepth((int) depth);

      }
      catch (JMSException e)
      {
         log.error(e.getMessage(), e);
View Full Code Here

   public void onException(Hermes hermes, DestinationConfig dConfig, Exception e)
   {
      try
      {
         WatchInfo info = getWatchInfo(hermes, dConfig);

         info.setE(e);

         setTabTitle(getTitle());
         repaint();

      }
View Full Code Here

   public void onOldestMessageChange(Hermes hermes, DestinationConfig dConfig, Date oldest)
   {
      try
      {
         WatchInfo info = getWatchInfo(hermes, dConfig);

         if (oldest != null)
         {
            info.setOldest(oldest.getTime());
         }
         else
         {
            info.setOldest(0);
         }

      }
      catch (JMSException ex)
      {
View Full Code Here

   public void onPropertyChange(Hermes hermes, DestinationConfig dConfig, Map properties)
   {
      try
      {
         WatchInfo info = getWatchInfo(hermes, dConfig);

         info.setStatistics(properties);

         repaint();

      }
      catch (JMSException ex)
View Full Code Here

            boolean localHasAlert = false;

            for (int i = 0; i < watchModel.getRowCount(); i++)
            {
                boolean deleted = false;
                final WatchInfo info = watchModel.getRow(i);

                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();)
            {
View Full Code Here

TOP

Related Classes of hermes.browser.model.WatchInfo

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.