xmlrpc_thread.h

00001 
00002 /***************************************************************************
00003  *  xmlrpc_thread.h - Thread that handles xml-rpc requests
00004  *
00005  *  Created: Sun Aug 30 12:44:30 2009
00006  *  Copyright  2006-2009  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU Library General Public License for more details.
00019  *
00020  *  Read the full text in the LICENSE.GPL file in the doc directory.
00021  */
00022 
00023 #ifndef __PLUGINS_XMLRPC_XMLRPC_THREAD_H_
00024 #define __PLUGINS_XMLRPC_XMLRPC_THREAD_H_
00025 
00026 #include <core/threading/thread.h>
00027 #include <aspect/logging.h>
00028 #include <aspect/configurable.h>
00029 #include <aspect/blackboard.h>
00030 #include <aspect/network.h>
00031 #include <aspect/logger.h>
00032 #include <aspect/plugin_director.h>
00033 
00034 #include <utils/logging/cache.h>
00035 
00036 namespace fawkes {
00037   class NetworkService;
00038   class WebRequestDispatcher;
00039   class WebServer;
00040 }
00041 
00042 class XmlRpcRequestProcessor;
00043 class XmlRpcPluginMethods;
00044 class XmlRpcLogMethods;
00045 
00046 class XmlRpcThread
00047 : public fawkes::Thread,
00048   public fawkes::LoggingAspect,
00049   public fawkes::ConfigurableAspect,
00050   public fawkes::BlackBoardAspect,
00051   public fawkes::NetworkAspect,
00052   public fawkes::LoggerAspect,
00053   public fawkes::PluginDirectorAspect
00054 {
00055  public:
00056   XmlRpcThread();
00057   ~XmlRpcThread();
00058 
00059   virtual void init();
00060   virtual void finalize();
00061   virtual void loop();
00062 
00063  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
00064  protected: virtual void run() { Thread::run(); }
00065 
00066  private:
00067   fawkes::WebServer            *__webserver;
00068   fawkes::WebRequestDispatcher *__dispatcher;
00069 
00070   XmlRpcRequestProcessor       *__processor;
00071   XmlRpcPluginMethods          *__plugin_methods;
00072   XmlRpcLogMethods             *__log_methods;
00073 
00074   unsigned int                  __cfg_port;
00075 
00076   fawkes::CacheLogger           __cache_logger;
00077   fawkes::NetworkService       *__xmlrpc_service;
00078 };
00079 
00080 #endif

Generated on 1 Mar 2011 for Fawkes API by  doxygen 1.6.1