Package org.jboss.jms.client

Examples of org.jboss.jms.client.JBossConnectionFactory


   private void rebindConnectionFactory(Context ic, JNDIBindings jndiBindings,
                                        ConnectionFactoryDelegate delegate)
      throws NamingException
   {
      JBossConnectionFactory cf = new JBossConnectionFactory(delegate);

      if (jndiBindings != null)
      {
         List jndiNames = jndiBindings.getNames();
         for(Iterator i = jndiNames.iterator(); i.hasNext(); )
View Full Code Here


   public void testUpdateConnectionFactory() throws Exception
   {
      Connection conn = cf.createConnection();

      JBossConnectionFactory jbcf = (JBossConnectionFactory)cf;

      ClientClusteredConnectionFactoryDelegate cfDelegate =
         (ClientClusteredConnectionFactoryDelegate)jbcf.getDelegate();

      assertEquals(3, cfDelegate.getDelegates().length);

      Connection conn1 = cf.createConnection();
View Full Code Here

   }

   public void testUpdateMixedConnectionFactory() throws Exception
   {
      Connection conn = cf.createConnection();
      JBossConnectionFactory jbcf = (JBossConnectionFactory)cf;

      ClientClusteredConnectionFactoryDelegate cfDelegate =
         (ClientClusteredConnectionFactoryDelegate)jbcf.getDelegate();

      assertEquals(3, cfDelegate.getDelegates().length);

      ConnectionFactory httpCF = (ConnectionFactory)ic[0].lookup("/HTTPConnectionFactory");
      JBossConnectionFactory jbhttpCF = (JBossConnectionFactory) httpCF;
     
      Connection httpConn = httpCF.createConnection();

      ClientClusteredConnectionFactoryDelegate httpcfDelegate =
         (ClientClusteredConnectionFactoryDelegate)jbhttpCF.getDelegate();

      assertEquals(3, httpcfDelegate.getDelegates().length);


      validateCFs(cfDelegate, httpcfDelegate);
View Full Code Here

    */
   public void testUpdateConnectionFactoryRaceCondition() throws Exception
   {
      // This connection needs to be opened, as we need the callback to update CF from this conn
      Connection conn = cf.createConnection();
      JBossConnectionFactory jbcf = (JBossConnectionFactory) cf;
      ClientClusteredConnectionFactoryDelegate cfDelegate =
         (ClientClusteredConnectionFactoryDelegate) jbcf.getDelegate();
      assertEquals(3, cfDelegate.getDelegates().length);

      Connection conn1 = cf.createConnection();

      Connection conn2 = cf.createConnection();
View Full Code Here

      {
         InitialContext ic = new InitialContext(ServerManagement.getJNDIEnvironment(0));

         ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");

         JBossConnectionFactory jbcf = (JBossConnectionFactory)cf;
         ClientClusteredConnectionFactoryDelegate clusteredDelegate =
            (ClientClusteredConnectionFactoryDelegate )jbcf.getDelegate();

         assertSame(RoundRobinLoadBalancingPolicy.class,
            clusteredDelegate.getLoadBalancingPolicy().getClass());

         Connection conn0 = cf.createConnection();
View Full Code Here

      {
         InitialContext ic0 = new InitialContext(ServerManagement.getJNDIEnvironment(0));

         ConnectionFactory cf = (ConnectionFactory)ic0.lookup("/ConnectionFactory");

         JBossConnectionFactory jbcf = (JBossConnectionFactory)cf;
         ClientClusteredConnectionFactoryDelegate clusteredDelegate =
            (ClientClusteredConnectionFactoryDelegate )jbcf.getDelegate();

         assertSame(RoundRobinLoadBalancingPolicy.class,
            clusteredDelegate.getLoadBalancingPolicy().getClass());

         Connection conn0 = cf.createConnection();
View Full Code Here

      {
         InitialContext ic0 = new InitialContext(ServerManagement.getJNDIEnvironment(0));

         ConnectionFactory cf = (ConnectionFactory)ic0.lookup("/ConnectionFactory");

         JBossConnectionFactory jbcf = (JBossConnectionFactory)cf;
         ClientClusteredConnectionFactoryDelegate clusteredDelegate =
            (ClientClusteredConnectionFactoryDelegate )jbcf.getDelegate();

         assertSame(RandomLoadBalancingPolicy.class,
            clusteredDelegate.getLoadBalancingPolicy().getClass());

         Connection conn0 = cf.createConnection();
View Full Code Here

      {
         InitialContext ic0 = new InitialContext(ServerManagement.getJNDIEnvironment(0));

         ConnectionFactory cf = (ConnectionFactory)ic0.lookup("/ConnectionFactory");

         JBossConnectionFactory jbcf = (JBossConnectionFactory)cf;
         ClientClusteredConnectionFactoryDelegate clusteredDelegate =
            (ClientClusteredConnectionFactoryDelegate )jbcf.getDelegate();

         assertSame(RandomLoadBalancingPolicy.class,
            clusteredDelegate.getLoadBalancingPolicy().getClass());

         Connection conn0 = cf.createConnection();
View Full Code Here

      ObjectName cf3 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactory3", name3, "/TestConnectionFactory3", "clientid3");
      //Last one shares the same connector
      ObjectName cf4 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactory4", name3, "/TestConnectionFactory4", "clientid4");
     
     
      JBossConnectionFactory f1 = (JBossConnectionFactory)initialContext.lookup("/TestConnectionFactory1");           
      ClientConnectionFactoryDelegate del1 = (ClientConnectionFactoryDelegate)f1.getDelegate();     
     
      assertTrue(del1.getServerLocatorURI().startsWith("socket://localhost:1234"));
     
      JBossConnectionFactory f2 = (JBossConnectionFactory)initialContext.lookup("/TestConnectionFactory2");           
      ClientConnectionFactoryDelegate del2 = (ClientConnectionFactoryDelegate)f2.getDelegate();     
      assertTrue(del2.getServerLocatorURI().startsWith("socket://localhost:1235"));
     
      JBossConnectionFactory f3 = (JBossConnectionFactory)initialContext.lookup("/TestConnectionFactory3");           
      ClientConnectionFactoryDelegate del3 = (ClientConnectionFactoryDelegate)f3.getDelegate();     
      assertTrue(del3.getServerLocatorURI().startsWith("socket://localhost:1236"));
     
      JBossConnectionFactory f4 = (JBossConnectionFactory)initialContext.lookup("/TestConnectionFactory4");           
      ClientConnectionFactoryDelegate del4 = (ClientConnectionFactoryDelegate)f4.getDelegate();     
      assertTrue(del4.getServerLocatorURI().startsWith("socket://localhost:1236"));
     
      Connection con1 = f1.createConnection();
      Connection con2 = f2.createConnection();
      Connection con3 = f3.createConnection();
      Connection con4 = f4.createConnection();
      con1.close();
      con2.close();
      con3.close();
      con4.close();
     
      stopService(cf1);
      stopService(cf2);
      stopService(cf3);
     
      //Check f4 is still ok
      Connection conn5 = f4.createConnection();
      conn5.close();
     
      stopService(cf4);
     
      stopService(c1);
View Full Code Here

   /**
    * This test was created as per http://jira.jboss.org/jira/browse/JBMESSAGING-696.
    */
   public void testCloseOnFailover() throws Exception
   {
      JBossConnectionFactory factory = (JBossConnectionFactory) ic[0].lookup("/ConnectionFactory");

      Connection conn1 = factory.createConnection();
      Connection conn2 = factory.createConnection();
      Connection conn3 = factory.createConnection();

      Connection[] conn = new Connection[]{conn1, conn2, conn3};

      log.info("Connection delegate information after creation");

View Full Code Here

TOP

Related Classes of org.jboss.jms.client.JBossConnectionFactory

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.