10 #ifndef __PION_PLUGIN_SERVER_HEADER__ 11 #define __PION_PLUGIN_SERVER_HEADER__ 14 #include <boost/asio.hpp> 15 #include <boost/bind.hpp> 16 #include <boost/shared_ptr.hpp> 17 #include <pion/config.hpp> 18 #include <pion/plugin.hpp> 19 #include <pion/plugin_manager.hpp> 20 #include <pion/http/server.hpp> 21 #include <pion/http/plugin_service.hpp> 48 set_logger(PION_GET_LOGGER(
"pion.http.plugin_server"));
59 set_logger(PION_GET_LOGGER(
"pion.http.plugin_server"));
69 : http::
server(sched, tcp_port)
71 set_logger(PION_GET_LOGGER(
"pion.http.plugin_server"));
81 : http::
server(sched, endpoint)
83 set_logger(PION_GET_LOGGER(
"pion.http.plugin_server"));
101 void load_service(
const std::string& resource,
const std::string& service_name);
110 void set_service_option(
const std::string& resource,
111 const std::string& name,
const std::string& value);
125 void load_service_config(
const std::string& config_name);
129 if (is_listening()) stop();
157 service_manager_t m_services;
162 typedef boost::shared_ptr<plugin_server> plugin_server_ptr;
plugin_server(scheduler &sched, const unsigned int tcp_port=0)
virtual void before_starting(void)
called before the TCP server starts listening for new connections
plugin_server(const unsigned int tcp_port=0)
plugin_server(scheduler &sched, const boost::asio::ip::tcp::endpoint &endpoint)
virtual void clear(void)
clears the collection of resources recognized by the HTTP server
virtual ~plugin_server()
default destructor
virtual void after_stopping(void)
called after the TCP server has stopped listening for new connections
virtual void stop(void)
called when the web service's server is stopping
virtual void clear(void)
clears all the web services that are currently configured
plugin_server(const boost::asio::ip::tcp::endpoint &endpoint)
virtual void start(void)
called when the web service's server is starting