Announcement Announcement Module
Collapse
No announcement yet.
Making Service Exported by RmiServiceExporter stateful Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #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

    Comment

    Working...
    X