net.sourceforge.smile.context
Class FacesContextImpl

java.lang.Object
  extended byjavax.faces.context.FacesContext
      extended bynet.sourceforge.smile.context.FacesContextImpl

public class FacesContextImpl
extends javax.faces.context.FacesContext

The context object for many JSF operations. Our implementation supports object pooling through the release() method, in conjunction with the FacesContextFactory implementation.


Constructor Summary
FacesContextImpl()
           
FacesContextImpl(javax.servlet.ServletContext servletContext, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.faces.lifecycle.Lifecycle lifecycle)
           
 
Method Summary
 void addFacesEvent(javax.faces.event.FacesEvent facesEvent)
           
 void addMessage(javax.faces.component.UIComponent component, javax.faces.application.Message message)
           
 javax.faces.context.ExternalContext getExternalContext()
           
 java.util.Iterator getFacesEvents()
          Return an iterator that supports dynamic modification of the underlying list of events.
 javax.servlet.http.HttpSession getHttpSession()
           
 java.util.Locale getLocale()
           
 int getMaximumSeverity()
           
 java.util.Iterator getMessages()
           
 java.util.Iterator getMessages(javax.faces.component.UIComponent component)
           
 javax.faces.context.ResponseStream getResponseStream()
           
 javax.faces.context.ResponseWriter getResponseWriter()
           
 javax.servlet.ServletContext getServletContext()
           
 javax.servlet.http.HttpServletRequest getServletRequest()
           
 javax.servlet.http.HttpServletResponse getServletResponse()
           
 javax.faces.tree.Tree getTree()
           
 javax.faces.lifecycle.ViewHandler getViewHandler()
           
 boolean hasMessages()
           
 boolean isRenderResponse()
           
 boolean isResponseComplete()
           
 boolean isTreeGuarded()
           
 void recycle()
          Method that will re-initialize this FacesContext, so that object pooling and recycling allows us to reduce strain on the garbage collector to a minimum
 void release()
           
 void renderResponse()
           
 void responseComplete()
           
 void setAsCurrentFacesContext()
          This operation allows us to register this instance in the current thread as current FacesContext.
 void setLocale(java.util.Locale locale)
           
 void setResponseStream(javax.faces.context.ResponseStream responseStream)
           
 void setResponseWriter(javax.faces.context.ResponseWriter responseWriter)
           
 void setTree(javax.faces.tree.Tree tree)
           
 void setTreeGuarded(boolean b)
           
 void setTreeInternal(javax.faces.tree.Tree tree)
           
 
Methods inherited from class javax.faces.context.FacesContext
getCurrentInstance
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FacesContextImpl

public FacesContextImpl()

FacesContextImpl

public FacesContextImpl(javax.servlet.ServletContext servletContext,
                        javax.servlet.ServletRequest request,
                        javax.servlet.ServletResponse response,
                        javax.faces.lifecycle.Lifecycle lifecycle)
Method Detail

addFacesEvent

public void addFacesEvent(javax.faces.event.FacesEvent facesEvent)

getFacesEvents

public java.util.Iterator getFacesEvents()
Return an iterator that supports dynamic modification of the underlying list of events. This is important as the list of events may be iterated over, and at the same time extended with new events. This happens during the common events handling phase of JSF.

Returns:
Iterator with the events currently queued.

addMessage

public void addMessage(javax.faces.component.UIComponent component,
                       javax.faces.application.Message message)

getMessages

public java.util.Iterator getMessages()

getMaximumSeverity

public int getMaximumSeverity()

getMessages

public java.util.Iterator getMessages(javax.faces.component.UIComponent component)

hasMessages

public boolean hasMessages()

getLocale

public java.util.Locale getLocale()

setLocale

public void setLocale(java.util.Locale locale)

getResponseStream

public javax.faces.context.ResponseStream getResponseStream()

setResponseStream

public void setResponseStream(javax.faces.context.ResponseStream responseStream)

getResponseWriter

public javax.faces.context.ResponseWriter getResponseWriter()

setResponseWriter

public void setResponseWriter(javax.faces.context.ResponseWriter responseWriter)

getTree

public javax.faces.tree.Tree getTree()

setTree

public void setTree(javax.faces.tree.Tree tree)

setTreeInternal

public void setTreeInternal(javax.faces.tree.Tree tree)

getViewHandler

public javax.faces.lifecycle.ViewHandler getViewHandler()

release

public void release()

renderResponse

public void renderResponse()

responseComplete

public void responseComplete()

recycle

public void recycle()
Method that will re-initialize this FacesContext, so that object pooling and recycling allows us to reduce strain on the garbage collector to a minimum


setAsCurrentFacesContext

public void setAsCurrentFacesContext()
This operation allows us to register this instance in the current thread as current FacesContext. This is called at least by the FacesContextFactory, because the JSF specifications require that a FacesContext returned by the FacesContextFactory is registered as the thread's current FacesContext, before returning from getFacesContext(). See specs JSF5.1.11


isRenderResponse

public boolean isRenderResponse()
Returns:
a boolean stating that the JSF pipeline should or should not proceed directly to the render response phase.

isResponseComplete

public boolean isResponseComplete()
Returns:
a boolean indicating the the response has allready been generated by the application, and the JSF pipeline should not render a response.

isTreeGuarded

public boolean isTreeGuarded()
Returns:
a boolean indicating that the Component Tree is guarded or not.

setTreeGuarded

public void setTreeGuarded(boolean b)
Parameters:
b - boolean indicating that the Tree is protected from changing or not.

getExternalContext

public javax.faces.context.ExternalContext getExternalContext()
See Also:
FacesContext.getExternalContext()

getServletRequest

public javax.servlet.http.HttpServletRequest getServletRequest()

getServletResponse

public javax.servlet.http.HttpServletResponse getServletResponse()

getServletContext

public javax.servlet.ServletContext getServletContext()

getHttpSession

public javax.servlet.http.HttpSession getHttpSession()