Package org.apache.thrift.server
Class TExtensibleServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.apache.thrift.server.TExtensibleServlet
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public abstract class TExtensibleServlet
extends javax.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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCustomHeader
(String key, String value) protected void
doGet
(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) protected void
doPost
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) protected abstract TProtocolFactory
Returns the appropriate inTProtocolFactory
.protected abstract TProtocolFactory
Returns the appropriate outTProtocolFactory
.protected abstract TProcessor
Returns the appropriateTProcessor
.final void
init
(javax.servlet.ServletConfig config) void
setCustomHeaders
(Collection<Map.Entry<String, String>> headers) Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
Methods inherited from class javax.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(javax.servlet.ServletConfig config) throws javax.servlet.ServletException - Specified by:
init
in interfacejavax.servlet.Servlet
- Overrides:
init
in classjavax.servlet.GenericServlet
- Throws:
javax.servlet.ServletException
-
doPost
protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException - Overrides:
doPost
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
- See Also:
-
HttpServlet.doPost(HttpServletRequest request, HttpServletResponse response)
-
doGet
protected void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException - Overrides:
doGet
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
- See Also:
-
HttpServlet.doGet(HttpServletRequest request, HttpServletResponse response)
-
addCustomHeader
-
setCustomHeaders
-