|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.remoting.support.RemotingSupport
org.springframework.remoting.support.RemoteAccessor
org.springframework.remoting.support.UrlBasedRemoteAccessor
org.springframework.remoting.caucho.HessianClientInterceptor
public class HessianClientInterceptor
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
Field Summary | |
---|---|
private java.lang.Object |
hessianProxy
|
private HessianProxyFactory |
proxyFactory
|
Fields inherited from class org.springframework.remoting.support.RemotingSupport |
---|
logger |
Constructor Summary | |
---|---|
HessianClientInterceptor()
|
Method Summary | |
---|---|
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. |
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 |
Field Detail |
---|
private HessianProxyFactory proxyFactory
private java.lang.Object hessianProxy
Constructor Detail |
---|
public HessianClientInterceptor()
Method Detail |
---|
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#setOverloadEnabled
public void setUsername(java.lang.String username)
The username will be sent by Hessian via HTTP Basic Authentication.
com.caucho.hessian.client.HessianProxyFactory#setUser
public void setPassword(java.lang.String password)
The password will be sent by Hessian via HTTP Basic Authentication.
com.caucho.hessian.client.HessianProxyFactory#setPassword
public void setDebug(boolean debug)
com.caucho.hessian.client.HessianProxyFactory#setDebug
public void setChunkedPost(boolean chunkedPost)
com.caucho.hessian.client.HessianProxyFactory#setChunkedPost
public void setReadTimeout(long timeout)
com.caucho.hessian.client.HessianProxyFactory#setReadTimeout
public void setHessian2(boolean hessian2)
com.caucho.hessian.client.HessianProxyFactory#setHessian2Request
public void setHessian2Request(boolean hessian2)
com.caucho.hessian.client.HessianProxyFactory#setHessian2Request
public void setHessian2Reply(boolean hessian2)
com.caucho.hessian.client.HessianProxyFactory#setHessian2Reply
public void afterPropertiesSet()
InitializingBean
This 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 InitializingBean
afterPropertiesSet
in class UrlBasedRemoteAccessor
public 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 use
java.net.MalformedURLException
- if thrown by the proxy factorycom.caucho.hessian.client.HessianProxyFactory#create
public java.lang.Object invoke(MethodInvocation invocation) throws java.lang.Throwable
java.lang.Throwable
protected RemoteAccessException convertHessianAccessException(java.lang.Throwable ex)
ex
- the exception to convert
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |