For now, we don't register and unregister apps. More...
#include <service.h>

Classes | |
| struct | FinishPostContext |
Public Types | |
| typedef boost::shared_ptr < ActionConfig > | action_config_ptr |
Public Member Functions | |
| Relay (caller_type &caller, const RelayInitializer &initializer) SSRC_DECL_THROW(LoadError | |
| virtual | ~Relay () |
| virtual void | http_post (const request_ptr &request, response_ptr &response) |
| virtual void | http_get (const request_ptr &request, response_ptr &response) |
| In order to support the use of GET to retrieve content that would otherwise be generated by a POST, we check to see if any parameters were specified. | |
| void | continue_post (FinishPostContext &context, const MessageSingleQueryResult &session_result) |
| void | finish_post (FinishPostContext &context, const MessageResponse &result) |
| virtual void | http_head (const request_ptr &request, response_ptr &response) |
| void | process_fcgi_request (const fcgx_request_ptr &request) |
Protected Types | |
| typedef HTTPServlet < FCGIRequest, FCGIResponse > | super_fcgi |
| typedef ServiceProtocolProcessor | super_service |
Protected Member Functions | |
| virtual void | set_lua_state (Lua::lua_State *state) |
| WISP_IMPORT (protocol_traits, MessageReloadConfig) | |
| virtual void | transition (State state) |
| virtual utility::properties_ptr | get_status () |
| void | render_and_cache (const request_ptr &request, response_ptr &response, const bool flush=true) |
| path | find_error_template (const path &error_template, const path &parent_path) |
| path | find_error_template (const path &parent_path) |
| path | find_error_template (const path &parent_path, int index) |
| void | send_error (const HTTPStatusCode status, const request_ptr &request, response_ptr &response, const path &error_template) |
| void | load_environment (const string &environment_name, const bool cache_template) SSRC_DECL_THROW(LuaCallError) |
| void | uncache_template (const string &template_name) SSRC_DECL_THROW(LuaCallError) |
| void | uncache_environment (const string &environment_name) SSRC_DECL_THROW(LuaCallError) |
| void | clear_template_cache () |
| path | load_template_args (const path &template_path, const char *template_key, const bool cache_environment=false, const bool cache_template=true) SSRC_DECL_THROW(LoadError) |
| path | load_template_args (const path &template_path, const bool cache_environment=false, const bool cache_template=true) SSRC_DECL_THROW(LoadError) |
Protected Attributes | |
| string | _global_env_file |
| string | _template_prefix |
| path | _template_dir |
| boost::regex | _get_path_pattern |
| Lua::lua_State * | _lua_state |
| int | _lua_render_ref |
| int | _lua_load_environment_ref |
| int | _lua_uncache_template_ref |
| int | _lua_uncache_environment_ref |
| int | _lua_clear_rendering_cache_ref |
| int | _lua_init_global_environment_ref |
Friends | |
| class | NS_SSRC_WISP_SERVICE::ServiceProtocolProcessor< packing_traits > |
Detailed Description
For now, we don't register and unregister apps.
Instead, we look for and load a service config file in the service config directory.
Definition at line 56 of file relay/service.h.
Member Typedef Documentation
| typedef boost::shared_ptr<ActionConfig> relay::Relay::action_config_ptr |
Definition at line 60 of file relay/service.h.
typedef HTTPServlet<FCGIRequest, FCGIResponse> renderer::Renderer::super_fcgi [protected, inherited] |
Definition at line 85 of file renderer/service.h.
typedef ServiceProtocolProcessor renderer::Renderer::super_service [protected, inherited] |
Definition at line 86 of file renderer/service.h.
Constructor & Destructor Documentation
| relay::Relay::Relay | ( | caller_type & | caller, |
| const RelayInitializer & | initializer | ||
| ) |
| virtual relay::Relay::~Relay | ( | ) | [inline, virtual] |
Definition at line 131 of file relay/service.h.
Member Function Documentation
| void renderer::Renderer::clear_template_cache | ( | ) | [protected, inherited] |
Definition at line 112 of file renderer/service.cc.
References renderer::_lua_clear_rendering_cache_ref(), renderer::_lua_state(), and lua::pcall().
| void relay::Relay::continue_post | ( | FinishPostContext & | context, |
| const MessageSingleQueryResult & | session_result | ||
| ) |
Definition at line 281 of file relay/service.cc.
References relay::Relay::FinishPostContext::action, fcgi::MethodGet, NS_SSRC_WSPR_FCGI, relay::Relay::FinishPostContext::parameters, relay::Relay::FinishPostContext::parent_path, relay::Relay::FinishPostContext::request, relay::Relay::FinishPostContext::request_method, relay::Relay::FinishPostContext::response, fcgi::StatusBadRequest, fcgi::StatusForbidden, and fcgi::StatusOK.
| path renderer::Renderer::find_error_template | ( | const path & | error_template, |
| const path & | parent_path | ||
| ) | [protected, inherited] |
Definition at line 308 of file renderer/service.cc.
References renderer::_template_dir(), and renderer::_template_prefix().
| path renderer::Renderer::find_error_template | ( | const path & | parent_path | ) | [inline, protected, inherited] |
Definition at line 117 of file renderer/service.h.
References renderer::_lua_state().
| path renderer::Renderer::find_error_template | ( | const path & | parent_path, |
| int | index | ||
| ) | [inline, protected, inherited] |
Definition at line 121 of file renderer/service.h.
References renderer::_lua_state().
| void relay::Relay::finish_post | ( | FinishPostContext & | context, |
| const MessageResponse & | result | ||
| ) |
Definition at line 362 of file relay/service.cc.
References renderer::_lua_init_global_environment_ref(), renderer::_lua_render_ref(), renderer::_lua_state(), renderer::_template_dir(), renderer::_template_prefix(), relay::_to_table(), relay::Relay::FinishPostContext::action, renderer::ltp_file(), NS_SSRC_WSPR_FCGI, relay::Relay::FinishPostContext::parent_path, lua::pcall(), lua::pcall_nopop(), lua::properties_to_table(), lua::push_value(), relay::Relay::FinishPostContext::request, relay::Relay::FinishPostContext::response, lua::set_value(), fcgi::StatusForbidden, fcgi::StatusInternalServerError, fcgi::StatusNotFound, and fcgi::StatusOK.
| utility::properties_ptr renderer::Renderer::get_status | ( | ) | [protected, virtual, inherited] |
Definition at line 102 of file renderer/service.cc.
References renderer::_lua_state(), utility::PropTree< Key, Ops, TreeType >::create_node(), and utility::Properties::set().
| virtual void relay::Relay::http_get | ( | const request_ptr & | request, |
| response_ptr & | response | ||
| ) | [inline, virtual] |
In order to support the use of GET to retrieve content that would otherwise be generated by a POST, we check to see if any parameters were specified.
If not, we execute Renderer::http_get, else we execute Renderer::http_post. That means you must supply a dummy argument for no-arg POSTs, except that right now we require an action parameter, so the minimum requirement would be to specify an action. Inside of http_post we check if the request method is GET and if so we require permits_get to be true in the ActionConfig.
Reimplemented from renderer::Renderer.
Definition at line 150 of file relay/service.h.
References fcgi::parse_get_parameters().
| virtual void renderer::Renderer::http_head | ( | const request_ptr & | request, |
| response_ptr & | response | ||
| ) | [inline, virtual, inherited] |
Definition at line 189 of file renderer/service.h.
| virtual void relay::Relay::http_post | ( | const request_ptr & | request, |
| response_ptr & | response | ||
| ) | [inline, virtual] |
Definition at line 133 of file relay/service.h.
References fcgi::parse_post_parameters().
| void renderer::Renderer::load_environment | ( | const string & | environment_name, |
| const bool | cache_template | ||
| ) | [inline, protected, inherited] |
Definition at line 130 of file renderer/service.h.
References renderer::_lua_load_environment_ref(), renderer::_lua_state(), and lua::pcall_nopop().
| path renderer::Renderer::load_template_args | ( | const path & | template_path, |
| const char * | template_key, | ||
| const bool | cache_environment = false, |
||
| const bool | cache_template = true |
||
| ) | [protected, inherited] |
| path renderer::Renderer::load_template_args | ( | const path & | template_path, |
| const bool | cache_environment = false, |
||
| const bool | cache_template = true |
||
| ) | [inline, protected, inherited] |
Definition at line 162 of file renderer/service.h.
| void renderer::Renderer::process_fcgi_request | ( | const fcgx_request_ptr & | request | ) | [inherited] |
Definition at line 216 of file renderer/service.cc.
References fcgi::MethodMax, NS_SSRC_WSPR_FCGI, fcgi::StatusInternalServerError, and fcgi::StatusMethodNotImplemented.
| void renderer::Renderer::render_and_cache | ( | const request_ptr & | request, |
| response_ptr & | response, | ||
| const bool | flush = true |
||
| ) | [protected, inherited] |
Definition at line 386 of file renderer/service.cc.
References renderer::_get_path_pattern(), renderer::_lua_init_global_environment_ref(), renderer::_lua_render_ref(), renderer::_lua_state(), renderer::_template_dir(), renderer::cache_to_file(), renderer::ltp_file(), NS_SSRC_WSPR_FCGI, lua::pcall(), lua::pcall_nopop(), lua::set_value(), fcgi::StatusInternalServerError, fcgi::StatusNotFound, and fcgi::StatusOK.
| void renderer::Renderer::send_error | ( | const HTTPStatusCode | status, |
| const request_ptr & | request, | ||
| response_ptr & | response, | ||
| const path & | error_template | ||
| ) | [protected, inherited] |
Definition at line 335 of file renderer/service.cc.
References renderer::_lua_render_ref(), renderer::_lua_state(), fcgi::CacheDisable, NS_SSRC_WSPR_FCGI, lua::pcall_nopop(), and fcgi::StatusInternalServerError.
| virtual void relay::Relay::set_lua_state | ( | Lua::lua_State * | state | ) | [inline, protected, virtual] |
Reimplemented from renderer::Renderer.
Definition at line 101 of file relay/service.h.
References relay::_to_table().
| void renderer::Renderer::transition | ( | State | state | ) | [protected, virtual, inherited] |
Definition at line 87 of file renderer/service.cc.
| void renderer::Renderer::uncache_environment | ( | const string & | environment_name | ) | [inline, protected, inherited] |
Definition at line 146 of file renderer/service.h.
References renderer::_lua_state(), renderer::_lua_uncache_environment_ref(), and lua::pcall().
| void renderer::Renderer::uncache_template | ( | const string & | template_name | ) | [inline, protected, inherited] |
Definition at line 139 of file renderer/service.h.
References renderer::_lua_state(), renderer::_lua_uncache_template_ref(), and lua::pcall().
| renderer::Renderer::WISP_IMPORT | ( | protocol_traits | , |
| MessageReloadConfig | |||
| ) | [protected, inherited] |
Friends And Related Function Documentation
friend class NS_SSRC_WISP_SERVICE::ServiceProtocolProcessor< packing_traits > [friend] |
Reimplemented from renderer::Renderer.
Definition at line 57 of file relay/service.h.
Member Data Documentation
boost::regex renderer::Renderer::_get_path_pattern [protected, inherited] |
Definition at line 93 of file renderer/service.h.
string renderer::Renderer::_global_env_file [protected, inherited] |
Definition at line 90 of file renderer/service.h.
int renderer::Renderer::_lua_clear_rendering_cache_ref [protected, inherited] |
Definition at line 100 of file renderer/service.h.
int renderer::Renderer::_lua_init_global_environment_ref [protected, inherited] |
Definition at line 101 of file renderer/service.h.
int renderer::Renderer::_lua_load_environment_ref [protected, inherited] |
Definition at line 97 of file renderer/service.h.
int renderer::Renderer::_lua_render_ref [protected, inherited] |
Definition at line 96 of file renderer/service.h.
Lua::lua_State* renderer::Renderer::_lua_state [protected, inherited] |
Definition at line 95 of file renderer/service.h.
int renderer::Renderer::_lua_uncache_environment_ref [protected, inherited] |
Definition at line 99 of file renderer/service.h.
int renderer::Renderer::_lua_uncache_template_ref [protected, inherited] |
Definition at line 98 of file renderer/service.h.
path renderer::Renderer::_template_dir [protected, inherited] |
Definition at line 92 of file renderer/service.h.
string renderer::Renderer::_template_prefix [protected, inherited] |
Definition at line 91 of file renderer/service.h.
The documentation for this class was generated from the following files: