public class HessianClientInterceptor extends UrlBasedRemoteAccessor
org.aopalliance.intercept.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: 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 com.caucho.hessian.server.HessianServlet.
RemoteAccessor.setServiceInterface(java.lang.Class),
UrlBasedRemoteAccessor.setServiceUrl(java.lang.String),
setUsername(java.lang.String),
setPassword(java.lang.String),
HessianServiceExporter,
HessianProxyFactoryBean,
com.caucho.hessian.client.HessianProxyFactory,
com.caucho.hessian.server.HessianServlet| Modifier and Type | Field and Description |
|---|---|
private java.lang.Object |
hessianProxy |
private HessianProxyFactory |
proxyFactory |
logger| Constructor and Description |
|---|
HessianClientInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied
(and satisfied BeanFactoryAware and ApplicationContextAware).
|
protected RemoteAccessException |
convertHessianAccessException(java.lang.Throwable ex)
Convert the given Hessian access exception to an appropriate
Spring RemoteAccessException.
|
protected java.lang.Object |
createHessianProxy(HessianProxyFactory proxyFactory)
Create the Hessian proxy that is wrapped by this interceptor.
|
java.lang.Object |
invoke(MethodInvocation invocation) |
void |
prepare()
Initialize the Hessian proxy for this interceptor.
|
void |
setChunkedPost(boolean chunkedPost)
Set whether to use a chunked post for sending a Hessian request.
|
void |
setDebug(boolean debug)
Set whether Hessian's debug mode should be enabled.
|
void |
setHessian2(boolean hessian2)
Set whether version 2 of the Hessian protocol should be used for
parsing requests and replies.
|
void |
setHessian2Reply(boolean hessian2)
Set whether version 2 of the Hessian protocol should be used for
parsing replies.
|
void |
setHessian2Request(boolean hessian2)
Set whether version 2 of the Hessian protocol should be used for
parsing requests.
|
void |
setOverloadEnabled(boolean overloadEnabled)
Set whether overloaded methods should be enabled for remote invocations.
|
void |
setPassword(java.lang.String password)
Set the password that this factory should use to access the remote service.
|
void |
setProxyFactory(HessianProxyFactory proxyFactory)
Set the HessianProxyFactory instance to use.
|
void |
setReadTimeout(long timeout)
Set the timeout to use when waiting for a reply from the Hessian service.
|
void |
setSendCollectionType(boolean sendCollectionType)
Set whether to send the Java collection type for each serialized
collection.
|
void |
setSerializerFactory(SerializerFactory serializerFactory)
Specify the Hessian SerializerFactory to use.
|
void |
setUsername(java.lang.String username)
Set the username that this factory should use to access the remote service.
|
getServiceUrl, setServiceUrlgetServiceInterface, setServiceInterfacegetBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoaderprivate HessianProxyFactory proxyFactory
private java.lang.Object hessianProxy
public void setProxyFactory(HessianProxyFactory proxyFactory)
Allows to use an externally configured factory instance, in particular a custom HessianProxyFactory subclass.
public void setSerializerFactory(SerializerFactory serializerFactory)
This will typically be passed in as an inner bean definition
of type com.caucho.hessian.io.SerializerFactory,
with custom bean property values applied.
public void setSendCollectionType(boolean sendCollectionType)
public void setOverloadEnabled(boolean overloadEnabled)
com.caucho.hessian.client.HessianProxyFactory#setOverloadEnabledpublic void setUsername(java.lang.String username)
The username will be sent by Hessian via HTTP Basic Authentication.
com.caucho.hessian.client.HessianProxyFactory#setUserpublic void setPassword(java.lang.String password)
The password will be sent by Hessian via HTTP Basic Authentication.
com.caucho.hessian.client.HessianProxyFactory#setPasswordpublic void setDebug(boolean debug)
com.caucho.hessian.client.HessianProxyFactory#setDebugpublic void setChunkedPost(boolean chunkedPost)
com.caucho.hessian.client.HessianProxyFactory#setChunkedPostpublic void setReadTimeout(long timeout)
com.caucho.hessian.client.HessianProxyFactory#setReadTimeoutpublic void setHessian2(boolean hessian2)
com.caucho.hessian.client.HessianProxyFactory#setHessian2Requestpublic void setHessian2Request(boolean hessian2)
com.caucho.hessian.client.HessianProxyFactory#setHessian2Requestpublic void setHessian2Reply(boolean hessian2)
com.caucho.hessian.client.HessianProxyFactory#setHessian2Replypublic void afterPropertiesSet()
InitializingBeanThis method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
afterPropertiesSet in interface InitializingBeanafterPropertiesSet in class UrlBasedRemoteAccessorpublic void prepare()
throws RemoteLookupFailureException
RemoteLookupFailureException - if the service URL is invalidprotected java.lang.Object createHessianProxy(HessianProxyFactory proxyFactory)
throws java.net.MalformedURLException
proxyFactory - the proxy factory to usejava.net.MalformedURLException - if thrown by the proxy factorycom.caucho.hessian.client.HessianProxyFactory#createpublic java.lang.Object invoke(MethodInvocation invocation)
throws java.lang.Throwable
java.lang.Throwableprotected RemoteAccessException convertHessianAccessException(java.lang.Throwable ex)
ex - the exception to convert