org.springframework.remoting.caucho

## Class HessianClientInterceptor

- java.lang.Object
- - org.springframework.remoting.support.RemotingSupport
  - - org.springframework.remoting.support.RemoteAccessor
    - - org.springframework.remoting.support.UrlBasedRemoteAccessor
      - - org.springframework.remoting.caucho.HessianClientInterceptor

- All Implemented Interfaces:
    Advice, Interceptor, MethodInterceptor, Aware, BeanClassLoaderAware, InitializingBean
  Direct Known Subclasses:
    HessianProxyFactoryBean

  Deprecated.
  as of 5.3 (phasing out serialization-based remoting)

      @Deprecated
      public class HessianClientInterceptor
      extends UrlBasedRemoteAccessor
      implements MethodInterceptor

  `MethodInterceptor` for accessing a Hessian service. Supports authentication via username and password. The service URL must be an HTTP URL exposing a Hessian service.

  Hessian is a slim, binary RPC protocol. For information on Hessian, see the Hessian website Note: As of Spring 4.0, this client requires Hessian 4.0 or above.

  Note: There is no requirement for services accessed with this proxy factory to have been exported using Spring's `HessianServiceExporter`, as there is no special handling involved. As a consequence, you can also access services that have been exported using Caucho's `HessianServlet`.

  Since:
    29.09.2003
  Author:
    Juergen Hoeller
  See Also:
    `RemoteAccessor.setServiceInterface(java.lang.Class<?>)`, `UrlBasedRemoteAccessor.setServiceUrl(java.lang.String)`, `setUsername(java.lang.String)`, `setPassword(java.lang.String)`, `HessianServiceExporter`, `HessianProxyFactoryBean`, `HessianProxyFactory`, `HessianServlet`

- - ### Field Summary

    - ### Fields inherited from class org.springframework.remoting.support.RemotingSupport

      `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HessianClientInterceptor()` Deprecated.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterPropertiesSet()` Deprecated. Invoked by the containing `BeanFactory` after it has set all bean properties and satisfied `BeanFactoryAware`, `ApplicationContextAware` etc.
    `protected RemoteAccessException` | `convertHessianAccessException(Throwable ex)` Deprecated. Convert the given Hessian access exception to an appropriate Spring RemoteAccessException.
    `protected Object` | `createHessianProxy(com.caucho.hessian.client.HessianProxyFactory proxyFactory)` Deprecated. Create the Hessian proxy that is wrapped by this interceptor.
    `Object` | `invoke(MethodInvocation invocation)` Deprecated. Implement this method to perform extra treatments before and after the invocation.
    `void` | `prepare()` Deprecated. Initialize the Hessian proxy for this interceptor.
    `void` | `setAllowNonSerializable(boolean allowNonSerializable)` Deprecated. Set whether to allow non-serializable types as Hessian arguments and return values.
    `void` | `setChunkedPost(boolean chunkedPost)` Deprecated. Set whether to use a chunked post for sending a Hessian request.
    `void` | `setConnectionFactory(com.caucho.hessian.client.HessianConnectionFactory connectionFactory)` Deprecated. Specify a custom HessianConnectionFactory to use for the Hessian client.
    `void` | `setConnectTimeout(long timeout)` Deprecated. Set the socket connect timeout to use for the Hessian client.
    `void` | `setDebug(boolean debug)` Deprecated. Set whether Hessian's debug mode should be enabled.
    `void` | `setHessian2(boolean hessian2)` Deprecated. Set whether version 2 of the Hessian protocol should be used for parsing requests and replies.
    `void` | `setHessian2Reply(boolean hessian2)` Deprecated. Set whether version 2 of the Hessian protocol should be used for parsing replies.
    `void` | `setHessian2Request(boolean hessian2)` Deprecated. Set whether version 2 of the Hessian protocol should be used for parsing requests.
    `void` | `setOverloadEnabled(boolean overloadEnabled)` Deprecated. Set whether overloaded methods should be enabled for remote invocations.
    `void` | `setPassword(String password)` Deprecated. Set the password that this factory should use to access the remote service.
    `void` | `setProxyFactory(com.caucho.hessian.client.HessianProxyFactory proxyFactory)` Deprecated. Set the HessianProxyFactory instance to use.
    `void` | `setReadTimeout(long timeout)` Deprecated. Set the timeout to use when waiting for a reply from the Hessian service.
    `void` | `setSendCollectionType(boolean sendCollectionType)` Deprecated. Set whether to send the Java collection type for each serialized collection.
    `void` | `setSerializerFactory(com.caucho.hessian.io.SerializerFactory serializerFactory)` Deprecated. Specify the Hessian SerializerFactory to use.
    `void` | `setUsername(String username)` Deprecated. Set the username that this factory should use to access the remote service.

    - ### Methods inherited from class org.springframework.remoting.support.UrlBasedRemoteAccessor

      `getServiceUrl, setServiceUrl`

    - ### Methods inherited from class org.springframework.remoting.support.RemoteAccessor

      `getServiceInterface, setServiceInterface`

    - ### Methods inherited from class org.springframework.remoting.support.RemotingSupport

      `getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader`

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### HessianClientInterceptor

          public HessianClientInterceptor()

      Deprecated.

  - ### Method Detail

    - #### setProxyFactory

          public void setProxyFactory(@Nullable
                                      com.caucho.hessian.client.HessianProxyFactory proxyFactory)

      Deprecated.
      Set the HessianProxyFactory instance to use. If not specified, a default HessianProxyFactory will be created.

      Allows to use an externally configured factory instance, in particular a custom HessianProxyFactory subclass.

    - #### setSerializerFactory

          public void setSerializerFactory(com.caucho.hessian.io.SerializerFactory serializerFactory)

      Deprecated.
      Specify the Hessian SerializerFactory to use.

      This will typically be passed in as an inner bean definition of type `com.caucho.hessian.io.SerializerFactory`, with custom bean property values applied.

    - #### setSendCollectionType

          public void setSendCollectionType(boolean sendCollectionType)

      Deprecated.
      Set whether to send the Java collection type for each serialized collection. Default is "true".

    - #### setAllowNonSerializable

          public void setAllowNonSerializable(boolean allowNonSerializable)

      Deprecated.
      Set whether to allow non-serializable types as Hessian arguments and return values. Default is "true".

    - #### setOverloadEnabled

          public void setOverloadEnabled(boolean overloadEnabled)

      Deprecated.
      Set whether overloaded methods should be enabled for remote invocations. Default is "false".
      See Also:
        `HessianProxyFactory.setOverloadEnabled(boolean)`

    - #### setUsername

          public void setUsername(String username)

      Deprecated.
      Set the username that this factory should use to access the remote service. Default is none.

      The username will be sent by Hessian via HTTP Basic Authentication.

      See Also:
        `HessianProxyFactory.setUser(java.lang.String)`

    - #### setPassword

          public void setPassword(String password)

      Deprecated.
      Set the password that this factory should use to access the remote service. Default is none.

      The password will be sent by Hessian via HTTP Basic Authentication.

      See Also:
        `HessianProxyFactory.setPassword(java.lang.String)`

    - #### setDebug

          public void setDebug(boolean debug)

      Deprecated.
      Set whether Hessian's debug mode should be enabled. Default is "false".
      See Also:
        `HessianProxyFactory.setDebug(boolean)`

    - #### setChunkedPost

          public void setChunkedPost(boolean chunkedPost)

      Deprecated.
      Set whether to use a chunked post for sending a Hessian request.
      See Also:
        `HessianProxyFactory.setChunkedPost(boolean)`

    - #### setConnectionFactory

          public void setConnectionFactory(com.caucho.hessian.client.HessianConnectionFactory connectionFactory)

      Deprecated.
      Specify a custom HessianConnectionFactory to use for the Hessian client.

    - #### setConnectTimeout

          public void setConnectTimeout(long timeout)

      Deprecated.
      Set the socket connect timeout to use for the Hessian client.
      See Also:
        `HessianProxyFactory.setConnectTimeout(long)`

    - #### setReadTimeout

          public void setReadTimeout(long timeout)

      Deprecated.
      Set the timeout to use when waiting for a reply from the Hessian service.
      See Also:
        `HessianProxyFactory.setReadTimeout(long)`

    - #### setHessian2

          public void setHessian2(boolean hessian2)

      Deprecated.
      Set whether version 2 of the Hessian protocol should be used for parsing requests and replies. Default is "false".
      See Also:
        `HessianProxyFactory.setHessian2Request(boolean)`

    - #### setHessian2Request

          public void setHessian2Request(boolean hessian2)

      Deprecated.
      Set whether version 2 of the Hessian protocol should be used for parsing requests. Default is "false".
      See Also:
        `HessianProxyFactory.setHessian2Request(boolean)`

    - #### setHessian2Reply

          public void setHessian2Reply(boolean hessian2)

      Deprecated.
      Set whether version 2 of the Hessian protocol should be used for parsing replies. Default is "false".
      See Also:
        `HessianProxyFactory.setHessian2Reply(boolean)`

    - #### afterPropertiesSet

          public void afterPropertiesSet()

      Deprecated.
      Description copied from interface: `InitializingBean`
      Invoked by the containing `BeanFactory` after it has set all bean properties and satisfied `BeanFactoryAware`, `ApplicationContextAware` etc.

      This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

      Specified by:
        `afterPropertiesSet` in interface `InitializingBean`
      Overrides:
        `afterPropertiesSet` in class `UrlBasedRemoteAccessor`

    - #### prepare

          public void prepare()
                       throws RemoteLookupFailureException

      Deprecated.
      Initialize the Hessian proxy for this interceptor.
      Throws:
        `RemoteLookupFailureException` - if the service URL is invalid

    - #### createHessianProxy

          protected Object createHessianProxy(com.caucho.hessian.client.HessianProxyFactory proxyFactory)
                                       throws MalformedURLException

      Deprecated.
      Create the Hessian proxy that is wrapped by this interceptor.
      Parameters:
        `proxyFactory` - the proxy factory to use
      Returns:
        the Hessian proxy
      Throws:
        `MalformedURLException` - if thrown by the proxy factory
      See Also:
        `HessianProxyFactory.create(java.lang.String)`

    - #### invoke

          @Nullable
          public Object invoke(MethodInvocation invocation)
                                  throws Throwable

      Deprecated.
      Description copied from interface: `MethodInterceptor`
      Implement this method to perform extra treatments before and after the invocation. Polite implementations would certainly like to invoke `Joinpoint.proceed()`.
      Specified by:
        `invoke` in interface `MethodInterceptor`
      Parameters:
        `invocation` - the method invocation joinpoint
      Returns:
        the result of the call to `Joinpoint.proceed()`; might be intercepted by the interceptor
      Throws:
        `Throwable` - if the interceptors or the target object throws an exception

    - #### convertHessianAccessException

          protected RemoteAccessException convertHessianAccessException(Throwable ex)

      Deprecated.
      Convert the given Hessian access exception to an appropriate Spring RemoteAccessException.
      Parameters:
        `ex` - the exception to convert
      Returns:
        the RemoteAccessException to throw