#include <XML_Topology_Factory.h>
Inheritance diagram for TAO_Notify::XML_Topology_Factory:
Public Member Functions | |
XML_Topology_Factory () | |
The constructor. | |
virtual | ~XML_Topology_Factory () |
virtual Topology_Saver * | create_saver () |
virtual Topology_Loader * | create_loader () |
virtual int | init (int argc, ACE_TCHAR *argv[]) |
virtual int | fini () |
Private Attributes | |
ACE_CString | save_base_path_ |
ACE_CString | load_base_path_ |
size_t | backup_count_ |
bool | timestamp_ |
Loaded by a svc.conf line like: dynamic Topology_Factory Service_Object* TAO_CosNotificationd:_make_XML_Topology_Factory() "[arguments]" where arguments are: -base_path Base path (directory and filename) for both saving and loading. .xml will be appended to the base path Default is ./Notification_Service_Topology -save_base_path Base path for saving. -load_base_path Base path for loading. -file_count How many backup copies to keep. Default is 1 -no_timestamp Disable timestamping (makes files diffable) Note: you can set both saving and storing to the same file using -base_path Or you can set them independently using -save_base_path and -load_base_path
Definition at line 52 of file XML_Topology_Factory.h.
|
The constructor.
Definition at line 18 of file XML_Topology_Factory.cpp.
00019 : save_base_path_ ("./Notification_Service_Topology") 00020 , load_base_path_ ("./Notification_Service_Topology") 00021 , backup_count_ (2) 00022 , timestamp_ (true) 00023 { 00024 } |
|
Definition at line 27 of file XML_Topology_Factory.cpp.
00028 { 00029 } |
|
Create a Loader
Implements TAO_Notify::Topology_Factory. Definition at line 49 of file XML_Topology_Factory.cpp. References ACE_NEW_NORETURN, and TAO_Notify::XML_Loader::open().
00050 { 00051 XML_Loader *loader = 0; 00052 ACE_NEW_NORETURN(loader, XML_Loader); 00053 00054 if (! loader->open(this->load_base_path_)) 00055 { 00056 delete loader; 00057 loader = 0; 00058 } 00059 return static_cast<Topology_Loader *> (loader); 00060 } |
|
Create a Saver.
Implements TAO_Notify::Topology_Factory. Definition at line 33 of file XML_Topology_Factory.cpp. References ACE_NEW_RETURN, and TAO_Notify::XML_Saver::open().
00034 { 00035 XML_Saver *saver = 0; 00036 00037 ACE_NEW_RETURN (saver, XML_Saver (this->timestamp_), 0); 00038 00039 if (! saver->open ( this->save_base_path_.c_str (), this->backup_count_)) 00040 { 00041 delete saver; 00042 saver = 0; 00043 } 00044 return static_cast<Topology_Saver *> (saver); 00045 } |
|
Reimplemented from ACE_Shared_Object. Definition at line 151 of file XML_Topology_Factory.cpp.
00152 { 00153 // nothing to do yet 00154 return 0; 00155 } |
|
Reimplemented from ACE_Shared_Object. Definition at line 64 of file XML_Topology_Factory.cpp. References ACE_DEBUG, ACE_ERROR, ACE_TCHAR, ACE_TEXT(), ACE_OS::atoi(), LM_DEBUG, LM_ERROR, load_base_path_, save_base_path_, ACE_OS::strcasecmp(), and TAO_debug_level.
00065 { 00066 int result = 0; 00067 bool verbose = false; 00068 for (int narg = 0; narg < argc; ++narg) 00069 { 00070 ACE_TCHAR * av = argv[narg]; 00071 if (ACE_OS::strcasecmp (av, "-v") == 0) 00072 { 00073 verbose = true; 00074 ACE_DEBUG ((LM_DEBUG, 00075 ACE_TEXT ("(%P|%t) Standard_Event_Persistence: -verbose\n") 00076 )); 00077 } 00078 else if (ACE_OS::strcasecmp (av, "-base_path") == 0 && narg + 1 < argc) 00079 { 00080 this->save_base_path_ = argv[narg + 1]; 00081 this->load_base_path_ = argv[narg + 1]; 00082 if (TAO_debug_level > 0 || verbose) 00083 { 00084 ACE_DEBUG ((LM_DEBUG, 00085 ACE_TEXT ("(%P|%t) XML_TopologyFactory: Setting -base_path: %s\n"), 00086 this->save_base_path_.c_str () 00087 )); 00088 } 00089 narg += 1; 00090 } 00091 else if (ACE_OS::strcasecmp (av, "-save_base_path") == 0 && narg + 1 < argc) 00092 { 00093 this->save_base_path_ = argv[narg + 1]; 00094 if (TAO_debug_level > 0 || verbose) 00095 { 00096 ACE_DEBUG ((LM_DEBUG, 00097 ACE_TEXT ("(%P|%t) XML_TopologyFactory: Setting -save_base_path: %s\n"), 00098 this->save_base_path_.c_str () 00099 )); 00100 } 00101 narg += 1; 00102 } 00103 else if (ACE_OS::strcasecmp (av, "-load_base_path") == 0 && narg + 1 < argc) 00104 { 00105 this->load_base_path_ = argv[narg + 1]; 00106 if (TAO_debug_level > 0 || verbose) 00107 { 00108 ACE_DEBUG ((LM_DEBUG, 00109 ACE_TEXT ("(%P|%t) XML_TopologyFactory: Setting -load_base_path: %s\n"), 00110 this->load_base_path_.c_str () 00111 )); 00112 } 00113 narg += 1; 00114 } 00115 else if (ACE_OS::strcasecmp (av, "-backup_count") == 0 && narg + 1 < argc) 00116 { 00117 this->backup_count_ = ACE_OS::atoi(argv[narg + 1]); 00118 if (TAO_debug_level > 0 || verbose) 00119 { 00120 ACE_DEBUG ((LM_DEBUG, 00121 ACE_TEXT ("(%P|%t) XML_TopologyFactory: Setting -file_count: %d\n"), 00122 this->backup_count_ 00123 )); 00124 } 00125 narg += 1; 00126 } 00127 else if (ACE_OS::strcasecmp (av, "-no_timestamp") == 0) 00128 { 00129 this->timestamp_ = false; 00130 if (TAO_debug_level > 0 || verbose) 00131 { 00132 ACE_DEBUG ((LM_DEBUG, 00133 ACE_TEXT ("(%P|%t) XML_TopologyFactory: Setting -no_timestamp\n") 00134 )); 00135 } 00136 } 00137 else 00138 { 00139 ACE_ERROR ((LM_ERROR, 00140 ACE_TEXT ("(%P|%t) Unknown parameter to XML Topology Factory: %s\n"), 00141 argv[narg] 00142 )); 00143 result = -1; 00144 } 00145 } 00146 return result; 00147 } |
|
Definition at line 74 of file XML_Topology_Factory.h. |
|
Definition at line 73 of file XML_Topology_Factory.h. Referenced by init(). |
|
Definition at line 72 of file XML_Topology_Factory.h. Referenced by init(). |
|
Definition at line 75 of file XML_Topology_Factory.h. |