org.apache.openejb.server.httpd
Class ServletResponseAdapter

java.lang.Object
  extended by org.apache.openejb.server.httpd.ServletResponseAdapter
All Implemented Interfaces:
java.io.Serializable, HttpResponse

public class ServletResponseAdapter
extends java.lang.Object
implements HttpResponse

See Also:
Serialized Form

Constructor Summary
ServletResponseAdapter(javax.servlet.http.HttpServletResponse response)
           
 
Method Summary
 void flushBuffer()
          Flushes the output buffer to the client.
 java.lang.String getContentType()
          Gets the content type that will be sent to the browser.
 java.lang.String getHeader(java.lang.String name)
          Gets a header based on the name passed in
 java.io.OutputStream getOutputStream()
          Gets the OutputStream to send data to the browser
 java.io.PrintWriter getPrintWriter()
          Gets the PrintWriter to send data to the browser
 int getStatusCode()
          Gets the response status code that will be sent to the browser
 void setContentType(java.lang.String type)
          Sets the content type to be sent back to the browser.
 void setHeader(java.lang.String name, java.lang.String value)
          Sets a header to be sent back to the browser
 void setStatusCode(int code)
          Sets the HTTP response status code to be sent to the browser.
 void setStatusMessage(java.lang.String responseString)
          Sets the response string to be sent to the browser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletResponseAdapter

public ServletResponseAdapter(javax.servlet.http.HttpServletResponse response)
Method Detail

getPrintWriter

public java.io.PrintWriter getPrintWriter()
                                   throws java.io.IOException
Description copied from interface: HttpResponse
Gets the PrintWriter to send data to the browser

Specified by:
getPrintWriter in interface HttpResponse
Returns:
the PrintWriter to send data to the browser
Throws:
java.io.IOException

setHeader

public void setHeader(java.lang.String name,
                      java.lang.String value)
Description copied from interface: HttpResponse
Sets a header to be sent back to the browser

Specified by:
setHeader in interface HttpResponse
Parameters:
name - the header name
value - the header value

getHeader

public java.lang.String getHeader(java.lang.String name)
Description copied from interface: HttpResponse
Gets a header based on the name passed in

Specified by:
getHeader in interface HttpResponse
Parameters:
name - the header name
Returns:
the header value

getOutputStream

public java.io.OutputStream getOutputStream()
Description copied from interface: HttpResponse
Gets the OutputStream to send data to the browser

Specified by:
getOutputStream in interface HttpResponse
Returns:
the OutputStream to send data to the browser

setStatusCode

public void setStatusCode(int code)
Description copied from interface: HttpResponse
Sets the HTTP response status code to be sent to the browser.

Specified by:
setStatusCode in interface HttpResponse
Parameters:
code - the status code to be sent to the browser

getStatusCode

public int getStatusCode()
Description copied from interface: HttpResponse
Gets the response status code that will be sent to the browser

Specified by:
getStatusCode in interface HttpResponse
Returns:
the HTTP status code

setContentType

public void setContentType(java.lang.String type)
Description copied from interface: HttpResponse
Sets the content type to be sent back to the browser.

Specified by:
setContentType in interface HttpResponse
Parameters:
type - the type to be sent to the browser (i.e. "text/html")

getContentType

public java.lang.String getContentType()
Description copied from interface: HttpResponse
Gets the content type that will be sent to the browser.

Specified by:
getContentType in interface HttpResponse
Returns:
the content type (i.e. "text/html")

setStatusMessage

public void setStatusMessage(java.lang.String responseString)
Description copied from interface: HttpResponse
Sets the response string to be sent to the browser

Specified by:
setStatusMessage in interface HttpResponse
Parameters:
responseString - the response string

flushBuffer

public void flushBuffer()
                 throws java.io.IOException
Description copied from interface: HttpResponse
Flushes the output buffer to the client.

Specified by:
flushBuffer in interface HttpResponse
Throws:
java.io.IOException


Copyright © 1999-2011 The Apache OpenEJB development community. All Rights Reserved.