Results 1 to 2 of 2

Thread: Change RMI serviceName/serviceURL at runtime?

  1. #1
    Join Date
    Apr 2007
    Posts
    6

    Default 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. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •