Package com.caucho.hessian.client
Class HessianProxy
- java.lang.Object
-
- com.caucho.hessian.client.HessianProxy
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.reflect.InvocationHandler
public class HessianProxy extends java.lang.Object implements java.lang.reflect.InvocationHandler, java.io.SerializableProxy implementation for Hessian clients. Applications will generally use HessianProxyFactory to create proxy clients.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected HessianProxyFactory_factory
-
Constructor Summary
Constructors Modifier Constructor Description protectedHessianProxy(java.net.URL url, HessianProxyFactory factory)Protected constructor for subclassingprotectedHessianProxy(java.net.URL url, HessianProxyFactory factory, java.lang.Class<?> type)Protected constructor for subclassing
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddRequestHeaders(HessianConnection conn)Method that allows subclasses to add request headers such as cookies.protected java.io.InputStreamgetInputStream(HessianConnection conn)java.net.URLgetURL()Returns the proxy's URL.java.lang.Objectinvoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)Handles the object invocation.protected java.lang.StringmangleName(java.lang.reflect.Method method)protected voidparseResponseHeaders(java.net.URLConnection conn)Method that allows subclasses to parse response headers such as cookies.protected HessianConnectionsendRequest(java.lang.String methodName, java.lang.Object[] args)Sends the HTTP request to the Hessian connection.java.lang.ObjectwriteReplace()
-
-
-
Field Detail
-
_factory
protected HessianProxyFactory _factory
-
-
Constructor Detail
-
HessianProxy
protected HessianProxy(java.net.URL url, HessianProxyFactory factory)Protected constructor for subclassing
-
HessianProxy
protected HessianProxy(java.net.URL url, HessianProxyFactory factory, java.lang.Class<?> type)Protected constructor for subclassing
-
-
Method Detail
-
getURL
public java.net.URL getURL()
Returns the proxy's URL.
-
invoke
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.ThrowableHandles the object invocation.- Specified by:
invokein interfacejava.lang.reflect.InvocationHandler- Parameters:
proxy- the proxy object to invokemethod- the method to callargs- the arguments to the proxy object- Throws:
java.lang.Throwable
-
getInputStream
protected java.io.InputStream getInputStream(HessianConnection conn) throws java.io.IOException
- Throws:
java.io.IOException
-
mangleName
protected java.lang.String mangleName(java.lang.reflect.Method method)
-
sendRequest
protected HessianConnection sendRequest(java.lang.String methodName, java.lang.Object[] args) throws java.io.IOException
Sends the HTTP request to the Hessian connection.- Throws:
java.io.IOException
-
addRequestHeaders
protected void addRequestHeaders(HessianConnection conn)
Method that allows subclasses to add request headers such as cookies. Default implementation is empty.
-
parseResponseHeaders
protected void parseResponseHeaders(java.net.URLConnection conn)
Method that allows subclasses to parse response headers such as cookies. Default implementation is empty.- Parameters:
conn-
-
writeReplace
public java.lang.Object writeReplace()
-
-