Class RestletServiceServlet

  • All Implemented Interfaces:
    jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

    public class RestletServiceServlet
    extends ServerServlet
    This class is used to create an instance of the Restlet ServerServlet programmatically outside of the Servlet Container.
    This enables the creation of an instance as a delegate that can be passed requests from another Java HttpServlet that is created by the Servlet Container.
    Since:
    12.0.0
    See Also:
    Serialized Form
    • Constructor Detail

      • RestletServiceServlet

        public RestletServiceServlet​(jakarta.servlet.http.HttpServlet servlet,
                                     Class<? extends ServiceEndpointApplication> application,
                                     String name)
        Constructs an instance of the RestletServiceServlet.
        Parameters:
        servlet - The underlying container created Java HttpServlet.
    • Method Detail

      • getInitParameter

        public String getInitParameter​(String name,
                                       String defaultValue)
        Overridden to return the ServiceEndpointApplication class name for the "org.restlet.application" init parameter.
        All other parameter requests get passed onto the underlying Java HttpServlet.
        Overrides:
        getInitParameter in class ServerServlet
        Parameters:
        name - The parameter name.
        defaultValue - The default to use in case the parameter is not found.
        Returns:
        The value of the parameter or null.
      • getServletName

        public String getServletName()
        Specified by:
        getServletName in interface jakarta.servlet.ServletConfig
        Overrides:
        getServletName in class jakarta.servlet.GenericServlet
      • getInitParameter

        public String getInitParameter​(String name)
        Specified by:
        getInitParameter in interface jakarta.servlet.ServletConfig
        Overrides:
        getInitParameter in class jakarta.servlet.GenericServlet
      • getInitParameterNames

        public Enumeration getInitParameterNames()
        Overridden to include the "org.restlet.application" init parameter name.
        Specified by:
        getInitParameterNames in interface jakarta.servlet.ServletConfig
        Overrides:
        getInitParameterNames in class jakarta.servlet.GenericServlet
        Returns:
        an enumeration of the init parameter names, including the "org.restlet.application" parameter
      • getServletConfig

        public jakarta.servlet.ServletConfig getServletConfig()
        Specified by:
        getServletConfig in interface jakarta.servlet.Servlet
        Overrides:
        getServletConfig in class jakarta.servlet.GenericServlet
      • getServletContext

        public jakarta.servlet.ServletContext getServletContext()
        Specified by:
        getServletContext in interface jakarta.servlet.ServletConfig
        Overrides:
        getServletContext in class jakarta.servlet.GenericServlet
      • getServletInfo

        public String getServletInfo()
        Specified by:
        getServletInfo in interface jakarta.servlet.Servlet
        Overrides:
        getServletInfo in class jakarta.servlet.GenericServlet
      • log

        public void log​(String msg)
        Overrides:
        log in class jakarta.servlet.GenericServlet
      • log

        public void log​(String message,
                        Throwable t)
        Overrides:
        log in class jakarta.servlet.GenericServlet