Loading...
Searching...
No Matches
XrdXrootdCBJob Class Reference
Inheritance diagram for XrdXrootdCBJob:
Collaboration diagram for XrdXrootdCBJob:

## Public Member Functions

| XrdXrootdCBJob (XrdXrootdCallBack *cbp, XrdOucErrInfo *erp, const char *path, int rval)
| ~XrdXrootdCBJob ()
void | DoIt ()
void | Recycle ()

## Static Public Member Functions

static XrdXrootdCBJob * | Alloc (XrdXrootdCallBack *cbF, XrdOucErrInfo *erp, const char *Path, int rval)

## Detailed Description

Definition at line 54 of file XrdXrootdCallBack.cc.

## Constructor & Destructor Documentation

## XrdXrootdCBJob()

XrdXrootdCBJob::XrdXrootdCBJob | ( | XrdXrootdCallBack * | cbp,
|  | XrdOucErrInfo * | erp,
|  | const char * | path,
|  | int | rval )

inline

Definition at line 69 of file XrdXrootdCallBack.cc.

: XrdJob("async response"),
cbFunc(cbp), eInfo(erp), Path(path),
Result(rval) {}
Path
XrdOucString Path
Definition XrdSecpwdSrvAdmin.cc:160
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:

## ~XrdXrootdCBJob()

XrdXrootdCBJob::~XrdXrootdCBJob | ( |  | ) |

inline

Definition at line 77 of file XrdXrootdCallBack.cc.

{}

## Member Function Documentation

## Alloc()

XrdXrootdCBJob * XrdXrootdCBJob::Alloc | ( | XrdXrootdCallBack * | cbF,
|  | XrdOucErrInfo * | erp,
|  | const char * | Path,
|  | int | rval )

static

Definition at line 116 of file XrdXrootdCallBack.cc.

{
XrdXrootdCBJob *cbj;
// Obtain a call back object by trying to avoid new()
//
myMutex.Lock();
if (!(cbj = FreeJob)) cbj = new XrdXrootdCBJob(cbF, erp, Path, rval);
else {cbj->cbFunc = cbF, cbj->eInfo = erp;
cbj->Result = rval;cbj->Path = Path;
FreeJob = cbj->Next;
}
myMutex.UnLock();
// Return the new object
//
return cbj;
}
XrdXrootdCBJob::XrdXrootdCBJob
XrdXrootdCBJob(XrdXrootdCallBack *cbp, XrdOucErrInfo *erp, const char *path, int rval)
Definition XrdXrootdCallBack.cc:69

References XrdXrootdCBJob().

Referenced by XrdXrootdCallBack::Done().

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

## DoIt()

void XrdXrootdCBJob::DoIt | ( |  | ) |

virtual

Implements XrdJob.

Definition at line 142 of file XrdXrootdCallBack.cc.

{
static const char *TraceID = "DoIt";
XrdXrootdFile *fP = 0;
// Do some tracing here
//
TRACE(RSP, eInfo->getErrUser() <<' ' <<cbFunc->Func() <<" async callback");
// Some operations differ in the way we handle them. For instance, for open()
// if it succeeds then we must force the client to retry the open request
// because we can't attach the file to the client here. We do this by asking
// the client to wait zero seconds. Protocol demands a client retry. Close
// operations are always final and we need to do some cleanup.
//
if (*(cbFunc->Func()) == 'c') fP = DoClose(eInfo);
else if (SFS_OK == Result)
{if (*(cbFunc->Func()) == 'o')
{int rc = 0; cbFunc->sendResp(eInfo, kXR_wait, &rc);}
else {if (*(cbFunc->Func()) == 'x') DoStatx(eInfo);
cbFunc->sendResp(eInfo, kXR_ok, 0, eInfo->getErrText(),
eInfo->getErrTextLen());
}
}
else cbFunc->sendError(Result, eInfo, Path);
// Tell the requestor that the callback has completed
//
if (eInfo->getErrCB()) eInfo->getErrCB()->Done(Result, eInfo);
else delete eInfo;
eInfo = 0;
if (fP) delete fP;
Recycle();
}
kXR_ok
@ kXR_ok
Definition XProtocol.hh:899
kXR_wait
@ kXR_wait
Definition XProtocol.hh:905
SFS_OK
#define SFS_OK
Definition XrdSfsInterface.hh:108
TRACE
#define TRACE(act, x)
Definition XrdTrace.hh:63
XrdXrootdCBJob::Recycle
void Recycle()
Definition XrdXrootdCallBack.cc:63

References kXR_ok, kXR_wait, Recycle(), SFS_OK, and TRACE.

Here is the call graph for this function:

## Recycle()

void XrdXrootdCBJob::Recycle | ( |  | ) |

inline

Definition at line 63 of file XrdXrootdCallBack.cc.

{myMutex.Lock();
Next = FreeJob;
FreeJob = this;
myMutex.UnLock();
}

Referenced by DoIt().

Here is the caller graph for this function:

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

- XrdXrootdCallBack.cc