org.springframework.remoting.rmi

## 类 RmiProxyFactoryBean

- java.lang.Object
- - org.springframework.remoting.support.RemotingSupport
  - - org.springframework.remoting.support.RemoteAccessor
    - - org.springframework.remoting.support.UrlBasedRemoteAccessor
      - - org.springframework.remoting.support.RemoteInvocationBasedAccessor
        - - org.springframework.remoting.rmi.RmiClientInterceptor
          - - org.springframework.remoting.rmi.RmiProxyFactoryBean

- 所有已实现的接口:
    org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<Object>, org.springframework.beans.factory.InitializingBean

      public class RmiProxyFactoryBean
      extends RmiClientInterceptor
      implements org.springframework.beans.factory.FactoryBean<Object>, org.springframework.beans.factory.BeanClassLoaderAware

  `FactoryBean` for RMI proxies, supporting both conventional RMI services and RMI invokers. Exposes the proxied service for use as a bean reference, using the specified service interface. Proxies will throw Spring's unchecked RemoteAccessException on remote invocation failure instead of RMI's RemoteException.

  The service URL must be a valid RMI URL like "rmi://localhost:1099/myservice". RMI invokers work at the RmiInvocationHandler level, using the same invoker stub for any service. Service interfaces do not have to extend `java.rmi.Remote` or throw `java.rmi.RemoteException`. Of course, in and out parameters have to be serializable.

  With conventional RMI services, this proxy factory is typically used with the RMI service interface. Alternatively, this factory can also proxy a remote RMI service with a matching non-RMI business interface, i.e. an interface that mirrors the RMI service methods but does not declare RemoteExceptions. In the latter case, RemoteExceptions thrown by the RMI stub will automatically get converted to Spring's unchecked RemoteAccessException.

  The major advantage of RMI, compared to Hessian, is serialization. Effectively, any serializable Java object can be transported without hassle. Hessian has its own (de-)serialization mechanisms, but is HTTP-based and thus much easier to setup than RMI. Alternatively, consider Spring's HTTP invoker to combine Java serialization with HTTP-based transport.

  从以下版本开始:
    13.05.2003
  作者:
    Juergen Hoeller
  另请参阅:
    `RemoteAccessor.setServiceInterface(java.lang.Class<?>)`, `UrlBasedRemoteAccessor.setServiceUrl(java.lang.String)`, `RmiClientInterceptor`, `RmiServiceExporter`, `Remote`, `RemoteException`, `RemoteAccessException`, `org.springframework.remoting.caucho.HessianProxyFactoryBean`, `org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean`

- - ### 字段概要

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

      `logger`

  - ### 构造器概要

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

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `afterPropertiesSet()`
    `Object` | `getObject()`
    `Class<?>` | `getObjectType()`
    `boolean` | `isSingleton()`

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

      `doInvoke, doInvoke, getStub, invoke, isConnectFailure, lookupStub, prepare, refreshAndRetry, setCacheStub, setLookupStubOnStartup, setRefreshStubOnConnectFailure, setRegistryClientSocketFactory`

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

      `createRemoteInvocation, getRemoteInvocationFactory, recreateRemoteInvocationResult, setRemoteInvocationFactory`

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

      `getServiceUrl, setServiceUrl`

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

      `getServiceInterface, setServiceInterface`

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

      `getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader`

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

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

    - ### 从接口继承的方法 org.springframework.beans.factory.BeanClassLoaderAware

      `setBeanClassLoader`

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

    - #### RmiProxyFactoryBean

          public RmiProxyFactoryBean()

  - ### 方法详细资料

    - #### afterPropertiesSet

          public void afterPropertiesSet()

      指定者:
        `afterPropertiesSet` 在接口中 `org.springframework.beans.factory.InitializingBean`
      覆盖:
        `afterPropertiesSet` 在类中 `RmiClientInterceptor`

    - #### getObject

          public Object getObject()

      指定者:
        `getObject` 在接口中 `org.springframework.beans.factory.FactoryBean<Object>`

    - #### getObjectType

          public Class<?> getObjectType()

      指定者:
        `getObjectType` 在接口中 `org.springframework.beans.factory.FactoryBean<Object>`

    - #### isSingleton

          public boolean isSingleton()

      指定者:
        `isSingleton` 在接口中 `org.springframework.beans.factory.FactoryBean<Object>`