Announcement Announcement Module
No announcement yet.
Change RMI serviceName/serviceURL at runtime? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • 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
    <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=""/>
    	<!-- 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.