[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:45:25 EDT 2006
User: rsigal
Date: 06/08/29 20:45:25
Modified: src/tests/org/jboss/test/remoting/performance/spring/rmi
SpringRMIHandler.java
Log:
JBREM-592: (1) New constructor gets sessionId parameter. (2) Callback are created programmatically instead of declaratively, and registered with a name ending in sessionId.
Revision Changes Path
1.2 +36 -8 JBossRemoting/src/tests/org/jboss/test/remoting/performance/spring/rmi/SpringRMIHandler.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SpringRMIHandler.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/performance/spring/rmi/SpringRMIHandler.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- SpringRMIHandler.java 13 Aug 2006 19:30:05 -0000 1.1
+++ SpringRMIHandler.java 30 Aug 2006 00:45:25 -0000 1.2
@@ -11,10 +11,7 @@
import org.jboss.remoting.callback.Callback;
import org.jboss.remoting.callback.HandleCallbackException;
import org.jboss.remoting.callback.InvokerCallbackHandler;
-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>
@@ -22,13 +19,44 @@
public class SpringRMIHandler implements InvokerCallbackHandler
{
private SpringRMICallbackServer springRMICallbackServer;
+ private String sessionId;
+
+ public SpringRMIHandler(String sessionId)
+ {
+ this.sessionId = sessionId;
+ }
public void start()
{
- Resource res = new ClassPathResource("SpringRMICallbackServerService.xml", SpringRMIHandler.class);
- BeanFactory factory = new XmlBeanFactory(res);
- springRMICallbackServer = (SpringRMICallbackServer)factory.getBean("springRMICallbackServerService");
+// Resource res = new ClassPathResource("SpringRMICallbackServerService.xml", SpringRMIHandler.class);
+// BeanFactory factory = new XmlBeanFactory(res);
+// springRMICallbackServer = (SpringRMICallbackServer)factory.getBean("springRMICallbackServerService:" );
+
+
+/*
+ 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="springRMICallbackServerService" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
+ <property name="serviceUrl" value="rmi://localhost:1299/SpringRMICallbackServerService"/>
+ <property name="serviceInterface" value="org.jboss.test.remoting.performance.spring.rmi.SpringRMICallbackServer"/>
+ </bean>
+ */
+ RmiProxyFactoryBean factory = new RmiProxyFactoryBean();
+ factory.setServiceUrl("rmi://localhost:1299/SpringRMICallbackServerService:" + sessionId);
+ factory.setServiceInterface(org.jboss.test.remoting.performance.spring.rmi.SpringRMICallbackServer.class);
+ try
+ {
+ factory.afterPropertiesSet();
+ }
+ catch (Exception e)
+ {
+ System.out.println("unable to create callback proxy");
+ System.out.println(e);
+ }
+ springRMICallbackServer = (SpringRMICallbackServer)factory.getObject();
}
public SpringRMICallbackServer getSpringRMICallbackServer()
More information about the jboss-cvs-commits
mailing list