#include <AsyncJob.h>

Inheritance diagram for AsyncJob:
Collaboration diagram for AsyncJob:

Public Types

typedef CbcPointer< AsyncJobPointer
 

Public Member Functions

 AsyncJob (const char *aTypeName)
 
bool canBeCalled (AsyncCall &call) const
 whether we can be called More...
 
void callStart (AsyncCall &call)
 
virtual void callEnd ()
 called right after the called job method More...
 
virtual void callException (const std::exception &e)
 called when the job throws during an async call More...
 
void handleStopRequest ()
 process external request to terminate now (i.e. during this async call) More...
 
virtual void * toCbdata ()=0
 

Static Public Member Functions

static void Start (const Pointer &job)
 

Public Attributes

const InstanceId< AsyncJobid
 job identifier More...
 

Protected Member Functions

void deleteThis (const char *aReason)
 
void mustStop (const char *aReason)
 
bool done () const
 the job is destroyed in callEnd() when done() More...
 
virtual void start ()
 called by AsyncStart; do not call directly More...
 
virtual bool doneAll () const
 whether positive goal has been reached More...
 
virtual void swanSong ()
 
virtual const char * status () const
 internal cleanup; do not call directly More...
 
virtual ~AsyncJob ()
 

Protected Attributes

const char * stopReason
 reason for forcing done() to be true More...
 
const char * typeName
 kid (leaf) class name, for debugging More...
 
AsyncCall::Pointer inCall
 the asynchronous call being handled, if any More...
 
bool started_ = false
 Start() has finished successfully. More...
 
bool swanSang_ = false
 swanSong() was called More...
 

Detailed Description

Base class for all asynchronous jobs

Definition at line 31 of file AsyncJob.h.

Member Typedef Documentation

◆ Pointer

Definition at line 34 of file AsyncJob.h.

Constructor & Destructor Documentation

◆ AsyncJob()

AsyncJob::AsyncJob ( const char *  aTypeName)

Definition at line 30 of file AsyncJob.cc.

References debugs, and typeName.

◆ ~AsyncJob()

AsyncJob::~AsyncJob ( )
protectedvirtual

Definition at line 37 of file AsyncJob.cc.

References assert, debugs, started_, swanSang_, and typeName.

Member Function Documentation

◆ callEnd()

void AsyncJob::callEnd ( )
virtual

called right after the called job method

Reimplemented in Adaptation::Icap::Xaction.

Definition at line 137 of file AsyncJob.cc.

References assert, AsyncCall::debugLevel, debugs, AsyncCall::debugSection, done(), HERE(), inCall, NULL, started_, status(), swanSang_, swanSong(), and typeName.

Referenced by Adaptation::Icap::Xaction::callEnd(), and deleteThis().

◆ callException()

◆ callStart()

void AsyncJob::callStart ( AsyncCall call)

called just before the called method

Definition at line 115 of file AsyncJob.cc.

References cbdataReferenceValid(), AsyncCall::debugLevel, debugs, AsyncCall::debugSection, inCall, Must, status(), CbdataParent::toCbdata(), and typeName.

◆ canBeCalled()

bool AsyncJob::canBeCalled ( AsyncCall call) const

Definition at line 102 of file AsyncJob.cc.

References AsyncCall::cancel(), debugs, HERE(), inCall, and NULL.

◆ deleteThis()

void AsyncJob::deleteThis ( const char *  aReason)
protected

Definition at line 50 of file AsyncJob.cc.

References asyncCall(), callEnd(), debugs, inCall, JobMemFun(), Must, NULL, stopReason, and typeName.

Referenced by ConnStateData::connStateClosed().

◆ done()

bool AsyncJob::done ( ) const
protected

◆ doneAll()

◆ handleStopRequest()

void AsyncJob::handleStopRequest ( )
inline

Definition at line 71 of file AsyncJob.h.

References mustStop().

◆ mustStop()

◆ start()

◆ Start()

◆ status()

◆ swanSong()

◆ toCbdata()

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited

Implemented in HttpStateData, ClientHttpRequest, and BodySink.

Referenced by callException(), and callStart().

Member Data Documentation

◆ id

const InstanceId<AsyncJob> AsyncJob::id

Definition at line 73 of file AsyncJob.h.

◆ inCall

AsyncCall::Pointer AsyncJob::inCall
protected

Definition at line 81 of file AsyncJob.h.

Referenced by callEnd(), callStart(), canBeCalled(), deleteThis(), and mustStop().

◆ started_

bool AsyncJob::started_ = false
protected

Definition at line 83 of file AsyncJob.h.

Referenced by ~AsyncJob(), callEnd(), and Start().

◆ stopReason

const char* AsyncJob::stopReason
protected

Definition at line 79 of file AsyncJob.h.

Referenced by deleteThis(), done(), mustStop(), status(), and HappyConnOpener::status().

◆ swanSang_

bool AsyncJob::swanSang_ = false
protected

Definition at line 84 of file AsyncJob.h.

Referenced by ~AsyncJob(), and callEnd().

◆ typeName

const char* AsyncJob::typeName
protected

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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors