Results 1 to 2 of 2

Thread: Making Service Exported by RmiServiceExporter stateful

Hybrid View

  1. #1
    Join Date
    Apr 2008
    Posts
    6

    Default 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. #2
    Join Date
    Apr 2008
    Posts
    6

    Default

    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
  •