Class HessianExporter
- java.lang.Object
- org.springframework.remoting.support.RemotingSupport
- org.springframework.remoting.support.RemoteExporter
- org.springframework.remoting.caucho.HessianExporter
- All Implemented Interfaces:
Aware,BeanClassLoaderAware,InitializingBean
- Direct Known Subclasses:
HessianServiceExporter,SimpleHessianServiceExporter
public class HessianExporter extends RemoteExporter implements InitializingBean
General stream-based protocol exporter for a Hessian endpoint.Hessian is a slim, binary RPC protocol. For information on Hessian, see the Hessian website. Note: As of Spring 4.0, this exporter requires Hessian 4.0 or above.
- Since:
- 2.5.1
- Author:
- Juergen Hoeller
- See Also:
invoke(java.io.InputStream, java.io.OutputStream),HessianServiceExporter,SimpleHessianServiceExporter
Field Summary
Fields Modifier and Type Field Description static StringCONTENT_TYPE_HESSIANFields inherited from class org.springframework.remoting.support.RemotingSupport
logger
Constructor Summary
Constructors Constructor Description HessianExporter()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()Invoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.protected voiddoInvoke(com.caucho.hessian.server.HessianSkeleton skeleton, InputStream inputStream, OutputStream outputStream)Actually invoke the skeleton with the given streams.voidinvoke(InputStream inputStream, OutputStream outputStream)Perform an invocation on the exported object.voidprepare()Initialize this exporter.voidsetAllowNonSerializable(boolean allowNonSerializable)Set whether to allow non-serializable types as Hessian arguments and return values.voidsetDebug(boolean debug)Set whether Hessian's debug mode should be enabled, logging to this exporter's Commons Logging log.voidsetRemoteResolver(com.caucho.hessian.io.HessianRemoteResolver remoteResolver)Specify a custom HessianRemoteResolver to use for resolving remote object references.voidsetSendCollectionType(boolean sendCollectionType)Set whether to send the Java collection type for each serialized collection.voidsetSerializerFactory(com.caucho.hessian.io.SerializerFactory serializerFactory)Specify the Hessian SerializerFactory to use.Methods inherited from class org.springframework.remoting.support.RemoteExporter
checkService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterface
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
Field Detail
CONTENT_TYPE_HESSIAN
public static final String CONTENT_TYPE_HESSIAN
- See Also:
- Constant Field Values
Constructor Detail
HessianExporter
public HessianExporter()
Method Detail
setSerializerFactory
public void setSerializerFactory(com.caucho.hessian.io.SerializerFactory serializerFactory)
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)
Set whether to send the Java collection type for each serialized collection. Default is "true".
setAllowNonSerializable
public void setAllowNonSerializable(boolean allowNonSerializable)
Set whether to allow non-serializable types as Hessian arguments and return values. Default is "true".
setRemoteResolver
public void setRemoteResolver(com.caucho.hessian.io.HessianRemoteResolver remoteResolver)
Specify a custom HessianRemoteResolver to use for resolving remote object references.
setDebug
public void setDebug(boolean debug)
Set whether Hessian's debug mode should be enabled, logging to this exporter's Commons Logging log. Default is "false".- See Also:
HessianProxyFactory.setDebug(boolean)
afterPropertiesSet
public void afterPropertiesSet()
Description copied from interface:InitializingBeanInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.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:
afterPropertiesSetin interfaceInitializingBean
prepare
public void prepare()
Initialize this exporter.
invoke
public void invoke(InputStream inputStream, OutputStream outputStream) throws Throwable
Perform an invocation on the exported object.- Parameters:
inputStream- the request streamoutputStream- the response stream- Throws:
Throwable- if invocation failed
doInvoke
protected void doInvoke(com.caucho.hessian.server.HessianSkeleton skeleton, InputStream inputStream, OutputStream outputStream) throws Throwable
Actually invoke the skeleton with the given streams.- Parameters:
skeleton- the skeleton to invokeinputStream- the request streamoutputStream- the response stream- Throws:
Throwable- if invocation failed