Package hermes.config

Examples of hermes.config.FactoryConfig


    } else {
      final String newName = JOptionPane.showInputDialog(HermesBrowser.getBrowser(), "Session name:", "");

      if (newName != null && !newName.equals("")) {
        if (!getAllHermesIds().contains(newName)) {
          FactoryConfig fConfig = (FactoryConfig) transferData.getFactories().iterator().next();

          HermesBrowser.getConfigDAO().renameSession(fConfig, newName);

          HermesBrowser.getBrowser().getConfig().getFactory().add(fConfig);
          HermesBrowser.getBrowser().saveConfig();
View Full Code Here


                     else
                     {
                        clazz = JNDITopicConnectionFactory.class;
                     }

                     FactoryConfig factoryConfig = HermesBrowser.getConfigDAO().createJNDIFactoryConfig(ctxNode.getConfig().getClasspathId(), "S:" + System.currentTimeMillis()
                           + ":" + node.getId(), binding, ctxNode.getConfig().getProperties(), clazz.getName());

                     rval.add(factoryConfig);
                  }
               }
View Full Code Here

   */

  @Override
  public void addDestinationConfig(Hermes hermes, DestinationConfig config) throws JMSException {
    if (factoryConfigById.containsKey(hermes.getId())) {
      FactoryConfig fConfig = factoryConfigById.get(hermes.getId());
      fConfig.getDestination().add(config);
      hermes.addDestinationConfig(config);
      notifyDestinationAdded(hermes, config);
    } else {
      throw new HermesException("No such session " + hermes.getId());
    }
View Full Code Here

    }

    // End HJMS-139

    if (factoryConfigById.containsKey(hermes.getId())) {
      final FactoryConfig fConfig = factoryConfigById.get(hermes.getId());

      for (final Iterator iter = fConfig.getDestination().iterator(); iter.hasNext();) {
        final DestinationConfig dConfig = (DestinationConfig) iter.next();

        if (dConfig.getDomain() == Domain.TOPIC.getId() && dConfig.isDurable()) {
          if (!keepDurableSubscriptionsDialogShown) {
            if (HermesBrowser.getBrowser() != null) {
              if (JOptionPane.showConfirmDialog(HermesBrowser.getBrowser(), "Do you want to keep configured durable subscriptions?", "Durable Subscriptions", JOptionPane.YES_NO_OPTION) == JOptionPane.NO_OPTION) {
                keepDurableSubscriptions = false;
              }
            }

            keepDurableSubscriptionsDialogShown = true;
          }

          if (!keepDurableSubscriptions) {
            iter.remove();
            notifyDestinationRemoved(hermes, dConfig);
          }
        } else {
          iter.remove();
          notifyDestinationRemoved(hermes, dConfig);
        }
      }

      for (final Iterator iter = dConfigs.iterator(); iter.hasNext();) {
        final DestinationConfig dConfig = (DestinationConfig) iter.next();

        fConfig.getDestination().add(dConfig);
        hermes.addDestinationConfig(dConfig);
        notifyDestinationAdded(hermes, dConfig);
      }
    } else {
      throw new HermesException("No such session " + hermes.getId());
View Full Code Here

        wConfig.setShowAge(true);
        config.getWatch().add(wConfig);
      }

      for (Iterator iter = config.getFactory().iterator(); iter.hasNext();) {
        final FactoryConfig factoryConfig = (FactoryConfig) iter.next();

        /*
         * If for some reason the XML has no connection or sesssion then
         * clean up the XML.
         */

        if (factoryConfig.getConnection().size() == 0) {
          log.debug("cleaning up FactoryConfig with no connections");
          iter.remove();
          continue;
        }

        ConnectionConfig firstConnection = factoryConfig.getConnection().get(0);

        if (firstConnection.getSession().size() == 0) {
          log.debug("cleaning up FactoryConfig with no sessions");
          iter.remove();
          continue;
View Full Code Here

    */
   public void removeHermes(HermesConfig config, String hermesId) throws HermesException
   {
      for (Iterator<FactoryConfig> iter = config.getFactory().iterator(); iter.hasNext();)
      {
         FactoryConfig factoryConfig = iter.next();

         for (Iterator<?> iter2 = factoryConfig.getDestination().iterator(); iter2.hasNext();)
         {
            DestinationConfig destinationConfig = (DestinationConfig) iter2.next();
         }

         for (Iterator<ConnectionConfig> iter3 = factoryConfig.getConnection().iterator(); iter3.hasNext();)
         {
            ConnectionConfig connectionConfig = iter3.next();

            for (Iterator<SessionConfig> iter4 = connectionConfig.getSession().iterator(); iter4.hasNext();)
            {
View Full Code Here

    */
   public void removeDestination(HermesConfig config, String hermesId, String destinationName) throws HermesException
   {
      for (Iterator<FactoryConfig> iter = config.getFactory().iterator(); iter.hasNext();)
      {
         FactoryConfig factoryConfig = iter.next();

         for (Iterator<ConnectionConfig> iter3 = factoryConfig.getConnection().iterator(); iter3.hasNext();)
         {

            ConnectionConfig connectionConfig = iter3.next();

            for (Iterator<SessionConfig> iter4 = connectionConfig.getSession().iterator(); iter4.hasNext();)
            {

               SessionConfig sessionConfig = iter4.next();

               if (sessionConfig.getId().equals(hermesId))
               {
                  for (Iterator<?> iter2 = factoryConfig.getDestination().iterator(); iter2.hasNext();)
                  {
                     DestinationConfig destinationConfig = (DestinationConfig) iter2.next();

                     if (destinationConfig.getName().equals(destinationName))
                     {
View Full Code Here

   {
      Collection<SessionConfig> rval = new ArrayList<SessionConfig>();

      for (Iterator<FactoryConfig> iter1 = config.getFactory().iterator(); iter1.hasNext();)
      {
         FactoryConfig factoryConfig = iter1.next();

         for (Iterator<ConnectionConfig> iter2 = factoryConfig.getConnection().iterator(); iter2.hasNext();)
         {
            ConnectionConfig connectionConfig = iter2.next();

            for (Iterator<SessionConfig> iter3 = connectionConfig.getSession().iterator(); iter3.hasNext();)
            {
View Full Code Here

   {
      Collection<Object> rval = new ArrayList<Object>();

      for (Iterator<FactoryConfig> iter1 = config.getFactory().iterator(); iter1.hasNext();)
      {
         FactoryConfig factoryConfig = iter1.next();

         for (Iterator<ConnectionConfig> iter2 = factoryConfig.getConnection().iterator(); iter2.hasNext();)
         {
            ConnectionConfig connectionConfig = iter2.next();

            for (Iterator<SessionConfig> iter3 = connectionConfig.getSession().iterator(); iter3.hasNext();)
            {

               SessionConfig sessionConfig = iter3.next();

               if (sessionConfig.getId() == null)
               {
                  log.debug("session with a null id removed");

                  iter3.remove();
               }
               else
               {
                  if (hermesId == null || sessionConfig.getId().equals(hermesId))
                  {
                     for (Iterator iter4 = factoryConfig.getDestination().iterator(); iter4.hasNext();)
                     {
                        rval.add(iter4.next());
                     }
                  }
               }
View Full Code Here

    *      java.lang.String)
    */
   public FactoryConfig createJNDIFactoryConfig(String classpathId, String sessionId, String binding, PropertySetConfig properties, String className)
         throws JAXBException
   {
      FactoryConfig factoryConfig = new FactoryConfig();
      factoryConfig.setClasspathId(classpathId);
      SessionConfig sessionConfig = new SessionConfig();
      ConnectionConfig connectConfig = new ConnectionConfig();
      ProviderConfig providerConfig = new ProviderConfig();

      sessionConfig.setId(sessionId);
      sessionConfig.setTransacted(true);
      sessionConfig.setReconnects(BigInteger.ZERO);

      connectConfig.getSession().add(sessionConfig);

      factoryConfig.getConnection().add(connectConfig);

      factoryConfig.setExtension(createDefaultProviderExtConfig(NullConnectionFactory.class.getName()));

      PropertySetConfig propertySet = factory.createPropertySetConfig();

      // Copy over the other ones...

      for (Iterator<PropertyConfig> iter = properties.getProperty().iterator(); iter.hasNext();)
      {
         PropertyConfig pConfig = iter.next();

         if (!pConfig.getName().equals("binding"))
         {
            propertySet.getProperty().add(pConfig);
         }
      }

      PropertyConfig bProperty = factory.createPropertyConfig();

      // Update with the binding.

      bProperty.setName("binding");
      bProperty.setValue(binding);

      propertySet.getProperty().add(bProperty);
      providerConfig.setProperties(propertySet);

      providerConfig.setClassName(className);
      factoryConfig.setProvider(providerConfig);

      return factoryConfig;
   }
View Full Code Here

TOP

Related Classes of hermes.config.FactoryConfig

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.