Locator_XMLHandler Class Reference

#include <Locator_XMLHandler.h>

Collaboration diagram for Locator_XMLHandler:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_Vector< EnvVarEnvList

Public Member Functions

 Locator_XMLHandler (Callback &cb)
virtual void startElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, const ACEXML_Char *qName, ACEXML_Attributes *atts)
virtual void endElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, const ACEXML_Char *qName)

Static Public Attributes

const char * ROOT_TAG = "ImplementationRepository"
const char * SERVER_INFO_TAG = "Servers"
const char * ENVIRONMENT_TAG = "EnvironmentVariables"
const char * ACTIVATOR_INFO_TAG = "Activators"

Private Attributes

Callbackcallback_
ACE_CString server_name_
ACE_CString activator_name_
ACE_CString command_line_
ACE_CString activation_
ACE_CString working_dir_
ACE_CString server_object_ior_
ACE_CString partial_ior_
int start_limit_
EnvList env_vars_

Detailed Description

Callback SAX XML Handler for parsing XML.

Definition at line 26 of file Locator_XMLHandler.h.


Member Typedef Documentation

typedef ACE_Vector<EnvVar> Locator_XMLHandler::EnvList
 

Definition at line 43 of file Locator_XMLHandler.h.

Referenced by convertEnvList(), and Server_Repo_XML_Callback::next_server().


Constructor & Destructor Documentation

Locator_XMLHandler::Locator_XMLHandler Callback cb  ) 
 

Definition at line 13 of file Locator_XMLHandler.cpp.

00014 : callback_ (cb)
00015 {
00016 }


Member Function Documentation

void Locator_XMLHandler::endElement const ACEXML_Char *  namespaceURI,
const ACEXML_Char *  localName,
const ACEXML_Char *  qName
[virtual]
 

Definition at line 69 of file Locator_XMLHandler.cpp.

References ACE_ASSERT, Locator_XMLHandler::Callback::next_server(), SERVER_INFO_TAG, server_name_, and ACE_OS::strcasecmp().

00072 {
00073   ACE_ASSERT(qName != 0);
00074   if (ACE_OS::strcasecmp (qName, SERVER_INFO_TAG) == 0
00075     && this->server_name_.length () > 0)
00076   {
00077     this->callback_.next_server (this->server_name_,
00078       this->activator_name_, this->command_line_,
00079       this->env_vars_, this->working_dir_, this->activation_,
00080       this->start_limit_, this->partial_ior_, this->server_object_ior_);
00081   }
00082   // activator info is handled in the startElement
00083 }

void Locator_XMLHandler::startElement const ACEXML_Char *  namespaceURI,
const ACEXML_Char *  localName,
const ACEXML_Char *  qName,
ACEXML_Attributes *  atts
[virtual]
 

Definition at line 19 of file Locator_XMLHandler.cpp.

References ACE_ASSERT, ACE_CString, activation_, ACTIVATOR_INFO_TAG, activator_name_, ACE_OS::atoi(), ACE_Vector< T, DEFAULT_SIZE >::clear(), command_line_, env_vars_, ENVIRONMENT_TAG, Locator_XMLHandler::EnvVar::name, Locator_XMLHandler::Callback::next_activator(), partial_ior_, ACE_Vector< T, DEFAULT_SIZE >::push_back(), SERVER_INFO_TAG, server_name_, server_object_ior_, start_limit_, ACE_OS::strcasecmp(), Locator_XMLHandler::EnvVar::value, and working_dir_.

00023 {
00024   ACE_ASSERT (qName != 0);
00025   if (ACE_OS::strcasecmp (qName, SERVER_INFO_TAG) == 0)
00026     {
00027       // We'll use this as a key to determine if we've got a valid record
00028       this->server_name_ = "";
00029       this->env_vars_.clear();
00030 
00031       if (attrs != 0 && attrs->getLength () == 8)
00032         {
00033           this->server_name_ = attrs->getValue ((size_t)0);
00034           this->activator_name_ = attrs->getValue ((size_t)1);
00035           this->command_line_ = attrs->getValue ((size_t)2);
00036           this->working_dir_ = attrs->getValue ((size_t)3);
00037           this->activation_ = attrs->getValue ((size_t)4);
00038           this->env_vars_.clear ();
00039           int limit = ACE_OS::atoi (attrs->getValue ((size_t)5));
00040           this->start_limit_ = limit;
00041           this->partial_ior_ = attrs->getValue ((size_t)6);
00042           this->server_object_ior_ = attrs->getValue ((size_t)7);
00043         }
00044     }
00045   else if (ACE_OS::strcasecmp (qName, ACTIVATOR_INFO_TAG) == 0)
00046   {
00047     if (attrs != 0 && attrs->getLength () == 3)
00048       {
00049         ACE_CString aname = attrs->getValue ((size_t)0);
00050         ACE_CString token_str = attrs->getValue ((size_t)1);
00051         long token = ACE_OS::atoi (token_str.c_str ());
00052         ACE_CString ior = attrs->getValue ((size_t)2);
00053         this->callback_.next_activator (aname, token, ior);
00054       }
00055   }
00056   else if (ACE_OS::strcasecmp (qName, ENVIRONMENT_TAG) == 0)
00057     {
00058       if (attrs != 0 && attrs->getLength () == 2)
00059         {
00060           EnvVar ev;
00061           ev.name = attrs->getValue ((size_t)0);
00062           ev.value = attrs->getValue ((size_t)1);
00063           this->env_vars_.push_back (ev);
00064         }
00065     }
00066 }


Member Data Documentation

ACE_CString Locator_XMLHandler::activation_ [private]
 

Definition at line 78 of file Locator_XMLHandler.h.

Referenced by startElement().

const char * Locator_XMLHandler::ACTIVATOR_INFO_TAG = "Activators" [static]
 

Definition at line 10 of file Locator_XMLHandler.cpp.

Referenced by startElement().

ACE_CString Locator_XMLHandler::activator_name_ [private]
 

Definition at line 76 of file Locator_XMLHandler.h.

Referenced by startElement().

Callback& Locator_XMLHandler::callback_ [private]
 

Definition at line 73 of file Locator_XMLHandler.h.

ACE_CString Locator_XMLHandler::command_line_ [private]
 

Definition at line 77 of file Locator_XMLHandler.h.

Referenced by startElement().

EnvList Locator_XMLHandler::env_vars_ [private]
 

Definition at line 83 of file Locator_XMLHandler.h.

Referenced by startElement().

const char * Locator_XMLHandler::ENVIRONMENT_TAG = "EnvironmentVariables" [static]
 

Definition at line 11 of file Locator_XMLHandler.cpp.

Referenced by startElement().

ACE_CString Locator_XMLHandler::partial_ior_ [private]
 

Definition at line 81 of file Locator_XMLHandler.h.

Referenced by startElement().

const char * Locator_XMLHandler::ROOT_TAG = "ImplementationRepository" [static]
 

Definition at line 8 of file Locator_XMLHandler.cpp.

const char * Locator_XMLHandler::SERVER_INFO_TAG = "Servers" [static]
 

Definition at line 9 of file Locator_XMLHandler.cpp.

Referenced by endElement(), and startElement().

ACE_CString Locator_XMLHandler::server_name_ [private]
 

Definition at line 75 of file Locator_XMLHandler.h.

Referenced by endElement(), and startElement().

ACE_CString Locator_XMLHandler::server_object_ior_ [private]
 

Definition at line 80 of file Locator_XMLHandler.h.

Referenced by startElement().

int Locator_XMLHandler::start_limit_ [private]
 

Definition at line 82 of file Locator_XMLHandler.h.

Referenced by startElement().

ACE_CString Locator_XMLHandler::working_dir_ [private]
 

Definition at line 79 of file Locator_XMLHandler.h.

Referenced by startElement().


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 15:55:58 2008 for TAO_Implementation_Repository by doxygen 1.3.6