Announcement Announcement Module
Collapse
No announcement yet.
RmiServiceExporter.setServicePort query Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • RmiServiceExporter.setServicePort query

    Hi Guys,
    Can someone explain what is the significance of the setServicePort() method? I have an interface that is exposed over RMI as follows:
    Code:
    <bean class="org.springframework.remoting.rmi.RmiServiceExporter">
    	<property name="serviceName" value="TopologyService"/>
    	<property name="service" ref="topologyManager"/>
    	<property name="serviceInterface" value="package.service.ITopologyService"/>
    	<property name="registryPort" value="50042"/>
    	<property name="servicePort" value="50043"/>
    </bean>
    I can then connect successfully to the service as follows:

    Code:
    <bean id="topologyService" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
    	<property name="serviceUrl" value="rmi://localhost:50042/TopologyService"/>
    	<property name="serviceInterface" value="package.service.ITopologyService"/>		
    </bean>

    My question is what is the point in specifying the port number of the service if I can connect without it? Or will this fall over in a more secure environment? If this is the case, how do I specify the port on the client side, I assume it should be part of the URL e.g.

    <property name="serviceUrl" value="rmi://localhost:50042/TopologyService:50043"/>

    or something similar?

    Thanks for any info
    Tom

  • #2
    The stub you get from the registry contains the servicePort, you don't need to do anything about it client side.

    Comment


    • #3
      Hi,
      Nice one, thanks for the reply! OK so the client does not actually care, he just uses the stub he gets back and doesnt know the difference? The situation I have is that one port is secure and the other is unsecure and how the client knows which one to connect to....but from what you are saying the client doesnt need this info, just leave the URL as it is and use what we get back...

      Sorry above sounds repetitive, just wanna be clear in my head

      /Tom

      Comment

      Working...
      X