-
Apr 7th, 2008, 11:46 PM
#1
Making Service Exported by RmiServiceExporter stateful
Hi,
I have a service that I want to expose to the outside world on RMI protocol. My bean definition looks like following:
<bean class="org.springframework.remoting.rmi.RmiService Exporter">
<property name="serviceName" value="MyService" />
<property name="service">
<bean id="myService"
class="com.test.service.MyServiceImpl"
scope="prototype">
<property name="factory">
<ref bean="csSessionFactory" />
</property>
<property name="batchSize" value="10" />
</bean>
</property>
<property name="serviceInterface"
value="com.test.service.MyService" />
<property name="registryPort" value="1199" />
</bean>
One of my requirement is to make this service stateful i.e. I want a dedicated service bean for each client connection. Currently even though I have specified the service implementation bean scope as "prototype" a single instance is used to serve multiple requests. How do I change this behavior? Is there a way to mark a service interface stateful?
- SD
-
Apr 8th, 2008, 06:20 AM
#2
I have been able to get this to work by making the "session" level attributes of the service as ThreadLocal. Dose anyone has any other suggestions?
- SD
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules