00001 // OSB library ************************************************ -*- C++ -*- 00006 /* 00007 AUTHOR(S): Stephan Broennimann (vb) 00008 00009 RCS information 00010 $Name: OSB_060808 $ 00011 $Revision: 1.6 $ 00012 00013 License 00014 OSB rating and billing library for communication networks 00015 Copyright (C) 2004, 2005, 2006 OSB systems 00016 00017 This file may be distributed and/or modify under the terms of the 00018 GNU General Public License (GPL) as published by the Free Software 00019 Foundation which is provided in the file LICENSE.GPL included in the 00020 packaging of this file. 00021 00022 The file is distributed in the hope that it will be useful, but WITHOUT 00023 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00024 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00025 for more details. 00026 00027 Holders of a OSB Commercial License may use this file under the terms 00028 and conditions of this commercial license. 00029 */ 00030 #ifndef _CADMINAPP_H_ 00031 #define _CADMINAPP_H_ 00032 00033 // ************************************************************************ 00034 // included header files 00035 // + standard includes 00036 #include <string> 00037 00038 // + libraries 00039 #include <ace/Reactor.h> 00040 #include <orbsvcs/CosNamingS.h> 00041 00042 // + local headers 00043 #include "caglobal.h" 00044 00045 // + class declarations 00046 namespace OSB_CORBA { 00047 class CorbaContext; 00048 } 00049 00050 // ************************************************************************ 00051 // class definitions 00052 class CaApp : public CaGlobal, public ACE_Event_Handler { 00053 typedef corba::rqserver::RequestServer_var RequestServer_var; 00054 public: 00055 CaApp( 00056 OSB_CORBA::CorbaContext& context 00057 ); 00058 public: 00059 void initOrb(int argc, char* const argv[]); 00060 void runOrb(); 00061 void shutdown(bool waitCompletion); 00062 void bindNamingContext( 00063 CORBA::Object* servant, 00064 const char* ncName 00065 ); 00066 public: 00067 RequestServer* requestServer(); 00068 public: 00069 CORBA::ORB_var orb_; 00070 CosNaming::NamingContext_var nc_; 00071 private: 00072 int handle_signal(int signum, siginfo_t*, ucontext_t*); 00073 RequestServer* requestServer(bool retry); 00074 private: 00075 std::string ncName_; 00076 OSB_CORBA::CorbaContext& context_; 00077 RequestServer_var requestServer_; 00078 }; // class CaApp 00079 00080 // ************************************************************************ 00081 // inline definitions 00082 #endif // #ifndef _CADMINAPP_H_