3 //=============================================================================
5 * @file Config_Backing_Store.h
7 * These classes define ACE_Configuration implementations of the backing store.
9 * @author Darrell Brunsch <brunsch@cs.wustl.edu>
10 * @author Priyanka Gontla <gontla_p@ociweb.com>
12 //=============================================================================
14 #ifndef CONFIG_BACKING_STORE_H
15 #define CONFIG_BACKING_STORE_H
17 #include "ace/config-lite.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "Locator_Repository.h"
25 #include "ace/Configuration.h"
28 * @class Config_Backing_Store
30 * @brief ACE_Configuration backing store interface containing all ImR persistent
34 class Config_Backing_Store
: public Locator_Repository
37 Config_Backing_Store(const Options
& opts
,
39 ACE_Configuration
& config
);
41 virtual ~Config_Backing_Store();
44 /// perform config backing store specific initialization
45 /// (loads servers and activators from the backing store)
46 virtual int init_repo(PortableServer::POA_ptr imr_poa
);
48 /// perform server persistent update
49 virtual int persistent_update(const Server_Info_Ptr
& info
, bool add
);
51 /// perform activator persistent update
52 virtual int persistent_update(const Activator_Info_Ptr
& info
, bool add
);
54 /// perform persistent remove
55 virtual int persistent_remove(const ACE_CString
& name
, bool activator
);
57 /// remove the section with the given name from the key section
58 int remove(const ACE_CString
& name
, const ACE_TCHAR
* key
);
60 /// the ACE_Configuration backing store
61 ACE_Configuration
& config_
;
62 /// the status of the config_
68 /// load all activators
69 void loadActivators();
73 * @class Heap_Backing_Store
75 * @brief Heap file backing store containing all ImR persistent information.
78 class Heap_Backing_Store
: public Config_Backing_Store
81 Heap_Backing_Store(const Options
& opts
,
84 virtual ~Heap_Backing_Store();
86 /// indicate the Heap filename as the persistence mode for the repository
87 virtual const ACE_TCHAR
* repo_mode() const;
91 const ACE_TString filename_
;
92 /// the Heap used for the actual backing store
93 ACE_Configuration_Heap heap_
;
97 * @class Registry_Backing_Store
99 * @brief Win32 registry backing store containing all ImR persistent
103 class Registry_Backing_Store
: public Config_Backing_Store
106 Registry_Backing_Store(const Options
& opts
,
109 virtual ~Registry_Backing_Store();
111 /// indicate Registry as the persistence mode for the repository
112 virtual const ACE_TCHAR
* repo_mode() const;
115 #if defined (ACE_WIN32) && !defined (ACE_LACKS_WIN32_REGISTRY)
116 /// the Win32 registry used for the actual backing store
117 ACE_Configuration_Win32Registry win32registry_
;
119 // invalid config (used to simplify #defines)
120 ACE_Configuration_Heap invalid_config_
;
125 #endif /* CONFIG_BACKING_STORE_H */