|
xrootd
|
A hub for dispatching and receiving messages. More...
#include <XrdClPostMaster.hh>

Public Member Functions | |
| PostMaster () | |
| Constructor. More... | |
| virtual | ~PostMaster () |
| Destructor. More... | |
| bool | Initialize () |
| Initializer. More... | |
| bool | Finalize () |
| Finalizer. More... | |
| bool | Start () |
| Start the post master. More... | |
| bool | Stop () |
| Stop the postmaster. More... | |
| bool | Reinitialize () |
| Reinitialize after fork. More... | |
| Status | Send (const URL &url, Message *msg, bool stateful, time_t expires) |
| Status | Send (const URL &url, Message *msg, OutgoingMsgHandler *handler, bool stateful, time_t expires) |
| Status | Receive (const URL &url, Message *&msg, MessageFilter *filter, time_t expires) |
| Status | Receive (const URL &url, IncomingMsgHandler *handler, time_t expires) |
| Status | QueryTransport (const URL &url, uint16_t query, AnyObject &result) |
| Status | RegisterEventHandler (const URL &url, ChannelEventHandler *handler) |
| Register channel event handler. More... | |
| Status | RemoveEventHandler (const URL &url, ChannelEventHandler *handler) |
| Remove a channel event handler. More... | |
| TaskManager * | GetTaskManager () |
| Get the task manager object user by the post master. More... | |
| JobManager * | GetJobManager () |
| Get the job manager object user by the post master. More... | |
Private Types | |
| typedef std::map< std::string, Channel * > | ChannelMap |
Private Member Functions | |
| Channel * | GetChannel (const URL &url) |
Private Attributes | |
| Poller * | pPoller |
| TaskManager * | pTaskManager |
| ChannelMap | pChannelMap |
| XrdSysMutex | pChannelMapMutex |
| bool | pInitialized |
| JobManager * | pJobManager |
A hub for dispatching and receiving messages.
|
private |
| XrdCl::PostMaster::PostMaster | ( | ) |
Constructor.
References XrdCl::DefaultWorkerThreads, XrdCl::DefaultEnv::GetEnv(), XrdCl::Env::GetInt(), pJobManager, and pTaskManager.
|
virtual |
Destructor.
References pJobManager, pPoller, and pTaskManager.
| bool XrdCl::PostMaster::Finalize | ( | ) |
Finalizer.
References XrdCl::JobManager::Finalize(), XrdCl::Poller::Finalize(), pChannelMap, pInitialized, pJobManager, and pPoller.
Referenced by XrdCl::ForkHandler::Child(), XrdCl::DefaultEnv::Finalize(), and XrdCl::DefaultEnv::GetPostMaster().
References XrdCl::Log::Error(), XrdCl::TransportManager::GetHandler(), XrdCl::URL::GetHostId(), XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetProtocol(), XrdCl::DefaultEnv::GetTransportManager(), pChannelMap, pChannelMapMutex, pJobManager, XrdCl::PostMasterMsg, pPoller, and pTaskManager.
Referenced by QueryTransport(), Receive(), RegisterEventHandler(), RemoveEventHandler(), and Send().
|
inline |
Get the job manager object user by the post master.
References pJobManager.
Referenced by XrdCl::FileStateHandler::TimeOutRequests().
|
inline |
Get the task manager object user by the post master.
References pTaskManager.
Referenced by XrdCl::ForkHandler::Child(), XrdCl::DefaultEnv::GetPostMaster(), and XrdCl::XRootDMsgHandler::Process().
| bool XrdCl::PostMaster::Initialize | ( | ) |
Initializer.
References XrdCl::PollerFactory::CreatePoller(), XrdCl::DefaultPollerPreference, XrdCl::DefaultEnv::GetEnv(), XrdCl::Env::GetString(), XrdCl::JobManager::Initialize(), XrdCl::Poller::Initialize(), pInitialized, pJobManager, and pPoller.
Referenced by XrdCl::ForkHandler::Child(), PostMasterTest::FunctionalTest(), XrdCl::DefaultEnv::GetPostMaster(), PostMasterTest::MultiIPConnectionTest(), PostMasterTest::PingIPv6(), and PostMasterTest::ThreadingTest().
Query the transport handler for a given URL
| url | the channel to be queried |
| query | the query as defined in the TransportQuery struct or others that may be recognized by the protocol transport |
| result | the result of the query |
References XrdCl::errNotSupported, XrdCl::errUninitialized, GetChannel(), pInitialized, XrdCl::Channel::QueryTransport(), XrdCl::stError, and XrdCl::stFatal.
Referenced by XrdCl::XRootDMsgHandler::Process(), XrdCl::XRootDMsgHandler::RewriteRequestRedirect(), and XrdCl::MessageUtils::SendMessage().
| Status XrdCl::PostMaster::Receive | ( | const URL & | url, |
| Message *& | msg, | ||
| MessageFilter * | filter, | ||
| time_t | expires | ||
| ) |
Synchronously receive a message - blocks until a message matching a filter is found in the incoming queue or the timeout passes
| url | sender of the message |
| msg | reference to a message pointer, the pointer will point to the received message |
| filter | filter object defining what to look for |
| expires | expiration timestamp |
References XrdCl::errNotSupported, XrdCl::errUninitialized, GetChannel(), pInitialized, XrdCl::Channel::Receive(), XrdCl::stError, and XrdCl::stFatal.
Referenced by XrdCl::XRootDMsgHandler::OnStatusReady().
| Status XrdCl::PostMaster::Receive | ( | const URL & | url, |
| IncomingMsgHandler * | handler, | ||
| time_t | expires | ||
| ) |
Listen to incoming messages, the listener is notified when a new message arrives and when the timeout passes
| url | sender of the message |
| handler | handler to be notified about new messages |
| expires | expiration timestamp |
References XrdCl::errNotSupported, XrdCl::errUninitialized, GetChannel(), pInitialized, XrdCl::Channel::Receive(), XrdCl::stError, and XrdCl::stFatal.
| Status XrdCl::PostMaster::RegisterEventHandler | ( | const URL & | url, |
| ChannelEventHandler * | handler | ||
| ) |
Register channel event handler.
References XrdCl::errNotSupported, XrdCl::errUninitialized, GetChannel(), pInitialized, XrdCl::Channel::RegisterEventHandler(), XrdCl::stError, and XrdCl::stFatal.
| bool XrdCl::PostMaster::Reinitialize | ( | ) |
Reinitialize after fork.
| Status XrdCl::PostMaster::RemoveEventHandler | ( | const URL & | url, |
| ChannelEventHandler * | handler | ||
| ) |
Remove a channel event handler.
References XrdCl::errNotSupported, XrdCl::errUninitialized, GetChannel(), pInitialized, XrdCl::Channel::RemoveEventHandler(), XrdCl::stError, and XrdCl::stFatal.
Send a message synchronously - synchronously means that it will block until the message is written to a socket
DEADLOCK WARNING: no lock should be taken while calling this method that are used in the callback as well.
| url | recipient of the message |
| msg | message to be sent |
| statful | physical stream disconnection causes an error |
| expires | unix timestamp after which a failure should be reported if sending was unsuccessful |
References XrdCl::errNotSupported, XrdCl::errUninitialized, GetChannel(), pInitialized, XrdCl::Channel::Send(), XrdCl::stError, and XrdCl::stFatal.
Referenced by XrdCl::XRootDMsgHandler::RetryAtServer(), and XrdCl::MessageUtils::SendMessage().
| Status XrdCl::PostMaster::Send | ( | const URL & | url, |
| Message * | msg, | ||
| OutgoingMsgHandler * | handler, | ||
| bool | stateful, | ||
| time_t | expires | ||
| ) |
Send the message asynchronously - the message is inserted into the send queue and a listener is called when the message is succesfsully pushed through the wire or when the timeout elapses
DEADLOCK WARNING: no lock should be taken while calling this method that are used in the callback as well.
| url | recipient of the message |
| msg | message to be sent |
| expires | unix timestamp after which a failure is reported to the handler |
| handler | handler will be notified about the status |
| stateful | physical stream disconnection causes an error |
References XrdCl::errNotSupported, XrdCl::errUninitialized, GetChannel(), pInitialized, XrdCl::Channel::Send(), XrdCl::stError, and XrdCl::stFatal.
| bool XrdCl::PostMaster::Start | ( | ) |
Start the post master.
References pInitialized, pJobManager, pPoller, pTaskManager, XrdCl::JobManager::Start(), XrdCl::TaskManager::Start(), XrdCl::Poller::Start(), XrdCl::TaskManager::Stop(), and XrdCl::Poller::Stop().
Referenced by XrdCl::ForkHandler::Child(), XrdCl::DefaultEnv::GetPostMaster(), and XrdCl::ForkHandler::Parent().
| bool XrdCl::PostMaster::Stop | ( | ) |
Stop the postmaster.
References pInitialized, pJobManager, pPoller, pTaskManager, XrdCl::JobManager::Stop(), XrdCl::TaskManager::Stop(), and XrdCl::Poller::Stop().
Referenced by XrdCl::DefaultEnv::Finalize(), and XrdCl::ForkHandler::Prepare().
|
private |
Referenced by Finalize(), and GetChannel().
|
private |
Referenced by GetChannel().
|
private |
Referenced by Finalize(), Initialize(), QueryTransport(), Receive(), RegisterEventHandler(), RemoveEventHandler(), Send(), Start(), and Stop().
|
private |
Referenced by Finalize(), GetChannel(), GetJobManager(), Initialize(), PostMaster(), Start(), Stop(), and ~PostMaster().
|
private |
Referenced by Finalize(), GetChannel(), Initialize(), Start(), Stop(), and ~PostMaster().
|
private |
Referenced by GetChannel(), GetTaskManager(), PostMaster(), Start(), Stop(), and ~PostMaster().
1.8.3.1