wt.httpgw
Class HTTPServletResponse

java.lang.Object
  extended bywt.httpgw.HTTPResponse
      extended bywt.httpgw.HTTPServletResponse

public class HTTPServletResponse
extends HTTPResponse


Field Summary
private  HTTPResponseHeaders hdrs
           
private  OutputStream out
           
private  String remoteHost
           
private  Object[] respTargetArgs
           
private  Method respTargetMethod
           
private  javax.servlet.http.HttpServletResponse servletResponse
           
private static boolean VERBOSE_SERVER
           
 
Fields inherited from class wt.httpgw.HTTPResponse
respException, serialVersionUID
 
Constructor Summary
HTTPServletResponse(javax.servlet.http.HttpServletResponse response)
           
 
Method Summary
 boolean containsHeader(String s)
          Checks if the response header is present.
 Object get(String s)
          Gets the value of this response header key.
 OutputStream getOutputStream()
          Called to get the output stream to write the data to.
 void invoke()
          Invoke the target method to write the response.
 Enumeration keys()
          Gets the response header keys.
 void setDateHeader(String s1, long date)
          Sets a date type response header.
 void setHeader(String s1, String s2)
          Sets a string type response header.
 void setIntHeader(String s1, int v1)
          Sets a int type response header.
 void setRemoteHost(String remote_host)
          Setter for the remote host that will be displayed in exception tracebacks.
 void setRespTarget(Method method, Object[] args)
          Setter for the target method that will generate the real response to the output stream.
 void setStatus(int v1)
          Sets a simple Status response header.
 void setStatus(int v1, String s1)
          Sets a Status response header.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERBOSE_SERVER

private static boolean VERBOSE_SERVER

servletResponse

private javax.servlet.http.HttpServletResponse servletResponse

out

private OutputStream out

respTargetMethod

private Method respTargetMethod

respTargetArgs

private Object[] respTargetArgs

remoteHost

private String remoteHost

hdrs

private HTTPResponseHeaders hdrs
Constructor Detail

HTTPServletResponse

public HTTPServletResponse(javax.servlet.http.HttpServletResponse response)
                    throws WTIOException
Method Detail

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Called to get the output stream to write the data to. It also causes the HTTPResponseHeaders object to be written out to the RMI marshal stream.

Supported API:false

Specified by:
getOutputStream in class HTTPResponse
Returns:
OutputStream for writing response body
Throws:
IOException - if not marshaling response in writeObject. the output stream is null until such time. Also, if the response target class or method is null. There is not a proper business class or method to write the response.

setRespTarget

public void setRespTarget(Method method,
                          Object[] args)
Setter for the target method that will generate the real response to the output stream.

Supported API: false

Specified by:
setRespTarget in class HTTPResponse
Parameters:
method - is the target business Method
args - are the object array of arguments needed my the target method.

setRemoteHost

public void setRemoteHost(String remote_host)
Setter for the remote host that will be displayed in exception tracebacks.

Supported API: false

Specified by:
setRemoteHost in class HTTPResponse

containsHeader

public boolean containsHeader(String s)
Checks if the response header is present.

Supported API:false

Specified by:
containsHeader in class HTTPResponse
Parameters:
s - String the header to search for.
Returns:
A boolean if the header is set.

keys

public Enumeration keys()
Gets the response header keys.

Supported API: false

Specified by:
keys in class HTTPResponse
Returns:
An Enumeration of the header keys.

get

public Object get(String s)
Gets the value of this response header key.

Supported API: false

Specified by:
get in class HTTPResponse
Parameters:
s - the key, as a string, to get the value of.
Returns:
the value of this key as an Object.

setHeader

public void setHeader(String s1,
                      String s2)
Sets a string type response header.

Supported API:false

Specified by:
setHeader in class HTTPResponse
Parameters:
s1 - String name of the header
s2 - String value to which header is set

setDateHeader

public void setDateHeader(String s1,
                          long date)
Sets a date type response header.

Supported API:false

Specified by:
setDateHeader in class HTTPResponse
Parameters:
s1 - String name of the header
date - long value to which header is set value is milliseconds since the epoch.

setIntHeader

public void setIntHeader(String s1,
                         int v1)
Sets a int type response header.

Supported API:false

Specified by:
setIntHeader in class HTTPResponse
Parameters:
s1 - String name of the header
v1 - int value to which header is set

setStatus

public void setStatus(int v1)
Sets a simple Status response header.

Supported API:false

Specified by:
setStatus in class HTTPResponse
Parameters:
v1 - Integer Status code

setStatus

public void setStatus(int v1,
                      String s1)
Sets a Status response header.

Supported API:false

Specified by:
setStatus in class HTTPResponse
Parameters:
v1 - Integer Status code
s1 - String Status reason code

invoke

public void invoke()
Invoke the target method to write the response.

Supported API: false