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.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 protected
HessianProxy(java.net.URL url, HessianProxyFactory factory)
Protected constructor for subclassingprotected
HessianProxy(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 void
addRequestHeaders(HessianConnection conn)
Method that allows subclasses to add request headers such as cookies.protected java.io.InputStream
getInputStream(HessianConnection conn)
java.net.URL
getURL()
Returns the proxy's URL.java.lang.Object
invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
Handles the object invocation.protected java.lang.String
mangleName(java.lang.reflect.Method method)
protected void
parseResponseHeaders(java.net.URLConnection conn)
Method that allows subclasses to parse response headers such as cookies.protected HessianConnection
sendRequest(java.lang.String methodName, java.lang.Object[] args)
Sends the HTTP request to the Hessian connection.java.lang.Object
writeReplace()
-
-
-
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.Throwable
Handles the object invocation.- Specified by:
invoke
in 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()
-
-