Class CamelServlet

    • Constructor Detail

      • CamelServlet

        public CamelServlet()
    • 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
      • 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
      • doServiceAsync

        protected void doServiceAsync​(javax.servlet.AsyncContext context)
        This is used to handle request asynchronously
        Parameters:
        context - the AsyncContext
      • doService

        protected void doService​(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response)
                          throws javax.servlet.ServletException,
                                 IOException
        This is the logical implementation to handle request with CamelServlet This is where most exceptions should be handled
        Parameters:
        request - the HttpServletRequest
        response - the HttpServletResponse
        Throws:
        javax.servlet.ServletException
        IOException
      • afterProcess

        protected void afterProcess​(javax.servlet.http.HttpServletResponse res,
                                    HttpConsumer consumer,
                                    org.apache.camel.Exchange exchange,
                                    boolean rethrow)
                             throws IOException,
                                    javax.servlet.ServletException
        Throws:
        IOException
        javax.servlet.ServletException
      • getServletName

        public String getServletName()
        Specified by:
        getServletName in interface HttpRegistryProvider
        Specified by:
        getServletName in interface javax.servlet.ServletConfig
        Overrides:
        getServletName in class javax.servlet.GenericServlet
      • setServletName

        public void setServletName​(String servletName)
      • setServletResolveConsumerStrategy

        public void setServletResolveConsumerStrategy​(ServletResolveConsumerStrategy servletResolveConsumerStrategy)
      • isAsync

        public boolean isAsync()
      • setAsync

        public void setAsync​(boolean async)
      • overrideTccl

        protected ClassLoader overrideTccl​(org.apache.camel.Exchange exchange)
        Override the Thread Context ClassLoader if need be.
        Returns:
        old classloader if overridden; otherwise returns null
      • restoreTccl

        protected void restoreTccl​(org.apache.camel.Exchange exchange,
                                   ClassLoader oldTccl)
        Restore the Thread Context ClassLoader if the old TCCL is not null.