Class ProxyServlet

  • All Implemented Interfaces:
    Serializable, javax.servlet.Filter, javax.servlet.Servlet, javax.servlet.ServletConfig

    public class ProxyServlet
    extends javax.servlet.http.HttpServlet
    implements javax.servlet.Filter
    The ProxyServlet is the private side of a Servlet that when registered (and init() called) in a servlet container will in-turn register and provide an OSGi Http Service implementation. This class is not meant for extending or even using directly and is purely meant for registering in a servlet container.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ProxyServlet()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void destroy()  
      void doFilter​(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)  
      String getHttpContext()  
      void init​(javax.servlet.FilterConfig filterConfig)  
      void init​(javax.servlet.ServletConfig config)  
      protected void process​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, javax.servlet.FilterChain filterChain)  
      void registerFilter​(String alias, javax.servlet.Filter filter, Dictionary<String,​String> initparams, org.osgi.service.http.HttpContext httpContext)  
      protected void service​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)  
      void unregisterFilter​(javax.servlet.Filter filter, boolean destroy)  
      • Methods inherited from class javax.servlet.http.HttpServlet

        doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
      • Methods inherited from class javax.servlet.GenericServlet

        getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
    • Constructor Detail

      • ProxyServlet

        public ProxyServlet()
    • Method Detail

      • init

        public void init​(javax.servlet.ServletConfig config)
                  throws javax.servlet.ServletException
        Specified by:
        init in interface javax.servlet.Servlet
        Overrides:
        init in class javax.servlet.GenericServlet
        Throws:
        javax.servlet.ServletException
      • destroy

        public void destroy()
        Specified by:
        destroy in interface javax.servlet.Filter
        Specified by:
        destroy in interface javax.servlet.Servlet
        Overrides:
        destroy in class javax.servlet.GenericServlet
      • service

        protected void service​(javax.servlet.http.HttpServletRequest req,
                               javax.servlet.http.HttpServletResponse resp)
                        throws javax.servlet.ServletException,
                               IOException
        Overrides:
        service in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        IOException
        See Also:
        HttpServlet.service(ServletRequest, ServletResponse)
      • process

        protected void process​(javax.servlet.http.HttpServletRequest req,
                               javax.servlet.http.HttpServletResponse resp,
                               javax.servlet.FilterChain filterChain)
                        throws javax.servlet.ServletException,
                               IOException
        Throws:
        javax.servlet.ServletException
        IOException
      • unregisterFilter

        public void unregisterFilter​(javax.servlet.Filter filter,
                                     boolean destroy)
      • registerFilter

        public void registerFilter​(String alias,
                                   javax.servlet.Filter filter,
                                   Dictionary<String,​String> initparams,
                                   org.osgi.service.http.HttpContext httpContext)
                            throws javax.servlet.ServletException
        Throws:
        javax.servlet.ServletException
      • init

        public void init​(javax.servlet.FilterConfig filterConfig)
                  throws javax.servlet.ServletException
        Specified by:
        init in interface javax.servlet.Filter
        Throws:
        javax.servlet.ServletException
      • doFilter

        public void doFilter​(javax.servlet.ServletRequest request,
                             javax.servlet.ServletResponse response,
                             javax.servlet.FilterChain chain)
                      throws IOException,
                             javax.servlet.ServletException
        Specified by:
        doFilter in interface javax.servlet.Filter
        Throws:
        IOException
        javax.servlet.ServletException
      • getHttpContext

        public String getHttpContext()