com.caucho.hessian.client
Class HessianProxy

java.lang.Object
  extended by 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
protected  HessianProxyFactory _factory
           
 
Constructor Summary
protected HessianProxy(URL url, HessianProxyFactory factory)
          Protected constructor for subclassing
protected HessianProxy(URL url, HessianProxyFactory factory, Class<?> type)
          Protected constructor for subclassing
 
Method Summary
protected  void addRequestHeaders(HessianConnection conn)
          Method that allows subclasses to add request headers such as cookies.
protected  InputStream getInputStream(HessianConnection conn)
           
 URL getURL()
          Returns the proxy's URL.
 Object invoke(Object proxy, Method method, Object[] args)
          Handles the object invocation.
protected  String mangleName(Method method)
           
protected  void parseResponseHeaders(URLConnection conn)
          Method that allows subclasses to parse response headers such as cookies.
protected  HessianConnection sendRequest(String methodName, Object[] args)
          Sends the HTTP request to the Hessian connection.
 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(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:
invoke in interface InvocationHandler
Parameters:
proxy - the proxy object to invoke
method - the method to call
args - the arguments to the proxy object
Throws:
Throwable

getInputStream

protected InputStream getInputStream(HessianConnection conn)
                              throws IOException
Throws:
IOException

mangleName

protected String mangleName(Method method)

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


Copyright © 2013. All Rights Reserved.