HydraExpress™ C++ 2019 |
HydraExpress™ C++ API Reference Guide |
Product Documentation: HydraExpress C++ Documentation Home |
Abstract base class for servlets. More...
#include <rwsf/servlet/Servlet.h>
Public Member Functions | |
virtual | ~Servlet () |
virtual void | destroy ()=0 |
virtual rwsf::ServletConfig | getServletConfig () const |
virtual std::string | getServletInfo () const =0 |
virtual void | init (const rwsf::ServletConfig &config)=0 |
virtual void | service (rwsf::ServletRequest &req, rwsf::ServletResponse &res)=0 |
rwsf::Servlet is an abstract base class for servlets. A servlet is a small piece of code that executes inside an Agent running on a server. You would typically use one of the derived classes for creating your own servlets. For example:
|
virtual |
Destructor.
|
pure virtual |
Pure virtual function. In derived classes, warns the servlet that the Agent has removed the servlet. The destroy() function allows the servlet to perform cleanup tasks and deallocate resources. The Agent does not forward requests to the servlet after calling this function. A servlet should perform all resource deallocation and cleanup tasks in the destroy() method rather than the servlet destructor.
Implemented in rwsf::WebServiceServlet, and rwsf::GenericServlet.
|
virtual |
Returns the rwsf::ServletConfig object that was used to initialize this servlet. The rwsf::ServletConfig object contains initialization and startup parameters for this servlet.
Reimplemented in rwsf::GenericServlet.
|
pure virtual |
Returns a string describing this servlet. By convention, the string typically includes information on the servlet author, version, and copyright.
Implemented in rwsf::GenericServlet.
|
pure virtual |
Pure virtual function. In derived classes, initializes the servlet. After this function returns, the Agent is free to call the service() method with requests. The config object contains initialization and startup parameters. A servlet should perform all resource allocation in the init() method.
Derived classes should throw rwsf::ServletUnavailableException to indicate failure. If this function throws an exception, the Agent does not place the servlet into service and the servlet does not receive requests.
Implemented in rwsf::GenericServlet, and rwsf::WebServiceServlet.
|
pure virtual |
Pure virtual function. In derived classes, the Agent calls this method when a request arrives for this servlet. The Agent only forwards requests after calling the init() method. This method may be called by multiple threads, so applications should take care to guard resources that might be shared across multiple threads.
Implemented in rwsf::HttpServlet.
Copyright © 2019 Rogue Wave Software, Inc. All Rights Reserved. |