xrootd
|
A hub for dispatching and receiving messages. More...
#include <XrdClPostMaster.hh>
Public Member Functions | |
PostMaster () | |
Constructor. | |
virtual | ~PostMaster () |
Destructor. | |
bool | Initialize () |
Initializer. | |
bool | Finalize () |
Finalizer. | |
bool | Start () |
Start the post master. | |
bool | Stop () |
Stop the postmaster. | |
bool | Reinitialize () |
Reinitialize after fork. | |
XRootDStatus | Send (const URL &url, Message *msg, MsgHandler *handler, bool stateful, time_t expires) |
Status | Redirect (const URL &url, Message *msg, MsgHandler *handler) |
Status | QueryTransport (const URL &url, uint16_t query, AnyObject &result) |
Status | RegisterEventHandler (const URL &url, ChannelEventHandler *handler) |
Register channel event handler. | |
Status | RemoveEventHandler (const URL &url, ChannelEventHandler *handler) |
Remove a channel event handler. | |
TaskManager * | GetTaskManager () |
Get the task manager object user by the post master. | |
JobManager * | GetJobManager () |
Get the job manager object user by the post master. | |
Status | ForceDisconnect (const URL &url) |
Shut down a channel. | |
Status | ForceReconnect (const URL &url) |
Reconnect the channel. | |
uint16_t | NbConnectedStrm (const URL &url) |
Get the number of connected data streams. | |
void | SetOnDataConnectHandler (const URL &url, std::shared_ptr< Job > onConnJob) |
Set the on-connect handler for data streams. | |
void | SetOnConnectHandler (std::unique_ptr< Job > onConnJob) |
Set the global connection error handler. | |
void | SetConnectionErrorHandler (std::function< void(const URL &, const XRootDStatus &)> handler) |
Set the global on-error on-connect handler for control streams. | |
void | NotifyConnectHandler (const URL &url) |
Notify the global on-connect handler. | |
void | NotifyConnErrHandler (const URL &url, const XRootDStatus &status) |
Notify the global error connection handler. | |
void | CollapseRedirect (const URL &oldurl, const URL &newURL) |
Collapse channel URL - replace the URL of the channel. | |
void | DecFileInstCnt (const URL &url) |
Decrement file object instance count bound to this channel. | |
bool | IsRunning () |
Private Member Functions | |
Channel * | GetChannel (const URL &url) |
Private Attributes | |
std::unique_ptr< PostMasterImpl > | pImpl |
A hub for dispatching and receiving messages.
XrdCl::PostMaster::PostMaster | ( | ) |
Constructor.
|
virtual |
Destructor.
void XrdCl::PostMaster::DecFileInstCnt | ( | const URL & | url | ) |
Decrement file object instance count bound to this channel.
bool XrdCl::PostMaster::Finalize | ( | ) |
Finalizer.
JobManager * XrdCl::PostMaster::GetJobManager | ( | ) |
Get the job manager object user by the post master.
Referenced by XrdCl::Operation< HasHndl >::Run(), XrdCl::EcHandler::Schedule(), XrdCl::ZipArchive::Schedule(), and XrdCl::ParallelOperation< HasHndl >::Schedule().
TaskManager * XrdCl::PostMaster::GetTaskManager | ( | ) |
Get the task manager object user by the post master.
bool XrdCl::PostMaster::Initialize | ( | ) |
Initializer.
bool XrdCl::PostMaster::IsRunning | ( | ) |
uint16_t XrdCl::PostMaster::NbConnectedStrm | ( | const URL & | url | ) |
Get the number of connected data streams.
void XrdCl::PostMaster::NotifyConnectHandler | ( | const URL & | url | ) |
Notify the global on-connect handler.
void XrdCl::PostMaster::NotifyConnErrHandler | ( | const URL & | url, |
const XRootDStatus & | status | ||
) |
Notify the global error connection handler.
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 |
Status XrdCl::PostMaster::Redirect | ( | const URL & | url, |
Message * | msg, | ||
MsgHandler * | handler | ||
) |
Status XrdCl::PostMaster::RegisterEventHandler | ( | const URL & | url, |
ChannelEventHandler * | handler | ||
) |
Register channel event handler.
bool XrdCl::PostMaster::Reinitialize | ( | ) |
Reinitialize after fork.
Status XrdCl::PostMaster::RemoveEventHandler | ( | const URL & | url, |
ChannelEventHandler * | handler | ||
) |
Remove a channel event handler.
XRootDStatus XrdCl::PostMaster::Send | ( | const URL & | url, |
Message * | msg, | ||
MsgHandler * | 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 |
void XrdCl::PostMaster::SetConnectionErrorHandler | ( | std::function< void(const URL &, const XRootDStatus &)> | handler | ) |
Set the global on-error on-connect handler for control streams.
void XrdCl::PostMaster::SetOnConnectHandler | ( | std::unique_ptr< Job > | onConnJob | ) |
Set the global connection error handler.
void XrdCl::PostMaster::SetOnDataConnectHandler | ( | const URL & | url, |
std::shared_ptr< Job > | onConnJob | ||
) |
Set the on-connect handler for data streams.
bool XrdCl::PostMaster::Start | ( | ) |
Start the post master.
bool XrdCl::PostMaster::Stop | ( | ) |
Stop the postmaster.
|
private |