#include <appcontext.h>
Classes | |
struct | ServletDesc |
class | SessionCleaner |
Public Types | |
typedef ServletMap< ServletDesc > | servletmap_t |
Public Member Functions | |
~AppContext () | |
GlobalContext * | getGlobalContext () |
ServletConfigImpl * | addServlet (const std::string &path, const std::string &name, const std::string &dso, bool hidden, size_t maxRequestSize, size_t maxFileSize) |
void | delServlet (const std::string &path) |
ServletContainer * | getServletContainer (const std::string &path) |
void | initServlets () |
void | destroyServlets () |
HttpSessionImpl * | getSession (const std::string &sid, bool create) |
Indicates whether to allow proxies to catch documents by default. | |
const std::string & | getSessionCookieName () |
void | killSession (const std::string &sid) |
void | cleanSessions () |
bool | isSessionValid (const std::string &sid) |
void | addInitParam (const std::string &name, const std::string &value) |
void | killAllSessions () |
const std::string & | getFileSaveTemplate () const |
const std::string & | getUriBase () const |
virtual servlet::ServletContext * | getContext (const std::string &uripath) |
virtual int | getMajorVersion () |
virtual int | getMinorVersion () |
virtual std::string | getMimeType (const std::string &file) |
virtual std::auto_ptr < std::set< std::string > > | getResourcePaths (const std::string &path) |
virtual std::string | getResource (const std::string &path) |
virtual std::istream & | getResourceAsStream (const std::string &path) |
virtual servlet::RequestDispatcher * | getRequestDispatcher (const std::string &path) |
virtual servlet::RequestDispatcher * | getNamedDispatcher (const std::string &name) |
virtual void | log (const std::string &msg) const |
virtual void | log (const std::string &message, const std::exception &e) const |
virtual std::string | getRealPath (const std::string &path) |
virtual std::string | getServerInfo () |
virtual std::string | getInitParameter (const std::string &name) |
virtual std::auto_ptr < std::vector< std::string > > | getInitParameterNames () |
virtual boost::shared_ptr< void > | getAttribute (const std::string &name) |
virtual std::auto_ptr < std::vector< std::string > > | getAttributeNames () |
virtual void | setAttribute (const std::string &name, boost::shared_ptr< void > object) |
virtual void | removeAttribute (const std::string &name) |
virtual bool | hasAttribute (const std::string &name) const |
virtual std::string | getServletContextName () const |
Static Public Member Functions | |
static Context * | contextCreator (const ConfigNode &node, Context *parent) |
Protected Member Functions | |
virtual bool | onSetParam (const ConfigNode &) |
virtual Context * | getContext (const ConfigNode &node) |
virtual bool | onPreComplete () |
virtual bool | onPostComplete () |
bool | setSessionTimeout (const ConfigNode &) |
bool | setUploadDir (const ConfigNode &) |
bool | addInitParam (const ConfigNode &) |
bool | setPhysBase (const ConfigNode &) |
bool | setDefaultMimeType (const ConfigNode &) |
bool | setDefaultCharacterEncoding (const ConfigNode &) |
bool | setUriBase (const ConfigNode &) |
Private Types | |
typedef std::map< std::string, HttpSessionImpl * > | sessionlist_t |
typedef std::map< std::string, boost::shared_ptr< void > > | attr_t |
typedef std::map< std::string, std::string > | param_t |
typedef servlet::Servlet *(* | servletcreatefunc_t )() |
Private Member Functions | |
AppContext (const ConfigNode &node, Context *parent) | |
void | unloadServlet (const std::string &path) |
ServletDesc * | getDesc (const std::string &path) |
void | initServlet (const std::string &path) |
void | destroyServlet (const std::string &path) |
HttpSessionImpl * | newSession () |
Static Private Member Functions | |
static void | registerParams (ParamRegistry< AppContext > &) |
static void | registerContexts (ContextRegistry &) |
static void | splitServPath (const std::string &path, std::string &dir, std::string &name) |
static std::string | makeSName (const std::string &name) |
Private Attributes | |
time_t | m_sessionTimeout |
std::string | m_uploadDir |
util::pairlist_t | m_init_params |
servletmap_t | m_maptop |
SessionCleaner * | m_cleaner |
sessionlist_t | m_sessions |
std::string | m_sessionCookieName |
std::string | m_fileSaveTemplate |
sptk::CWaiter | m_sessionLock |
attr_t | m_attrs |
param_t | m_params |
std::string | m_uribase |
std::string | m_physbase |
std::string | m_mime |
std::string | m_enc |
bool | m_cache |
Static Private Attributes | |
static ContextRegistry | m_contextregistry |
static ParamRegistry< AppContext > | m_paramregistry |
Definition at line 48 of file appcontext.h.
typedef std::map<std::string,boost::shared_ptr<void> > container::serverconfig::AppContext::attr_t [private] |
Definition at line 132 of file appcontext.h.
typedef std::map<std::string,std::string> container::serverconfig::AppContext::param_t [private] |
Definition at line 134 of file appcontext.h.
typedef servlet::Servlet*(* container::serverconfig::AppContext::servletcreatefunc_t)() [private] |
Definition at line 93 of file appcontext.h.
typedef std::map<std::string, HttpSessionImpl*> container::serverconfig::AppContext::sessionlist_t [private] |
Definition at line 127 of file appcontext.h.
container::serverconfig::AppContext::AppContext | ( | const ConfigNode & | node, | |
Context * | parent | |||
) | [private] |
Definition at line 61 of file appcontext.cpp.
References container::serverconfig::ConfigNode::getAttrs(), container::serverconfig::ParamRegistry< T >::getParamList(), container::serverconfig::Context::getUnsetParams(), m_cache, and m_paramregistry.
Referenced by contextCreator().
container::serverconfig::AppContext::~AppContext | ( | ) |
Definition at line 88 of file appcontext.cpp.
References destroyServlets(), container::ServletMap< T >::forEachServletPath(), killAllSessions(), m_cleaner, m_maptop, container::serverconfig::AppContext::AppContext::SessionCleaner::stop(), and unloadServlet().
void container::serverconfig::AppContext::addInitParam | ( | const std::string & | name, | |
const std::string & | value | |||
) |
bool container::serverconfig::AppContext::addInitParam | ( | const ConfigNode & | val | ) | [protected] |
Definition at line 166 of file appcontext.cpp.
References container::serverconfig::ConfigNode::getAttrs(), and m_init_params.
Referenced by onPreComplete(), and registerParams().
ServletConfigImpl * container::serverconfig::AppContext::addServlet | ( | const std::string & | path, | |
const std::string & | name, | |||
const std::string & | dso, | |||
bool | hidden, | |||
size_t | maxRequestSize, | |||
size_t | maxFileSize | |||
) |
Definition at line 209 of file appcontext.cpp.
References container::RequestHandler::addServlet(), delServlet(), getDesc(), getServletContainer(), getServletContextName(), m_cache, m_enc, m_maptop, m_mime, and unloadServlet().
Referenced by container::serverconfig::ServletContext::onPostComplete().
void container::serverconfig::AppContext::cleanSessions | ( | ) |
Definition at line 380 of file appcontext.cpp.
References killSession(), m_sessionLock, and m_sessions.
Referenced by container::serverconfig::AppContext::AppContext::SessionCleaner::threadFunction().
static Context* container::serverconfig::AppContext::contextCreator | ( | const ConfigNode & | node, | |
Context * | parent | |||
) | [inline, static] |
Definition at line 76 of file appcontext.h.
References AppContext().
Referenced by container::serverconfig::GlobalContext::registerContexts().
void container::serverconfig::AppContext::delServlet | ( | const std::string & | path | ) |
Definition at line 250 of file appcontext.cpp.
References m_maptop, and container::ServletMap< T >::removeDesc().
Referenced by addServlet().
void container::serverconfig::AppContext::destroyServlet | ( | const std::string & | path | ) | [private] |
Definition at line 281 of file appcontext.cpp.
References container::ServletContainer::destroy(), and getServletContainer().
Referenced by destroyServlets().
void container::serverconfig::AppContext::destroyServlets | ( | ) |
Definition at line 311 of file appcontext.cpp.
References destroyServlet(), container::ServletMap< T >::forEachServletPath(), and m_maptop.
Referenced by ~AppContext().
boost::shared_ptr< void > container::serverconfig::AppContext::getAttribute | ( | const std::string & | name | ) | [virtual] |
Returns the servlet container attribute with the given name, or null
if there is no attribute by that name. An attribute allows a servlet container to give the servlet additional information not already provided by this interface. See your server documentation for information about its attributes. A list of supported attributes can be retrieved using getAttributeNames
.
The attribute is returned as a java.lang.Object
or some subclass. Attribute names should follow the same convention as package names. The Java Servlet API specification reserves names matching java.*
, javax.*
, and sun.*
.
name | a String specifying the name of the attribute |
Object
containing the value of the attribute, or null
if no attribute exists matching the given nameImplements servlet::ServletContext.
Definition at line 641 of file appcontext.cpp.
References m_attrs.
std::auto_ptr< std::vector< std::string > > container::serverconfig::AppContext::getAttributeNames | ( | ) | [virtual] |
Returns an Enumeration
containing the attribute names available within this servlet context. Use the getAttribute method with an attribute name to get the value of an attribute.
Enumeration
of attribute namesImplements servlet::ServletContext.
Definition at line 649 of file appcontext.cpp.
References container::util::getMapKeyNames(), and m_attrs.
servlet::ServletContext * container::serverconfig::AppContext::getContext | ( | const std::string & | uripath | ) | [virtual] |
Returns a ServletContext
object that corresponds to a specified URL on the server.
This method allows servlets to gain access to the context for various parts of the server, and as needed obtain servlet::RequestDispatcher objects from the context. The given path must be begin with "/", is interpreted relative to the server's document root and is matched against the context roots of other web applications hosted on this container.
In a security conscious environment, the servlet container may return null
for a given URL.
uripath | a String specifying the context path of another web application in the container. |
ServletContext
object that corresponds to the named URL, or null if either none exists or the container wishes to restrict this access.Implements servlet::ServletContext.
Definition at line 536 of file appcontext.cpp.
References container::serverconfig::ServerConfig::getApp(), container::serverconfig::Context::getServerConfig(), and getUriBase().
virtual Context* container::serverconfig::AppContext::getContext | ( | const ConfigNode & | node | ) | [inline, protected, virtual] |
Implements container::serverconfig::Context.
Definition at line 61 of file appcontext.h.
References container::serverconfig::ContextRegistry::getContext(), and m_contextregistry.
AppContext::ServletDesc * container::serverconfig::AppContext::getDesc | ( | const std::string & | path | ) | [private] |
Definition at line 245 of file appcontext.cpp.
References container::ServletMap< T >::getServletDesc(), and m_maptop.
Referenced by addServlet(), getServletContainer(), and unloadServlet().
const std::string& container::serverconfig::AppContext::getFileSaveTemplate | ( | ) | const [inline] |
Definition at line 173 of file appcontext.h.
References m_fileSaveTemplate.
Referenced by container::HttpServletRequestImpl::getFileSaveTemplate().
GlobalContext* container::serverconfig::AppContext::getGlobalContext | ( | ) | [inline] |
Definition at line 78 of file appcontext.h.
References container::serverconfig::Context::getParent().
Referenced by onPreComplete().
std::string container::serverconfig::AppContext::getInitParameter | ( | const std::string & | name | ) | [virtual] |
Returns a String
containing the value of the named context-wide initialization parameter, or null
if the parameter does not exist.
This method can make available configuration information useful to an entire "web application". For example, it can provide a webmaster's email address or the name of a system that holds critical data.
name | a String containing the name of the parameter whose value is requested |
Implements servlet::ServletContext.
Definition at line 629 of file appcontext.cpp.
References m_params.
std::auto_ptr< std::vector< std::string > > container::serverconfig::AppContext::getInitParameterNames | ( | ) | [virtual] |
Returns the names of the context's initialization parameters as an Enumeration
of String
objects, or an empty Enumeration
if the context has no initialization parameters.
Enumeration
of String
objects containing the names of the context's initialization parametersImplements servlet::ServletContext.
Definition at line 637 of file appcontext.cpp.
References container::util::getMapKeyNames(), and m_params.
int container::serverconfig::AppContext::getMajorVersion | ( | ) | [virtual] |
Returns the major version of the Java Servlet API that this servlet container supports. All implementations that comply with Version 2.4 must have this method return the integer 2.
Implements servlet::ServletContext.
Definition at line 544 of file appcontext.cpp.
std::string container::serverconfig::AppContext::getMimeType | ( | const std::string & | file | ) | [virtual] |
Returns the MIME type of the specified file, or null
if the MIME type is not known. The MIME type is determined by the configuration of the servlet container, and may be specified in a web application deployment descriptor. Common MIME types are "text/html"
and "image/gif"
.
file | a String specifying the name of a file |
String
specifying the file's MIME type Implements servlet::ServletContext.
Definition at line 552 of file appcontext.cpp.
int container::serverconfig::AppContext::getMinorVersion | ( | ) | [virtual] |
Returns the minor version of the Servlet API that this servlet container supports. All implementations that comply with Version 2.4 must have this method return the integer 4.
Implements servlet::ServletContext.
Definition at line 548 of file appcontext.cpp.
servlet::RequestDispatcher * container::serverconfig::AppContext::getNamedDispatcher | ( | const std::string & | name | ) | [virtual] |
Returns a servlet::RequestDispatcher object that acts as a wrapper for the named servlet.
Servlets (and JSP pages also) may be given names via server administration or via a web application deployment descriptor. A servlet instance can determine its name using servlet::ServletConfig#getServletName.
This method returns null
if the ServletContext
cannot return a RequestDispatcher
for any reason.
name | a String specifying the name of a servlet to wrap |
RequestDispatcher
object that acts as a wrapper for the named servlet, or null
if the ServletContext
cannot return a RequestDispatcher
ServletConfig::getServletName
Implements servlet::ServletContext.
Definition at line 609 of file appcontext.cpp.
References getServletContainer().
std::string container::serverconfig::AppContext::getRealPath | ( | const std::string & | path | ) | [virtual] |
Returns a String
containing the real path for a given virtual path. For example, the path "/index.html" returns the absolute file path on the server's filesystem would be served by a request for "http://host/contextPath/index.html", where contextPath is the context path of this ServletContext..
The real path returned will be in a form appropriate to the computer and operating system on which the servlet container is running, including the proper path separators. This method returns null
if the servlet container cannot translate the virtual path to a real path for any reason (such as when the content is being made available from a .war
archive).
path | a String specifying a virtual path |
String
specifying the real path, or null if the translation cannot be performed Implements servlet::ServletContext.
Definition at line 613 of file appcontext.cpp.
References m_physbase.
Referenced by container::HttpServletRequestImpl::getPathTranslated().
servlet::RequestDispatcher * container::serverconfig::AppContext::getRequestDispatcher | ( | const std::string & | path | ) | [virtual] |
Returns a servlet::RequestDispatcher object that acts as a wrapper for the resource located at the given path. A RequestDispatcher
object can be used to forward a request to the resource or to include the resource in a response. The resource can be dynamic or static.
The pathname must begin with a "/" and is interpreted as relative to the current context root. Use getContext
to obtain a RequestDispatcher
for resources in foreign contexts. This method returns null
if the ServletContext
cannot return a RequestDispatcher
.
path | a String specifying the pathname to the resource |
RequestDispatcher
object that acts as a wrapper for the resource at the specified path, or null
if the ServletContext
cannot return a RequestDispatcher
Implements servlet::ServletContext.
Definition at line 602 of file appcontext.cpp.
References getServletContainer().
Referenced by container::HttpServletRequestImpl::getRequestDispatcher().
std::string container::serverconfig::AppContext::getResource | ( | const std::string & | path | ) | [virtual] |
Returns a URL to the resource that is mapped to a specified path. The path must begin with a "/" and is interpreted as relative to the current context root.
This method allows the servlet container to make a resource available to servlets from any source. Resources can be located on a local or remote file system, in a database, or in a .war
file.
The servlet container must implement the URL handlers and URLConnection
objects that are necessary to access the resource.
This method returns null
if no resource is mapped to the pathname.
Some containers may allow writing to the URL returned by this method using the methods of the URL class.
The resource content is returned directly, so be aware that requesting a .jsp
page returns the JSP source code. Use a RequestDispatcher
instead to include results of an execution.
This method has a different purpose than java.lang.Class.getResource
, which looks up resources based on a class loader. This method does not use class loaders.
path | a String specifying the path to the resource |
null
if there is no resource at that pathMalformedURLException | if the pathname is not given in the correct form |
Implements servlet::ServletContext.
Definition at line 593 of file appcontext.cpp.
std::istream & container::serverconfig::AppContext::getResourceAsStream | ( | const std::string & | path | ) | [virtual] |
Returns the resource located at the named path as an InputStream
object.
The data in the InputStream
can be of any type or length. The path must be specified according to the rules given in getResource
. This method returns null
if no resource exists at the specified path.
Meta-information such as content length and content type that is available via getResource
method is lost when using this method.
The servlet container must implement the URL handlers and URLConnection
objects necessary to access the resource.
This method is different from java.lang.Class.getResourceAsStream
, which uses a class loader. This method allows servlet containers to make a resource available to a servlet from any location, without using a class loader.
path | a String specifying the path to the resource |
InputStream
returned to the servlet, or null
if no resource exists at the specified path Implements servlet::ServletContext.
Definition at line 598 of file appcontext.cpp.
std::auto_ptr< std::set< std::string > > container::serverconfig::AppContext::getResourcePaths | ( | const std::string & | path | ) | [virtual] |
Returns a directory-like listing of all the paths to resources within the web application whose longest sub-path matches the supplied path argument. Paths indicating subdirectory paths end with a '/'. The returned paths are all relative to the root of the web application and have a leading '/'. For example, for a web application containing<br>
/welcome.html
/catalog/index.html
/catalog/products.html
/catalog/offers/books.html
/catalog/offers/music.html
/customer/login.jsp
/WEB-INF/web.xml
/WEB-INF/classes/com.acme.OrderServlet.class,
getResourcePaths("/") returns {"/welcome.html", "/catalog/", "/customer/", "/WEB-INF/"}
getResourcePaths("/catalog/") returns {"/catalog/index.html", "/catalog/products.html", "/catalog/offers/"}.
path | the partial path used to match the resources, which must start with a / |
Implements servlet::ServletContext.
Definition at line 580 of file appcontext.cpp.
References container::ServletMap< T >::getPath(), container::ServletMap< T >::getServlets(), container::ServletMap< T >::getSubpaths(), and m_maptop.
std::string container::serverconfig::AppContext::getServerInfo | ( | ) | [virtual] |
Returns the name and version of the servlet container on which the servlet is running.
The form of the returned string is servername/versionnumber. For example, the JavaServer Web Development Kit may return the string JavaServer Web Dev Kit/1.0
.
The servlet container may return other optional information after the primary string in parentheses, for example, JavaServer Web Dev Kit/1.0 (JDK 1.1.6; Windows NT 4.0 x86)
.
Implements servlet::ServletContext.
Definition at line 625 of file appcontext.cpp.
References CPPSERV_VERSION.
ServletContainer * container::serverconfig::AppContext::getServletContainer | ( | const std::string & | path | ) |
Definition at line 255 of file appcontext.cpp.
References getDesc(), and container::serverconfig::AppContext::AppContext::ServletDesc::m_cont.
Referenced by addServlet(), destroyServlet(), getNamedDispatcher(), getRequestDispatcher(), initServlet(), and unloadServlet().
std::string container::serverconfig::AppContext::getServletContextName | ( | ) | const [virtual] |
Implements servlet::ServletContext.
Definition at line 478 of file appcontext.cpp.
References container::serverconfig::Context::getName().
Referenced by addServlet(), container::ServletContainer::forward(), container::HttpServletRequestImpl::getContextPath(), and container::HttpServletRequestImpl::getSession().
container::HttpSessionImpl * container::serverconfig::AppContext::getSession | ( | const std::string & | sid, | |
bool | create | |||
) |
Indicates whether to allow proxies to catch documents by default.
sid | Session ID. If empty string, new session is created | |
create | Whether to create session if it doesn't exist |
Definition at line 327 of file appcontext.cpp.
References m_sessionLock, m_sessions, newSession(), and container::HttpSessionImpl::notNew().
Referenced by container::HttpServletRequestImpl::getSession(), and container::HttpServletRequestImpl::isRequestedSessionIdValid().
container::serverconfig::AppContext::getSessionCookieName | ( | ) | [inline] |
Definition at line 163 of file appcontext.h.
References m_sessionCookieName.
Referenced by container::HttpServletRequestImpl::getSession(), and container::HttpServletRequestImpl::parseCookieHeader().
const std::string& container::serverconfig::AppContext::getUriBase | ( | ) | const [inline] |
Definition at line 174 of file appcontext.h.
References m_uribase.
Referenced by container::ServletContainer::forward(), getContext(), container::ForwardedRequestWrapper::getContextPath(), and container::HttpServletRequestImpl::getSession().
bool container::serverconfig::AppContext::hasAttribute | ( | const std::string & | name | ) | const [virtual] |
[C++ Servlet API Extention]
Returns the false if no attribute of the given name exists. Returns true otherwize
name | a String specifying the name of the attribute |
Implements servlet::ServletContext.
Definition at line 663 of file appcontext.cpp.
References m_attrs.
void container::serverconfig::AppContext::initServlet | ( | const std::string & | path | ) | [private] |
Definition at line 275 of file appcontext.cpp.
References getServletContainer(), and container::ServletContainer::init().
Referenced by initServlets().
void container::serverconfig::AppContext::initServlets | ( | ) |
Definition at line 304 of file appcontext.cpp.
References container::ServletMap< T >::forEachServletPath(), initServlet(), and m_maptop.
Referenced by onPostComplete().
bool container::serverconfig::AppContext::isSessionValid | ( | const std::string & | sid | ) |
sid | Session ID, as retrieved from session cookie. Session is valid if it exists and did not expire. |
Definition at line 459 of file appcontext.cpp.
References m_sessions.
Referenced by container::HttpServletRequestImpl::isRequestedSessionIdValid().
void container::serverconfig::AppContext::killAllSessions | ( | ) |
Removes all sessions in this context. It presumes no servlets in this context are going to use us.
Definition at line 512 of file appcontext.cpp.
References m_sessionLock, and m_sessions.
Referenced by ~AppContext().
void container::serverconfig::AppContext::killSession | ( | const std::string & | sid | ) |
sid | ID of session to kill |
Definition at line 366 of file appcontext.cpp.
References m_sessions.
Referenced by cleanSessions().
void container::serverconfig::AppContext::log | ( | const std::string & | message, | |
const std::exception & | e | |||
) | const [virtual] |
Writes an explanatory message and a stack trace for a given Throwable
exception to the servlet log file. The name and type of the servlet log file is specific to the servlet container, usually an event log.
message | a std::string that describes the error or exception | |
e | the std::exception error or exception |
Implements servlet::ServletContext.
Definition at line 488 of file appcontext.cpp.
References log().
void container::serverconfig::AppContext::log | ( | const std::string & | msg | ) | const [virtual] |
Writes the specified message to a servlet log file, usually an event log. The name and type of the servlet log file is specific to the servlet container.
msg | a String specifying the message to be written to the log file |
Implements servlet::ServletContext.
Definition at line 483 of file appcontext.cpp.
Referenced by log().
std::string container::serverconfig::AppContext::makeSName | ( | const std::string & | name | ) | [static, private] |
container::HttpSessionImpl * container::serverconfig::AppContext::newSession | ( | ) | [private] |
This function must always be called with sessionLock locked.
Definition at line 352 of file appcontext.cpp.
References container::util::getRandomString(), m_sessions, and m_sessionTimeout.
Referenced by getSession().
bool container::serverconfig::AppContext::onPostComplete | ( | ) | [protected, virtual] |
called after child contexts' complete()
Reimplemented from container::serverconfig::Context.
Definition at line 197 of file appcontext.cpp.
References initServlets(), m_cleaner, m_fileSaveTemplate, m_sessionTimeout, and m_uploadDir.
bool container::serverconfig::AppContext::onPreComplete | ( | ) | [protected, virtual] |
called before child contexts' complete()
Reimplemented from container::serverconfig::Context.
Definition at line 178 of file appcontext.cpp.
References addInitParam(), getGlobalContext(), container::serverconfig::Context::getName(), m_enc, m_init_params, m_mime, m_sessionCookieName, m_uribase, makeSName(), and container::serverconfig::GlobalContext::registerApp().
bool container::serverconfig::AppContext::onSetParam | ( | const ConfigNode & | node | ) | [protected, virtual] |
Implements container::serverconfig::Context.
Definition at line 83 of file appcontext.cpp.
References m_paramregistry, and container::serverconfig::ParamRegistry< T >::setParam().
void container::serverconfig::AppContext::registerContexts | ( | ContextRegistry & | reg | ) | [static, private] |
Definition at line 110 of file appcontext.cpp.
References container::serverconfig::CSPContext::contextCreator(), container::serverconfig::ServletContext::contextCreator(), and container::serverconfig::ContextRegistry::registerContext().
void container::serverconfig::AppContext::registerParams | ( | ParamRegistry< AppContext > & | reg | ) | [static, private] |
Definition at line 116 of file appcontext.cpp.
References addInitParam(), container::serverconfig::PARAM_INHERITABLE, container::serverconfig::PARAM_REQUIRED, container::serverconfig::PARAM_SINGLE_OF_TYPE, container::serverconfig::ParamRegistry< T >::registerParam(), setDefaultCharacterEncoding(), setDefaultMimeType(), container::serverconfig::Context::setIgnore(), setPhysBase(), setSessionTimeout(), setUploadDir(), and setUriBase().
void container::serverconfig::AppContext::removeAttribute | ( | const std::string & | name | ) | [virtual] |
Removes the attribute with the given name from the servlet context. After removal, subsequent calls to getAttribute to retrieve the attribute's value will return null
.
If listeners are configured on the ServletContext
the container notifies them accordingly.
name | a String specifying the name of the attribute to be removed |
Implements servlet::ServletContext.
Definition at line 657 of file appcontext.cpp.
References m_attrs.
void container::serverconfig::AppContext::setAttribute | ( | const std::string & | name, | |
boost::shared_ptr< void > | object | |||
) | [virtual] |
Binds an object to a given attribute name in this servlet context. If the name specified is already used for an attribute, this method will replace the attribute with the new to the new attribute.
If listeners are configured on the ServletContext
the container notifies them accordingly.
If a null value is passed, the effect is the same as calling removeAttribute()
.
Attribute names should follow the same convention as package names. The Java Servlet API specification reserves names matching java.*
, javax.*
, and sun.*
.
name | a String specifying the name of the attribute | |
object | an Object representing the attribute to be bound |
Implements servlet::ServletContext.
Definition at line 653 of file appcontext.cpp.
References m_attrs.
bool container::serverconfig::AppContext::setDefaultCharacterEncoding | ( | const ConfigNode & | val | ) | [protected] |
Definition at line 161 of file appcontext.cpp.
References m_enc, and container::serverconfig::Context::setString().
Referenced by registerParams().
bool container::serverconfig::AppContext::setDefaultMimeType | ( | const ConfigNode & | val | ) | [protected] |
Definition at line 156 of file appcontext.cpp.
References m_mime, and container::serverconfig::Context::setString().
Referenced by registerParams().
bool container::serverconfig::AppContext::setPhysBase | ( | const ConfigNode & | val | ) | [protected] |
Definition at line 146 of file appcontext.cpp.
References m_physbase, and container::serverconfig::Context::setString().
Referenced by registerParams().
bool container::serverconfig::AppContext::setSessionTimeout | ( | const ConfigNode & | val | ) | [protected] |
Definition at line 129 of file appcontext.cpp.
References container::serverconfig::ConfigNode::getAttrs(), and m_sessionTimeout.
Referenced by registerParams().
bool container::serverconfig::AppContext::setUploadDir | ( | const ConfigNode & | val | ) | [protected] |
Definition at line 141 of file appcontext.cpp.
References m_uploadDir, and container::serverconfig::Context::setString().
Referenced by registerParams().
bool container::serverconfig::AppContext::setUriBase | ( | const ConfigNode & | val | ) | [protected] |
Definition at line 151 of file appcontext.cpp.
References m_uribase, and container::serverconfig::Context::setString().
Referenced by registerParams().
void container::serverconfig::AppContext::splitServPath | ( | const std::string & | path, | |
std::string & | dir, | |||
std::string & | name | |||
) | [static, private] |
Definition at line 263 of file appcontext.cpp.
void container::serverconfig::AppContext::unloadServlet | ( | const std::string & | name | ) | [private] |
name | Name of servlet to unload, as specified in name= parameter in config file Stops servlet - that is removed it from mapper, and waits till all requests within this servlet are done. |
Definition at line 293 of file appcontext.cpp.
References container::ServletContainer::getConfig(), getDesc(), getServletContainer(), and container::serverconfig::AppContext::AppContext::ServletDesc::m_h.
Referenced by addServlet(), and ~AppContext().
Definition at line 133 of file appcontext.h.
Referenced by getAttribute(), getAttributeNames(), hasAttribute(), removeAttribute(), and setAttribute().
bool container::serverconfig::AppContext::m_cache [private] |
ContextRegistry container::serverconfig::AppContext::m_contextregistry [static, private] |
std::string container::serverconfig::AppContext::m_enc [private] |
Definition at line 151 of file appcontext.h.
Referenced by addServlet(), onPreComplete(), and setDefaultCharacterEncoding().
std::string container::serverconfig::AppContext::m_fileSaveTemplate [private] |
Definition at line 130 of file appcontext.h.
Referenced by getFileSaveTemplate(), and onPostComplete().
Definition at line 95 of file appcontext.h.
Referenced by addServlet(), delServlet(), destroyServlets(), getDesc(), getResourcePaths(), initServlets(), and ~AppContext().
std::string container::serverconfig::AppContext::m_mime [private] |
Definition at line 150 of file appcontext.h.
Referenced by addServlet(), onPreComplete(), and setDefaultMimeType().
ParamRegistry< AppContext > container::serverconfig::AppContext::m_paramregistry [static, private] |
Reimplemented from container::serverconfig::Context.
Definition at line 135 of file appcontext.h.
Referenced by addInitParam(), getInitParameter(), and getInitParameterNames().
std::string container::serverconfig::AppContext::m_physbase [private] |
Base physical path for this application It should roughly correspond to the place where static content for the application is located (e.g. $HOME/public_html) By default it's directory where engine.xml is located (completely random, and in most cases inappropriate default)
Definition at line 149 of file appcontext.h.
Referenced by getRealPath(), and setPhysBase().
std::string container::serverconfig::AppContext::m_sessionCookieName [private] |
Definition at line 129 of file appcontext.h.
Referenced by getSessionCookieName(), and onPreComplete().
sptk::CWaiter container::serverconfig::AppContext::m_sessionLock [private] |
Definition at line 131 of file appcontext.h.
Referenced by cleanSessions(), getSession(), and killAllSessions().
Definition at line 128 of file appcontext.h.
Referenced by cleanSessions(), getSession(), isSessionValid(), killAllSessions(), killSession(), and newSession().
time_t container::serverconfig::AppContext::m_sessionTimeout [private] |
Definition at line 53 of file appcontext.h.
Referenced by newSession(), onPostComplete(), and setSessionTimeout().
std::string container::serverconfig::AppContext::m_uploadDir [private] |
std::string container::serverconfig::AppContext::m_uribase [private] |
Base virtual path for this application It should roughly correspond to location from which static content for this application is served (e.g. /~user/) It _MUST_ end with '/'
Definition at line 141 of file appcontext.h.
Referenced by getUriBase(), onPreComplete(), and setUriBase().