Package hermes.config

Examples of hermes.config.DestinationConfig


   *
   * @see hermes.impl.SessionManager#getDestination(java.lang.String)
   */
  public Destination getDestination(String named, Domain domain) throws JMSException, NamingException {
    Destination rval = destinationManager.getDestination(getSession(), named, domain);
    DestinationConfig config = getDestinationConfig(named, domain);

    if (config != null) {
      destinationToConfigMap.put(rval, getDestinationConfig(named, domain));

      if (config.getProperties() != null) {
        try {
          LoaderSupport.populateBean(rval, config.getProperties());
        } catch (Exception ex) {
          throw new HermesException(ex);
        }

      }
View Full Code Here


               {
                  if (qinfos[i].getJNDINames() != null)
                  {
                     for (int j = 0; j < qinfos[i].getJNDINames().length; j++)
                     {
                        final DestinationConfig dConfig = HermesBrowser.getConfigDAO().createDestinationConfig();

                        dConfig.setName(qinfos[i].getJNDINames()[j]);
                        dConfig.setDomain(Domain.QUEUE.getId());
                        rval.add(dConfig);

                     }
                  }
               }
               else
               {
                  final DestinationConfig dConfig = HermesBrowser.getConfigDAO().createDestinationConfig();

                  dConfig.setName(qinfos[i].getName());
                  dConfig.setDomain(Domain.QUEUE.getId());
                  rval.add(dConfig);
               }
            }
         }

         if (!(getHermes().getConnectionFactory() instanceof QueueConnectionFactory) || both)
         {
            final TopicInfo[] tinfos = getAdmin().getTopics();

            for (int i = 0; i < tinfos.length; i++)
            {
               if (getHermes().getConnectionFactory() instanceof JNDIConnectionFactory)
               {
                  if (tinfos[i].getJNDINames() != null)
                  {
                     for (int j = 0; j < tinfos[i].getJNDINames().length; j++)
                     {
                        final DestinationConfig dConfig = HermesBrowser.getConfigDAO().createDestinationConfig();

                        dConfig.setName(tinfos[i].getJNDINames()[j]);
                        dConfig.setDomain(Domain.TOPIC.getId());
                        rval.add(dConfig);
                        rval.addAll(discoverDurableSubscriptions(tinfos[i].getName(), tinfos[i].getJNDINames()[j]));
                     }
                  }
               }
               else
               {
                  final DestinationConfig dConfig = HermesBrowser.getConfigDAO().createDestinationConfig();
                  dConfig.setName(tinfos[i].getName());

                  dConfig.setDomain(Domain.TOPIC.getId());
                  rval.add(dConfig);

                  rval.addAll(discoverDurableSubscriptions(tinfos[i].getName(), null));
               }
            }
View Full Code Here

         for (int j = 0; j < dInfos.length; j++)
         {
            DurableInfo dInfo = dInfos[j];

            final DestinationConfig dConfig = HermesBrowser.getConfigDAO().createDestinationConfig();

            dConfig.setDurable(true);
            dConfig.setName(jndiName == null ? dInfo.getTopicName() : jndiName);
            dConfig.setClientID(dInfo.getDurableName());
            dConfig.setSelector(dInfo.getSelector());
            dConfig.setDomain(Domain.TOPIC.getId());

            rval.add(dConfig);
         }

         return rval;
View Full Code Here

   }

   @Override
   protected DestinationConfig createDestinationConfig()
   {
      final DestinationConfig rval = super.createDestinationConfig();
      final DestinationConfigTreeNode node = HermesBrowser.getBrowser().getBrowserTree().getFirstSelectedDestinationNode() ;
     
      rval.setDomain(Domain.TOPIC.getId());
      rval.setDurable(true);
     
      if (node != null)
      {
         DestinationConfig selectedConfig = node.getConfig();

         if (selectedConfig.getDomain() == Domain.TOPIC.getId())
         {
            rval.setName(selectedConfig.getName());
         }
      }

      return rval;
   }
View Full Code Here

            {
                log.error("ReflectionException - ", e);
                throw new RuntimeException(e);
            }

            DestinationConfig dConfig = new DestinationConfig();
            dConfig.setName(jndiName);
            dConfig.setShortName(destName);
            dConfig.setDomain(domain.getId());

            rval.add(dConfig);
        }

        return rval;
View Full Code Here

            final ArrayList rval = new ArrayList();

            for (Iterator queues = getBrokerProxy().getQueues(null).iterator(); queues.hasNext();)
            {
               final IQueueData queueData = (IQueueData) queues.next();
               final DestinationConfig dConfig = HermesBrowser.getConfigDAO().createDestinationConfig();

               dConfig.setName(queueData.getQueueName());
               dConfig.setDomain(Domain.QUEUE.getId());

               rval.add(dConfig);
            }

            return rval;
View Full Code Here

      final PCFMessage[] responses = agent.send(request);
      final String[] names = (String[]) responses[0].getParameterValue(CMQCFC.MQCACF_Q_NAMES);

      for (int i = 0; i < names.length; i++)
      {
         final DestinationConfig dConfig = new DestinationConfig();

         dConfig.setName(names[i].trim());
         dConfig.setDomain(Domain.QUEUE.getId());

         destinations.add(dConfig);
      }     
   }
View Full Code Here

            while (rs.next()) {
                String tableName = rs.getString(1);
                // tableName = getActualTopicName(tableName);
                LOG.debug("Fetching Topic information " + tableName);
                ConfigDAO configDao = new ConfigDAOImpl();
                DestinationConfig dc = configDao.createDestinationConfig(
                        tableName, Domain.TOPIC);
                dc.setDurable(false);
                dc.setName(tableName);
                dc.setShortName(tableName);
                String hostname = InetAddress.getLocalHost().getHostName();
                hostname = hostname.replace('-', '_');
                String subName = System.getProperty("user.name") + "_"
                        + hostname + "_Hermes";
                if (subName.length() > 30) {
                    subName = subName.substring(0, 30);
                }
                dc.setClientID(subName);
                rval.add(dc);
            }
            rs.close();
            stmt.close();
        } catch (SQLException e) {
View Full Code Here

                QMFObject qmfObject = new QMFObject(i);
                String queueName = qmfObject.getName();

                if(acceptDestination(queueName)) {
                    DestinationConfig destinationConfig = buildDestinationConfig(queueName);
                    PropertySetConfig propertySetConfig = new PropertySetConfig();

                    for (String key : qmfObject.keySet()) {

                        PropertyConfig propertyConfig = new PropertyConfig();
                        propertyConfig.setName(key);
                        propertyConfig.setValue(qmfObject.getStringValue(key));
                        propertySetConfig.getProperty().add(propertyConfig);
                    }

                    destinationConfig.setProperties(propertySetConfig);
                    rval.add(destinationConfig);
                }
            }
        } catch (UnsupportedEncodingException e) {
            throw new HermesException(e);
View Full Code Here

     *
     * @param queueName - destination name.
     * @return DestinationConfig - hermes DestinationConfig
     */
    protected DestinationConfig buildDestinationConfig(String queueName) {
        DestinationConfig destinationConfig = HermesBrowser.getConfigDAO()
            .createDestinationConfig(queueName, Domain.QUEUE);
        return destinationConfig;
    }
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.