org.springframework.remoting.support

Class RemoteExporter

  • All Implemented Interfaces:
    Aware, BeanClassLoaderAware
    Direct Known Subclasses:
    HessianExporter, 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.

    Since:
    26.12.2003
    Author:
    Juergen Hoeller
    • Constructor Detail

      • RemoteExporter

        public RemoteExporter()
    • Method Detail

      • setService

        public void setService(java.lang.Object service)
        Set the service to export. Typically populated via a bean reference.
      • getService

        public java.lang.Object getService()
        Return the service to export.
      • setServiceInterface

        public void setServiceInterface(java.lang.Class<?> serviceInterface)
        Set the interface of the service to export. The interface must be suitable for the particular service and remoting strategy.
      • getServiceInterface

        public java.lang.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.

        See Also:
        setInterceptors(java.lang.Object[]), getProxyForService(), RemoteInvocationTraceInterceptor
      • setInterceptors

        public void setInterceptors(java.lang.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.

        See Also:
        getProxyForService(), PerformanceMonitorInterceptor
      • checkService

        protected void checkService()
                             throws java.lang.IllegalArgumentException
        Check whether the service reference has been set.
        Throws:
        java.lang.IllegalArgumentException
        See Also:
        setService(java.lang.Object)