org.apache.myfaces.context.servlet
Class StartupServletExternalContextImpl

java.lang.Object
  extended by javax.faces.context.ExternalContext
      extended by org.apache.myfaces.context.servlet.ServletExternalContextImplBase
          extended by org.apache.myfaces.context.servlet.StartupServletExternalContextImpl
All Implemented Interfaces:
ReleaseableExternalContext

public class StartupServletExternalContextImpl
extends ServletExternalContextImplBase

An ExternalContext implementation for Servlet environments, which is used by StartupFacesContextImpl at container startup and shutdown and which provides ExternalContext functionality that does not require request and response objects.

Version:
$Revision: 1144260 $ $Date: 2011-07-08 06:13:32 -0500 (Fri, 08 Jul 2011) $
Author:
Jakob Korherr (latest modification by $Author: jakobk $)

Field Summary
static String EXCEPTION_TEXT
           
 
Fields inherited from class javax.faces.context.ExternalContext
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
StartupServletExternalContextImpl(javax.servlet.ServletContext servletContext, boolean startup)
           
 
Method Summary
 void addResponseCookie(String name, String value, Map<String,Object> properties)
           
 void addResponseHeader(String name, String value)
           
 void dispatch(String path)
          Cannot dispatch because this is not a page request
 String encodeActionURL(String url)
           
 String encodeBookmarkableURL(String baseUrl, Map<String,List<String>> parameters)
           
 String encodeNamespace(String name)
           
 String encodePartialActionURL(String url)
           
 String encodeRedirectURL(String baseUrl, Map<String,List<String>> parameters)
           
 String encodeResourceURL(String url)
           
 String getAuthType()
           
 Flash getFlash()
           
 String getRemoteUser()
           
 Object getRequest()
           
 String getRequestCharacterEncoding()
           
 int getRequestContentLength()
           
 String getRequestContentType()
           
 String getRequestContextPath()
           
 Map<String,Object> getRequestCookieMap()
           
 Map<String,String> getRequestHeaderMap()
           
 Map<String,String[]> getRequestHeaderValuesMap()
           
 Locale getRequestLocale()
           
 Iterator<Locale> getRequestLocales()
           
 Map<String,Object> getRequestMap()
           
 Map<String,String> getRequestParameterMap()
           
 Iterator<String> getRequestParameterNames()
           
 Map<String,String[]> getRequestParameterValuesMap()
           
 String getRequestPathInfo()
           
 String getRequestScheme()
           
 String getRequestServerName()
           
 int getRequestServerPort()
           
 String getRequestServletPath()
           
 Object getResponse()
           
 int getResponseBufferSize()
           
 String getResponseCharacterEncoding()
           
 String getResponseContentType()
           
 OutputStream getResponseOutputStream()
           
 Writer getResponseOutputWriter()
           
 Object getSession(boolean create)
           
 Map<String,Object> getSessionMap()
           
 int getSessionMaxInactiveInterval()
           
 Principal getUserPrincipal()
           
 void invalidateSession()
           
 boolean isResponseCommitted()
           
 boolean isSecure()
           
 boolean isUserInRole(String role)
           
 void redirect(String url)
          Cannot redirect because this is not a page request
 void responseFlushBuffer()
           
 void responseReset()
           
 void responseSendError(int statusCode, String message)
           
 void setRequest(Object request)
           
 void setRequestCharacterEncoding(String encoding)
           
 void setResponse(Object response)
           
 void setResponseBufferSize(int size)
           
 void setResponseCharacterEncoding(String encoding)
           
 void setResponseContentLength(int length)
           
 void setResponseContentType(String contentType)
           
 void setResponseHeader(String name, String value)
           
 void setResponseStatus(int statusCode)
           
 void setSessionMaxInactiveInterval(int interval)
           
 
Methods inherited from class org.apache.myfaces.context.servlet.ServletExternalContextImplBase
checkNull, getApplicationMap, getContext, getContextName, getInitParameter, getInitParameterMap, getMimeType, getRealPath, getResource, getResourceAsStream, getResourcePaths, log, log, release
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXCEPTION_TEXT

public static final String EXCEPTION_TEXT
See Also:
Constant Field Values
Constructor Detail

StartupServletExternalContextImpl

public StartupServletExternalContextImpl(javax.servlet.ServletContext servletContext,
                                         boolean startup)
Method Detail

encodeActionURL

public String encodeActionURL(String url)
Specified by:
encodeActionURL in class ExternalContext

encodeNamespace

public String encodeNamespace(String name)
Specified by:
encodeNamespace in class ExternalContext

encodeResourceURL

public String encodeResourceURL(String url)
Specified by:
encodeResourceURL in class ExternalContext

getAuthType

public String getAuthType()
Specified by:
getAuthType in class ExternalContext

getRemoteUser

public String getRemoteUser()
Specified by:
getRemoteUser in class ExternalContext

getRequest

public Object getRequest()
Specified by:
getRequest in class ExternalContext

getRequestContextPath

public String getRequestContextPath()
Specified by:
getRequestContextPath in class ExternalContext

getRequestCookieMap

public Map<String,Object> getRequestCookieMap()
Specified by:
getRequestCookieMap in class ExternalContext

getRequestHeaderMap

public Map<String,String> getRequestHeaderMap()
Specified by:
getRequestHeaderMap in class ExternalContext

getRequestHeaderValuesMap

public Map<String,String[]> getRequestHeaderValuesMap()
Specified by:
getRequestHeaderValuesMap in class ExternalContext

getRequestLocale

public Locale getRequestLocale()
Specified by:
getRequestLocale in class ExternalContext

getRequestLocales

public Iterator<Locale> getRequestLocales()
Specified by:
getRequestLocales in class ExternalContext

getRequestMap

public Map<String,Object> getRequestMap()
Specified by:
getRequestMap in class ExternalContext

getRequestParameterMap

public Map<String,String> getRequestParameterMap()
Specified by:
getRequestParameterMap in class ExternalContext

getRequestParameterNames

public Iterator<String> getRequestParameterNames()
Specified by:
getRequestParameterNames in class ExternalContext

getRequestParameterValuesMap

public Map<String,String[]> getRequestParameterValuesMap()
Specified by:
getRequestParameterValuesMap in class ExternalContext

getRequestPathInfo

public String getRequestPathInfo()
Specified by:
getRequestPathInfo in class ExternalContext

getRequestServletPath

public String getRequestServletPath()
Specified by:
getRequestServletPath in class ExternalContext

getResponse

public Object getResponse()
Specified by:
getResponse in class ExternalContext

getSession

public Object getSession(boolean create)
Specified by:
getSession in class ExternalContext

getSessionMap

public Map<String,Object> getSessionMap()
Specified by:
getSessionMap in class ExternalContext

getUserPrincipal

public Principal getUserPrincipal()
Specified by:
getUserPrincipal in class ExternalContext

isUserInRole

public boolean isUserInRole(String role)
Specified by:
isUserInRole in class ExternalContext

encodeBookmarkableURL

public String encodeBookmarkableURL(String baseUrl,
                                    Map<String,List<String>> parameters)
Overrides:
encodeBookmarkableURL in class ExternalContext

encodePartialActionURL

public String encodePartialActionURL(String url)
Overrides:
encodePartialActionURL in class ExternalContext

encodeRedirectURL

public String encodeRedirectURL(String baseUrl,
                                Map<String,List<String>> parameters)
Overrides:
encodeRedirectURL in class ExternalContext

getRequestCharacterEncoding

public String getRequestCharacterEncoding()
Overrides:
getRequestCharacterEncoding in class ExternalContext

getRequestContentLength

public int getRequestContentLength()
Overrides:
getRequestContentLength in class ExternalContext

getRequestContentType

public String getRequestContentType()
Overrides:
getRequestContentType in class ExternalContext

getRequestScheme

public String getRequestScheme()
Overrides:
getRequestScheme in class ExternalContext

getRequestServerName

public String getRequestServerName()
Overrides:
getRequestServerName in class ExternalContext

getRequestServerPort

public int getRequestServerPort()
Overrides:
getRequestServerPort in class ExternalContext

getResponseBufferSize

public int getResponseBufferSize()
Overrides:
getResponseBufferSize in class ExternalContext

getResponseCharacterEncoding

public String getResponseCharacterEncoding()
Overrides:
getResponseCharacterEncoding in class ExternalContext

getResponseContentType

public String getResponseContentType()
Overrides:
getResponseContentType in class ExternalContext

invalidateSession

public void invalidateSession()
Overrides:
invalidateSession in class ExternalContext

isResponseCommitted

public boolean isResponseCommitted()
Overrides:
isResponseCommitted in class ExternalContext

setRequest

public void setRequest(Object request)
Overrides:
setRequest in class ExternalContext

setRequestCharacterEncoding

public void setRequestCharacterEncoding(String encoding)
                                 throws UnsupportedEncodingException
Overrides:
setRequestCharacterEncoding in class ExternalContext
Throws:
UnsupportedEncodingException

setResponse

public void setResponse(Object response)
Overrides:
setResponse in class ExternalContext

setResponseBufferSize

public void setResponseBufferSize(int size)
Overrides:
setResponseBufferSize in class ExternalContext

setResponseCharacterEncoding

public void setResponseCharacterEncoding(String encoding)
Overrides:
setResponseCharacterEncoding in class ExternalContext

setResponseContentLength

public void setResponseContentLength(int length)
Overrides:
setResponseContentLength in class ExternalContext

setResponseContentType

public void setResponseContentType(String contentType)
Overrides:
setResponseContentType in class ExternalContext

setResponseHeader

public void setResponseHeader(String name,
                              String value)
Overrides:
setResponseHeader in class ExternalContext

setResponseStatus

public void setResponseStatus(int statusCode)
Overrides:
setResponseStatus in class ExternalContext

dispatch

public void dispatch(String path)
              throws IOException
Cannot dispatch because this is not a page request

Specified by:
dispatch in class ExternalContext
Throws:
IOException

redirect

public void redirect(String url)
              throws IOException
Cannot redirect because this is not a page request

Specified by:
redirect in class ExternalContext
Throws:
IOException

responseFlushBuffer

public void responseFlushBuffer()
                         throws IOException
Overrides:
responseFlushBuffer in class ExternalContext
Throws:
IOException

responseReset

public void responseReset()
Overrides:
responseReset in class ExternalContext

responseSendError

public void responseSendError(int statusCode,
                              String message)
                       throws IOException
Overrides:
responseSendError in class ExternalContext
Throws:
IOException

addResponseCookie

public void addResponseCookie(String name,
                              String value,
                              Map<String,Object> properties)
Overrides:
addResponseCookie in class ExternalContext

addResponseHeader

public void addResponseHeader(String name,
                              String value)
Overrides:
addResponseHeader in class ExternalContext

getFlash

public Flash getFlash()
Overrides:
getFlash in class ExternalContext

getResponseOutputStream

public OutputStream getResponseOutputStream()
                                     throws IOException
Overrides:
getResponseOutputStream in class ExternalContext
Throws:
IOException

getResponseOutputWriter

public Writer getResponseOutputWriter()
                               throws IOException
Overrides:
getResponseOutputWriter in class ExternalContext
Throws:
IOException

isSecure

public boolean isSecure()
Overrides:
isSecure in class ExternalContext

getSessionMaxInactiveInterval

public int getSessionMaxInactiveInterval()
Overrides:
getSessionMaxInactiveInterval in class ExternalContext

setSessionMaxInactiveInterval

public void setSessionMaxInactiveInterval(int interval)
Overrides:
setSessionMaxInactiveInterval in class ExternalContext


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.