Package hermes.config

Examples of hermes.config.FactoryConfig


    *
    * @see hermes.impl.ConfigDAO#createDefaultFactoryConfig(java.lang.String)
    */
   public FactoryConfig createDefaultFactoryConfig(String sessionId) throws JAXBException
   {
      FactoryConfig factoryConfig = new FactoryConfig();
      factoryConfig.setClasspathId(SimpleClassLoaderManager.SYSTEM_LOADER);
      SessionConfig sessionConfig = new SessionConfig();
      ConnectionConfig connectConfig = new ConnectionConfig();
      ProviderConfig providerConfig = new ProviderConfig();

      sessionConfig.setId(sessionId);
      connectConfig.getSession().add(sessionConfig);
      factoryConfig.getConnection().add(connectConfig);
      factoryConfig.setExtension(createDefaultProviderExtConfig(NullConnectionFactory.class.getName()));
      sessionConfig.setTransacted(true);

      providerConfig.setProperties(new PropertySetConfig());
      factoryConfig.setProvider(providerConfig);

      return factoryConfig;
   }
View Full Code Here


    */
   public void replaceDestinationConfigs(HermesConfig config, String hermesId, Collection<DestinationConfig> destinationConfigs)
   {
      for (Iterator<FactoryConfig> fIter = config.getFactory().iterator(); fIter.hasNext();)
      {
         final FactoryConfig factoryConfig = fIter.next();

         for (Iterator<ConnectionConfig> cIter = factoryConfig.getConnection().iterator(); cIter.hasNext();)
         {
            final ConnectionConfig connConfig = cIter.next();

            for (Iterator<SessionConfig> sIter = connConfig.getSession().iterator(); sIter.hasNext();)
            {
               final SessionConfig sConfig = sIter.next();

               if (sConfig.getId().equals(hermesId))
               {
                  for (Iterator iter = factoryConfig.getDestination().iterator(); iter.hasNext();)
                  {
                     DestinationConfig dConfig = (DestinationConfig) iter.next();

                     if (dConfig.getDomain() == Domain.TOPIC.getId() && dConfig.isDurable())
                     {
                        // Don't replace the durable topics....
                     }
                     else
                     {
                        iter.remove();
                     }
                  }

                  factoryConfig.getDestination().addAll(destinationConfigs);

                  return;
               }
            }
         }
View Full Code Here

    */
   public FactoryConfig getFactoryConfig(HermesConfig config, String hermesId) throws HermesException
   {
      for (Iterator<FactoryConfig> factoryIter = config.getFactory().iterator(); factoryIter.hasNext();)
      {
         FactoryConfig factoryConfig = factoryIter.next();
         ConnectionConfig connectionConfig = (ConnectionConfig) factoryConfig.getConnection().get(0);

         if (connectionConfig.getSession().size() > 0)
         {
            SessionConfig sessionConfig = (SessionConfig) connectionConfig.getSession().get(0);

View Full Code Here

    * @see hermes.impl.ConfigDAO#duplicate(hermes.config.FactoryConfig,
    *      java.lang.String)
    */
   public FactoryConfig duplicate(FactoryConfig sourceFactory, String newSessionId) throws JAXBException
   {
      FactoryConfig rval = factory.createFactoryConfig();
      ConnectionConfig connectionConfig = (ConnectionConfig) sourceFactory.getConnection().get(0);

      rval.setClasspathId(sourceFactory.getClasspathId());
      rval.setExtension(sourceFactory.getExtension());
      rval.setProvider(sourceFactory.getProvider());

      rval.getConnection().add(duplicate(connectionConfig, newSessionId));

      return rval;
   }
View Full Code Here

    * @see hermes.impl.ConfigDAO#duplicateSession(hermes.config.HermesConfig,
    *      java.lang.String, java.lang.String)
    */
   public void duplicateSession(HermesConfig config, String hermesId, String newHermesId) throws JAXBException, HermesException
   {
      FactoryConfig sourceFactory = getFactoryConfig(config, hermesId);
      FactoryConfig newFactory = duplicate(sourceFactory, newHermesId);

      newFactory.getDestination().addAll(sourceFactory.getDestination());

      config.getFactory().add(newFactory);
   }
View Full Code Here

      {
         try
         {
            currentSessionId = sessionId;

            FactoryConfig factoryConfig = getFactoryConfigBySessionId(sessionId);

            if (factoryConfig == null)
            {
               factoryConfig = HermesBrowser.getConfigDAO().createDefaultFactoryConfig(sessionId);
               factoryConfig.getDestination().addAll(destinationConfigPanel.getDestinations());
               sessionToFactoryMap.put(sessionId, factoryConfig);

               newFactories.add(factoryConfig);

               setDirty();
            }

            connectionFactoryConfigPanel.setFactoryConfig(model, factoryConfig);
            destinationConfigPanel.setFactoryConfig(factoryConfig);
            connectionConfigPanel.setConnectionConfig((ConnectionConfig) factoryConfig.getConnection().get(0));
            sessionConfigPanel.setSessionConfig((SessionConfig) connectionConfigPanel.getConnectionConfig().getSession().get(0));

            if (model.isDisplayFactoryAdmin() && adminConfigPanel != null)
            {
               adminConfigPanel.setConfig(factoryConfig.getClasspathId(), factoryConfig.getExtension());
            }
         }
         catch (Throwable ex)
         {
            cat.error(ex.getMessage(), ex);
View Full Code Here

         sessionPanel = new JPanel();
         factoryPanel = new JPanel();

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

            if (factoryConfig.getConnection().size() == 0)
            {
               factoryConfig.getConnection().add(new ConnectionConfig());
            }

            if (factoryConfig.getProvider().getProperties() == null)
            {
               factoryConfig.getProvider().setProperties(new PropertySetConfig());
            }

            connectionFactoryConfigPanel.setFactoryConfig(model, factoryConfig);
            destinationConfigPanel.setFactoryConfig(factoryConfig);

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

               connectionConfigPanel.setConnectionConfig(connectionConfig);
View Full Code Here

         if (newFactories.size() > 0)
         {
            for (Iterator iter = newFactories.iterator(); iter.hasNext();)
            {
               final FactoryConfig config = (FactoryConfig) iter.next();

               cat.debug("new factory config for class=" + config.getProvider().getClassName());
               model.getFactory().add(config);
            }

            newFactories.clear();
         }

         try
         {
            //
            // Cleanup any sessions that have stoopid names

            for (Iterator iter = HermesBrowser.getBrowser().getConfig().getFactory().iterator(); iter.hasNext();)
            {
               FactoryConfig fConfig = (FactoryConfig) iter.next();

               ConnectionConfig cConfig = (ConnectionConfig) fConfig.getConnection().get(0);

               for (Iterator iter2 = cConfig.getSession().iterator(); iter2.hasNext();)
               {
                  SessionConfig sConfig = (SessionConfig) iter2.next();
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.