TAO_Implementation_Repository  2.1.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
XML_Backing_Store Class Reference

XML backing store interface containing all ImR persistent information in a single file. More...

#include <XML_Backing_Store.h>

Inheritance diagram for XML_Backing_Store:
Inheritance graph
Collaboration diagram for XML_Backing_Store:
Collaboration graph

Public Types

typedef std::pair< ACE_CString,
ACE_CString
NameValue
 
typedef std::vector< NameValueNameValues
 
- Public Types inherited from Locator_Repository
typedef ACE_CString ServerKey
 
typedef
ACE_Hash_Map_Manager_Ex
< ServerKey, Server_Info_Ptr,
ACE_Hash< ServerKey >
, ACE_Equal_To< ServerKey >
, ACE_Null_Mutex
SIMap
 
typedef ACE_CString ActivatorKey
 
typedef
ACE_Hash_Map_Manager_Ex
< ActivatorKey,
Activator_Info_Ptr, ACE_Hash
< ActivatorKey >, ACE_Equal_To
< ActivatorKey >
, ACE_Null_Mutex
AIMap
 

Public Member Functions

 XML_Backing_Store (const Options &opts, CORBA::ORB_ptr orb, bool suppress_erase=false)
 
virtual ~XML_Backing_Store ()
 
virtual const ACE_TCHARrepo_mode () const
 indicate the XML filename as the persistence mode for the repository More...
 
virtual void load_server (const ACE_CString &server_id, const ACE_CString &server_name, bool jacorb_server, const ACE_CString &activator_name, const ACE_CString &cmdline, const ImplementationRepository::EnvironmentList &env_vars, const ACE_CString &working_dir, ImplementationRepository::ActivationMode actmode, int start_limit, const ACE_CString &partial_ior, const ACE_CString &ior, bool server_started, const NameValues &extra_params)
 
virtual void load_activator (const ACE_CString &activator_name, long token, const ACE_CString &ior, const NameValues &extra_params)
 
- Public Member Functions inherited from Locator_Repository
 Locator_Repository (const Options &opts, CORBA::ORB_ptr orb)
 
virtual ~Locator_Repository ()
 
int unregister_if_address_reused (const ACE_CString &server_id, const ACE_CString &name, const char *partial_ior)
 
int add_server (const ACE_CString &server_id, const ACE_CString &name, bool jacorbs, const ACE_CString &aname, const ACE_CString &startup_command, const ImplementationRepository::EnvironmentList &environment_vars, const ACE_CString &working_dir, ImplementationRepository::ActivationMode activation, int start_limit, const ACE_CString &partial_ior=ACE_CString(""), const ACE_CString &ior=ACE_CString(""), ImplementationRepository::ServerObject_ptr svrobj=ImplementationRepository::ServerObject::_nil())
 Add a new server to the Repository. More...
 
int add_activator (const ACE_CString &name, const CORBA::Long token, const ACE_CString &ior=ACE_CString(""), ImplementationRepository::Activator_ptr act=ImplementationRepository::Activator::_nil())
 Add a new activator to the Repository. More...
 
int update_server (const Server_Info_Ptr &info)
 Update the associated information. More...
 
int update_activator (const Activator_Info_Ptr &info)
 Update the associated information. More...
 
Server_Info_Ptr get_server (const ACE_CString &name)
 Returns information related to startup. More...
 
Activator_Info_Ptr get_activator (const ACE_CString &name)
 Returns information related to startup. More...
 
bool has_activator (const ACE_CString &name)
 
int remove_server (const ACE_CString &name)
 Removes the server from the Repository. More...
 
int remove_activator (const ACE_CString &name)
 Removes the activator from the Repository. More...
 
SIMapservers (void)
 Returns the internal hash map containing the server information. More...
 
const SIMapservers (void) const
 
AIMapactivators (void)
 Returns the internal hash map containing the activator information. More...
 
const AIMapactivators (void) const
 
int init (PortableServer::POA_ptr root_poa, PortableServer::POA_ptr imr_poa, const char *this_ior)
 Initialize the repo. More...
 
bool multicast () const
 Indicate if multicast should be used. More...
 

Protected Member Functions

virtual int init_repo (PortableServer::POA_ptr imr_poa)
 
virtual int persistent_update (const Server_Info_Ptr &info, bool add)
 perform server persistent update More...
 
virtual int persistent_update (const Activator_Info_Ptr &info, bool add)
 perform activator persistent update More...
 
virtual int persistent_remove (const ACE_CString &name, bool activator)
 perform persistent remove More...
 
int load (const ACE_TString &filename, FILE *open_file=0)
 
void persist (FILE *fp, const Server_Info &info, const char *tag_prepend, const NameValues &name_values=NameValues())
 
void persist (FILE *fp, const Activator_Info &info, const char *tag_prepend, const NameValues &name_values=NameValues())
 
void create_server (bool server_started, const Server_Info_Ptr &si)
 
- Protected Member Functions inherited from Locator_Repository
virtual int sync_load ()
 
virtual int report_ior (PortableServer::POA_ptr imr_poa)
 report the ImR Locator's IOR More...
 
int setup_multicast (ACE_Reactor *reactor, const char *imr_ior)
 
void teardown_multicast ()
 
bool registered () const
 

Static Protected Member Functions

static int load (const ACE_TString &filename, ACEXML_DefaultHandler &xml_handler, unsigned int debug, FILE *open_file=0)
 

Protected Attributes

const ACE_TString filename_
 the filename indicated in the Options for the backing store More...
 
- Protected Attributes inherited from Locator_Repository
const Optionsopts_
 
TAO_IOR_Multicast ior_multicast_
 
const CORBA::ORB_var orb_
 
CORBA::String_var imr_ior_
 

Private Member Functions

int persist ()
 persist all servers and activators More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Locator_Repository
static ACE_CString lcase (const ACE_CString &s)
 convert to lower case More...
 

Detailed Description

XML backing store interface containing all ImR persistent information in a single file.

Member Typedef Documentation

Constructor & Destructor Documentation

XML_Backing_Store::XML_Backing_Store ( const Options opts,
CORBA::ORB_ptr  orb,
bool  suppress_erase = false 
)
XML_Backing_Store::~XML_Backing_Store ( )
virtual

Member Function Documentation

void XML_Backing_Store::create_server ( bool  server_started,
const Server_Info_Ptr si 
)
protected

create the Server_Info server object

Parameters
server_startedindication from persistence indicating if the server object was present
sithe server info in question
int XML_Backing_Store::init_repo ( PortableServer::POA_ptr  imr_poa)
protectedvirtual

perform XML backing store specific initialization (loads servers and activators from the backing store)

Implements Locator_Repository.

Reimplemented in Shared_Backing_Store.

int XML_Backing_Store::load ( const ACE_TString filename,
FILE *  open_file = 0 
)
protected

load the contents of a file into the repo using a Locator_XMLHandler

Parameters
filenamethe filename to read the contents from
open_filethe already open FILE stream for the filename
int XML_Backing_Store::load ( const ACE_TString filename,
ACEXML_DefaultHandler &  xml_handler,
unsigned int  debug,
FILE *  open_file = 0 
)
staticprotected

load the contents of a file into the repo using the provided ACEXML_DefaultHandler

Parameters
filenamethe filename to read the contents from
xml_handlerthe ACEXML_DefaultHandler to use to parse the file
open_filethe already open FILE stream for the filename
void XML_Backing_Store::load_activator ( const ACE_CString activator_name,
long  token,
const ACE_CString ior,
const NameValues extra_params 
)
virtual

create the Activator_Info activator object

Parameters
activator_namethe Activator_Info name
tokenthe Activator_Info token
iorthe Activator_Info ior
extra_paramsextra name value pairs that were reported for the activator

Reimplemented in Shared_Backing_Store.

void XML_Backing_Store::load_server ( const ACE_CString server_id,
const ACE_CString server_name,
bool  jacorb_server,
const ACE_CString activator_name,
const ACE_CString cmdline,
const ImplementationRepository::EnvironmentList &  env_vars,
const ACE_CString working_dir,
ImplementationRepository::ActivationMode  actmode,
int  start_limit,
const ACE_CString partial_ior,
const ACE_CString ior,
bool  server_started,
const NameValues extra_params 
)
virtual

create the Server_Info server object

Parameters
server_idthe Server_Info server_id
server_namethe Server_Info server_name
activator_namethe Server_Info activator
cmdlinethe Server_Info cmdline
env_varsthe Server_Info env_vars
workin_dirthe Server_Info dir
actmodethe Server_Info activation_mode
start_limitthe Server_Info start_limit
partial_iorthe Server_Info partial_ior
iorthe Server_Info ior
server_startedindicates if the server object existed when data was persisted
extra_paramsextra name value pairs that were reported for the server

Reimplemented in Shared_Backing_Store.

void XML_Backing_Store::persist ( FILE *  fp,
const Server_Info info,
const char *  tag_prepend,
const NameValues name_values = NameValues() 
)
protected

persist the server

Parameters
fpthe FILE stream to persist the server contents to
infothe Server_Info to persist
tag_prependa character string to prepend at the start of every xml line to maintain proper indentation
name_valuesextra name value pairs to write as attributes
void XML_Backing_Store::persist ( FILE *  fp,
const Activator_Info info,
const char *  tag_prepend,
const NameValues name_values = NameValues() 
)
protected

persist the activator

Parameters
fpthe FILE stream to persist the activator contents to
infothe Server_Info to persist
tag_prependa character string to prepend at the start of every xml line to maintain proper indentation
name_valuesextra name value pairs to write as attributes
int XML_Backing_Store::persist ( )
private

persist all servers and activators

int XML_Backing_Store::persistent_remove ( const ACE_CString name,
bool  activator 
)
protectedvirtual

perform persistent remove

Implements Locator_Repository.

Reimplemented in Shared_Backing_Store.

int XML_Backing_Store::persistent_update ( const Server_Info_Ptr info,
bool  add 
)
protectedvirtual

perform server persistent update

Implements Locator_Repository.

Reimplemented in Shared_Backing_Store.

int XML_Backing_Store::persistent_update ( const Activator_Info_Ptr info,
bool  add 
)
protectedvirtual

perform activator persistent update

Implements Locator_Repository.

Reimplemented in Shared_Backing_Store.

const ACE_TCHAR * XML_Backing_Store::repo_mode ( ) const
virtual

indicate the XML filename as the persistence mode for the repository

Implements Locator_Repository.

Reimplemented in Shared_Backing_Store.

Member Data Documentation

const ACE_TString XML_Backing_Store::filename_
protected

the filename indicated in the Options for the backing store


The documentation for this class was generated from the following files: