Please excuse what is quite a daft question but I'm curious as to what is the recommended technique (if any) to address the situation below.
An RmiServiceExporter bean is loaded into a Spring app context as below (this is based on sample source from Craig's SIA2). On running the Java program the log output as below is produced as I'm making Spring load the rmiregistry - (I know how to manually invoke it).
I want the service to stay loaded and available, but as soon as the call to
ClassPathXmlApplicationContext() completes then the rmiregistry terminates. If I suspend the main() thread via a sleep or something then the rmiregistry remains. What is the better way to do this - apart from having some other entity manage the rmiregistry - instead of the Spring app context.
Thank you,
David Victor.
--
Service bean:
my-service.xml
<bean class="org.springframework.remoting.rmi.RmiService Exporter">
<property name="service" ref="myService"/>
.
.
</bean>
public static void main(String[] args) {
new ClassPathXmlApplicationContext("my-service.xml");
}
log info:
INFO - Looking for RMI registry at port '1099'
INFO - Could not detect RMI registry - creating new one
INFO - Binding service 'myService' to RMI registry: RegistryImpl[UnicastServerRef [liveRef:



Reply With Quote
