Package com.caucho.hessian.client
Class HessianProxy
- java.lang.Object
-
- com.caucho.hessian.client.HessianProxy
-
- All Implemented Interfaces:
Serializable,InvocationHandler
public class HessianProxy extends Object implements InvocationHandler, Serializable
Proxy 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(URL url, HessianProxyFactory factory)Protected constructor for subclassingprotectedHessianProxy(URL url, HessianProxyFactory factory, 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 InputStreamgetInputStream(HessianConnection conn)URLgetURL()Returns the proxy's URL.Objectinvoke(Object proxy, Method method, Object[] args)Handles the object invocation.protected StringmangleName(Method method)protected voidparseResponseHeaders(URLConnection conn)Method that allows subclasses to parse response headers such as cookies.protected HessianConnectionsendRequest(String methodName, Object[] args)Sends the HTTP request to the Hessian connection.ObjectwriteReplace()
-
-
-
Field Detail
-
_factory
protected HessianProxyFactory _factory
-
-
Constructor Detail
-
HessianProxy
protected HessianProxy(URL url, HessianProxyFactory factory)
Protected constructor for subclassing
-
HessianProxy
protected HessianProxy(URL url, HessianProxyFactory factory, Class<?> type)
Protected constructor for subclassing
-
-
Method Detail
-
getURL
public URL getURL()
Returns the proxy's URL.
-
invoke
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
Handles the object invocation.- Specified by:
invokein interfaceInvocationHandler- Parameters:
proxy- the proxy object to invokemethod- the method to callargs- the arguments to the proxy object- Throws:
Throwable
-
getInputStream
protected InputStream getInputStream(HessianConnection conn) throws IOException
- Throws:
IOException
-
sendRequest
protected HessianConnection sendRequest(String methodName, Object[] args) throws IOException
Sends the HTTP request to the Hessian connection.- Throws:
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(URLConnection conn)
Method that allows subclasses to parse response headers such as cookies. Default implementation is empty.- Parameters:
conn-
-
writeReplace
public Object writeReplace()
-
-