org.apache.shale.remoting.faces
Class ResponseFactory

java.lang.Object
  extended by org.apache.shale.remoting.faces.ResponseFactory

public class ResponseFactory
extends Object

Factory class for returning ResponseStream or ResponseWriter instances that may be used to produce output response content that is independent of whether we are running in a servlet or portlet environment. The RenderKit for the current request will be used to manufacture stream or writer instances, if necessary.


Constructor Summary
ResponseFactory()
           
 
Method Summary
protected  javax.faces.context.ResponseStream createResponseStream(javax.faces.context.FacesContext context, String contentType)
          Create a new ResponseStream that writes to the servlet or portlet response stream for the current request.
protected  javax.faces.context.ResponseWriter createResponseWriter(javax.faces.context.FacesContext context, String contentType)
          Create a new ResponseWriter that writes to the servlet or portlet response writer for the current request.
 javax.faces.context.ResponseStream getResponseStream(javax.faces.context.FacesContext context, String contentType)
          Return the configured ResponseStream for the current request, creating and installing a new one if necessary.
 javax.faces.context.ResponseWriter getResponseWriter(javax.faces.context.FacesContext context, String contentType)
          Return the configured ResponseWriter for the current request, creating and installing a new one if necessary.
protected  javax.faces.render.RenderKit renderKit(javax.faces.context.FacesContext context)
          Return the relevant RenderKit to construct response stream or writer instances for this request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResponseFactory

public ResponseFactory()
Method Detail

getResponseStream

public javax.faces.context.ResponseStream getResponseStream(javax.faces.context.FacesContext context,
                                                            String contentType)

Return the configured ResponseStream for the current request, creating and installing a new one if necessary.

Parameters:
context - FacesContext for the current request
contentType - Content type to be set on the response, or null to let this be defaulted

getResponseWriter

public javax.faces.context.ResponseWriter getResponseWriter(javax.faces.context.FacesContext context,
                                                            String contentType)

Return the configured ResponseWriter for the current request, creating and installing a new one if necessary.

Parameters:
context - FacesContext for the current request
contentType - Content type to be set on the response, or null to let this be defaulted

createResponseStream

protected javax.faces.context.ResponseStream createResponseStream(javax.faces.context.FacesContext context,
                                                                  String contentType)

Create a new ResponseStream that writes to the servlet or portlet response stream for the current request.

Parameters:
context - FacesContext for the current request
contentType - Content type to be set on the response, or null to let this be defaulted
Throws:
IllegalStateException - if a writer for the current response has already been acquired

createResponseWriter

protected javax.faces.context.ResponseWriter createResponseWriter(javax.faces.context.FacesContext context,
                                                                  String contentType)

Create a new ResponseWriter that writes to the servlet or portlet response writer for the current request.

Parameters:
context - FacesContext for the current request
contentType - Content type to be set on the response, or null to let this be defaulted
Throws:
IllegalStateException - if a writer for the current response has already been acquired

renderKit

protected javax.faces.render.RenderKit renderKit(javax.faces.context.FacesContext context)

Return the relevant RenderKit to construct response stream or writer instances for this request. If there is no render kit identified yet, the default RenderKit will be returned.

Parameters:
context - FacesContext for the current request


Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.