Index: src/com/caucho/hessian/client/HessianProxy.java =================================================================== --- src/com/caucho/hessian/client/HessianProxy.java (revision 3370) +++ src/com/caucho/hessian/client/HessianProxy.java (working copy) @@ -74,17 +74,25 @@ private static final Logger log = Logger.getLogger(HessianProxy.class.getName()); - private HessianProxyFactory _factory; + protected HessianProxyFactory _factory; private WeakHashMap _mangleMap = new WeakHashMap(); private URL _url; + /** Package protected constructor for factory */ HessianProxy(HessianProxyFactory factory, URL url) { _factory = factory; _url = url; } + /** Protected constructor for subclassing */ + protected HessianProxy(URL url, HessianProxyFactory factory) + { + _factory = factory; + _url = url; + } + /** * Returns the proxy's URL. */ @@ -159,6 +167,8 @@ } catch (Exception e) { } + parseResponseHeaders(conn); + if (code != 200) { StringBuffer sb = new StringBuffer(); int ch; @@ -238,6 +248,15 @@ return AbstractSkeleton.mangleName(method, false); } + /** + * Method that allows subclasses to parse response headers such as cookies. + * Default implementation is empty. + * @param conn + */ + protected void parseResponseHeaders(URLConnection conn) { + + } + protected URLConnection sendRequest(String methodName, Object []args) throws IOException { @@ -255,6 +274,8 @@ } } + addRequestHeaders(conn); + OutputStream os = null; try { @@ -283,6 +304,15 @@ } } + /** + * Method that allows subclasses to add request headers such as cookies. + * Default implementation is empty. + */ + protected void addRequestHeaders(URLConnection conn) { + + } + + static class ResultInputStream extends InputStream { private HttpURLConnection _conn; private InputStream _connIs;