00001 #ifndef loggingService_H 00002 #define loggingService_H 00003 00004 /******************************************************************************* 00005 * ALMA - Atacama Large Millimiter Array 00006 * (c) European Southern Observatory, 2002 00007 * Copyright by ESO (in the framework of the ALMA collaboration) 00008 * and Cosylab 2002, All rights reserved 00009 * 00010 * This library is free software; you can redistribute it and/or 00011 * modify it under the terms of the GNU Lesser General Public 00012 * License as published by the Free Software Foundation; either 00013 * version 2.1 of the License, or (at your option) any later version. 00014 * 00015 * This library 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 GNU 00018 * Lesser General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU Lesser General Public 00021 * License along with this library; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 * 00024 * "@(#) $Id: loggingService.h,v 1.43 2007/05/28 06:23:39 cparedes Exp $" 00025 * 00026 * who when what 00027 * -------- ---------- ---------------------------------------------- 00028 * bjeram 2003-03-10 DsLogAdmin::LogFullAction -> DsLogAdmin::LogFullActionType, LogMgr_i -> TAO_LogMgr_i, BasicLog_i to TAO_BasicLog_i (TAO x.3) 00029 * msekoran 2001-07-08 added implementation of sending logs to Notify Service 00030 * msekoran 2001-06-17 created 00031 */ 00032 00033 #ifndef __cplusplus 00034 #error This is a C++ include file and cannot be used from plain C 00035 #endif 00036 00037 #include <string> 00038 #include <acsutil.h> 00039 #include <orbsvcs/CosNamingC.h> 00040 #include <orbsvcs/DsLogAdminC.h> 00041 #include <orbsvcs/CosNotifyChannelAdminS.h> 00042 00043 #include "loggingACSStructuredPushSupplier.h" 00044 #include "loggingACSLogFactory_i.h" 00045 #define LOG_BIN_TYPE 0 00046 #define LOG_XML_TYPE 1 00047 00051 class LoggingService 00052 { 00053 public: 00054 00055 //--Constants---------------------------------------------- 00059 static const std::string CLP_NO_AUTORECONNECT; 00060 00061 00062 //--Initialization and termination methods----------------- 00066 LoggingService(); 00067 00071 virtual ~LoggingService(); 00072 00076 bool 00077 isInitialized() { return m_isInitialized; } 00078 00083 int 00084 parse_args (int argc, char *argv []); 00085 00089 void 00090 startup (int argc, char *argv[]); 00091 00095 void 00096 reinit(); 00097 00103 bool autoreconnect() const; 00104 00109 int 00110 run (); 00111 00115 void shutdown (); 00116 00117 00118 protected: 00119 00123 void 00124 init_ORB (int& argc, char *argv []); 00125 00129 void 00130 resolve_naming_service (); 00131 00135 void resolve_notify_factory (); 00136 00140 void create_EC (); 00141 00145 void 00146 create_supplieradmin(); 00147 00151 void 00152 create_suppliers(); 00153 00154 void 00155 reinit_suppliers(); 00156 00160 void 00161 create_basic_log_factory(); 00162 00166 void 00167 create_basic_log(); 00168 00169 00170 //--Notify Service data members------------------------------- 00171 00173 CosNotifyChannelAdmin::EventChannelFactory_var m_notify_factory; 00174 00176 CosNotifyChannelAdmin::EventChannel_var m_logging_ec; 00177 00179 CosNotification::QoSProperties m_initial_qos; 00180 00182 CosNotification::AdminProperties m_initial_admin; 00183 00185 CosNotifyChannelAdmin::InterFilterGroupOperator m_ifgop; 00186 00188 CosNotifyChannelAdmin::SupplierAdmin_var m_logging_supplier_admin; 00189 00191 ACSStructuredPushSupplier* m_logging_supplier; 00192 00193 00194 //--Logging Service data members---------------------------- 00195 00197 const char* m_basic_log_factory_name; 00198 00200 const char* m_basic_log_name; 00201 00203 ACSLogFactory_i m_basic_log_factory; 00204 00206 DsLogAdmin::BasicLog_var m_basic_log; 00207 00208 00209 //--Common data members------------------------------------- 00210 00211 bool m_logBin; 00212 00214 bool m_isInitialized; 00215 00217 CORBA::ORB_var m_orb; 00218 00220 PortableServer::POA_var m_poa; 00221 00223 CosNaming::NamingContext_var m_naming_context; 00224 00226 ACE_SYNCH_MUTEX m_mutexReinit; 00227 00233 bool m_autoreconnect; 00234 }; 00235 #endif /* loggingService_H */ 00236 00237 00238 00239 // ************************************************************************ 00240 // 00241 // REVISION HISTORY: 00242 // 00243 // $Log: loggingService.h,v $ 00244 // Revision 1.43 2007/05/28 06:23:39 cparedes 00245 // Adding the new alternate method to log binaries 00246 // 00247 // Revision 1.42.14.2 2007/04/03 07:46:03 cparedes 00248 // Changing from ACS_LOG_TYPE to ACS_LOG_BIN 00249 // 00250 // Revision 1.42.14.1 2007/03/05 06:16:24 cparedes 00251 // First attempt, work well with old things, but seg fault with the new things. To debug 00252 // 00253 // Revision 1.42 2006/01/28 00:03:51 dfugate 00254 // The LoggingChannel is now created using the LoggingNotifyEventChannelFactory instead of NotifyEventChannelFactory. 00255 // 00256 // Revision 1.41 2005/09/12 19:02:15 dfugate 00257 // Stripped out all code dealing with the archiving channel EXCEPT that used to 00258 // create the notification channel. 00259 // 00260 // Revision 1.40 2005/09/12 17:57:06 dfugate 00261 // Converted plain C++ comments to Doxygen-style. 00262 // Split loggingService.h into four headers (three new) as it's an ALMA C++ 00263 // coding violation to have more than one class declaration per header. 00264 // 00265 // Revision 1.39 2005/09/09 21:33:45 dfugate 00266 // Decoupled a generic event supplier from loggingService.cpp. 00267 // 00268 // Revision 1.38 2003/10/24 19:27:07 dfugate 00269 // Fixed a few serious bugs and now use native exceptions. 00270 // 00271 // Revision 1.37 2003/10/23 07:39:09 acaproni 00272 // True native exception handling. No more extra parameters 00273 // 00274 // Revision 1.36 2003/07/28 09:46:57 bjeram 00275 // modification for native exception 00276 // 00277 // Revision 1.35 2003/03/14 10:24:37 rgeorgie 00278 // LGPL 00279 // 00280 // Revision 1.34 2003/03/10 14:29:29 bjeram 00281 // changes according to the changes in TAO x.3 00282 // 00283 // Revision 1.33 2002/09/23 12:43:04 vltsccm 00284 // msekoran: loggingXMLParser fixed, memory leak removed and tat test added. 00285 // ************************************************************************ 00286 00287 00288 00289
1.7.0