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

Ron Sigal rsigal at belmont.prod.atl2.jboss.com
Wed Aug 30 21:25:23 EDT 2006


  User: rsigal  
  Date: 06/08/30 21:25:23

  Modified:    src/tests/org/jboss/test/remoting/performance/spring/http/web 
                        SpringHttpHandler.java
  Log:
  JBREM-595:  Callback server proxy is now created programmatically.
  
  Revision  Changes    Path
  1.2       +36 -4     JBossRemoting/src/tests/org/jboss/test/remoting/performance/spring/http/web/SpringHttpHandler.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SpringHttpHandler.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/performance/spring/http/web/SpringHttpHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- SpringHttpHandler.java	14 Aug 2006 22:06:34 -0000	1.1
  +++ SpringHttpHandler.java	31 Aug 2006 01:25:23 -0000	1.2
  @@ -12,10 +12,12 @@
   import org.jboss.remoting.callback.HandleCallbackException;
   import org.jboss.remoting.callback.InvokerCallbackHandler;
   import org.jboss.test.remoting.performance.spring.http.client.SpringHttpCallbackServer;
  +import org.jboss.test.remoting.performance.spring.rmi.SpringRMICallbackServer;
   import org.springframework.beans.factory.BeanFactory;
   import org.springframework.beans.factory.xml.XmlBeanFactory;
   import org.springframework.core.io.ClassPathResource;
   import org.springframework.core.io.Resource;
  +import org.springframework.remoting.rmi.RmiProxyFactoryBean;
   
   /**
    * @author <a href="mailto:tom at jboss.org">Tom Elrod</a>
  @@ -23,13 +25,43 @@
   public class SpringHttpHandler implements InvokerCallbackHandler
   {
      private SpringHttpCallbackServer springHttpCallbackServer;
  +   private String sessionId;
  +
  +   public SpringHttpHandler(String sessionId)
  +   {
  +      this.sessionId = sessionId;
  +   }
   
      public void start()
      {
  -      Resource res = new ClassPathResource("SpringHttpCallbackServerService.xml", SpringHttpHandler.class);
  -      BeanFactory factory = new XmlBeanFactory(res);
  -      springHttpCallbackServer = (SpringHttpCallbackServer)factory.getBean("springHttpCallbackServerService");
  +//      Resource res = new ClassPathResource("SpringHttpCallbackServerService.xml", SpringHttpHandler.class);
  +//      BeanFactory factory = new XmlBeanFactory(res);
  +//      springHttpCallbackServer = (SpringHttpCallbackServer)factory.getBean("springHttpCallbackServerService");
  +    
  +/*
  +      Instead of creating callback server proxies by injection, the following xml declaration is
  +      replaced by programmatic creation.  Each callback server is registered under a name
  +      ending in the sessionId.
  +      
  +   <bean id="springHttpCallbackServerService" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
  +      <property name="serviceUrl" value="rmi://localhost:1299/SpringHttpCallbackServerService"/>
  +      <property name="serviceInterface" value="org.jboss.test.remoting.performance.spring.http.client.SpringHttpCallbackServer"/>
  +   </bean>
  + */
   
  +      RmiProxyFactoryBean factory = new RmiProxyFactoryBean();
  +      factory.setServiceUrl("rmi://localhost:1299/SpringHttpCallbackServerService:" + sessionId);
  +      factory.setServiceInterface(org.jboss.test.remoting.performance.spring.http.client.SpringHttpCallbackServer.class);
  +      try
  +      {
  +         factory.afterPropertiesSet();
  +      }
  +      catch (Exception e)
  +      {
  +         System.out.println("unable to create callback proxy");
  +         System.out.println(e);
  +      }
  +      springHttpCallbackServer = (SpringHttpCallbackServer)factory.getObject(); 
      }
   
      public SpringHttpCallbackServer getSpringHttpCallbackServer()
  
  
  



More information about the jboss-cvs-commits mailing list