[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/performance/spring/rmi ...

Ron Sigal rsigal at belmont.prod.atl2.jboss.com
Tue Aug 29 20:59:47 EDT 2006


  User: rsigal  
  Date: 06/08/29 20:59:47

  Modified:    src/tests/org/jboss/test/remoting/performance/spring/rmi 
                        SpringRMIPerformanceClient.java
  Log:
  JBREM-592:  Callback servers are now exported programatically under name ending in sessionId.
  
  Revision  Changes    Path
  1.3       +35 -1     JBossRemoting/src/tests/org/jboss/test/remoting/performance/spring/rmi/SpringRMIPerformanceClient.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SpringRMIPerformanceClient.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/performance/spring/rmi/SpringRMIPerformanceClient.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- SpringRMIPerformanceClient.java	29 Aug 2006 04:23:03 -0000	1.2
  +++ SpringRMIPerformanceClient.java	30 Aug 2006 00:59:47 -0000	1.3
  @@ -21,6 +21,7 @@
   import org.springframework.context.support.FileSystemXmlApplicationContext;
   import org.springframework.core.io.ClassPathResource;
   import org.springframework.core.io.Resource;
  +import org.springframework.remoting.rmi.RmiServiceExporter;
   
   import java.rmi.server.UID;
   import java.util.Map;
  @@ -101,6 +102,7 @@
            try
            {
               context = new FileSystemXmlApplicationContext(springServiceXml);
  +            if (context != null)
               break;
            }
            catch (Exception e)
  @@ -112,6 +114,38 @@
         SpringRMICallbackServer callbackServer = (SpringRMICallbackServer) context.getBean("springRMICallbackServerService");
         callbackServer.setClientSessionId(clientSessionId);
         callbackServer.setServerDoneLock(serverDoneLock);
  +      
  +/*
  +      Instead of creating callback servers by injection, the following xml declaration is
  +      replaced by programmatic creation.  Each callback server is registered under a name
  +      ending in the sessionId.
  +    
  +   <bean class="org.springframework.remoting.rmi.RmiServiceExporter">
  +      <property name="serviceName" value="SpringRMICallbackServerService"/>
  +      <property name="service" ref="springRMICallbackServerService"/>
  +      <!--<property name="servicePort" value="1300"/>-->
  +      <property name="serviceInterface" value="org.jboss.test.remoting.performance.spring.rmi.SpringRMICallbackServer"/>
  +      <property name="registryPort" value="1299"/>
  +   </bean> 
  +*/
  +      for (int i = 0; i < 10; i++)
  +      {
  +         try
  +         {
  +            RmiServiceExporter exporter = new RmiServiceExporter();
  +            exporter.setServiceName("SpringRMICallbackServerService:" + clientSessionId);
  +            exporter.setService(callbackServer);
  +            exporter.setServiceInterface(org.jboss.test.remoting.performance.spring.rmi.SpringRMICallbackServer.class);
  +            exporter.setRegistryPort(1299);
  +            exporter.afterPropertiesSet();
  +            log.info("exported SpringRMICallbackServerService:" + clientSessionId);
  +         }
  +         catch (Exception e)
  +         {
  +            Thread.sleep(2000);
  +         }
  +      }
  +      
         return callbackServer;
   
   //      RMICallbackServer callbackServer = new RMICallbackServer(clientSessionId, serverDoneLock);
  
  
  



More information about the jboss-cvs-commits mailing list