Package hermes.store

Examples of hermes.store.MessageStore


         throw new BuildException("storeId not set");
      }

      final Hermes myHermes;
      final Destination toDestination;
      final MessageStore messageStore;

      try
      {
         myHermes = HermesFactory.createHermes(getConfig(), getHermes());

         if (queue != null || topic != null)
         {
            final Domain domain = queue != null ? Domain.QUEUE : Domain.TOPIC;
            final String destinationName = queue != null ? queue : topic;

            toDestination = myHermes.getDestination(destinationName, domain);
         }
         else
         {
            toDestination = null;
         }

         messageStore = jdbcURL == null ? MessageStoreManager.create(storeId) : MessageStoreManager.create(jdbcURL, storeId);
      }
      catch (Exception e)
      {
         throw new BuildException(e);
      }

      try
      {
         if (storeDestinations.size() == 0)
         {
            if (toDestination == null)
            {
               log("Replaying all messages from store " + messageStore.getId() + " to " + myHermes.getId());

            }
            doReplay(messageStore, myHermes, toDestination);
         }
         else
View Full Code Here


      }

      Hermes myHermes = null;
      QueueBrowser browser = null;
      final DestinationConfig myDestination;
      final MessageStore messageStore;

      try
      {
         final Domain domain = queue != null ? Domain.QUEUE : Domain.TOPIC;
         final String destinationName = queue != null ? queue : topic;

         myHermes = HermesFactory.createHermes(getConfig(), getHermes());
         myDestination = myHermes.getDestinationConfig(destinationName, domain);
         messageStore = jdbcURL == null ? MessageStoreManager.create(storeId) : MessageStoreManager.create(jdbcURL, storeId);
      }
      catch (Exception e)
      {
         throw new BuildException(e);
      }

      try
      {
         int messagesRead = 0 ;
        
         browser = myHermes.createBrowser(myDestination);

         for (final Enumeration iter = browser.getEnumeration(); iter.hasMoreElements();)
         {
            final Message m = (Message) iter.nextElement();

            if (m != null)
            {
               messageStore.store(m);
              
               if (++messagesRead % commitInterval == 0)
               {
                  messageStore.checkpoint();
               }
            }
         }
      }
      catch (Exception e)
      {
         throw new BuildException(e);
      }
      finally
      {
         try
         {
            messageStore.checkpoint();
           
            if (browser != null)
            {
               browser.close();
            }
View Full Code Here

      if (name != null && !name.equals(""))
      {
         try
         {
            final TreePath treePath = HermesBrowser.getBrowser().getBrowserTree().getSelectionPath();
            MessageStore store = null;

            if (treePath != null)
            {
               if (treePath.getLastPathComponent() instanceof MessageStoreURLTreeNode)
               {
View Full Code Here

      }
   }

   private void doDelete(final MessageStoreTreeNode node) throws JMSException
   {
      final MessageStore store = node.getMessageStore();

      HermesBrowser.getBrowser().getThreadPool().invokeLater(new Runnable()
      {
         public void run()
         {
            try
            {
               store.delete();
               store.checkpoint();

               SwingUtilities.invokeLater(new Runnable()
               {
                  public void run()
                  {
                     HermesBrowser.getBrowser().getBrowserTree().remove(node);
                  }
               });
            }
            catch (Throwable e)
            {
               String message = "Cannot delete from store " + store.getId();

               try
               {
                  store.rollback();
               }
               catch (Throwable e1)
               {
                  log.error(e1);
               }
View Full Code Here

        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();
      }

      final Hermes hermes = h ;
      final String from = f ;
      JFileChooser chooser;
View Full Code Here

TOP

Related Classes of hermes.store.MessageStore

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.