Package org.jboss.jms.client.delegate

Examples of org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate


   public void testRestartServer() throws Exception
   {
      JBossConnectionFactory cf2 = (JBossConnectionFactory) ic[1].lookup("/ConnectionFactory");

      ClientClusteredConnectionFactoryDelegate clusterCF = (ClientClusteredConnectionFactoryDelegate)cf.getDelegate();
      ClientConnectionFactoryDelegate delegates[] = clusterCF.getDelegates();
      clusterCF.closeCallback(false);

      ServerManagement.kill(1);

      //Restart the server on the same place
View Full Code Here


      //Last one shares the same connector
      ObjectName cf4 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactory4", name3, "/TestConnectionFactory4", "clientid4", false);


      JBossConnectionFactory f1 = (JBossConnectionFactory)ic.lookup("/TestConnectionFactory1");
      ClientConnectionFactoryDelegate del1 = (ClientConnectionFactoryDelegate)f1.getDelegate();

      assertTrue(del1.getServerLocatorURI().startsWith("bisocket://localhost:1234"));

      JBossConnectionFactory f2 = (JBossConnectionFactory)ic.lookup("/TestConnectionFactory2");
      ClientConnectionFactoryDelegate del2 = (ClientConnectionFactoryDelegate)f2.getDelegate();
      assertTrue(del2.getServerLocatorURI().startsWith("bisocket://localhost:1235"));

      JBossConnectionFactory f3 = (JBossConnectionFactory)ic.lookup("/TestConnectionFactory3");
      ClientConnectionFactoryDelegate del3 = (ClientConnectionFactoryDelegate)f3.getDelegate();
      assertTrue(del3.getServerLocatorURI().startsWith("bisocket://localhost:1236"));

      JBossConnectionFactory f4 = (JBossConnectionFactory)ic.lookup("/TestConnectionFactory4");
      ClientConnectionFactoryDelegate del4 = (ClientConnectionFactoryDelegate)f4.getDelegate();
      assertTrue(del4.getServerLocatorURI().startsWith("bisocket://localhost:1236"));

      Connection con1 = f1.createConnection();
      Connection con2 = f2.createConnection();
      Connection con3 = f3.createConnection();
      Connection con4 = f4.createConnection();
View Full Code Here

   // Validate if two distinct CFs are valid
   private void validateCFs(ClientClusteredConnectionFactoryDelegate cfDelegate,
                            ClientClusteredConnectionFactoryDelegate httpcfDelegate)
   {
      ClientConnectionFactoryDelegate delegatesSocket[] = cfDelegate.getDelegates();
      ClientConnectionFactoryDelegate delegatesHTTP[] = httpcfDelegate.getDelegates();

      log.info("ValidateCFs:");

      assertEquals(delegatesSocket.length, delegatesHTTP.length);
      for (int i=0;i<delegatesSocket.length;i++)
View Full Code Here

   public void testRestartServer() throws Exception
   {
      JBossConnectionFactory cf2 = (JBossConnectionFactory) ic[1].lookup("/ConnectionFactory");

      ClientClusteredConnectionFactoryDelegate clusterCF = (ClientClusteredConnectionFactoryDelegate)cf.getDelegate();
      ClientConnectionFactoryDelegate delegates[] = clusterCF.getDelegates();
      clusterCF.closeCallback();

      ServerManagement.kill(1);

      //Restart the server on the same place
View Full Code Here

      ClientClusteredConnectionFactoryDelegate delegate =
         (ClientClusteredConnectionFactoryDelegate)cf.getDelegate();

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

      ClientConnectionFactoryDelegate cf1 = delegate.getDelegates()[0];

      ClientConnectionFactoryDelegate cf2 = delegate.getDelegates()[1];

      ClientConnectionFactoryDelegate cf3 = delegate.getDelegates()[2];

      assertEquals(0, cf1.getServerID());

      assertEquals(1, cf2.getServerID());

      assertEquals(2, cf3.getServerID());

      assertEquals(3, ServerManagement.getServer(0).getNodeIDView().size());

      Connection conn1 = null;
View Full Code Here

   // Validate if two distinct CFs are valid
   private void validateCFs(ClientClusteredConnectionFactoryDelegate cfDelegate,
                            ClientClusteredConnectionFactoryDelegate httpcfDelegate)
   {
      ClientConnectionFactoryDelegate delegatesSocket[] = cfDelegate.getDelegates();
      ClientConnectionFactoryDelegate delegatesHTTP[] = httpcfDelegate.getDelegates();

      log.info("ValidateCFs:");

      assertEquals(delegatesSocket.length, delegatesHTTP.length);
      for (int i=0;i<delegatesSocket.length;i++)
View Full Code Here

      boolean creatingClustered = (supportsFailover || supportsLoadBalancing) && replicator != null;
     
      //The server peer strict setting overrides the connection factory
      boolean useStrict = serverPeer.isStrictTck() || strictTck;

      ClientConnectionFactoryDelegate localDelegate =
         new ClientConnectionFactoryDelegate(uniqueName, id, serverPeer.getServerPeerID(),
                                             locatorURI, version, clientPing, useStrict);

      log.debug(this + " created local delegate " + localDelegate);

      // When registering a new clustered connection factory I should first create it with the
View Full Code Here

      Collections.sort(localDels,
         new Comparator()
         {
            public int compare(Object obj1, Object obj2)
            {
               ClientConnectionFactoryDelegate del1 = (ClientConnectionFactoryDelegate)obj1;
               ClientConnectionFactoryDelegate del2 = (ClientConnectionFactoryDelegate)obj2;
               return del1.getServerID() - del2.getServerID();
            }
         });

      return localDels;
   }
View Full Code Here

   {
     Iterator iter = factories.iterator();
     InvokerLocator prevLocator = null;
     while (iter.hasNext())
     {
       ClientConnectionFactoryDelegate fact = (ClientConnectionFactoryDelegate)iter.next();
      
       //Sanity check - the locator protocol and params MUST be the same on each node
       String locatorString = fact.getServerLocatorURI();
      
       InvokerLocator locator = new InvokerLocator(locatorString);
      
       if (prevLocator != null)
       {
View Full Code Here

    {
      Map.Entry entry = (Map.Entry)iter.next();
     
      Integer nid = (Integer)entry.getKey();
     
      ClientConnectionFactoryDelegate delegate = (ClientConnectionFactoryDelegate)entry.getValue();
     
      if (connections.get(nid) == null)
      {
        try
        {
View Full Code Here

TOP

Related Classes of org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate

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.