Package org.apache.thrift.server
Class TExtensibleServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.apache.thrift.server.TExtensibleServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet,jakarta.servlet.ServletConfig,Serializable
public abstract class TExtensibleServlet
extends jakarta.servlet.http.HttpServlet
Servlet implementation class ThriftServer, that allows
Subclasses must implement the abstract methods that return the TProcessor and two TProtocolFactory. Those methods are guaranteed to be called exactly once, and that
TProcessor and TProtocolFactory to be supplied after the GenericServlet.init() method has finished. Subclasses must implement the abstract methods that return the TProcessor and two TProtocolFactory. Those methods are guaranteed to be called exactly once, and that
ServletContext is available.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCustomHeader(String key, String value) protected voiddoGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) protected voiddoPost(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) protected abstract TProtocolFactoryReturns the appropriate inTProtocolFactory.protected abstract TProtocolFactoryReturns the appropriate outTProtocolFactory.protected abstract TProcessorReturns the appropriateTProcessor.final voidinit(jakarta.servlet.ServletConfig config) voidsetCustomHeaders(Collection<Map.Entry<String, String>> headers) Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, serviceMethods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
TExtensibleServlet
public TExtensibleServlet()
-
-
Method Details
-
getProcessor
Returns the appropriateTProcessor. This will be called once just after theGenericServlet.init()method- Returns:
- the appropriate
TProcessor
-
getInProtocolFactory
Returns the appropriate inTProtocolFactory. This will be called once just after theGenericServlet.init()method- Returns:
- the appropriate in
TProtocolFactory
-
getOutProtocolFactory
Returns the appropriate outTProtocolFactory. This will be called once just after theGenericServlet.init()method- Returns:
- the appropriate out
TProtocolFactory
-
init
public final void init(jakarta.servlet.ServletConfig config) throws jakarta.servlet.ServletException - Specified by:
initin interfacejakarta.servlet.Servlet- Overrides:
initin classjakarta.servlet.GenericServlet- Throws:
jakarta.servlet.ServletException
-
doPost
protected void doPost(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException - Overrides:
doPostin classjakarta.servlet.http.HttpServlet- Throws:
jakarta.servlet.ServletExceptionIOException- See Also:
-
HttpServlet.doPost(HttpServletRequest request, HttpServletResponse response)
-
doGet
protected void doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws jakarta.servlet.ServletException, IOException - Overrides:
doGetin classjakarta.servlet.http.HttpServlet- Throws:
jakarta.servlet.ServletExceptionIOException- See Also:
-
HttpServlet.doGet(HttpServletRequest request, HttpServletResponse response)
-
addCustomHeader
-
setCustomHeaders
-