[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/samples/detection/jndi ...

Ron Sigal ron_sigal at yahoo.com
Wed Oct 11 16:25:30 EDT 2006


  User: rsigal  
  Date: 06/10/11 16:25:30

  Modified:    src/main/org/jboss/remoting/samples/detection/jndi 
                        SimpleDetectorClient.java
  Log:
  JBREM-581, JBREM-603: Added overridable getConfiguration() method which returns configuration map to be passed to Client and JNDIDetector.  
  
  Revision  Changes    Path
  1.3       +13 -2     JBossRemoting/src/main/org/jboss/remoting/samples/detection/jndi/SimpleDetectorClient.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SimpleDetectorClient.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/samples/detection/jndi/SimpleDetectorClient.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- SimpleDetectorClient.java	21 May 2006 04:47:26 -0000	1.2
  +++ SimpleDetectorClient.java	11 Oct 2006 20:25:30 -0000	1.3
  @@ -12,6 +12,8 @@
   import javax.management.NotificationListener;
   import javax.management.ObjectName;
   import java.net.InetAddress;
  +import java.util.Map;
  +import java.util.HashMap;
   
   /**
    * Simple remoting client that uses detection to discover the remoting server to make invocation on. Note that this
  @@ -54,7 +56,7 @@
         String detectorHost = InetAddress.getLocalHost().getHostName();
         
         // jndi detector will detect new network registries that come online
  -      JNDIDetector detector = new JNDIDetector();
  +      JNDIDetector detector = new JNDIDetector(getConfiguration());
         // set config info for detector and start it.
         detector.setPort(detectorPort);
         detector.setHost(detectorHost);
  @@ -128,12 +130,13 @@
         InvokerLocator locator = new InvokerLocator(locatorURI);
         println("Sending welcome message to remoting server with locator uri of: " + locatorURI);
   
  -      Client remotingClient = new Client(locator);
  +      Client remotingClient = new Client(locator, getConfiguration());
         remotingClient.connect();
         Object response = remotingClient.invoke("Welcome Aboard!", null);
   
         println("The newly discovered server sent this response to our welcome message: " + response);
   
  +      remotingClient.disconnect();
         return;
      }
   
  @@ -173,4 +176,12 @@
      {
         System.out.println(new java.util.Date() + ": [CLIENT]: " + msg);
      }
  +   
  +   /**
  +    * @return configuration map for JNDIDetector
  +    */
  +   protected Map getConfiguration()
  +   {
  +      return new HashMap();
  +   }
   }
  
  
  



More information about the jboss-cvs-commits mailing list