Package hermes

Examples of hermes.Domain


               log.debug("found " + entry.getClassName() + " bound at " + entry.getName());

               if (object instanceof Destination)
               {
                  final Domain domain = Domain.getDomain((Destination) object);

                  if (domain == Domain.TOPIC)
                  {
                     child = new TopicTreeNode(entry.getName(), (Topic) object);
                  }
View Full Code Here


   }
  
   public void insert(Connection connection, String storeId, Message message) throws SQLException, JMSException
   {
      final String destinationName = message.getJMSDestination() == null ? "default" : JMSUtils.getDestinationName(message.getJMSDestination());
      final Domain domain = message.getJMSDestination() == null ? Domain.QUEUE : Domain.getDomain(message.getJMSDestination());
      final String messageAsXMLString = xmlHelper.toXML(message);
      final InputStream messageAsXML = new StringInputStream(messageAsXMLString);
      final String messageId = getNextMessageId(storeId);

      //
      // DBUtils does not seem to correctly deal with CLOBS, so we have to use
      // normal JDBC...
      //
      // runner.update(connection, "insert into messages values (?, ?)", new
      // Object[] { message.getJMSMessageID(), messageAsXML });

      final PreparedStatement pstmt = connection.prepareStatement("insert into messages values (?, ?)");

      pstmt.setString(1, messageId);
      pstmt.setAsciiStream(2, messageAsXML, messageAsXMLString.length());

      pstmt.execute();
      pstmt.close();

      final QueryRunner runner = new QueryRunner();

      runner.update(connection, "insert into stores values (?, ?, ?, ?)", new Object[] { storeId, destinationName, domain.getId(), messageId });
   }
View Full Code Here

            {
               public Object handle(ResultSet rs) throws SQLException
               {
                  while (rs.next())
                  {
                    final Domain domain = Domain.getDomain(rs.getInt(2)) ;
                    if (domain.equals(Domain.QUEUE)) {
                          destinations.add( new MessageStoreQueue(rs.getString(1)));
                    } else if (domain.equals(Domain.TOPIC)) {
                      destinations.add(new MessageStoreTopic(rs.getString(1))) ;
                    } else if (domain.equals(Domain.FOLDER)) {
                      destinations.add(new MessageStoreFolder(rs.getString(1))) ;
                    }
                    
                  }
View Full Code Here

        try {
          final Object object = ctx.lookup(entry.getName());
          DestinationConfig config = null;

          if (object instanceof Destination) {
            final Domain domain = Domain.getDomain((Destination) object);

            if (domain == Domain.QUEUE) {
              config = HermesBrowser.getConfigDAO().createDestinationConfig();
              config.setDomain(Domain.QUEUE.getId());
            } else if (domain == Domain.TOPIC) {
View Full Code Here

    }

    public Map getStatistics(DestinationConfig dConfig) throws JMSException
    {
        final Map<String, Object> map = new TreeMap<String, Object>();
        final Domain domain = Domain.getDomain(dConfig.getDomain());

        if ( domain == Domain.QUEUE)
        {
            map.put(DELIVERABLE_MESSGAES, new Long(getAdminService().getNumberOfDeliverableMessages(dConfig.getName())));
            map.put(UNDELETED_MESSGAES, new Long(getAdminService().getNumberOfUndeletedMessages(dConfig.getName())));
View Full Code Here

      
      }
      else
      {
         final DestinationConfig dConfig = getDestinationConfig(d);
         Domain domain;

         if (dConfig != null)
         {
            domain = Domain.getDomain(dConfig.getDomain());
         }
View Full Code Here

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

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

               config.setDurable(((Boolean) durableProperty.getValue()).booleanValue());
            }

            if (domainProperty.getValue() != null)
            {
               Domain domain = (Domain) domainProperty.getValue();

               config.setDomain(domain.getId());
            }

            if (durableClientIDProperty.getValue() != null && !durableClientIDProperty.getValue().equals(""))
            {
               config.setClientID(durableClientIDProperty.getValue().toString());
View Full Code Here

TOP

Related Classes of hermes.Domain

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.