org.springframework.remoting.rmi
Class JndiRmiServiceExporter

java.lang.Object
  extended byorg.springframework.jndi.JndiAccessor
      extended byorg.springframework.remoting.rmi.JndiRmiServiceExporter
All Implemented Interfaces:
DisposableBean, InitializingBean

public class JndiRmiServiceExporter
extends JndiAccessor
implements InitializingBean, DisposableBean

Service exporter which binds RMI services to JNDI. Typically used for RMI-IIOP (CORBA).

Exports services via the PortableRemoteObject class. You need to run "rmic" with the "-iiop" option to generate corresponding stubs and skeletons for each exported service.

The JNDI environment can be specified as jndiEnvironment property, or be configured in a jndi.properties file or as system properties. For example:

 <property name="jndiEnvironment">
 	 <props>
		 <prop key="java.naming.factory.initial">com.sun.jndi.cosnaming.CNCtxFactory</prop>
		 <prop key="java.naming.provider.url">iiop://localhost:1050</prop>
	 </props>
 </property>

Since:
1.1
Author:
Juergen Hoeller
See Also:
setService(java.rmi.Remote), JndiAccessor.setJndiTemplate(org.springframework.jndi.JndiTemplate), JndiAccessor.setJndiEnvironment(java.util.Properties), setJndiName(java.lang.String), JndiRmiClientInterceptor, JndiRmiProxyFactoryBean, PortableRemoteObject.exportObject(java.rmi.Remote)

Field Summary
 
Fields inherited from class org.springframework.jndi.JndiAccessor
logger
 
Constructor Summary
JndiRmiServiceExporter()
           
 
Method Summary
 void afterPropertiesSet()
          Register the service as RMI object.
 void destroy()
          Unbind the RMI service from JNDI at bean factory shutdown.
 void setJndiName(String jndiName)
          Set the JNDI name of the exported RMI service.
 void setService(Remote service)
          Set the RMI service to export.
 
Methods inherited from class org.springframework.jndi.JndiAccessor
getJndiEnvironment, getJndiTemplate, setJndiEnvironment, setJndiTemplate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JndiRmiServiceExporter

public JndiRmiServiceExporter()
Method Detail

setService

public void setService(Remote service)
Set the RMI service to export. Typically populated via a bean reference.


setJndiName

public void setJndiName(String jndiName)
Set the JNDI name of the exported RMI service.


afterPropertiesSet

public void afterPropertiesSet()
                        throws NamingException,
                               RemoteException
Register the service as RMI object. Creates an RMI registry on the specified port if none exists.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
NamingException
RemoteException

destroy

public void destroy()
             throws NamingException,
                    NoSuchObjectException
Unbind the RMI service from JNDI at bean factory shutdown.

Specified by:
destroy in interface DisposableBean
Throws:
NamingException
NoSuchObjectException


Copyright (C) 2003-2004 The Spring Framework Project.