Examples of PersistedConnectionFactory


Examples of org.hornetq.jms.persistence.config.PersistedConnectionFactory

         byte rec = record.getUserRecordType();

         if (rec == CF_RECORD)
         {
            PersistedConnectionFactory cf = new PersistedConnectionFactory();
            cf.decode(buffer);
            cf.setId(id);
            mapFactories.put(cf.getName(), cf);
         }
         else if(rec == DESTINATION_RECORD)
         {
            PersistedDestination destination = new PersistedDestination();
            destination.decode(buffer);
View Full Code Here

Examples of org.hornetq.jms.persistence.config.PersistedConnectionFactory

         byte rec = record.getUserRecordType();

         if (rec == JMSJournalStorageManagerImpl.CF_RECORD)
         {
            PersistedConnectionFactory cf = new PersistedConnectionFactory();
            cf.decode(buffer);
            cf.setId(id);
            HornetQServerLogger.LOGGER.info("Found JMS connection factory: " + cf.getName());
            jmsConnectionFactories.put(cf.getName(), cf);
         }
         else if (rec == JMSJournalStorageManagerImpl.DESTINATION_RECORD)
         {
            PersistedDestination destination = new PersistedDestination();
            destination.decode(buffer);
View Full Code Here

Examples of org.hornetq.jms.persistence.config.PersistedConnectionFactory

   {
      xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORIES);
      for (String jmsConnectionFactoryKey : jmsConnectionFactories.keySet())
      {
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY);
         PersistedConnectionFactory jmsConnectionFactory = jmsConnectionFactories.get(jmsConnectionFactoryKey);
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_NAME);
         xmlWriter.writeCharacters(jmsConnectionFactory.getName());
         xmlWriter.writeEndElement();
         String clientID = jmsConnectionFactory.getConfig().getClientID();
         if (clientID != null)
         {
            xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_CLIENT_ID);
            xmlWriter.writeCharacters(clientID);
            xmlWriter.writeEndElement();
         }

         long callFailoverTimeout = jmsConnectionFactory.getConfig().getCallFailoverTimeout();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_CALL_FAILOVER_TIMEOUT);
         xmlWriter.writeCharacters(Long.toString(callFailoverTimeout));
         xmlWriter.writeEndElement();

         long callTimeout = jmsConnectionFactory.getConfig().getCallTimeout();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_CALL_TIMEOUT);
         xmlWriter.writeCharacters(Long.toString(callTimeout));
         xmlWriter.writeEndElement();

         long clientFailureCheckPeriod = jmsConnectionFactory.getConfig().getClientFailureCheckPeriod();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_CLIENT_FAILURE_CHECK_PERIOD);
         xmlWriter.writeCharacters(Long.toString(clientFailureCheckPeriod));
         xmlWriter.writeEndElement();

         int confirmationWindowSize = jmsConnectionFactory.getConfig().getConfirmationWindowSize();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_CONFIRMATION_WINDOW_SIZE);
         xmlWriter.writeCharacters(Integer.toString(confirmationWindowSize));
         xmlWriter.writeEndElement();

         long connectionTTL = jmsConnectionFactory.getConfig().getConnectionTTL();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_CONNECTION_TTL);
         xmlWriter.writeCharacters(Long.toString(connectionTTL));
         xmlWriter.writeEndElement();

         long consumerMaxRate = jmsConnectionFactory.getConfig().getConsumerMaxRate();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_CONSUMER_MAX_RATE);
         xmlWriter.writeCharacters(Long.toString(consumerMaxRate));
         xmlWriter.writeEndElement();

         long consumerWindowSize = jmsConnectionFactory.getConfig().getConsumerWindowSize();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_CONSUMER_WINDOW_SIZE);
         xmlWriter.writeCharacters(Long.toString(consumerWindowSize));
         xmlWriter.writeEndElement();

         String discoveryGroupName = jmsConnectionFactory.getConfig().getDiscoveryGroupName();
         if (discoveryGroupName != null)
         {
            xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_DISCOVERY_GROUP_NAME);
            xmlWriter.writeCharacters(discoveryGroupName);
            xmlWriter.writeEndElement();
         }

         int dupsOKBatchSize = jmsConnectionFactory.getConfig().getDupsOKBatchSize();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_DUPS_OK_BATCH_SIZE);
         xmlWriter.writeCharacters(Integer.toString(dupsOKBatchSize));
         xmlWriter.writeEndElement();

         JMSFactoryType factoryType = jmsConnectionFactory.getConfig().getFactoryType();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_TYPE);
         xmlWriter.writeCharacters(Integer.toString(factoryType.intValue()));
         xmlWriter.writeEndElement();

         String groupID = jmsConnectionFactory.getConfig().getGroupID();
         if (groupID != null)
         {
            xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_GROUP_ID);
            xmlWriter.writeCharacters(groupID);
            xmlWriter.writeEndElement();
         }

         String loadBalancingPolicyClassName = jmsConnectionFactory.getConfig().getLoadBalancingPolicyClassName();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_LOAD_BALANCING_POLICY_CLASS_NAME);
         xmlWriter.writeCharacters(loadBalancingPolicyClassName);
         xmlWriter.writeEndElement();

         long maxRetryInterval = jmsConnectionFactory.getConfig().getMaxRetryInterval();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_MAX_RETRY_INTERVAL);
         xmlWriter.writeCharacters(Long.toString(maxRetryInterval));
         xmlWriter.writeEndElement();

         long minLargeMessageSize = jmsConnectionFactory.getConfig().getMinLargeMessageSize();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_MIN_LARGE_MESSAGE_SIZE);
         xmlWriter.writeCharacters(Long.toString(minLargeMessageSize));
         xmlWriter.writeEndElement();

         long producerMaxRate = jmsConnectionFactory.getConfig().getProducerMaxRate();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_PRODUCER_MAX_RATE);
         xmlWriter.writeCharacters(Long.toString(producerMaxRate));
         xmlWriter.writeEndElement();

         long producerWindowSize = jmsConnectionFactory.getConfig().getProducerWindowSize();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_PRODUCER_WINDOW_SIZE);
         xmlWriter.writeCharacters(Long.toString(producerWindowSize));
         xmlWriter.writeEndElement();

         long reconnectAttempts = jmsConnectionFactory.getConfig().getReconnectAttempts();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_RECONNECT_ATTEMPTS);
         xmlWriter.writeCharacters(Long.toString(reconnectAttempts));
         xmlWriter.writeEndElement();

         long retryInterval = jmsConnectionFactory.getConfig().getRetryInterval();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_RETRY_INTERVAL);
         xmlWriter.writeCharacters(Long.toString(retryInterval));
         xmlWriter.writeEndElement();

         double retryIntervalMultiplier = jmsConnectionFactory.getConfig().getRetryIntervalMultiplier();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_RETRY_INTERVAL_MULTIPLIER);
         xmlWriter.writeCharacters(Double.toString(retryIntervalMultiplier));
         xmlWriter.writeEndElement();

         long scheduledThreadPoolMaxSize = jmsConnectionFactory.getConfig().getScheduledThreadPoolMaxSize();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_SCHEDULED_THREAD_POOL_MAX_SIZE);
         xmlWriter.writeCharacters(Long.toString(scheduledThreadPoolMaxSize));
         xmlWriter.writeEndElement();

         long threadPoolMaxSize = jmsConnectionFactory.getConfig().getThreadPoolMaxSize();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_THREAD_POOL_MAX_SIZE);
         xmlWriter.writeCharacters(Long.toString(threadPoolMaxSize));
         xmlWriter.writeEndElement();

         long transactionBatchSize = jmsConnectionFactory.getConfig().getTransactionBatchSize();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_TRANSACTION_BATCH_SIZE);
         xmlWriter.writeCharacters(Long.toString(transactionBatchSize));
         xmlWriter.writeEndElement();

         boolean autoGroup = jmsConnectionFactory.getConfig().isAutoGroup();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_AUTO_GROUP);
         xmlWriter.writeCharacters(Boolean.toString(autoGroup));
         xmlWriter.writeEndElement();

         boolean blockOnAcknowledge = jmsConnectionFactory.getConfig().isBlockOnAcknowledge();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_BLOCK_ON_ACKNOWLEDGE);
         xmlWriter.writeCharacters(Boolean.toString(blockOnAcknowledge));
         xmlWriter.writeEndElement();

         boolean blockOnDurableSend = jmsConnectionFactory.getConfig().isBlockOnDurableSend();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_BLOCK_ON_DURABLE_SEND);
         xmlWriter.writeCharacters(Boolean.toString(blockOnDurableSend));
         xmlWriter.writeEndElement();

         boolean blockOnNonDurableSend = jmsConnectionFactory.getConfig().isBlockOnNonDurableSend();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_BLOCK_ON_NON_DURABLE_SEND);
         xmlWriter.writeCharacters(Boolean.toString(blockOnNonDurableSend));
         xmlWriter.writeEndElement();

         boolean cacheLargeMessagesClient = jmsConnectionFactory.getConfig().isCacheLargeMessagesClient();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_CACHE_LARGE_MESSAGES_CLIENT);
         xmlWriter.writeCharacters(Boolean.toString(cacheLargeMessagesClient));
         xmlWriter.writeEndElement();

         boolean compressLargeMessages = jmsConnectionFactory.getConfig().isCompressLargeMessages();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_COMPRESS_LARGE_MESSAGES);
         xmlWriter.writeCharacters(Boolean.toString(compressLargeMessages));
         xmlWriter.writeEndElement();

         boolean failoverOnInitialConnection = jmsConnectionFactory.getConfig().isFailoverOnInitialConnection();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_FAILOVER_ON_INITIAL_CONNECTION);
         xmlWriter.writeCharacters(Boolean.toString(failoverOnInitialConnection));
         xmlWriter.writeEndElement();

         boolean ha = jmsConnectionFactory.getConfig().isHA();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_HA);
         xmlWriter.writeCharacters(Boolean.toString(ha));
         xmlWriter.writeEndElement();

         boolean preAcknowledge = jmsConnectionFactory.getConfig().isPreAcknowledge();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_PREACKNOWLEDGE);
         xmlWriter.writeCharacters(Boolean.toString(preAcknowledge));
         xmlWriter.writeEndElement();

         boolean useGlobalPools = jmsConnectionFactory.getConfig().isUseGlobalPools();
         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_USE_GLOBAL_POOLS);
         xmlWriter.writeCharacters(Boolean.toString(useGlobalPools));
         xmlWriter.writeEndElement();

         xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_CONNECTORS);
         for (String connector : jmsConnectionFactory.getConfig().getConnectorNames())
         {
            xmlWriter.writeStartElement(XmlDataConstants.JMS_CONNECTION_FACTORY_CONNECTOR);
            xmlWriter.writeCharacters(connector);
            xmlWriter.writeEndElement();
         }
         xmlWriter.writeEndElement();

         xmlWriter.writeStartElement(XmlDataConstants.JMS_JNDI_ENTRIES);
         PersistedJNDI jndi = jmsJNDI.get(new Pair<>(PersistedType.ConnectionFactory, jmsConnectionFactory.getName()));
         for (String jndiEntry : jndi.getJndi())
         {
            xmlWriter.writeStartElement(XmlDataConstants.JMS_JNDI_ENTRY);
            xmlWriter.writeCharacters(jndiEntry);
            xmlWriter.writeEndElement();
View Full Code Here

Examples of org.hornetq.jms.persistence.config.PersistedConnectionFactory

      }
     

      ConnectionFactoryConfiguration config = new ConnectionFactoryConfigurationImpl("some-name", transportConfigs);

      addSetting(new PersistedConnectionFactory(config));

      jmsJournal.stop();

      createJMSStorage();

      List<PersistedConnectionFactory> cfs = jmsJournal.recoverConnectionFactories();

      assertEquals(1, cfs.size());

      assertEquals("some-name", cfs.get(0).getName());
     
      PersistedConnectionFactory cf1 = cfs.get(0);
     
      assertEquals(5, cf1.getConfig().getConnectorConfigs().size());
     
      int i = 0 ;
      for (Pair<TransportConfiguration, TransportConfiguration> itemCf : cf1.getConfig().getConnectorConfigs())
      {
        
         assertEquals(itemCf.a.toString(), "c1-" + i);
         assertEquals(itemCf.b.toString(), "c2-" + i);
         i++;
View Full Code Here

Examples of org.hornetq.jms.persistence.config.PersistedConnectionFactory

      config.encode(buffer);

      assertEquals(size, buffer.writerIndex());
     
      PersistedConnectionFactory persistedCF = new PersistedConnectionFactory(config);
     
      size = persistedCF.getEncodeSize();

      buffer = HornetQBuffers.fixedBuffer(size);
     
      persistedCF.encode(buffer);
     
      assertEquals(size, buffer.writerIndex());
     
   }
View Full Code Here

Examples of org.hornetq.jms.persistence.config.PersistedConnectionFactory

      String[] usedJNDI = bindings.toArray(new String[bindings.size()]);
      addToBindings(connectionFactoryJNDI, cfConfig.getName(), usedJNDI);

      if (storeConfig)
      {
         storage.storeConnectionFactory(new PersistedConnectionFactory(cfConfig));
         storage.addJNDI(PersistedType.ConnectionFactory, cfConfig.getName(), usedJNDI);
      }
   }
View Full Code Here

Examples of org.hornetq.jms.persistence.config.PersistedConnectionFactory

      String[] usedJNDI = bindings.toArray(new String[bindings.size()]);
      addToBindings(connectionFactoryJNDI, cfConfig.getName(), usedJNDI);

      if (storeConfig)
      {
         storage.storeConnectionFactory(new PersistedConnectionFactory(cfConfig));
         storage.addJNDI(PersistedType.ConnectionFactory, cfConfig.getName(), usedJNDI);
      }
   }
View Full Code Here

Examples of org.hornetq.jms.persistence.config.PersistedConnectionFactory

      }
     

      ConnectionFactoryConfiguration config = new ConnectionFactoryConfigurationImpl("some-name", false,  transportConfigs);

      addSetting(new PersistedConnectionFactory(config));

      jmsJournal.stop();

      createJMSStorage();

      List<PersistedConnectionFactory> cfs = jmsJournal.recoverConnectionFactories();

      assertEquals(1, cfs.size());

      assertEquals("some-name", cfs.get(0).getName());
     
      PersistedConnectionFactory cf1 = cfs.get(0);
     
      assertEquals(10, cf1.getConfig().getConnectorNames().size());
     
      List<String> configs = cf1.getConfig().getConnectorNames();
      for (int i = 0, j = 0; i < 10; i+=2, j++)
      {
         assertEquals(configs.get(i), "c1-" + j);
         assertEquals(configs.get(i+1), "c2-" + j);
      }
View Full Code Here

Examples of org.hornetq.jms.persistence.config.PersistedConnectionFactory

      config.encode(buffer);

      assertEquals(size, buffer.writerIndex());
     
      PersistedConnectionFactory persistedCF = new PersistedConnectionFactory(config);
     
      size = persistedCF.getEncodeSize();

      buffer = HornetQBuffers.fixedBuffer(size);
     
      persistedCF.encode(buffer);
     
      assertEquals(size, buffer.writerIndex());
     
   }
View Full Code Here

Examples of org.hornetq.jms.persistence.config.PersistedConnectionFactory

      List<Pair<String, String>> connectors = new ArrayList<Pair<String,String>>();
      connectors.add(new Pair<String, String>(RandomUtil.randomString(), null));
      //config.setConnectorNames(connectors);
      config.setCallTimeout(RandomUtil.randomPositiveLong());
     
      addSetting(new PersistedConnectionFactory(config));

      jmsJournal.stop();

      createJMSStorage();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.