Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
Arc::InfoRegisterContainer Class Reference

Singleton class for scanning configuration and storing refernces to registration elements. More...

#include <InfoRegister.h>

Collaboration diagram for Arc::InfoRegisterContainer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ~InfoRegisterContainer (void)
InfoRegistraraddRegistrar (XMLNode doc)
 Adds ISISes to list of handled services.
void addService (InfoRegister *reg, const std::list< std::string > &ids, XMLNode cfg=XMLNode())
 Adds service to list of handled.
void removeService (InfoRegister *reg)
 This method must be called if service being destroyed.

Static Public Member Functions

static InfoRegisterContainerInstance (void)

Private Member Functions

 InfoRegisterContainer (void)
 InfoRegisterContainer (const InfoRegisterContainer &)

Private Attributes

std::list< InfoRegistrar * > regr_
Glib::Mutex lock_

Static Private Attributes

static InfoRegisterContainerinstance_ = NULL

Detailed Description

Singleton class for scanning configuration and storing refernces to registration elements.

Definition at line 159 of file InfoRegister.h.


Constructor & Destructor Documentation

Definition at line 92 of file InfoRegister.cpp.

                                                 {
}

Here is the caller graph for this function:

Definition at line 167 of file InfoRegister.h.

{};

Definition at line 95 of file InfoRegister.cpp.

                                                  {
    Glib::Mutex::Lock lock(lock_);
    for(std::list<InfoRegistrar*>::iterator r = regr_.begin();
                              r != regr_.end();++r) {
        delete (*r);
    };
}

Member Function Documentation

Adds ISISes to list of handled services.

Supplied configuration document is scanned for InfoRegistrar elements and those are turned into InfoRegistrar classes for handling connection to ISIS service each.

Definition at line 103 of file InfoRegister.cpp.

                                                               {
    //Glib::Mutex::Lock lock(lock_);
    InfoRegistrar* r = new InfoRegistrar(node);
    if(!(*r)) {
         delete r;
         return NULL;
    }
    regr_.push_back(r);
    CreateThreadFunction(&reg_thread, r);
    return r;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void Arc::InfoRegisterContainer::addService ( InfoRegister reg,
const std::list< std::string > &  ids,
XMLNode  cfg = XMLNode() 
)

Adds service to list of handled.

This method must be called first time after last addRegistrar was called - services will be only associated with ISISes which are already added. Argument ids contains list of ISIS identifiers to which service is associated. If ids is empty then service is associated to all ISISes currently added. If argument cfg is available and no ISISes are configured then addRegistrars is called with cfg used as configuration document.

Definition at line 115 of file InfoRegister.cpp.

                                                                                                  {
    // Add to registrars
    Glib::Mutex::Lock lock(lock_);
    for(std::list<std::string>::const_iterator i = ids.begin(); i != ids.end();++i) {
        bool id_found = false;
        for(std::list<InfoRegistrar*>::iterator r = regr_.begin(); r != regr_.end();++r) {
            if((*i) == (*r)->id()) {
                logger_.msg(VERBOSE, "InfoRegistrar id \"%s\" has been found.", (*i));
                (*r)->addService(reg, cfg);
                id_found = true;
            }
        }
        if (!id_found) {
            // id appears at first time - InfoRegistrar need to be created
            logger_.msg(VERBOSE, "InfoRegistrar id \"%s\" was not found. New registrar created", (*i));
            for(XMLNode node = cfg["InfoRegister"]["Registrar"];(bool)node;++node) {
                if ((*i) == (std::string)node["URL"]) {
                    InfoRegistrar *r = addRegistrar(node);
                    if (r != NULL) r->addService(reg, cfg);
                }
            }
        }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 87 of file InfoRegister.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

This method must be called if service being destroyed.

Definition at line 140 of file InfoRegister.cpp.

                                                           {
    // If this method is called that means service is most probably
    // being deleted.
    Glib::Mutex::Lock lock(lock_);
    for(std::list<InfoRegistrar*>::iterator r = regr_.begin();
                              r != regr_.end();++r) {
            (*r)->removeService(reg);
    };
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 161 of file InfoRegister.h.

Glib::Mutex Arc::InfoRegisterContainer::lock_ [private]

Definition at line 165 of file InfoRegister.h.

Definition at line 163 of file InfoRegister.h.


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