com.caucho.hessian.client
Class HessianURLConnection

java.lang.Object
  extended by com.caucho.hessian.client.AbstractHessianConnection
      extended by com.caucho.hessian.client.HessianURLConnection
All Implemented Interfaces:
HessianConnection

public class HessianURLConnection
extends AbstractHessianConnection

Internal connection to a server. The default connection is based on java.net


Method Summary
 void addHeader(java.lang.String key, java.lang.String value)
          Adds a HTTP header.
 void close()
          Close/free the connection
 void destroy()
          Disconnect the connection
 java.io.InputStream getInputStream()
          Returns the InputStream to the result
 java.io.OutputStream getOutputStream()
          Returns the output stream for the request.
 int getStatusCode()
          Returns the status code.
 java.lang.String getStatusMessage()
          Returns the status string.
protected  void parseResponseHeaders(java.net.HttpURLConnection conn)
           
 void sendRequest()
          Sends the request
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addHeader

public void addHeader(java.lang.String key,
                      java.lang.String value)
Adds a HTTP header.

Specified by:
addHeader in interface HessianConnection
Overrides:
addHeader in class AbstractHessianConnection

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Returns the output stream for the request.

Specified by:
getOutputStream in interface HessianConnection
Specified by:
getOutputStream in class AbstractHessianConnection
Throws:
java.io.IOException

sendRequest

public void sendRequest()
                 throws java.io.IOException
Sends the request

Specified by:
sendRequest in interface HessianConnection
Specified by:
sendRequest in class AbstractHessianConnection
Throws:
java.io.IOException

parseResponseHeaders

protected void parseResponseHeaders(java.net.HttpURLConnection conn)
                             throws java.io.IOException
Throws:
java.io.IOException

getStatusCode

public int getStatusCode()
Returns the status code.

Specified by:
getStatusCode in interface HessianConnection
Specified by:
getStatusCode in class AbstractHessianConnection

getStatusMessage

public java.lang.String getStatusMessage()
Returns the status string.

Specified by:
getStatusMessage in interface HessianConnection
Specified by:
getStatusMessage in class AbstractHessianConnection

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Returns the InputStream to the result

Specified by:
getInputStream in interface HessianConnection
Specified by:
getInputStream in class AbstractHessianConnection
Throws:
java.io.IOException

close

public void close()
Close/free the connection

Specified by:
close in interface HessianConnection
Overrides:
close in class AbstractHessianConnection

destroy

public void destroy()
Disconnect the connection

Specified by:
destroy in interface HessianConnection
Specified by:
destroy in class AbstractHessianConnection