Package cloud.piranha

Class DefaultWebApplication

  • java.lang.Object
    • cloud.piranha.DefaultWebApplication
  • All Implemented Interfaces:
    cloud.piranha.api.WebApplication, javax.servlet.ServletContext


    public class DefaultWebApplication
    extends java.lang.Object
    implements cloud.piranha.api.WebApplication
    The default WebApplication.

    The filters field is backed by a LinkedHashMap so we get an insertion-order key set. If you change this, be aware that methods using this field should be changed to account for that.

    The servlets field is backed by a LinkedHashMap so we get an insertion-order key set. If you change this, be aware that methods using this field should be changed to account for that.

    Author:
    Manfred Riem (mriem@manorrock.com)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected cloud.piranha.api.AnnotationManager annotationManager
      Stores the annotation manager.
      protected java.util.Map<java.lang.String,java.lang.Object> attributes
      Stores the attributes.
      protected java.lang.ClassLoader classLoader
      Stores the class loader.
      protected java.util.List<javax.servlet.ServletContextAttributeListener> contextAttributeListeners
      Stores the servlet context attribute listeners.
      protected java.util.ArrayList<javax.servlet.ServletContextListener> contextListeners
      Stores the servlet context listeners.
      protected java.lang.String contextPath
      Stores the context path.
      protected boolean distributable
      Stores the boolean flag indicating if the web application is distributable.
      protected static int ERROR
      Stores the ERROR constant.
      protected java.util.Map<java.lang.Integer,java.lang.String> errorPagesByCode  
      protected java.util.Map<java.lang.String,java.lang.String> errorPagesByException  
      protected java.util.Map<java.lang.String,DefaultFilterEnvironment> filters
      Stores the filters.
      protected cloud.piranha.api.HttpRequestManager httpRequestManager
      Stores the request manager.
      protected cloud.piranha.api.HttpSessionManager httpSessionManager
      Stores the session manager.
      protected static int INITIALIZED
      Stores the INITIALIZED constant.
      protected java.util.List<javax.servlet.ServletContainerInitializer> initializers
      Stores the servlet container initializers.
      protected java.util.Map<java.lang.String,java.lang.String> initParameters
      Stores the init parameters.
      protected cloud.piranha.api.JspManager jspManager
      Stores the JSP manager.
      protected cloud.piranha.api.LoggingManager loggingManager
      Stores the logging manager.
      protected cloud.piranha.api.MimeTypeManager mimeTypeManager
      Stores the mime type manager.
      protected cloud.piranha.api.ObjectInstanceManager objectInstanceManager
      Stores the object instance manager.
      protected java.lang.String requestCharacterEncoding
      Stores the request character encoding.
      protected java.util.List<javax.servlet.ServletRequestListener> requestListeners
      Stores the servlet request listeners.
      protected java.util.Map<javax.servlet.ServletRequest,javax.servlet.ServletResponse> requests
      Stores the active requests and the associated response.
      protected cloud.piranha.resource.api.ResourceManager resourceManager
      Stores the resource manager.
      protected java.lang.String responseCharacterEncoding
      Stores the response character encoding.
      protected java.util.Map<javax.servlet.ServletResponse,javax.servlet.ServletRequest> responses
      Stores the active responses and the associated requests.
      protected cloud.piranha.api.SecurityManager securityManager
      Stores the security manager.
      protected static int SERVICING
      Stores the SERVICING constant.
      protected java.lang.String servletContextName
      Stores the servlet context name.
      protected java.util.Map<java.lang.String,DefaultServletEnvironment> servlets
      Stores the servlets.
      protected static int SETUP
      Stores the SETUP constant.
      protected int status
      Stores the status.
      protected java.lang.String virtualServerName
      Stores the virtual server name.
      protected cloud.piranha.api.WebApplicationRequestMapper webApplicationRequestMapper
      Stores the web application request mapper.
      • Fields inherited from interface javax.servlet.ServletContext

        ORDERED_LIBS, TEMPDIR
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addErrorPage​(int code, java.lang.String location)  
      void addErrorPage​(java.lang.String exception, java.lang.String location)  
      javax.servlet.FilterRegistration.Dynamic addFilter​(java.lang.String filterName, java.lang.Class<? extends javax.servlet.Filter> filterClass)
      Add the filter.
      javax.servlet.FilterRegistration.Dynamic addFilter​(java.lang.String filterName, java.lang.String className)
      Add the filter.
      javax.servlet.FilterRegistration.Dynamic addFilter​(java.lang.String filterName, javax.servlet.Filter filter)
      Add the filter.
      java.util.Set<java.lang.String> addFilterMapping​(java.lang.String filterName, boolean isMatchAfter, java.lang.String... urlPatterns)  
      java.util.Set<java.lang.String> addFilterMapping​(java.lang.String filterName, java.lang.String... urlPatterns)  
      void addInitializer​(java.lang.String className)
      Add a servlet container initializer.
      void addInitializer​(javax.servlet.ServletContainerInitializer servletContainerInitializer)  
      javax.servlet.ServletRegistration.Dynamic addJspFile​(java.lang.String servletName, java.lang.String jspFile)
      Add a JSP file.
      void addListener​(java.lang.Class<? extends java.util.EventListener> type)
      Add the listener.
      void addListener​(java.lang.String className)
      Add listener.
      <T extends java.util.EventListener>
      void
      addListener​(T listener)
      Add the listener.
      void addResource​(cloud.piranha.resource.api.Resource resource)
      Add the resource.
      javax.servlet.ServletRegistration.Dynamic addServlet​(java.lang.String servletName, java.lang.Class<? extends javax.servlet.Servlet> servletClass)
      Add the servlet.
      javax.servlet.ServletRegistration.Dynamic addServlet​(java.lang.String servletName, java.lang.String className)
      Add the servlet.
      javax.servlet.ServletRegistration.Dynamic addServlet​(java.lang.String servletName, javax.servlet.Servlet servlet)
      Add the servlet.
      java.util.Set<java.lang.String> addServletMapping​(java.lang.String servletName, java.lang.String... urlPatterns)
      Add the servlet mapping.
      <T extends javax.servlet.Filter>
      T
      createFilter​(java.lang.Class<T> filterClass)
      Create the filter.
      <T extends java.util.EventListener>
      T
      createListener​(java.lang.Class<T> clazz)
      Create the listener.
      <T extends javax.servlet.Servlet>
      T
      createServlet​(java.lang.Class<T> servletClass)
      Create the servlet.
      void declareRoles​(java.lang.String... roles)
      Declare roles.
      void destroy​()
      Destroy the web application.
      protected java.util.List<DefaultFilterEnvironment> findFilterEnvironments​(javax.servlet.http.HttpServletRequest request)
      Find the filter environments.
      cloud.piranha.api.AnnotationManager getAnnotationManager​()  
      java.lang.Object getAttribute​(java.lang.String name)
      Get the attribute.
      java.util.Enumeration<java.lang.String> getAttributeNames​()
      Get the attribute names.
      java.lang.ClassLoader getClassLoader​()
      Get the class loader.
      javax.servlet.ServletContext getContext​(java.lang.String uripath)
      Get the servlet context for the given uripath.
      java.lang.String getContextPath​()
      Get the context path.
      java.util.Set<javax.servlet.SessionTrackingMode> getDefaultSessionTrackingModes​()
      Get the default session tracking modes.
      boolean getDenyUncoveredHttpMethods​()
      Are we denying uncovered HTTP methods.
      int getEffectiveMajorVersion​()
      Get the effective major version.
      int getEffectiveMinorVersion​()
      Get the effective minor version.
      java.util.Set<javax.servlet.SessionTrackingMode> getEffectiveSessionTrackingModes​()
      Get the effective tracking modes.
      javax.servlet.FilterRegistration getFilterRegistration​(java.lang.String filterName)
      Get the filter registration.
      java.util.Map<java.lang.String,? extends javax.servlet.FilterRegistration> getFilterRegistrations​()
      Get the filter registrations.
      cloud.piranha.api.HttpRequestManager getHttpRequestManager​()  
      cloud.piranha.api.HttpSessionManager getHttpSessionManager​()
      Get the session manager.
      java.lang.String getInitParameter​(java.lang.String name)
      Get the init parameter.
      java.util.Enumeration<java.lang.String> getInitParameterNames​()
      Get the init parameter names.
      javax.servlet.descriptor.JspConfigDescriptor getJspConfigDescriptor​()
      Get the JSP config descriptor.
      int getMajorVersion​()
      Get the major version.
      java.util.Collection<java.lang.String> getMappings​(java.lang.String servletName)
      Get the servlet mappings for the given servlet.
      java.lang.String getMimeType​(java.lang.String filename)
      Get the mime type.
      cloud.piranha.api.MimeTypeManager getMimeTypeManager​()
      Get the mime type manager.
      int getMinorVersion​()
      Get the minor version.
      javax.servlet.RequestDispatcher getNamedDispatcher​(java.lang.String name)
      Get the name request dispatcher.
      protected javax.servlet.RequestDispatcher getNamedDispatcher​(java.lang.String name, java.lang.String path)
      Get the name request dispatcher.
      cloud.piranha.api.ObjectInstanceManager getObjectInstanceManager​()
      Get the DependencyInjectionManager.
      java.lang.String getRealPath​(java.lang.String path)
      Get the real path.
      javax.servlet.ServletRequest getRequest​(javax.servlet.ServletResponse response)
      Get the request associated with the response.
      java.lang.String getRequestCharacterEncoding​()
      Get the default request character encoding.
      javax.servlet.RequestDispatcher getRequestDispatcher​(java.lang.String path)
      Get the request dispatcher.
      java.net.URL getResource​(java.lang.String location)
      Get the resource.
      java.io.InputStream getResourceAsStream​(java.lang.String location)
      Get the resource as a stream.
      java.util.Set<java.lang.String> getResourcePaths​(java.lang.String path)
      Get the resource paths.
      javax.servlet.ServletResponse getResponse​(javax.servlet.ServletRequest request)
      Get the response.
      java.lang.String getResponseCharacterEncoding​()
      Get the default response character encoding.
      cloud.piranha.api.SecurityManager getSecurityManager​()
      Get the security manager.
      java.lang.String getServerInfo​()
      Get the server info.
      javax.servlet.Servlet getServlet​(java.lang.String name)
      Deprecated.  
      java.lang.String getServletContextName​()
      Get the servlet context name (aka display-name).
      java.util.Enumeration<java.lang.String> getServletNames​()
      Deprecated.  
      javax.servlet.ServletRegistration getServletRegistration​(java.lang.String servletName)
      Get the servlet registration.
      java.util.Map<java.lang.String,? extends javax.servlet.ServletRegistration> getServletRegistrations​()
      Get the servlet registrations.
      java.util.Enumeration<javax.servlet.Servlet> getServlets​()
      Deprecated.  
      javax.servlet.SessionCookieConfig getSessionCookieConfig​()
      Get the session cookie config.
      int getSessionTimeout​()
      Get the default session timeout.
      java.lang.String getVirtualServerName​()
      Get the virtual server name.
      void initialize​()
      Initialize the web application.
      void initializeFilters​()
      Initialize the filters.
      void initializeFinish​()
      Finish the initialization.
      void initializeInitializers​()
      Initialize the servlet container initializers.
      void initializeServlets​()
      Initialize the servlets.
      boolean isDistributable​()
      Is the web application distributable.
      void linkRequestAndResponse​(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
      Link the request and response.
      void log​(java.lang.Exception exception, java.lang.String message)
      Deprecated.  
      void log​(java.lang.String message)
      Log a message.
      void log​(java.lang.String message, java.lang.Throwable throwable)
      Log a message.
      void removeAttribute​(java.lang.String name)
      Remove the attribute with the given name.
      void service​(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
      Service the request using this web application.
      void setAnnotationManager​(cloud.piranha.api.AnnotationManager annotationManager)  
      void setAttribute​(java.lang.String name, java.lang.Object value)
      Set the attribute.
      void setClassLoader​(java.lang.ClassLoader classLoader)
      Set the class-loader.
      void setContextPath​(java.lang.String contextPath)
      Set the context path.
      void setDenyUncoveredHttpMethods​(boolean denyUncoveredHttpMethods)
      Set if we are denying uncovered HTTP methods.
      void setDistributable​(boolean distributable)
      Set if the web application is distributable.
      void setHttpRequestManager​(cloud.piranha.api.HttpRequestManager httpRequestManager)  
      void setHttpSessionManager​(cloud.piranha.api.HttpSessionManager httpSessionManager)
      Set the HTTP session manager.
      boolean setInitParameter​(java.lang.String name, java.lang.String value)
      Set the init parameter.
      void setJspManager​(cloud.piranha.api.JspManager jspManager)
      Set the JSP manager.
      void setLoggingManager​(cloud.piranha.api.LoggingManager loggingManager)
      Set the logging manager.
      void setMimeTypeManager​(cloud.piranha.api.MimeTypeManager mimeTypeManager)
      Set the mimeType manager.
      void setObjectInstanceManager​(cloud.piranha.api.ObjectInstanceManager objectInstanceManager)
      Set the object instance manager.
      void setRequestCharacterEncoding​(java.lang.String requestCharacterEncoding)
      Set the default request character encoding.
      void setResourceManager​(cloud.piranha.resource.api.ResourceManager resourceManager)
      Set the resource manager.
      void setResponseCharacterEncoding​(java.lang.String responseCharacterEncoding)
      Set the default response character encoding.
      void setSecurityManager​(cloud.piranha.api.SecurityManager securityManager)
      Set the security manager.
      void setServletContextName​(java.lang.String servletContextName)
      Set the servlet context name.
      void setSessionTimeout​(int sessionTimeout)
      Set the default session timeout.
      void setSessionTrackingModes​(java.util.Set<javax.servlet.SessionTrackingMode> sessionTrackingModes)
      Set the session tracking modes.
      void setVirtualServerName​(java.lang.String virtualServerName)
      Set the virtual server name.
      void setWebApplicationRequestMapper​(cloud.piranha.api.WebApplicationRequestMapper webApplicationRequestMapper)
      Set the web application request mapper.
      void start​()
      Start servicing.
      void stop​()
      Stop servicing.
      void unlinkRequestAndResponse​(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
      Unlink the request and response.
      protected void verifyState​(int desiredStatus, java.lang.String message)
      Verify the web application state.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface cloud.piranha.api.WebApplication

        getServletContextId
    • Field Detail

      • INITIALIZED

        protected static final int INITIALIZED
        Stores the INITIALIZED constant.
        See Also:
        Constant Field Values
      • SERVICING

        protected static final int SERVICING
        Stores the SERVICING constant.
        See Also:
        Constant Field Values
      • classLoader

        protected java.lang.ClassLoader classLoader
        Stores the class loader.
      • contextPath

        protected java.lang.String contextPath
        Stores the context path.
      • distributable

        protected boolean distributable
        Stores the boolean flag indicating if the web application is distributable.
      • servletContextName

        protected java.lang.String servletContextName
        Stores the servlet context name.
      • virtualServerName

        protected java.lang.String virtualServerName
        Stores the virtual server name.
      • responseCharacterEncoding

        protected java.lang.String responseCharacterEncoding
        Stores the response character encoding.
      • status

        protected int status
        Stores the status.
      • requests

        protected final java.util.Map<javax.servlet.ServletRequest,javax.servlet.ServletResponse> requests
        Stores the active requests and the associated response.
      • responses

        protected final java.util.Map<javax.servlet.ServletResponse,javax.servlet.ServletRequest> responses
        Stores the active responses and the associated requests.
      • initializers

        protected final java.util.List<javax.servlet.ServletContainerInitializer> initializers
        Stores the servlet container initializers.
      • initParameters

        protected final java.util.Map<java.lang.String,java.lang.String> initParameters
        Stores the init parameters.
      • attributes

        protected final java.util.Map<java.lang.String,java.lang.Object> attributes
        Stores the attributes.
      • errorPagesByCode

        protected final java.util.Map<java.lang.Integer,java.lang.String> errorPagesByCode
      • errorPagesByException

        protected final java.util.Map<java.lang.String,java.lang.String> errorPagesByException
      • contextAttributeListeners

        protected final java.util.List<javax.servlet.ServletContextAttributeListener> contextAttributeListeners
        Stores the servlet context attribute listeners.
      • contextListeners

        protected final java.util.ArrayList<javax.servlet.ServletContextListener> contextListeners
        Stores the servlet context listeners.
      • requestListeners

        protected final java.util.List<javax.servlet.ServletRequestListener> requestListeners
        Stores the servlet request listeners.
      • objectInstanceManager

        protected cloud.piranha.api.ObjectInstanceManager objectInstanceManager
        Stores the object instance manager.
      • annotationManager

        protected cloud.piranha.api.AnnotationManager annotationManager
        Stores the annotation manager.
      • httpSessionManager

        protected cloud.piranha.api.HttpSessionManager httpSessionManager
        Stores the session manager.
      • securityManager

        protected cloud.piranha.api.SecurityManager securityManager
        Stores the security manager.
      • jspManager

        protected cloud.piranha.api.JspManager jspManager
        Stores the JSP manager.
      • loggingManager

        protected cloud.piranha.api.LoggingManager loggingManager
        Stores the logging manager.
      • httpRequestManager

        protected cloud.piranha.api.HttpRequestManager httpRequestManager
        Stores the request manager.
      • mimeTypeManager

        protected cloud.piranha.api.MimeTypeManager mimeTypeManager
        Stores the mime type manager.
      • requestCharacterEncoding

        protected java.lang.String requestCharacterEncoding
        Stores the request character encoding.
      • webApplicationRequestMapper

        protected cloud.piranha.api.WebApplicationRequestMapper webApplicationRequestMapper
        Stores the web application request mapper.
    • Constructor Detail

      • DefaultWebApplication

        public DefaultWebApplication​()
        Constructor.
    • Method Detail

      • addFilter

        public javax.servlet.FilterRegistration.Dynamic addFilter​(java.lang.String filterName,
                                                                  java.lang.String className)
        Add the filter.
        Specified by:
        addFilter in interface javax.servlet.ServletContext
        Parameters:
        filterName - the filter name.
        className - the class name.
        Returns:
        the filter dynamic.
      • addFilter

        public javax.servlet.FilterRegistration.Dynamic addFilter​(java.lang.String filterName,
                                                                  java.lang.Class<? extends javax.servlet.Filter> filterClass)
        Add the filter.
        Specified by:
        addFilter in interface javax.servlet.ServletContext
        Parameters:
        filterName - the filter name.
        filterClass - the filter class.
        Returns:
        the filter dynamic.
        See Also:
        ServletContext.addFilter(java.lang.String, java.lang.Class)
      • addFilter

        public javax.servlet.FilterRegistration.Dynamic addFilter​(java.lang.String filterName,
                                                                  javax.servlet.Filter filter)
        Add the filter.
        Specified by:
        addFilter in interface javax.servlet.ServletContext
        Parameters:
        filterName - the filter name.
        filter - the filter.
        Returns:
        the filter dynamic registration.
      • addFilterMapping

        public java.util.Set<java.lang.String> addFilterMapping​(java.lang.String filterName,
                                                                java.lang.String... urlPatterns)
        Specified by:
        addFilterMapping in interface cloud.piranha.api.WebApplication
      • addFilterMapping

        public java.util.Set<java.lang.String> addFilterMapping​(java.lang.String filterName,
                                                                boolean isMatchAfter,
                                                                java.lang.String... urlPatterns)
        Specified by:
        addFilterMapping in interface cloud.piranha.api.WebApplication
      • addInitializer

        public void addInitializer​(java.lang.String className)
        Add a servlet container initializer.
        Specified by:
        addInitializer in interface cloud.piranha.api.WebApplication
        Parameters:
        className - the class name.
      • addInitializer

        public void addInitializer​(javax.servlet.ServletContainerInitializer servletContainerInitializer)
        Specified by:
        addInitializer in interface cloud.piranha.api.WebApplication
      • addJspFile

        public javax.servlet.ServletRegistration.Dynamic addJspFile​(java.lang.String servletName,
                                                                    java.lang.String jspFile)
        Add a JSP file.
        Specified by:
        addJspFile in interface javax.servlet.ServletContext
        Parameters:
        servletName - the name of the servlet.
        jspFile - the JSP file.
        Returns:
        the dynamic servlet registration.
      • addListener

        public void addListener​(java.lang.String className)
        Add listener.
        Specified by:
        addListener in interface javax.servlet.ServletContext
        Parameters:
        className - the class name.
      • addListener

        public void addListener​(java.lang.Class<? extends java.util.EventListener> type)
        Add the listener.
        Specified by:
        addListener in interface javax.servlet.ServletContext
        Parameters:
        type - the type.
      • addListener

        public <T extends java.util.EventListener> void addListener​(T listener)
        Add the listener.
        Specified by:
        addListener in interface javax.servlet.ServletContext
        Type Parameters:
        T - the type.
        Parameters:
        listener - the listener
      • addResource

        public void addResource​(cloud.piranha.resource.api.Resource resource)
        Add the resource.
        Specified by:
        addResource in interface cloud.piranha.api.WebApplication
        Parameters:
        resource - the resource.
      • addServlet

        public javax.servlet.ServletRegistration.Dynamic addServlet​(java.lang.String servletName,
                                                                    java.lang.Class<? extends javax.servlet.Servlet> servletClass)
        Add the servlet.
        Specified by:
        addServlet in interface javax.servlet.ServletContext
        Parameters:
        servletName - the servlet name.
        servletClass - the class type.
        Returns:
        the servlet dynamic.
      • addServlet

        public javax.servlet.ServletRegistration.Dynamic addServlet​(java.lang.String servletName,
                                                                    java.lang.String className)
        Add the servlet.
        Specified by:
        addServlet in interface javax.servlet.ServletContext
        Parameters:
        servletName - the servlet name.
        className - the class name.
        Returns:
        the servlet dynamic.
      • addServlet

        public javax.servlet.ServletRegistration.Dynamic addServlet​(java.lang.String servletName,
                                                                    javax.servlet.Servlet servlet)
        Add the servlet.
        Specified by:
        addServlet in interface javax.servlet.ServletContext
        Parameters:
        servletName - the servlet name.
        servlet - the servlet.
        Returns:
        the servlet dynamic.
      • addServletMapping

        public java.util.Set<java.lang.String> addServletMapping​(java.lang.String servletName,
                                                                 java.lang.String... urlPatterns)
        Add the servlet mapping.
        Specified by:
        addServletMapping in interface cloud.piranha.api.WebApplication
        Parameters:
        servletName - the servlet name.
        urlPatterns - the URL patterns.
        Returns:
        the set of added mappings.
      • addErrorPage

        public void addErrorPage​(int code,
                                 java.lang.String location)
        Specified by:
        addErrorPage in interface cloud.piranha.api.WebApplication
      • addErrorPage

        public void addErrorPage​(java.lang.String exception,
                                 java.lang.String location)
        Specified by:
        addErrorPage in interface cloud.piranha.api.WebApplication
      • createFilter

        public <T extends javax.servlet.Filter> T createFilter​(java.lang.Class<T> filterClass)
                                                        throws javax.servlet.ServletException
        Create the filter.
        Specified by:
        createFilter in interface javax.servlet.ServletContext
        Type Parameters:
        T - the return type.
        Parameters:
        filterClass - the filter class.
        Returns:
        the filter.
        Throws:
        javax.servlet.ServletException - when a Filter error occurs.
      • createListener

        public <T extends java.util.EventListener> T createListener​(java.lang.Class<T> clazz)
                                                             throws javax.servlet.ServletException
        Create the listener.
        Specified by:
        createListener in interface javax.servlet.ServletContext
        Type Parameters:
        T - the type.
        Parameters:
        clazz - the class of the listener to create.
        Returns:
        the listener.
        Throws:
        javax.servlet.ServletException - when it fails to create the listener.
      • createServlet

        public <T extends javax.servlet.Servlet> T createServlet​(java.lang.Class<T> servletClass)
                                                          throws javax.servlet.ServletException
        Create the servlet.
        Specified by:
        createServlet in interface javax.servlet.ServletContext
        Type Parameters:
        T - the return type.
        Parameters:
        servletClass - the servlet class.
        Returns:
        the servlet.
        Throws:
        javax.servlet.ServletException - when a Servlet error occurs.
      • declareRoles

        public void declareRoles​(java.lang.String... roles)
        Declare roles.
        Specified by:
        declareRoles in interface javax.servlet.ServletContext
        Parameters:
        roles - the roles.
      • destroy

        public void destroy​()
        Destroy the web application.
        Specified by:
        destroy in interface cloud.piranha.api.WebApplication
      • findFilterEnvironments

        protected java.util.List<DefaultFilterEnvironment> findFilterEnvironments​(javax.servlet.http.HttpServletRequest request)
        Find the filter environments.
        Parameters:
        request - the HTTP servlet request.
        Returns:
        the filter environments.
      • getAttribute

        public java.lang.Object getAttribute​(java.lang.String name)
        Get the attribute.
        Specified by:
        getAttribute in interface javax.servlet.ServletContext
        Parameters:
        name - the attribute name.
        Returns:
        the attribute value.
      • getAttributeNames

        public java.util.Enumeration<java.lang.String> getAttributeNames​()
        Get the attribute names.
        Specified by:
        getAttributeNames in interface javax.servlet.ServletContext
        Returns:
        the attribute names.
      • getDenyUncoveredHttpMethods

        public boolean getDenyUncoveredHttpMethods​()
        Are we denying uncovered HTTP methods.
        Specified by:
        getDenyUncoveredHttpMethods in interface cloud.piranha.api.WebApplication
        Returns:
        true if we are, false otherwise.
      • getClassLoader

        public java.lang.ClassLoader getClassLoader​()
        Get the class loader.
        Specified by:
        getClassLoader in interface javax.servlet.ServletContext
        Returns:
        the class loader.
      • getContext

        public javax.servlet.ServletContext getContext​(java.lang.String uripath)
        Get the servlet context for the given uripath.
        Specified by:
        getContext in interface javax.servlet.ServletContext
        Parameters:
        uripath - the uripath.
        Returns:
        the servlet context.
      • getContextPath

        public java.lang.String getContextPath​()
        Get the context path.
        Specified by:
        getContextPath in interface javax.servlet.ServletContext
        Returns:
        the context path.
      • getDefaultSessionTrackingModes

        public java.util.Set<javax.servlet.SessionTrackingMode> getDefaultSessionTrackingModes​()
        Get the default session tracking modes.
        Specified by:
        getDefaultSessionTrackingModes in interface javax.servlet.ServletContext
        Returns:
        the default session tracking modes.
      • getObjectInstanceManager

        public cloud.piranha.api.ObjectInstanceManager getObjectInstanceManager​()
        Get the DependencyInjectionManager.
        Specified by:
        getObjectInstanceManager in interface cloud.piranha.api.WebApplication
        Returns:
        the DependencyInjectionManager.
      • getEffectiveMajorVersion

        public int getEffectiveMajorVersion​()
        Get the effective major version.
        Specified by:
        getEffectiveMajorVersion in interface javax.servlet.ServletContext
        Returns:
        the effective major version.
      • getEffectiveMinorVersion

        public int getEffectiveMinorVersion​()
        Get the effective minor version.
        Specified by:
        getEffectiveMinorVersion in interface javax.servlet.ServletContext
        Returns:
        the effective minor version.
      • getEffectiveSessionTrackingModes

        public java.util.Set<javax.servlet.SessionTrackingMode> getEffectiveSessionTrackingModes​()
        Get the effective tracking modes.
        Specified by:
        getEffectiveSessionTrackingModes in interface javax.servlet.ServletContext
        Returns:
        the effective tracking modes.
      • getFilterRegistration

        public javax.servlet.FilterRegistration getFilterRegistration​(java.lang.String filterName)
        Get the filter registration.
        Specified by:
        getFilterRegistration in interface javax.servlet.ServletContext
        Parameters:
        filterName - the filter name.
        Returns:
        the filter registration, or null if not found.
      • getFilterRegistrations

        public java.util.Map<java.lang.String,? extends javax.servlet.FilterRegistration> getFilterRegistrations​()
        Get the filter registrations.
        Specified by:
        getFilterRegistrations in interface javax.servlet.ServletContext
        Returns:
        the filter registrations.
      • getInitParameter

        public java.lang.String getInitParameter​(java.lang.String name)
        Get the init parameter.
        Specified by:
        getInitParameter in interface javax.servlet.ServletContext
        Parameters:
        name - the init parameter name.
        Returns:
        the init parameter value.
      • getInitParameterNames

        public java.util.Enumeration<java.lang.String> getInitParameterNames​()
        Get the init parameter names.
        Specified by:
        getInitParameterNames in interface javax.servlet.ServletContext
        Returns:
        the enumeration.
      • getJspConfigDescriptor

        public javax.servlet.descriptor.JspConfigDescriptor getJspConfigDescriptor​()
        Get the JSP config descriptor.
        Specified by:
        getJspConfigDescriptor in interface javax.servlet.ServletContext
        Returns:
        the JSP config descriptor.
      • getMajorVersion

        public int getMajorVersion​()
        Get the major version.
        Specified by:
        getMajorVersion in interface javax.servlet.ServletContext
        Returns:
        the major version.
      • getMappings

        public java.util.Collection<java.lang.String> getMappings​(java.lang.String servletName)
        Get the servlet mappings for the given servlet.
        Specified by:
        getMappings in interface cloud.piranha.api.WebApplication
        Parameters:
        servletName - the name of the servlet.
        Returns:
        the servlet mappings.
      • getMimeType

        public java.lang.String getMimeType​(java.lang.String filename)
        Get the mime type.
        Specified by:
        getMimeType in interface javax.servlet.ServletContext
        Parameters:
        filename - the filename.
        Returns:
        the mime type.
      • getMimeTypeManager

        public cloud.piranha.api.MimeTypeManager getMimeTypeManager​()
        Get the mime type manager.
        Specified by:
        getMimeTypeManager in interface cloud.piranha.api.WebApplication
        Returns:
        the mime type manager.
      • getMinorVersion

        public int getMinorVersion​()
        Get the minor version.
        Specified by:
        getMinorVersion in interface javax.servlet.ServletContext
        Returns:
        the minor version.
      • getNamedDispatcher

        public javax.servlet.RequestDispatcher getNamedDispatcher​(java.lang.String name)
        Get the name request dispatcher.
        Specified by:
        getNamedDispatcher in interface javax.servlet.ServletContext
        Parameters:
        name - the name.
        Returns:
        the request dispatcher.
      • getNamedDispatcher

        protected javax.servlet.RequestDispatcher getNamedDispatcher​(java.lang.String name,
                                                                     java.lang.String path)
        Get the name request dispatcher.
        Parameters:
        name - the name.
        path - the path.
        Returns:
        the request dispatcher.
      • getRealPath

        public java.lang.String getRealPath​(java.lang.String path)
        Get the real path.
        Specified by:
        getRealPath in interface javax.servlet.ServletContext
        Parameters:
        path - the path
        Returns:
        the real path.
      • getRequest

        public javax.servlet.ServletRequest getRequest​(javax.servlet.ServletResponse response)
        Get the request associated with the response.
        Specified by:
        getRequest in interface cloud.piranha.api.WebApplication
        Parameters:
        response - the response.
        Returns:
        the request.
      • getRequestCharacterEncoding

        public java.lang.String getRequestCharacterEncoding​()
        Get the default request character encoding.
        Specified by:
        getRequestCharacterEncoding in interface javax.servlet.ServletContext
        Returns:
        the default request character encoding.
      • getRequestDispatcher

        public javax.servlet.RequestDispatcher getRequestDispatcher​(java.lang.String path)
        Get the request dispatcher.
        Specified by:
        getRequestDispatcher in interface javax.servlet.ServletContext
        Parameters:
        path - the path.
        Returns:
        the request dispatcher.
      • getResponseCharacterEncoding

        public java.lang.String getResponseCharacterEncoding​()
        Get the default response character encoding.
        Specified by:
        getResponseCharacterEncoding in interface javax.servlet.ServletContext
        Returns:
        the default response character encoding.
      • getResource

        public java.net.URL getResource​(java.lang.String location)
                                 throws java.net.MalformedURLException
        Get the resource.
        Specified by:
        getResource in interface javax.servlet.ServletContext
        Parameters:
        location - the location.
        Returns:
        the URL.
        Throws:
        java.net.MalformedURLException - when the URL is malformed.
      • getResourceAsStream

        public java.io.InputStream getResourceAsStream​(java.lang.String location)
        Get the resource as a stream.
        Specified by:
        getResourceAsStream in interface javax.servlet.ServletContext
        Parameters:
        location - the resource location
        Returns:
        the input stream, or null if not found.
      • getResourcePaths

        public java.util.Set<java.lang.String> getResourcePaths​(java.lang.String path)
        Get the resource paths.
        Specified by:
        getResourcePaths in interface javax.servlet.ServletContext
        Parameters:
        path - the path.
        Returns:
        the resource paths.
      • getResponse

        public javax.servlet.ServletResponse getResponse​(javax.servlet.ServletRequest request)
        Get the response.
        Specified by:
        getResponse in interface cloud.piranha.api.WebApplication
        Parameters:
        request - the request.
        Returns:
        the response.
      • getSecurityManager

        public cloud.piranha.api.SecurityManager getSecurityManager​()
        Get the security manager.
        Specified by:
        getSecurityManager in interface cloud.piranha.api.WebApplication
        Returns:
        the security manager.
      • getAnnotationManager

        public cloud.piranha.api.AnnotationManager getAnnotationManager​()
        Specified by:
        getAnnotationManager in interface cloud.piranha.api.WebApplication
      • setAnnotationManager

        public void setAnnotationManager​(cloud.piranha.api.AnnotationManager annotationManager)
        Specified by:
        setAnnotationManager in interface cloud.piranha.api.WebApplication
      • getServerInfo

        public java.lang.String getServerInfo​()
        Get the server info.
        Specified by:
        getServerInfo in interface javax.servlet.ServletContext
        Returns:
        the server info.
      • getServlet

        public javax.servlet.Servlet getServlet​(java.lang.String name)
                                         throws javax.servlet.ServletException
        Deprecated. 
        Get the servlet.
        Specified by:
        getServlet in interface javax.servlet.ServletContext
        Parameters:
        name - the name of the servlet.
        Returns:
        null
        Throws:
        javax.servlet.ServletException - when a Servlet error occurs.
      • getServletContextName

        public java.lang.String getServletContextName​()
        Get the servlet context name (aka display-name).
        Specified by:
        getServletContextName in interface javax.servlet.ServletContext
        Returns:
        the servlet context name.
      • getServletNames

        public java.util.Enumeration<java.lang.String> getServletNames​()
        Deprecated. 
        Get the servlet names.
        Specified by:
        getServletNames in interface javax.servlet.ServletContext
        Returns:
        the servlet names.
      • getServletRegistration

        public javax.servlet.ServletRegistration getServletRegistration​(java.lang.String servletName)
        Get the servlet registration.
        Specified by:
        getServletRegistration in interface javax.servlet.ServletContext
        Parameters:
        servletName - the servlet name.
        Returns:
        the servlet registration, or null if not found.
      • getServletRegistrations

        public java.util.Map<java.lang.String,? extends javax.servlet.ServletRegistration> getServletRegistrations​()
        Get the servlet registrations.
        Specified by:
        getServletRegistrations in interface javax.servlet.ServletContext
        Returns:
        the servlet registrations.
      • getServlets

        public java.util.Enumeration<javax.servlet.Servlet> getServlets​()
        Deprecated. 
        Get the servlets.
        Specified by:
        getServlets in interface javax.servlet.ServletContext
        Returns:
        the servlets (empty enumeration).
      • getSessionCookieConfig

        public javax.servlet.SessionCookieConfig getSessionCookieConfig​()
        Get the session cookie config.
        Specified by:
        getSessionCookieConfig in interface javax.servlet.ServletContext
        Returns:
        the session cookie config.
      • getSessionTimeout

        public int getSessionTimeout​()
        Get the default session timeout.
        Specified by:
        getSessionTimeout in interface javax.servlet.ServletContext
        Returns:
        the default session timeout.
      • getHttpSessionManager

        public cloud.piranha.api.HttpSessionManager getHttpSessionManager​()
        Get the session manager.
        Specified by:
        getHttpSessionManager in interface cloud.piranha.api.WebApplication
        Returns:
        the session manager.
      • getVirtualServerName

        public java.lang.String getVirtualServerName​()
        Get the virtual server name.
        Specified by:
        getVirtualServerName in interface javax.servlet.ServletContext
        Returns:
        the virtual server name.
      • initialize

        public void initialize​()
        Initialize the web application.
        Specified by:
        initialize in interface cloud.piranha.api.WebApplication
      • initializeFinish

        public void initializeFinish​()
        Finish the initialization.
        Specified by:
        initializeFinish in interface cloud.piranha.api.WebApplication
      • initializeFilters

        public void initializeFilters​()
        Initialize the filters.
        Specified by:
        initializeFilters in interface cloud.piranha.api.WebApplication
      • initializeInitializers

        public void initializeInitializers​()
        Initialize the servlet container initializers.
        Specified by:
        initializeInitializers in interface cloud.piranha.api.WebApplication
      • initializeServlets

        public void initializeServlets​()
        Initialize the servlets.
        Specified by:
        initializeServlets in interface cloud.piranha.api.WebApplication
      • isDistributable

        public boolean isDistributable​()
        Is the web application distributable.
        Specified by:
        isDistributable in interface cloud.piranha.api.WebApplication
        Returns:
        true if it is, false otherwise.
      • linkRequestAndResponse

        public void linkRequestAndResponse​(javax.servlet.ServletRequest request,
                                           javax.servlet.ServletResponse response)
        Link the request and response.
        Specified by:
        linkRequestAndResponse in interface cloud.piranha.api.WebApplication
        Parameters:
        request - the request.
        response - the response.
      • log

        public void log​(java.lang.Exception exception,
                        java.lang.String message)
        Deprecated. 
        Log a message.
        Specified by:
        log in interface javax.servlet.ServletContext
        Parameters:
        exception - the exception.
        message - the message.
      • log

        public void log​(java.lang.String message,
                        java.lang.Throwable throwable)
        Log a message.
        Specified by:
        log in interface javax.servlet.ServletContext
        Parameters:
        message - the message.
        throwable - the throwable.
      • log

        public void log​(java.lang.String message)
        Log a message.
        Specified by:
        log in interface javax.servlet.ServletContext
        Parameters:
        message - the message.
      • removeAttribute

        public void removeAttribute​(java.lang.String name)
        Remove the attribute with the given name.
        Specified by:
        removeAttribute in interface javax.servlet.ServletContext
        Parameters:
        name - the name.
      • service

        public void service​(javax.servlet.ServletRequest request,
                            javax.servlet.ServletResponse response)
                     throws javax.servlet.ServletException,
                            java.io.IOException
        Service the request using this web application.
        Specified by:
        service in interface cloud.piranha.api.WebApplication
        Parameters:
        request - the servlet request.
        response - the servlet response.
        Throws:
        java.io.IOException - when an I/O error occurs.
        javax.servlet.ServletException - when a servlet error occurs.
      • setAttribute

        public void setAttribute​(java.lang.String name,
                                 java.lang.Object value)
        Set the attribute.
        Specified by:
        setAttribute in interface javax.servlet.ServletContext
        Parameters:
        name - the attribute name.
        value - the attribute value.
      • setClassLoader

        public void setClassLoader​(java.lang.ClassLoader classLoader)
        Set the class-loader.
        Specified by:
        setClassLoader in interface cloud.piranha.api.WebApplication
        Parameters:
        classLoader - the class loader.
      • setContextPath

        public void setContextPath​(java.lang.String contextPath)
        Set the context path.
        Specified by:
        setContextPath in interface cloud.piranha.api.WebApplication
        Parameters:
        contextPath - the context path.
      • setDenyUncoveredHttpMethods

        public void setDenyUncoveredHttpMethods​(boolean denyUncoveredHttpMethods)
        Set if we are denying uncovered HTTP methods.
        Specified by:
        setDenyUncoveredHttpMethods in interface cloud.piranha.api.WebApplication
        Parameters:
        denyUncoveredHttpMethods - the boolean value.
      • setDistributable

        public void setDistributable​(boolean distributable)
        Set if the web application is distributable.
        Specified by:
        setDistributable in interface cloud.piranha.api.WebApplication
        Parameters:
        distributable - the boolean value.
      • setHttpSessionManager

        public void setHttpSessionManager​(cloud.piranha.api.HttpSessionManager httpSessionManager)
        Set the HTTP session manager.
        Specified by:
        setHttpSessionManager in interface cloud.piranha.api.WebApplication
        Parameters:
        httpSessionManager - the HTTP session manager.
      • getHttpRequestManager

        public cloud.piranha.api.HttpRequestManager getHttpRequestManager​()
        Specified by:
        getHttpRequestManager in interface cloud.piranha.api.WebApplication
      • setHttpRequestManager

        public void setHttpRequestManager​(cloud.piranha.api.HttpRequestManager httpRequestManager)
        Specified by:
        setHttpRequestManager in interface cloud.piranha.api.WebApplication
      • setInitParameter

        public boolean setInitParameter​(java.lang.String name,
                                        java.lang.String value)
        Set the init parameter.
        Specified by:
        setInitParameter in interface javax.servlet.ServletContext
        Parameters:
        name - the name.
        value - the value.
        Returns:
        true if it could be set, false otherwise.
      • setJspManager

        public void setJspManager​(cloud.piranha.api.JspManager jspManager)
        Set the JSP manager.
        Specified by:
        setJspManager in interface cloud.piranha.api.WebApplication
        Parameters:
        jspManager - the JSP manager.
      • setLoggingManager

        public void setLoggingManager​(cloud.piranha.api.LoggingManager loggingManager)
        Set the logging manager.
        Specified by:
        setLoggingManager in interface cloud.piranha.api.WebApplication
        Parameters:
        loggingManager - the logging manager.
      • setMimeTypeManager

        public void setMimeTypeManager​(cloud.piranha.api.MimeTypeManager mimeTypeManager)
        Set the mimeType manager.
        Specified by:
        setMimeTypeManager in interface cloud.piranha.api.WebApplication
        Parameters:
        mimeTypeManager - the mimeType manager.
      • setObjectInstanceManager

        public void setObjectInstanceManager​(cloud.piranha.api.ObjectInstanceManager objectInstanceManager)
        Set the object instance manager.
        Specified by:
        setObjectInstanceManager in interface cloud.piranha.api.WebApplication
        Parameters:
        objectInstanceManager - the object instance manager.
      • setRequestCharacterEncoding

        public void setRequestCharacterEncoding​(java.lang.String requestCharacterEncoding)
        Set the default request character encoding.
        Specified by:
        setRequestCharacterEncoding in interface javax.servlet.ServletContext
        Parameters:
        requestCharacterEncoding - the default request character encoding.
      • setResourceManager

        public void setResourceManager​(cloud.piranha.resource.api.ResourceManager resourceManager)
        Set the resource manager.
        Specified by:
        setResourceManager in interface cloud.piranha.api.WebApplication
        Parameters:
        resourceManager - the resource manager.
      • setResponseCharacterEncoding

        public void setResponseCharacterEncoding​(java.lang.String responseCharacterEncoding)
        Set the default response character encoding.
        Specified by:
        setResponseCharacterEncoding in interface javax.servlet.ServletContext
        Parameters:
        responseCharacterEncoding - the default response character encoding.
      • setSecurityManager

        public void setSecurityManager​(cloud.piranha.api.SecurityManager securityManager)
        Set the security manager.
        Specified by:
        setSecurityManager in interface cloud.piranha.api.WebApplication
        Parameters:
        securityManager - the security manager.
      • setServletContextName

        public void setServletContextName​(java.lang.String servletContextName)
        Set the servlet context name.
        Specified by:
        setServletContextName in interface cloud.piranha.api.WebApplication
        Parameters:
        servletContextName - the servlet context name.
      • setSessionTrackingModes

        public void setSessionTrackingModes​(java.util.Set<javax.servlet.SessionTrackingMode> sessionTrackingModes)
        Set the session tracking modes.
        Specified by:
        setSessionTrackingModes in interface javax.servlet.ServletContext
        Parameters:
        sessionTrackingModes - the session tracking modes.
      • setSessionTimeout

        public void setSessionTimeout​(int sessionTimeout)
        Set the default session timeout.
        Specified by:
        setSessionTimeout in interface javax.servlet.ServletContext
        Parameters:
        sessionTimeout - the default session timeout.
      • setVirtualServerName

        public void setVirtualServerName​(java.lang.String virtualServerName)
        Set the virtual server name.
        Parameters:
        virtualServerName - the virtual server name.
      • setWebApplicationRequestMapper

        public void setWebApplicationRequestMapper​(cloud.piranha.api.WebApplicationRequestMapper webApplicationRequestMapper)
        Set the web application request mapper.
        Specified by:
        setWebApplicationRequestMapper in interface cloud.piranha.api.WebApplication
        Parameters:
        webApplicationRequestMapper - the web application request mapper.
      • start

        public void start​()
        Start servicing.
        Specified by:
        start in interface cloud.piranha.api.WebApplication
      • stop

        public void stop​()
        Stop servicing.
        Specified by:
        stop in interface cloud.piranha.api.WebApplication
      • unlinkRequestAndResponse

        public void unlinkRequestAndResponse​(javax.servlet.ServletRequest request,
                                             javax.servlet.ServletResponse response)
        Unlink the request and response.
        Specified by:
        unlinkRequestAndResponse in interface cloud.piranha.api.WebApplication
        Parameters:
        request - the request.
        response - the response.
      • verifyState

        protected void verifyState​(int desiredStatus,
                                   java.lang.String message)
        Verify the web application state.
        Parameters:
        desiredStatus - the desired status.
        message - the message.

Copyright © 2020 Piranha Cloud. All rights reserved.