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:
java.io.Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public abstract class TExtensibleServlet extends javax.servlet.http.HttpServletServlet implementation class ThriftServer, that allowsTProcessorandTProtocolFactoryto be supplied after theGenericServlet.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 thatServletContextis available.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TExtensibleServlet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddCustomHeader(java.lang.String key, java.lang.String value)protected voiddoGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)protected voiddoPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)protected abstract TProtocolFactorygetInProtocolFactory()Returns the appropriate inTProtocolFactory.protected abstract TProtocolFactorygetOutProtocolFactory()Returns the appropriate outTProtocolFactory.protected abstract TProcessorgetProcessor()Returns the appropriateTProcessor.voidinit(javax.servlet.ServletConfig config)voidsetCustomHeaders(java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>> headers)-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
-
-
-
-
Method Detail
-
getProcessor
protected abstract TProcessor getProcessor()
Returns the appropriateTProcessor. This will be called once just after theGenericServlet.init()method- Returns:
- the appropriate
TProcessor
-
getInProtocolFactory
protected abstract TProtocolFactory getInProtocolFactory()
Returns the appropriate inTProtocolFactory. This will be called once just after theGenericServlet.init()method- Returns:
- the appropriate in
TProtocolFactory
-
getOutProtocolFactory
protected abstract 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:
initin interfacejavax.servlet.Servlet- Overrides:
initin 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, java.io.IOException- Overrides:
doPostin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionjava.io.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, java.io.IOException- Overrides:
doGetin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionjava.io.IOException- See Also:
HttpServlet.doGet(HttpServletRequest request, HttpServletResponse response)
-
addCustomHeader
public void addCustomHeader(java.lang.String key, java.lang.String value)
-
setCustomHeaders
public void setCustomHeaders(java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>> headers)
-
-