org.springframework.remoting.rmi

## 类 JndiRmiServiceExporter

- java.lang.Object
- - org.springframework.remoting.support.RemotingSupport
  - - org.springframework.remoting.support.RemoteExporter
    - - org.springframework.remoting.support.RemoteInvocationBasedExporter
      - - org.springframework.remoting.rmi.RmiBasedExporter
        - - org.springframework.remoting.rmi.JndiRmiServiceExporter

- 所有已实现的接口:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean

      public class JndiRmiServiceExporter
      extends RmiBasedExporter
      implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.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.

  Also supports exposing any non-RMI service via RMI invokers, to be accessed via `JndiRmiClientInterceptor` / `JndiRmiProxyFactoryBean`'s automatic detection of such invokers.

  With an RMI invoker, RMI communication works on the `RmiInvocationHandler` level, needing only one stub for any service. Service interfaces do not have to extend `java.rmi.Remote` or throw `java.rmi.RemoteException` on all methods, but in and out parameters have to be serializable.

  The JNDI environment can be specified as "jndiEnvironment" bean 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>

  从以下版本开始:
    1.1
  作者:
    Juergen Hoeller
  另请参阅:
    `RemoteExporter.setService(java.lang.Object)`, `setJndiTemplate(org.springframework.jndi.JndiTemplate)`, `setJndiEnvironment(java.util.Properties)`, `setJndiName(java.lang.String)`, `JndiRmiClientInterceptor`, `JndiRmiProxyFactoryBean`, `PortableRemoteObject`

- - ### 字段概要

    - ### 从类继承的字段 org.springframework.remoting.support.RemotingSupport

      `logger`

  - ### 构造器概要

    构造器
    构造器和说明
    `JndiRmiServiceExporter()`

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `afterPropertiesSet()`
    `void` | `destroy()` Unbind the RMI service from JNDI on bean factory shutdown.
    `void` | `prepare()` Initialize this service exporter, binding the specified service to JNDI.
    `void` | `rebind()` Rebind the specified service to JNDI, for recovering in case of the target registry having been restarted.
    `void` | `setJndiEnvironment(Properties jndiEnvironment)` Set the JNDI environment to use for JNDI lookups.
    `void` | `setJndiName(String jndiName)` Set the JNDI name of the exported RMI service.
    `void` | `setJndiTemplate(JndiTemplate jndiTemplate)` Set the JNDI template to use for JNDI lookups.

    - ### 从类继承的方法 org.springframework.remoting.rmi.RmiBasedExporter

      `getObjectToExport, invoke`

    - ### 从类继承的方法 org.springframework.remoting.support.RemoteInvocationBasedExporter

      `getRemoteInvocationExecutor, invokeAndCreateResult, setRemoteInvocationExecutor`

    - ### 从类继承的方法 org.springframework.remoting.support.RemoteExporter

      `checkService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterface`

    - ### 从类继承的方法 org.springframework.remoting.support.RemotingSupport

      `getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### JndiRmiServiceExporter

          public JndiRmiServiceExporter()

  - ### 方法详细资料

    - #### setJndiTemplate

          public void setJndiTemplate(JndiTemplate jndiTemplate)

      Set the JNDI template to use for JNDI lookups. You can also specify JNDI environment settings via "jndiEnvironment".
      另请参阅:
        `setJndiEnvironment(java.util.Properties)`

    - #### setJndiEnvironment

          public void setJndiEnvironment(Properties jndiEnvironment)

      Set the JNDI environment to use for JNDI lookups. Creates a JndiTemplate with the given environment settings.
      另请参阅:
        `setJndiTemplate(org.springframework.jndi.JndiTemplate)`

    - #### setJndiName

          public void setJndiName(String jndiName)

      Set the JNDI name of the exported RMI service.

    - #### afterPropertiesSet

          public void afterPropertiesSet()
                                  throws NamingException,
                                         RemoteException

      指定者:
        `afterPropertiesSet` 在接口中 `org.springframework.beans.factory.InitializingBean`
      抛出:
        `NamingException`
        `RemoteException`

    - #### prepare

          public void prepare()
                       throws NamingException,
                              RemoteException

      Initialize this service exporter, binding the specified service to JNDI.
      抛出:
        `NamingException` - if service binding failed
        `RemoteException` - if service export failed

    - #### rebind

          public void rebind()
                      throws NamingException

      Rebind the specified service to JNDI, for recovering in case of the target registry having been restarted.
      抛出:
        `NamingException` - if service binding failed

    - #### destroy

          public void destroy()
                       throws NamingException,
                              RemoteException

      Unbind the RMI service from JNDI on bean factory shutdown.
      指定者:
        `destroy` 在接口中 `org.springframework.beans.factory.DisposableBean`
      抛出:
        `NamingException`
        `RemoteException`