Package hermes.config

Examples of hermes.config.SessionConfig


          log.debug("cleaning up FactoryConfig with no sessions");
          iter.remove();
          continue;
        }

        SessionConfig firstSession = firstConnection.getSession().get(0);

        if (firstSession.getId() == null) {
          log.debug("cleaning up FactoryConfig with a null session");
          iter.remove();
          continue;
        }

        try {

          Hermes hermes = createHermes(factoryConfig);

          rval.add(hermes);

          notifyHermesAdded(hermes);

          for (Iterator diter = hermes.getDestinations(); diter.hasNext();) {
            DestinationConfig destinationConfig = (DestinationConfig) diter.next();

            boolean isQueue = hermes.getConnectionFactory() instanceof QueueConnectionFactory;
            boolean isTopic = hermes.getConnectionFactory() instanceof TopicConnectionFactory;

            if (destinationConfig.getDomain() == 0 && HermesBrowser.getBrowser() != null) {
              if (isQueue && isTopic) {
                Object options[] = { "Queue", "Topic" };

                int n = JOptionPane.showOptionDialog(HermesBrowser.getBrowser(), "This XML is from an older version of Hermes and it is unclear which domain the destination\n"
                    + destinationConfig.getName() + " for session " + hermes.getId() + " is in. Please choose whether queue or topic domain", "Select domain",
                    JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[1]);

                if (n == JOptionPane.YES_OPTION) {
                  isQueue = true;
                  isTopic = false;

                  log.info(destinationConfig.getName() + " is now in the queue domain");
                } else {
                  isQueue = false;
                  isTopic = true;

                  log.info(destinationConfig.getName() + " is now in the topic domain");
                }
              }

              if (isQueue) {
                destinationConfig.setDomain(Domain.QUEUE.getId());
              } else if (isTopic) {
                destinationConfig.setDomain(Domain.TOPIC.getId());
              }
            }

            notifyDestinationAdded(hermes, destinationConfig);
          }
        }

        catch (Throwable t) {
          log.error("unable to create Hermes instance " + firstSession.getId() + ": " + t.getMessage(), t);
        }
      }

      return rval;
View Full Code Here


      connectionManager.setPassword(connectionConfig.getPassword());

      if (connectionConfig.getSession().size() > 0) {
        SessionManager sessionManager;
        DestinationManager destinationManager;
        SessionConfig sessionConfig = connectionConfig.getSession().get(0);

        if (jndiFactory != null) {
          jndiFactory._setDelegateClassLoader(classLoader);

          destinationManager = new JNDIDestinationManager(jndiFactory._getProperties(), true);
          sessionManager = new ThreadLocalSessionManager(sessionConfig, destinationManager);
        } else {
          destinationManager = new SimpleDestinationManager();
          sessionManager = new ThreadLocalSessionManager(sessionConfig, destinationManager);
        }

        log.debug("SESSION IS " + sessionConfig.getId());

        if (sessionConfig.getReconnects() != null) {
          sessionManager.setReconnects(sessionConfig.getReconnects().intValue());
        }

        classLoaderManager.putClassLoaderByHermes(sessionConfig.getId(), classLoader);
        factoryConfigById.put(sessionConfig.getId(), factoryConfig);

        sessionManager.setTransacted(sessionConfig.isTransacted());
        sessionManager.setId(sessionConfig.getId());
        sessionManager.setFactoryConfig(factoryConfig);
        sessionManager.setAudit(sessionConfig.isAudit());

        sessionManager.setParent(connectionManager);
        connectionManager.setParent(connectionFactoryManager);

        if (config.getAuditDirectory() != null) {
          sessionManager.setAuditDirectory(config.getAuditDirectory());
        } else if (sessionConfig.getAuditDirectory() != null) {
          sessionManager.setAuditDirectory(sessionConfig.getAuditDirectory());
        }

        connectionManager.addChild(sessionManager);

        hermes = new DefaultHermesImpl(factoryConfig.getExtension(), sessionManager, classLoader);
View Full Code Here

         log.debug(r.getDisplayName() + ": " + r.getClass().getName()) ;
      }

      for (Iterator hIter = HermesBrowser.getConfigDAO().getAllSessions(config).iterator(); hIter.hasNext();)
      {
         SessionConfig sConfig = (SessionConfig) hIter.next();

         for (Iterator iter2 = HermesBrowser.getConfigDAO().getAllDestinations(config, sConfig.getId()).iterator(); iter2.hasNext();)
         {
            DestinationConfig dConfig = (DestinationConfig) iter2.next();

            if (dConfig.getRenderer() != null)
            {
View Full Code Here

            ConnectionConfig connectionConfig = iter3.next();

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

               SessionConfig sessionConfig = iter4.next();

               if (sessionConfig.getId() == null)
               {
                  iter4.remove();
               }
               else if (sessionConfig.getId().equals(hermesId))
               {
                  iter4.remove();

                  log.debug(hermesId + " removed");
View Full Code Here

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

         {
            ConnectionConfig connectionConfig = iter2.next();

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

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

            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

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

    */
   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

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

TOP

Related Classes of hermes.config.SessionConfig

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.