com.caucho.hessian.client
Class HessianProxy

java.lang.Object
  extended by 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
protected  HessianProxyFactory _factory
           
 
Constructor Summary
protected HessianProxy(java.net.URL url, HessianProxyFactory factory)
          Protected constructor for subclassing
protected HessianProxy(java.net.URL url, HessianProxyFactory factory, java.lang.Class<?> type)
          Protected constructor for subclassing
 
Method Summary
protected  void addRequestHeaders(HessianConnection conn)
          Method that allows subclasses to add request headers such as cookies.
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 interface java.lang.reflect.InvocationHandler
Parameters:
proxy - the proxy object to invoke
method - the method to call
args - the arguments to the proxy object
Throws:
java.lang.Throwable

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()