Package org.apache.xmlrpc.webserver
Class XmlRpcServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.apache.xmlrpc.webserver.XmlRpcServlet
-
- All Implemented Interfaces:
java.io.Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public class XmlRpcServlet extends javax.servlet.http.HttpServlet
A default servlet implementation The typical use would be to derive a subclass, which is overwriting at least the method
newXmlRpcHandlerMapping()
.The servlet accepts the following init parameters:
Name Description enabledForExtensions Sets the value XmlRpcConfig.isEnabledForExtensions()
to true.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private AbstractReflectiveHandlerMapping.AuthenticationHandler
authenticationHandler
private static org.apache.commons.logging.Log
log
private RequestProcessorFactoryFactory
requestProcessorFactoryFactory
private static long
serialVersionUID
private XmlRpcServletServer
server
private TypeConverterFactory
typeConverterFactory
-
Constructor Summary
Constructors Constructor Description XmlRpcServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doPost(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse)
Creates a new instance ofRequestData
for the request.AbstractReflectiveHandlerMapping.AuthenticationHandler
getAuthenticationHandler()
Returns the servletsAbstractReflectiveHandlerMapping.AuthenticationHandler
.RequestProcessorFactoryFactory
getRequestProcessorFactoryFactory()
Returns the servletsRequestProcessorFactoryFactory
.TypeConverterFactory
getTypeConverterFactory()
Returns the servletsTypeConverterFactory
.XmlRpcServletServer
getXmlRpcServletServer()
Returns the servlets instance ofXmlRpcServletServer
.private void
handleInitParameters(javax.servlet.ServletConfig pConfig)
void
init(javax.servlet.ServletConfig pConfig)
void
log(java.lang.String pMessage)
void
log(java.lang.String pMessage, java.lang.Throwable pThrowable)
protected PropertyHandlerMapping
newPropertyHandlerMapping(java.net.URL url)
Creates a new instance ofPropertyHandlerMapping
by loading the property file from the given URL.protected XmlRpcHandlerMapping
newXmlRpcHandlerMapping()
Creates a new handler mapping.protected XmlRpcServletServer
newXmlRpcServer(javax.servlet.ServletConfig pConfig)
Creates a new instance ofXmlRpcServer
, which is being used to process the requests.void
setAuthenticationHandler(AbstractReflectiveHandlerMapping.AuthenticationHandler pHandler)
Sets the servletsAbstractReflectiveHandlerMapping.AuthenticationHandler
.void
setRequestProcessorFactoryFactory(RequestProcessorFactoryFactory pFactory)
Sets the servletsRequestProcessorFactoryFactory
.void
setTypeConverterFactory(TypeConverterFactory pFactory)
Sets the servletsTypeConverterFactory
.-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
log
private static final org.apache.commons.logging.Log log
-
server
private XmlRpcServletServer server
-
authenticationHandler
private AbstractReflectiveHandlerMapping.AuthenticationHandler authenticationHandler
-
requestProcessorFactoryFactory
private RequestProcessorFactoryFactory requestProcessorFactoryFactory
-
typeConverterFactory
private TypeConverterFactory typeConverterFactory
-
-
Method Detail
-
getXmlRpcServletServer
public XmlRpcServletServer getXmlRpcServletServer()
Returns the servlets instance ofXmlRpcServletServer
.- Returns:
- The configurable instance of
XmlRpcServletServer
.
-
handleInitParameters
private void handleInitParameters(javax.servlet.ServletConfig pConfig) throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
-
init
public void init(javax.servlet.ServletConfig pConfig) throws javax.servlet.ServletException
- Specified by:
init
in interfacejavax.servlet.Servlet
- Overrides:
init
in classjavax.servlet.GenericServlet
- Throws:
javax.servlet.ServletException
-
setAuthenticationHandler
public void setAuthenticationHandler(AbstractReflectiveHandlerMapping.AuthenticationHandler pHandler)
Sets the servletsAbstractReflectiveHandlerMapping.AuthenticationHandler
.
-
getAuthenticationHandler
public AbstractReflectiveHandlerMapping.AuthenticationHandler getAuthenticationHandler()
Returns the servletsAbstractReflectiveHandlerMapping.AuthenticationHandler
.
-
setRequestProcessorFactoryFactory
public void setRequestProcessorFactoryFactory(RequestProcessorFactoryFactory pFactory)
Sets the servletsRequestProcessorFactoryFactory
.
-
getRequestProcessorFactoryFactory
public RequestProcessorFactoryFactory getRequestProcessorFactoryFactory()
Returns the servletsRequestProcessorFactoryFactory
.
-
setTypeConverterFactory
public void setTypeConverterFactory(TypeConverterFactory pFactory)
Sets the servletsTypeConverterFactory
.
-
getTypeConverterFactory
public TypeConverterFactory getTypeConverterFactory()
Returns the servletsTypeConverterFactory
.
-
newXmlRpcServer
protected XmlRpcServletServer newXmlRpcServer(javax.servlet.ServletConfig pConfig) throws XmlRpcException
Creates a new instance ofXmlRpcServer
, which is being used to process the requests. The default implementation will simply invokenew
XmlRpcServer
.- Parameters:
pConfig
- The servlets configuration.- Throws:
XmlRpcException
-
newXmlRpcHandlerMapping
protected XmlRpcHandlerMapping newXmlRpcHandlerMapping() throws XmlRpcException
Creates a new handler mapping. The default implementation loads a property file from the resourceorg/apache/xmlrpc/webserver/XmlRpcServlet.properties
- Throws:
XmlRpcException
-
newPropertyHandlerMapping
protected PropertyHandlerMapping newPropertyHandlerMapping(java.net.URL url) throws java.io.IOException, XmlRpcException
Creates a new instance ofPropertyHandlerMapping
by loading the property file from the given URL. Called fromnewXmlRpcHandlerMapping()
.- Throws:
java.io.IOException
XmlRpcException
-
doPost
public void doPost(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse) throws java.io.IOException, javax.servlet.ServletException
Creates a new instance ofRequestData
for the request.- Overrides:
doPost
in classjavax.servlet.http.HttpServlet
- Throws:
java.io.IOException
javax.servlet.ServletException
-
log
public void log(java.lang.String pMessage, java.lang.Throwable pThrowable)
- Overrides:
log
in classjavax.servlet.GenericServlet
-
log
public void log(java.lang.String pMessage)
- Overrides:
log
in classjavax.servlet.GenericServlet
-
-