org.springframework.remoting.httpinvoker
Class HttpInvokerClientInterceptor

java.lang.Object
  extended byorg.springframework.remoting.support.RemoteAccessor
      extended byorg.springframework.remoting.support.UrlBasedRemoteAccessor
          extended byorg.springframework.remoting.support.RemoteInvocationBasedAccessor
              extended byorg.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor
All Implemented Interfaces:
Advice, HttpInvokerClientConfiguration, Interceptor, MethodInterceptor
Direct Known Subclasses:
HttpInvokerProxyFactoryBean

public class HttpInvokerClientInterceptor
extends RemoteInvocationBasedAccessor
implements MethodInterceptor, HttpInvokerClientConfiguration

Interceptor for accessing an HTTP invoker service. The service URL must be an HTTP URL exposing an HTTP invoker service.

Simply serializes remote invocation objects and deserializes remote invocation results. Uses Java serialization just like RMI, but provides the same ease of setup as Caucho's HTTP-based Hessian and Burlap protocols.

Since:
1.1
Author:
Juergen Hoeller
See Also:
UrlBasedRemoteAccessor.setServiceUrl(java.lang.String), HttpInvokerServiceExporter, HttpInvokerProxyFactoryBean

Field Summary
 
Fields inherited from class org.springframework.remoting.support.RemoteAccessor
logger
 
Constructor Summary
HttpInvokerClientInterceptor()
           
 
Method Summary
protected  RemoteInvocationResult executeRequest(RemoteInvocation invocation)
          Execute the given remote invocation via the HttpInvokerRequestExecutor.
 HttpInvokerRequestExecutor getHttpInvokerRequestExecutor()
          Return the HttpInvokerRequestExecutor used by this remote accessor.
 Object invoke(MethodInvocation methodInvocation)
           
 void setHttpInvokerRequestExecutor(HttpInvokerRequestExecutor httpInvokerRequestExecutor)
          Set the HttpInvokerRequestExecutor implementation to use for executing remote invocations.
 
Methods inherited from class org.springframework.remoting.support.RemoteInvocationBasedAccessor
createRemoteInvocation, getRemoteInvocationFactory, recreateRemoteInvocationResult, setRemoteInvocationFactory
 
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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration
getServiceUrl
 

Constructor Detail

HttpInvokerClientInterceptor

public HttpInvokerClientInterceptor()
Method Detail

setHttpInvokerRequestExecutor

public void setHttpInvokerRequestExecutor(HttpInvokerRequestExecutor httpInvokerRequestExecutor)
Set the HttpInvokerRequestExecutor implementation to use for executing remote invocations. Default is SimpleHttpInvokerRequestExecutor.

Alternatively, consider CommonsHttpInvokerRequestExecutor for more sophisticated needs.

See Also:
SimpleHttpInvokerRequestExecutor, CommonsHttpInvokerRequestExecutor

getHttpInvokerRequestExecutor

public HttpInvokerRequestExecutor getHttpInvokerRequestExecutor()
Return the HttpInvokerRequestExecutor used by this remote accessor.


invoke

public Object invoke(MethodInvocation methodInvocation)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable

executeRequest

protected RemoteInvocationResult executeRequest(RemoteInvocation invocation)
                                         throws IOException,
                                                ClassNotFoundException
Execute the given remote invocation via the HttpInvokerRequestExecutor.

Can be overridden in subclasses to pass a different configuration object to the executor. Alternatively, add further configuration properties in a subclass of this accessor: By default, the accessor passed itself as configuration object to the executor.

Parameters:
invocation - the RemoteInvocation to execute
Returns:
the RemoteInvocationResult object
Throws:
IOException - if thrown by I/O operations
ClassNotFoundException - if thrown during deserialization
See Also:
getHttpInvokerRequestExecutor(), HttpInvokerClientConfiguration


Copyright (C) 2003-2004 The Spring Framework Project.