[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/transporter ...

Tom Elrod tom.elrod at jboss.com
Thu Mar 8 11:59:36 EST 2007


  User: telrod  
  Date: 07/03/08 11:59:36

  Modified:    src/main/org/jboss/remoting/transporter  Tag: remoting_2_x
                        TransporterClient.java
  Log:
  JBREM-720 - added ability to pass load balancer policy when creating transporter client.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.11.4.1  +21 -0     JBossRemoting/src/main/org/jboss/remoting/transporter/TransporterClient.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TransporterClient.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transporter/TransporterClient.java,v
  retrieving revision 1.11
  retrieving revision 1.11.4.1
  diff -u -b -r1.11 -r1.11.4.1
  --- TransporterClient.java	5 Jul 2006 17:01:48 -0000	1.11
  +++ TransporterClient.java	8 Mar 2007 16:59:36 -0000	1.11.4.1
  @@ -194,6 +194,27 @@
       *
       * @param locatorURI  - the remoting locator uri to the target server where the target POJO exists.
       * @param targetClass - the interface class of the POJO will be calling upon.
  +    * @param loadBalancer - policy for selecting which target server to use from list of available servers.
  +    * @return dynamic remote proxy typed to the interface specified by the targetClass param.
  +    * @throws Exception
  +    */
  +   public static Object createTransporterClient(String locatorURI, Class targetClass, LoadBalancer loadBalancer) throws Exception
  +   {
  +         if (InternalTransporterServices.getInstance().getNetworkRegistry() == null)
  +         {
  +            setupDetector();
  +         }
  +         InvokerLocator locator = new InvokerLocator(locatorURI);
  +         TransporterClient client = new TransporterClient(locator, targetClass.getName(), loadBalancer);
  +         return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),
  +                                       new Class[]{targetClass}, client);
  +   }
  +
  +   /**
  +    * Create a remote proxy to a POJO on a remote server.
  +    *
  +    * @param locatorURI  - the remoting locator uri to the target server where the target POJO exists.
  +    * @param targetClass - the interface class of the POJO will be calling upon.
       * @return dynamic remote proxy typed to the interface specified by the targetClass param.
       * @throws Exception
       */
  
  
  



More information about the jboss-cvs-commits mailing list