LogService
libdadi: utility tools for distributed applications
|
00001 /****************************************************************************/ 00002 /* Defines an object implementing the interface LogCentralTool defined in */ 00003 /* the LogCentralTool.idl */ 00004 /* */ 00005 /* Author(s): */ 00006 /* - Georg Hoesch (hoesch@in.tum.de) */ 00007 /* - Cyrille Pontvieux (cyrille.pontvieux@edu.univ-fcomte.fr) */ 00008 /* */ 00009 /* This file is part of DIET . */ 00010 /* */ 00011 /* Copyright (C) 2000-2003 ENS Lyon, LIFC, INSA, INRIA and SysFera (2000) */ 00012 /* */ 00013 /* - Frederic.Desprez@ens-lyon.fr (Project Manager) */ 00014 /* - Eddy.Caron@ens-lyon.fr (Technical Manager) */ 00015 /* - Tech@sysfera.com (Maintainer and Technical Support) */ 00016 /* */ 00017 /* This software is a computer program whose purpose is to provide an */ 00018 /* distributed logging services. */ 00019 /* */ 00020 /* */ 00021 /* This software is governed by the CeCILL license under French law and */ 00022 /* abiding by the rules of distribution of free software. You can use, */ 00023 /* modify and/ or redistribute the software under the terms of the CeCILL */ 00024 /* license as circulated by CEA, CNRS and INRIA at the following URL */ 00025 /* "http://www.cecill.info". */ 00026 /* */ 00027 /* As a counterpart to the access to the source code and rights to copy, */ 00028 /* modify and redistribute granted by the license, users are provided */ 00029 /* only with a limited warranty and the software's author, the holder */ 00030 /* of the economic rights, and the successive licensors have only */ 00031 /* limited liability. */ 00032 /* */ 00033 /* In this respect, the user's attention is drawn to the risks */ 00034 /* associated with loading, using, modifying and/or developing or */ 00035 /* reproducing the software by the user in light of its specific status */ 00036 /* of free software, that may mean that it is complicated to */ 00037 /* manipulate, and that also therefore means that it is reserved for */ 00038 /* developers and experienced professionals having in-depth computer */ 00039 /* knowledge. Users are therefore encouraged to load and test the */ 00040 /* software's suitability as regards their requirements in conditions */ 00041 /* enabling the security of their systems and/or data to be ensured and, */ 00042 /* more generally, to use and operate it in the same conditions as */ 00043 /* regards security. */ 00044 /* */ 00045 /* The fact that you are presently reading this means that you have had */ 00046 /* knowledge of the CeCILL license and that you accept its terms. */ 00047 /* */ 00048 /****************************************************************************/ 00049 /* $Id$ 00050 * $Log$ 00051 * Revision 1.3 2010/12/03 12:40:27 kcoulomb 00052 * MAJ log to use forwarders 00053 * 00054 * Revision 1.2 2010/11/10 02:27:44 kcoulomb 00055 * Update the log to use the forwarder. 00056 * Programm run without launching forwarders but fails with forwarder. 00057 * 00058 * Revision 1.1 2004/01/09 11:07:12 ghoesch 00059 * Restructured the whole LogService source tree. 00060 * Added autotools make process. Cleaned up code. 00061 * Removed some testers. Ready to release. 00062 * 00063 ***************************************************************************/ 00064 00065 #ifndef _LOGCENTRALTOOL_IMPL_HH_ 00066 #define _LOGCENTRALTOOL_IMPL_HH_ 00067 00068 #include "ToolList.hh" 00069 #include "ComponentList.hh" 00070 #include "FilterManagerInterface.hh" 00071 #include "StateManager.hh" 00072 00073 #include "CorbaLogForwarder.hh" 00074 00089 class LogCentralTool_impl: public POA_LogCentralTool, 00090 public PortableServer::RefCountServantBase { 00091 public: 00092 LogCentralTool_impl(ToolList* toolList, 00093 ComponentList* compList, 00094 FilterManagerInterface* filterMan, 00095 StateManager* stateMan, 00096 tag_list_t* allTags); 00097 00098 ~LogCentralTool_impl(); 00099 00100 void 00101 test(); 00102 00118 CORBA::Short 00119 connectTool(char*& toolName, const char* msgReceiver); 00120 00128 CORBA::Short 00129 disconnectTool(const char* toolName); 00130 00136 tag_list_t* 00137 getDefinedTags(); 00138 00145 component_list_t* 00146 getDefinedComponents(); 00147 00157 CORBA::Short 00158 addFilter(const char* toolName, const filter_t& filter); 00159 00167 CORBA::Short 00168 removeFilter(const char* toolName, const char* filterName); 00169 00175 CORBA::Short 00176 flushAllFilters(const char* toolName); 00177 00178 private: 00179 FilterManagerInterface* filterManager; 00180 StateManager* stateManager; 00181 ToolList* toolList; 00182 ComponentList* componentList; 00183 tag_list_t allTags; 00184 00196 bool 00197 getToolByName(const char* toolName, ToolList::ReadIterator* it); 00198 00210 bool 00211 getFilterByName(const char* filterName, FilterList::ReadIterator* it); 00212 }; 00213 00214 00215 class LogCentralToolFwdr_impl: public POA_LogCentralToolFwdr, 00216 public PortableServer::RefCountServantBase { 00217 public: 00218 00219 LogCentralToolFwdr_impl(CorbaLogForwarder_ptr fwdr, 00220 const char* objName); 00221 00222 ~LogCentralToolFwdr_impl(); 00223 00224 void 00225 test(); 00226 00242 CORBA::Short 00243 connectTool(char*& toolName, 00244 const char* msgReceiver); 00245 00253 CORBA::Short 00254 disconnectTool(const char* toolName); 00255 00261 tag_list_t* 00262 getDefinedTags(); 00263 00270 component_list_t* 00271 getDefinedComponents(); 00272 00282 CORBA::Short 00283 addFilter(const char* toolName, const filter_t& filter); 00284 00292 CORBA::Short 00293 removeFilter(const char* toolName, const char* filterName); 00294 00300 CORBA::Short 00301 flushAllFilters(const char* toolName); 00302 00303 protected: 00304 CorbaLogForwarder_ptr forwarder; 00305 char* objName; 00306 }; 00307 00308 00309 00310 00311 00312 00313 class ToolMsgReceiverFwdr_impl: public POA_ToolMsgReceiverFwdr, 00314 public PortableServer::RefCountServantBase { 00315 public: 00316 00317 ToolMsgReceiverFwdr_impl(CorbaLogForwarder_ptr fwdr, const char* objName); 00318 00319 ~ToolMsgReceiverFwdr_impl(); 00320 00321 void 00322 sendMsg(const log_msg_buf_t& msgBuf); 00323 00324 protected: 00325 CorbaLogForwarder_ptr forwarder; 00326 char* objName; 00327 }; 00328 00329 #endif