Examples of PooledConnectionFactory


Examples of org.apache.activemq.pool.PooledConnectionFactory

        // Another way of guaranteeing order is to use persistent messages or transactions.
        connectionFactory.setUseAsyncSend(false);

        connectionFactory.setAlwaysSessionAsync(false);
        // use a pooled connection factory
        PooledConnectionFactory pooled = new PooledConnectionFactory(connectionFactory);
        pooled.setMaxConnections(8);
        return pooled;
    }
View Full Code Here

Examples of org.apache.activemq.pool.PooledConnectionFactory

        connectionFactory.setOptimizedMessageDispatch(true);
        connectionFactory.setUseAsyncSend(true);
        connectionFactory.setAlwaysSessionAsync(false);

        // use a pooled connection factory
        PooledConnectionFactory pooled = new PooledConnectionFactory(connectionFactory);
        pooled.setMaxConnections(8);
        return pooled;
    }
View Full Code Here

Examples of org.apache.activemq.pool.PooledConnectionFactory

    public class AMQConnectionResource implements ConnectionResource {
        private PooledConnectionFactory pcf;

        public AMQConnectionResource(String connectString, int maxConnections) {
            pcf = new PooledConnectionFactory(connectString);
            pcf.setMaxConnections(maxConnections);
            pcf.start();
        }
View Full Code Here

Examples of org.apache.activemq.pool.PooledConnectionFactory

    private CamelJmsTestHelper() {
    }

    public static PooledConnectionFactory createPooledConnectionFactory() {
        ConnectionFactory cf = createConnectionFactory(null);
        PooledConnectionFactory pooled = new PooledConnectionFactory();
        pooled.setConnectionFactory(cf);
        pooled.setMaxConnections(8);
        return pooled;
    }
View Full Code Here

Examples of org.apache.activemq.pool.PooledConnectionFactory

        // Another way of guaranteeing order is to use persistent messages or transactions.
        connectionFactory.setUseAsyncSend(false);

        connectionFactory.setAlwaysSessionAsync(false);
        // use a pooled connection factory
        PooledConnectionFactory pooled = new PooledConnectionFactory(connectionFactory);
        pooled.setMaxConnections(8);
        return pooled;
    }
View Full Code Here

Examples of org.apache.activemq.pool.PooledConnectionFactory

        connectionFactory.setOptimizedMessageDispatch(true);
        connectionFactory.setUseAsyncSend(true);
        connectionFactory.setAlwaysSessionAsync(false);

        // use a pooled connection factory
        PooledConnectionFactory pooled = new PooledConnectionFactory(connectionFactory);
        pooled.setMaxConnections(8);
        return pooled;
    }
View Full Code Here

Examples of org.apache.activemq.pool.PooledConnectionFactory

  // This should fail with incubator-activemq-fuse-4.1.0.5
  public void testQueueLimitsWithOneBrokerSameConnection() throws Exception {

    BrokerService brokerService1 = null;
    ActiveMQConnectionFactory acf = null;
    PooledConnectionFactory pcf = null;
    DefaultMessageListenerContainer container1 = null;

    try {
      brokerService1 = createBrokerService("broker1", URL1, null);
      brokerService1.start();

      acf = createConnectionFactory(URL1);
      pcf = new PooledConnectionFactory(acf);

      // Only listen on the first queue.. let the 2nd queue fill up.
      doneLatch = new CountDownLatch(NUM_MESSAGE_TO_SEND);
      container1 = createDefaultMessageListenerContainer(acf,  new TestMessageListener1(500), QUEUE1_NAME);
      container1.afterPropertiesSet();
View Full Code Here

Examples of org.infinispan.loaders.jdbc.connectionfactory.PooledConnectionFactory

      static boolean started = false;

      @Override
      public void start(ConnectionFactoryConfig config, ClassLoader classLoader) throws CacheLoaderException {
         if (!started) {
            sharedFactory = new PooledConnectionFactory();
            sharedFactory.start(config, classLoader);
            started = true;
         }
      }
View Full Code Here

Examples of org.infinispan.persistence.jdbc.connectionfactory.PooledConnectionFactory

      }
   }

   public static void verifyConnectionLeaks(ConnectionFactory connectionFactory) {
      if (connectionFactory instanceof PooledConnectionFactory) {
         PooledConnectionFactory pcf = (PooledConnectionFactory) connectionFactory;
         try {
            Thread.sleep(500); // C3P0 needs a little delay before reporting the correct number of connections. Bah!
            assertEquals(pcf.getPooledDataSource().getNumBusyConnectionsAllUsers(), 0);
         } catch (Exception e) {
            throw new RuntimeException(e);
         }
      } else if (connectionFactory instanceof SimpleConnectionFactory) {
         SimpleConnectionFactory scf = (SimpleConnectionFactory) connectionFactory;
View Full Code Here

Examples of org.infinispan.persistence.jdbc.connectionfactory.PooledConnectionFactory

      static boolean started = false;

      @Override
      public void start(ConnectionFactoryConfiguration config, ClassLoader classLoader) throws PersistenceException {
         if (!started) {
            sharedFactory = new PooledConnectionFactory();
            sharedFactory.start(config, classLoader);
            started = true;
         }
      }
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.