Loading...
Searching...
No Matches
XrdCmsJob Class Reference

`#include <XrdCmsJob.hh>`

Inheritance diagram for XrdCmsJob:
Collaboration diagram for XrdCmsJob:

## Public Member Functions

| XrdCmsJob ()
| ~XrdCmsJob ()
void | DoIt ()
void | Recycle ()
Public Member Functions inherited from XrdJob
| XrdJob (const char *desc="")
virtual | ~XrdJob ()

## Static Public Member Functions

static XrdCmsJob * | Alloc (XrdCmsProtocol *, XrdCmsRRData *)

## Additional Inherited Members

Public Attributes inherited from XrdJob
const char * | Comment
XrdJob * | NextJob

## Detailed Description

Definition at line 42 of file XrdCmsJob.hh.

## Constructor & Destructor Documentation

## XrdCmsJob()

XrdCmsJob::XrdCmsJob | ( |  | ) |

inline

Definition at line 52 of file XrdCmsJob.hh.

: XrdJob("cms request job"), JobLink(0) {}
XrdJob::XrdJob
XrdJob(const char *desc="")
Definition XrdJob.hh:51

References XrdJob::XrdJob().

Referenced by Alloc().

Here is the call graph for this function:
Here is the caller graph for this function:

## ~XrdCmsJob()

XrdCmsJob::~XrdCmsJob | ( |  | ) |

inline

Definition at line 53 of file XrdCmsJob.hh.

{}

## Member Function Documentation

## Alloc()

XrdCmsJob * XrdCmsJob::Alloc | ( | XrdCmsProtocol * | Proto,
|  | XrdCmsRRData * | Data )

static

Definition at line 64 of file XrdCmsJob.cc.

{
XrdCmsJob *jp;
// Grab a protocol object and, if none, return a new one
//
JobMutex.Lock();
if ((jp = JobStack)) JobStack = jp->JobLink;
else jp = new XrdCmsJob();
JobMutex.UnLock();
// Copy relevant sections to the newly allocated protocol object
//
if (jp)
{jp->theProto = Proto;
jp->theData = Data;
jp->Comment = Proto->myRole;
Proto->Link->setRef(1);
} else Say.Emsg("Job","No more job objects to serve",Proto->Link->Name());
// All done
//
return jp;
}
XrdCmsJob::XrdCmsJob
XrdCmsJob()
Definition XrdCmsJob.hh:52
XrdJob::Comment
const char * Comment
Definition XrdJob.hh:47
XrdLink::setRef
void setRef(int cnt)
Definition XrdLink.cc:455
XrdLink::Name
const char * Name() const
Definition XrdLink.cc:262
XrdSysError::Emsg
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
Definition XrdSysError.cc:95
XrdCms::Say
XrdSysError Say
Definition XrdCmsManager.cc:62

References XrdCmsJob(), XrdJob::Comment, XrdLink::Name(), XrdCms::Say, and XrdLink::setRef().

Here is the call graph for this function:

## DoIt()

void XrdCmsJob::DoIt | ( |  | ) |

virtual

Implements XrdJob.

Definition at line 93 of file XrdCmsJob.cc.

{
int rc;
// Simply execute the method on the data. If operation started and we have to
// wait foir it, simply reschedule ourselves for a later time.
//
if ((rc = theProto->Execute(*theData)))
if (rc == -EINPROGRESS)
{Sched->Schedule((XrdJob *)this, theData->waitVal+time(0)); return;}
theProto->Ref(-1);
Recycle();
}
XrdCmsJob::Recycle
void Recycle()
Definition XrdCmsJob.cc:111
XrdScheduler::Schedule
void Schedule(XrdJob *jp)
Definition XrdScheduler.cc:373
XrdCms::Sched
XrdScheduler * Sched
Definition XrdCmsConfig.cc:114

References XrdJob::XrdJob(), Recycle(), and XrdCms::Sched.

Here is the call graph for this function:

## Recycle()

void XrdCmsJob::Recycle | ( |  | ) |

Definition at line 111 of file XrdCmsJob.cc.

{
// Dereference the link at this point
//
theProto->Link->setRef(-1);
// Release the data buffer
//
if (theData) {XrdCmsRRData::Objectify(theData); theData = 0;}
// Push ourselves on the stack
//
JobMutex.Lock();
JobLink = JobStack;
JobStack = this;
JobMutex.UnLock();
}
XrdCmsRRData::Objectify
static XrdCmsRRData * Objectify(XrdCmsRRData *op=0)
Definition XrdCmsRRData.cc:68

References XrdCmsRRData::Objectify().

Referenced by DoIt().

Here is the call graph for this function:
Here is the caller graph for this function:

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

- XrdCmsJob.hh
- XrdCmsJob.cc