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:
org.aopalliance.aop.Advice, HttpInvokerClientConfiguration, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor
Direct Known Subclasses:
HttpInvokerProxyFactoryBean

public class HttpInvokerClientInterceptor
extends RemoteInvocationBasedAccessor
implements org.aopalliance.intercept.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()
           
 java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation methodInvocation)
           
protected  java.lang.Object recreateRemoteInvocationResult(RemoteInvocationResult result)
          Recreate the invocation result contained in the given RemoteInvocationResult object.
 void setHttpInvokerRequestExecutor(HttpInvokerRequestExecutor httpInvokerRequestExecutor)
           
 
Methods inherited from class org.springframework.remoting.support.RemoteInvocationBasedAccessor
createRemoteInvocation, getRemoteInvocationFactory, 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)

getHttpInvokerRequestExecutor

public HttpInvokerRequestExecutor getHttpInvokerRequestExecutor()

invoke

public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation methodInvocation)
                        throws java.lang.Throwable
Specified by:
invoke in interface org.aopalliance.intercept.MethodInterceptor
Throws:
java.lang.Throwable

executeRequest

protected RemoteInvocationResult executeRequest(RemoteInvocation invocation)
                                         throws java.io.IOException,
                                                java.lang.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:
java.io.IOException - if thrown by I/O operations
java.lang.ClassNotFoundException - if thrown during deserialization
See Also:
getHttpInvokerRequestExecutor(), HttpInvokerClientConfiguration

recreateRemoteInvocationResult

protected java.lang.Object recreateRemoteInvocationResult(RemoteInvocationResult result)
                                                   throws java.lang.Throwable
Recreate the invocation result contained in the given RemoteInvocationResult object. The default implementation calls the default recreate method.

Can be overridden in subclass to provide custom recreation, potentially processing the returned result object.

Parameters:
result - the RemoteInvocationResult to recreate
Returns:
a return value if the invocation result is a successful return
Throws:
java.lang.Throwable - if the invocation result is an exception
See Also:
RemoteInvocationResult.recreate()


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