Package org.jboss.jms.client.delegate

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


      // We attempt to connect to the next node in a loop, since we might need to go through
      // multiple hops

      int attemptCount = 0;
      ClientConnectionFactoryDelegate delegate = null;

      while (attemptCount < MAX_RECONNECT_HOP_COUNT)
      {
         // since an exception might be captured during an attempt, this has to be the first
         // operation
         attemptCount++;

         int nextHopingServer = -1;
         try
         {
            int failedNodeIDToServer = -1;
            if (delegate == null)
            {
               if (failedNodeID != null && failedNodeID.intValue() >= 0)
               {
                 //It's a reconnect after failover
                  delegate = getFailoverDelegateForNode(failedNodeID);
                  failedNodeIDToServer = failedNodeID.intValue();
                  nextHopingServer = delegate.getServerID();
               }
               else
               {
                 //It's a first time create connection
                  LoadBalancingPolicy loadBalancingPolicy = clusteredDelegate.getLoadBalancingPolicy();                 
                  delegate = (ClientConnectionFactoryDelegate)loadBalancingPolicy.getNext();
               }
            }

            log.trace(this + " has chosen " + delegate + " as target, " +
               (attemptCount == 0 ? "first connection attempt" : attemptCount + " connection attempts"));
 
            CreateConnectionResult res = delegate.
               createConnectionDelegate(username, password, failedNodeIDToServer);
           
            ClientConnectionDelegate cd = (ClientConnectionDelegate)res.getDelegate();

            if (cd != null)
View Full Code Here


      delegates = new ClientConnectionFactoryDelegate[len];

      for (int i = 0; i < len; i++)
      {
         delegates[i] = new ClientConnectionFactoryDelegate();

         delegates[i].read(is);
      }

      len = is.readInt();
View Full Code Here

      // We attempt to connect to the next node in a loop, since we might need to go through
      // multiple hops

      int attemptCount = 0;
      ClientConnectionFactoryDelegate delegate = null;

      while (attemptCount < MAX_RECONNECT_HOP_COUNT)
      {
         // since an exception might be captured during an attempt, this has to be the first
         // operation
         attemptCount++;

         int nextHopingServer = -1;
         try
         {
            int failedNodeIDToServer = -1;
            if (delegate == null)
            {
               if (failedNodeID != null && failedNodeID.intValue() >= 0)
               {
                 //It's a reconnect after failover
                  delegate = getFailoverDelegateForNode(failedNodeID);
                  failedNodeIDToServer = failedNodeID.intValue();
                  nextHopingServer = delegate.getServerID();
               }
               else
               {
                 //It's a first time create connection
                  LoadBalancingPolicy loadBalancingPolicy = clusteredDelegate.getLoadBalancingPolicy();                 
                  delegate = (ClientConnectionFactoryDelegate)loadBalancingPolicy.getNext();
               }
            }

            log.trace(this + " has chosen " + delegate + " as target, " +
               (attemptCount == 0 ? "first connection attempt" : attemptCount + " connection attempts"));
 
            CreateConnectionResult res = delegate.
               createConnectionDelegate(username, password, failedNodeIDToServer);
           
            ClientConnectionDelegate cd = (ClientConnectionDelegate)res.getDelegate();

            if (cd != null)
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

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

      ClientConnectionFactoryDelegate[] delegates = delegate.getDelegates();

      ClientConnectionFactoryDelegate cf1 = delegates[0];

      ClientConnectionFactoryDelegate cf2 = delegates[1];

      ClientConnectionFactoryDelegate cf3 = delegates[2];

      int server0Id = cf1.getServerID();

      int server1Id = cf2.getServerID();

      int server2Id = cf3.getServerID();

      log.info("server 0 id: " + server0Id);

      log.info("server 1 id: " + server1Id);
View Full Code Here

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

      ClientConnectionFactoryDelegate[] delegates = delegate.getDelegates();

      ClientConnectionFactoryDelegate cf1 = delegates[0];

      ClientConnectionFactoryDelegate cf2 = delegates[1];

      ClientConnectionFactoryDelegate cf3 = delegates[2];

      int server0Id = cf1.getServerID();

      int server1Id = cf2.getServerID();

      int server2Id = cf3.getServerID();

      log.info("server 0 id: " + server0Id);

      log.info("server 1 id: " + server1Id);
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

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.