Announcement Announcement Module
Collapse
No announcement yet.
Change RMI serviceName/serviceURL at runtime? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Change RMI serviceName/serviceURL at runtime?

    Hi all,

    I'm looking for a way to change the serviceName for a RmiServiceExporter at run-time, ie for
    Code:
    <bean id = "serviceExporter" class="org.springframework.remoting.rmi.RmiServiceExporter">
    	<!-- the serviceName is dynamically reconfigured at runtime -->
    	<property name="serviceName" value="CommunicationService"/>
    	<property name="service" ref="communicationService"/>
    	<property name="serviceInterface" value="foo.bar.CommunicationService"/>
    	<!-- defaults to 1099 -->
    	<property name="registryPort" value="1099"/>
    I dont want to instantiate the serviceExporter bean until I have configured a different value for the serviceName.

    I found this thread, which suggested (for HttpInvoker) that i prepend the bean name with an "&". What is this doing exactly? Will this work for RMI and is there a better way that anyone can suggest?

    Thanks in advance.

  • #2
    The & is a dereferencer for the FactoryBean. That means that rather than retrieving the result of the FactoryBean's getObject() method, you would get the FactoryBean itself.

    Comment

    Working...
    X