org.springframework.remoting.support

## 类 RemoteExporter

- java.lang.Object
- - org.springframework.remoting.support.RemotingSupport
  - - org.springframework.remoting.support.RemoteExporter

- 所有已实现的接口:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware
  直接已知子类:
    RemoteInvocationBasedExporter

      public abstract class RemoteExporter
      extends RemotingSupport

  Abstract base class for classes that export a remote service. Provides "service" and "serviceInterface" bean properties.

  Note that the service interface being used will show some signs of remotability, like the granularity of method calls that it offers. Furthermore, it has to have serializable arguments etc.

  从以下版本开始:
    26.12.2003
  作者:
    Juergen Hoeller

- - ### 字段概要

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

      `logger`

  - ### 构造器概要

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

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected void` | `checkService()` Check whether the service reference has been set.
    `protected void` | `checkServiceInterface()` Check whether a service reference has been set, and whether it matches the specified service.
    `protected String` | `getExporterName()` Return a short name for this exporter.
    `protected Object` | `getProxyForService()` Get a proxy for the given service object, implementing the specified service interface.
    `Object` | `getService()` Return the service to export.
    `Class<?>` | `getServiceInterface()` Return the interface of the service to export.
    `void` | `setInterceptors(Object[] interceptors)` Set additional interceptors (or advisors) to be applied before the remote endpoint, e.g. a PerformanceMonitorInterceptor.
    `void` | `setRegisterTraceInterceptor(boolean registerTraceInterceptor)` Set whether to register a RemoteInvocationTraceInterceptor for exported services.
    `void` | `setService(Object service)` Set the service to export.
    `void` | `setServiceInterface(Class<?> serviceInterface)` Set the interface of the service to export.

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

      `getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader`

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

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

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

    - #### RemoteExporter

          public RemoteExporter()

  - ### 方法详细资料

    - #### setService

          public void setService(Object service)

      Set the service to export. Typically populated via a bean reference.

    - #### getService

          public Object getService()

      Return the service to export.

    - #### setServiceInterface

          public void setServiceInterface(Class<?> serviceInterface)

      Set the interface of the service to export. The interface must be suitable for the particular service and remoting strategy.

    - #### getServiceInterface

          public Class<?> getServiceInterface()

      Return the interface of the service to export.

    - #### setRegisterTraceInterceptor

          public void setRegisterTraceInterceptor(boolean registerTraceInterceptor)

      Set whether to register a RemoteInvocationTraceInterceptor for exported services. Only applied when a subclass uses `getProxyForService` for creating the proxy to expose.

      Default is "true". RemoteInvocationTraceInterceptor's most important value is that it logs exception stacktraces on the server, before propagating an exception to the client. Note that RemoteInvocationTraceInterceptor will not be registered by default if the "interceptors" property has been specified.

      另请参阅:
        `setInterceptors(java.lang.Object[])`, `getProxyForService()`, `RemoteInvocationTraceInterceptor`

    - #### setInterceptors

          public void setInterceptors(Object[] interceptors)

      Set additional interceptors (or advisors) to be applied before the remote endpoint, e.g. a PerformanceMonitorInterceptor.

      You may specify any AOP Alliance MethodInterceptors or other Spring AOP Advices, as well as Spring AOP Advisors.

      另请参阅:
        `getProxyForService()`, `PerformanceMonitorInterceptor`

    - #### checkService

          protected void checkService()
                               throws IllegalArgumentException

      Check whether the service reference has been set.
      抛出:
        `IllegalArgumentException`
      另请参阅:
        `setService(java.lang.Object)`

    - #### checkServiceInterface

          protected void checkServiceInterface()
                                        throws IllegalArgumentException

      Check whether a service reference has been set, and whether it matches the specified service.
      抛出:
        `IllegalArgumentException`
      另请参阅:
        `setServiceInterface(java.lang.Class<?>)`, `setService(java.lang.Object)`

    - #### getProxyForService

          protected Object getProxyForService()

      Get a proxy for the given service object, implementing the specified service interface.

      Used to export a proxy that does not expose any internals but just a specific interface intended for remote access. Furthermore, a `RemoteInvocationTraceInterceptor` will be registered (by default).

      返回:
        the proxy
      另请参阅:
        `setServiceInterface(java.lang.Class<?>)`, `setRegisterTraceInterceptor(boolean)`, `RemoteInvocationTraceInterceptor`

    - #### getExporterName

          protected String getExporterName()

      Return a short name for this exporter. Used for tracing of remote invocations.

      Default is the unqualified class name (without package). Can be overridden in subclasses.

      另请参阅:
        `getProxyForService()`, `RemoteInvocationTraceInterceptor`, `ClassUtils.getShortName(java.lang.String)`