#include <BESRequestHandlerList.h>
Inheritance diagram for BESRequestHandlerList:
Public Types | |
typedef map< string, BESRequestHandler * >::const_iterator | Handler_citer |
typedef map< string, BESRequestHandler * >::iterator | Handler_iter |
Public Member Functions | |
virtual bool | add_handler (const string &handler_name, BESRequestHandler *handler) |
add a request handler to the list of registered handlers for this server | |
virtual void | dump (ostream &strm) const |
dumps information about this object | |
virtual void | execute_all (BESDataHandlerInterface &dhi) |
for all of the registered request handlers, execute the given request | |
virtual void | execute_current (BESDataHandlerInterface &dhi) |
Execute a single method for the current container that will fill in the response object rather than iterating over the list of containers or request handlers. | |
virtual void | execute_each (BESDataHandlerInterface &dhi) |
for each container in the given data handler interface, execute the given request | |
virtual void | execute_once (BESDataHandlerInterface &dhi) |
Execute a single method that will fill in the response object rather than iterating over the list of containers or request handlers. | |
virtual BESRequestHandler * | find_handler (const string &handler_name) |
find and return the specified request handler | |
virtual Handler_citer | get_first_handler () |
return an iterator pointing to the first request handler in the list | |
virtual string | get_handler_names () |
Returns a comma separated string of request handlers registered with the server. | |
virtual Handler_citer | get_last_handler () |
return a constant iterator pointing to the end of the list | |
virtual BESRequestHandler * | remove_handler (const string &handler_name) |
remove and return the specified request handler | |
virtual | ~BESRequestHandlerList (void) |
Static Public Member Functions | |
static BESRequestHandlerList * | TheList () |
Protected Member Functions | |
BESRequestHandlerList (void) |
For a type of data to be handled by the BES the data type must registered a request handler with the server. This request handler knows how to fill in specific response objects, such as DAS, DDS, help, version, etc... The request handlers are registered with this request handler list.
Definition at line 54 of file BESRequestHandlerList.h.
typedef map< string, BESRequestHandler * >::const_iterator BESRequestHandlerList::Handler_citer |
Definition at line 64 of file BESRequestHandlerList.h.
typedef map< string, BESRequestHandler * >::iterator BESRequestHandlerList::Handler_iter |
Definition at line 65 of file BESRequestHandlerList.h.
BESRequestHandlerList::BESRequestHandlerList | ( | void | ) | [inline, protected] |
Definition at line 60 of file BESRequestHandlerList.h.
virtual BESRequestHandlerList::~BESRequestHandlerList | ( | void | ) | [inline, virtual] |
Definition at line 62 of file BESRequestHandlerList.h.
bool BESRequestHandlerList::add_handler | ( | const string & | handler_name, | |
BESRequestHandler * | handler_object | |||
) | [virtual] |
add a request handler to the list of registered handlers for this server
handler_name | name of the data type handled by this request handler | |
handler_object | the request handler object that knows how to fill in specific response objects |
Definition at line 50 of file BESRequestHandlerList.cc.
References find_handler().
Referenced by BESDapModule::initialize().
Here is the call graph for this function:
void BESRequestHandlerList::dump | ( | ostream & | strm | ) | const [virtual] |
dumps information about this object
Displays the pointer value of this instance along with information about each of the registered request handlers.
strm | C++ i/o stream to dump the information to |
Implements BESObj.
Definition at line 306 of file BESRequestHandlerList.cc.
References BESIndent::Indent(), BESIndent::LMarg(), and BESIndent::UnIndent().
Here is the call graph for this function:
void BESRequestHandlerList::execute_all | ( | BESDataHandlerInterface & | dhi | ) | [virtual] |
for all of the registered request handlers, execute the given request
In some cases, such as a version or help request, it is necessary to iterate over all of the registered request handlers to fill in the response object. If a request handler does not know how to fill in the response object, i.e. doesn't handle the response type, then simply move on to the next. No exception is thrown in this case.
dhi | data handler interface that contains the necessary information to fill in the response object. |
Definition at line 199 of file BESRequestHandlerList.cc.
References BESDataHandlerInterface::action, get_first_handler(), and get_last_handler().
Referenced by BESVersionResponseHandler::execute(), and BESHelpResponseHandler::execute().
Here is the call graph for this function:
void BESRequestHandlerList::execute_current | ( | BESDataHandlerInterface & | dhi | ) | [virtual] |
Execute a single method for the current container that will fill in the response object rather than iterating over the list of containers or request handlers.
The request is passed * off to the request handler for the current container in the data handler interface.
dhi | data handler interface that contains the necessary information to fill in the response object |
BESInternalError | if the request handler cannot be found for the current containers data type or if the request handler cannot fill in the specified response object. |
Definition at line 256 of file BESRequestHandlerList.cc.
References BESDataHandlerInterface::action, BES_REQUEST_HANDLER_CATCH_ALL, BESDataHandlerInterface::container, BESRequestHandler::find_handler(), find_handler(), BESContainer::get_container_type(), and REAL_NAME_LIST.
Referenced by execute_each(), and execute_once().
Here is the call graph for this function:
void BESRequestHandlerList::execute_each | ( | BESDataHandlerInterface & | dhi | ) | [virtual] |
for each container in the given data handler interface, execute the given request
For some response objects it is necessary to iterate over all of the containers listed in the specified data handler interface. For each container, get the type of data represented by that container, find the request handler for that data type, find the method within that request handler that knows how to handle the response object to be filled in, and execute that method.
dhi | the data handler interface that contains the list of containers to be iterated over |
BESInternalError | if any one of the request handlers does not know how to fill in the specified response object or if any one of the request handlers does not exist. |
Definition at line 173 of file BESRequestHandlerList.cc.
References BESDataHandlerInterface::container, execute_current(), BESDataHandlerInterface::first_container(), and BESDataHandlerInterface::next_container().
Referenced by BESDDXResponseHandler::execute(), BESDDSResponseHandler::execute(), BESDataResponseHandler::execute(), BESDataDDXResponseHandler::execute(), and BESDASResponseHandler::execute().
Here is the call graph for this function:
void BESRequestHandlerList::execute_once | ( | BESDataHandlerInterface & | dhi | ) | [virtual] |
Execute a single method that will fill in the response object rather than iterating over the list of containers or request handlers.
This method is for requests of a single type of data. The request is passed off to the request handler for the first container in the data handler interface. It is up to this request handlers method for the specified response object type to fill in the response object. It can iterate over the containers in the data handler interface, for example.
dhi | data handler interface that contains the necessary information to fill in the response object |
BESInternalError | if the request handler cannot be found for the first containers data type or if the request handler cannot fill in the specified response object. |
Definition at line 233 of file BESRequestHandlerList.cc.
References execute_current(), and BESDataHandlerInterface::first_container().
Here is the call graph for this function:
BESRequestHandler * BESRequestHandlerList::find_handler | ( | const string & | handler_name | ) | [virtual] |
find and return the specified request handler
handler_name | name of the data type request handler |
Definition at line 94 of file BESRequestHandlerList.cc.
Referenced by add_handler(), and execute_current().
BESRequestHandlerList::Handler_citer BESRequestHandlerList::get_first_handler | ( | ) | [virtual] |
return an iterator pointing to the first request handler in the list
Definition at line 113 of file BESRequestHandlerList.cc.
Referenced by execute_all().
string BESRequestHandlerList::get_handler_names | ( | ) | [virtual] |
Returns a comma separated string of request handlers registered with the server.
Definition at line 137 of file BESRequestHandlerList.cc.
BESRequestHandlerList::Handler_citer BESRequestHandlerList::get_last_handler | ( | ) | [virtual] |
return a constant iterator pointing to the end of the list
Definition at line 124 of file BESRequestHandlerList.cc.
Referenced by execute_all().
BESRequestHandler * BESRequestHandlerList::remove_handler | ( | const string & | handler_name | ) | [virtual] |
remove and return the specified request handler
Finds, removes and returns the specified request handler. if the handler exists then it is removed from the list, but not deleted. Deleting the request handler is the responsability of the caller. The request handler is then returned to the caller. If not found, NULL is returned
handler_name | name of the data type request handler to be removed and returned |
Definition at line 74 of file BESRequestHandlerList.cc.
Referenced by CSVModule::terminate(), and BESDapModule::terminate().
BESRequestHandlerList * BESRequestHandlerList::TheList | ( | ) | [static] |
Definition at line 332 of file BESRequestHandlerList.cc.
Referenced by BESVersionResponseHandler::execute(), BESHelpResponseHandler::execute(), BESDDXResponseHandler::execute(), BESDDSResponseHandler::execute(), BESDataResponseHandler::execute(), BESDataDDXResponseHandler::execute(), BESDASResponseHandler::execute(), CSVModule::initialize(), BESDapModule::initialize(), CSVModule::terminate(), and BESDapModule::terminate().