iterates services in ServiceGroup, starting adaptation launchers More...

#include <Iterator.h>

Inheritance diagram for Adaptation::Iterator:
Collaboration diagram for Adaptation::Iterator:

Public Types

typedef CbcPointer< AsyncJobPointer
 

Public Member Functions

 Iterator (Http::Message *virginHeader, HttpRequest *virginCause, const AccessLogEntryPointer &, const Adaptation::ServiceGroupPointer &aGroup)
 
 ~Iterator () override
 
void noteInitiatorAborted () override
 
void noteAdaptationAnswer (const Answer &answer) override
 
void initiator (const CbcPointer< Initiator > &i)
 sets initiator More...
 
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
 
virtual void noteAdaptationAclCheckDone (Adaptation::ServiceGroupPointer group)
 

Static Public Member Functions

static void Start (const Pointer &job)
 
static void RegisterWithCacheManager ()
 

Public Attributes

const InstanceId< AsyncJobid
 job identifier More...
 

Protected Member Functions

void start () override
 called by AsyncStart; do not call directly More...
 
bool doneAll () const override
 whether positive goal has been reached More...
 
void swanSong () override
 
void step ()
 launches adaptation for the service selected by the plan More...
 
bool updatePlan (bool adopt)
 replace the current group and plan with service-proposed ones if needed More...
 
ServiceFilter filter () const
 creates service filter for the current step More...
 
void handleAdaptedHeader (Http::Message *msg)
 
void handleAdaptationBlock (const Answer &answer)
 
void handleAdaptationError (bool final)
 
void sendAnswer (const Answer &answer)
 
void tellQueryAborted (bool final)
 
void clearInitiator ()
 
const char * status () const override
 internal cleanup; do not call directly More...
 
void deleteThis (const char *aReason)
 
void mustStop (const char *aReason)
 
bool done () const
 the job is destroyed in callEnd() when done() More...
 
CbcPointer< InitiateinitiateAdaptation (Initiate *x)
 < starts freshly created initiate and returns a safe pointer to it More...
 
void clearAdaptation (CbcPointer< Initiate > &x)
 clears the pointer (does not call announceInitiatorAbort) More...
 
void announceInitiatorAbort (CbcPointer< Initiate > &x)
 inform the transaction about abnormal termination and clear the pointer More...
 
bool initiated (const CbcPointer< AsyncJob > &job) const
 Must(initiated(initiate)) instead of Must(initiate.set()), for clarity. More...
 

Static Protected Member Functions

static void ReportAllJobs (StoreEntry *)
 writes a cache manager report about all jobs existing in this worker More...
 

Protected Attributes

ServiceGroupPointer theGroup
 the service group we are iterating More...
 
ServicePlan thePlan
 which services to use and in what order More...
 
Http::MessagetheMsg
 the message being adapted (virgin for each step) More...
 
HttpRequesttheCause
 the cause of the original virgin message More...
 
AccessLogEntryPointer al
 info for the future access.log entry More...
 
CbcPointer< Adaptation::InitiatetheLauncher
 current transaction launcher More...
 
int iterations
 number of steps initiated More...
 
bool adapted
 whether the virgin message has been replaced More...
 
CbcPointer< InitiatortheInitiator
 
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...
 

Private Member Functions

 CBDATA_CHILD (Iterator)
 
virtual void finalizedInCbdataChild ()=0
 hack: ensure CBDATA_CHILD() after a toCbdata()-defining CBDATA_INTERMEDIATE() More...
 

Detailed Description

Definition at line 31 of file Iterator.h.

Member Typedef Documentation

◆ Pointer

Definition at line 34 of file AsyncJob.h.

Constructor & Destructor Documentation

◆ Iterator()

Adaptation::Iterator::Iterator ( Http::Message virginHeader,
HttpRequest virginCause,
const AccessLogEntryPointer alp,
const Adaptation::ServiceGroupPointer aGroup 
)

Definition at line 22 of file Iterator.cc.

References HTTPMSGLOCK(), theCause, and theMsg.

◆ ~Iterator()

Adaptation::Iterator::~Iterator ( )
override

Definition at line 43 of file Iterator.cc.

References assert, and HTTPMSGUNLOCK().

Member Function Documentation

◆ announceInitiatorAbort()

void Adaptation::Initiator::announceInitiatorAbort ( CbcPointer< Initiate > &  x)
protectedinherited

Definition at line 38 of file Initiator.cc.

References CallJobHere.

Referenced by ClientHttpRequest::~ClientHttpRequest(), and Client::cleanAdaptation().

◆ callEnd()

void AsyncJob::callEnd ( )
virtualinherited

◆ callException()

◆ callStart()

void AsyncJob::callStart ( AsyncCall call)
inherited

◆ canBeCalled()

bool AsyncJob::canBeCalled ( AsyncCall call) const
inherited

Definition at line 117 of file AsyncJob.cc.

References AsyncCall::cancel(), debugs, and AsyncJob::inCall.

◆ CBDATA_CHILD()

Adaptation::Iterator::CBDATA_CHILD ( Iterator  )
private

◆ clearAdaptation()

void Adaptation::Initiator::clearAdaptation ( CbcPointer< Initiate > &  x)
protectedinherited

◆ clearInitiator()

void Adaptation::Initiate::clearInitiator ( )
protectedinherited

Definition at line 74 of file Initiate.cc.

◆ deleteThis()

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

◆ done()

bool AsyncJob::done ( ) const
protectedinherited

◆ doneAll()

bool Adaptation::Iterator::doneAll ( ) const
overrideprotectedvirtual

Reimplemented from AsyncJob.

Definition at line 210 of file Iterator.cc.

References AsyncJob::doneAll().

◆ filter()

Adaptation::ServiceFilter Adaptation::Iterator::filter ( ) const
protected

◆ finalizedInCbdataChild()

virtual void CbdataParent::finalizedInCbdataChild ( )
privatepure virtualinherited

◆ handleAdaptationBlock()

void Adaptation::Iterator::handleAdaptationBlock ( const Answer answer)
protected

Definition at line 166 of file Iterator.cc.

References debugs.

◆ handleAdaptationError()

void Adaptation::Iterator::handleAdaptationError ( bool  final)
protected

Definition at line 175 of file Iterator.cc.

References debugs, Adaptation::Answer::Forward(), and Must.

◆ handleAdaptedHeader()

void Adaptation::Iterator::handleAdaptedHeader ( Http::Message msg)
protected

Definition at line 133 of file Iterator.cc.

References debugs, HTTPMSGLOCK(), HTTPMSGUNLOCK(), and Must.

◆ handleStopRequest()

void AsyncJob::handleStopRequest ( )
inlineinherited

Definition at line 73 of file AsyncJob.h.

References AsyncJob::mustStop().

◆ initiateAdaptation()

CbcPointer< Adaptation::Initiate > Adaptation::Initiator::initiateAdaptation ( Initiate x)
protectedinherited

◆ initiated()

bool Adaptation::Initiator::initiated ( const CbcPointer< AsyncJob > &  job) const
inlineprotectedinherited

Definition at line 52 of file Initiator.h.

References CbcPointer< Cbc >::set().

Referenced by ClientHttpRequest::startAdaptation(), and Client::startAdaptation().

◆ initiator()

void Adaptation::Initiate::initiator ( const CbcPointer< Initiator > &  i)
inherited

Definition at line 54 of file Initiate.cc.

References Must, and CbcPointer< Cbc >::valid().

Referenced by Adaptation::Initiator::initiateAdaptation().

◆ mustStop()

◆ noteAdaptationAclCheckDone()

void Adaptation::Initiator::noteAdaptationAclCheckDone ( Adaptation::ServiceGroupPointer  group)
virtualinherited

AccessCheck calls this back with a possibly nil service group to signal whether adaptation is needed and where it should start.

Reimplemented in Client, and ClientHttpRequest.

Definition at line 17 of file Initiator.cc.

References Must.

◆ noteAdaptationAnswer()

void Adaptation::Iterator::noteAdaptationAnswer ( const Answer answer)
overridevirtual

called with the initial adaptation decision (adapt, block, error); virgin and/or adapted body transmission may continue after this

Implements Adaptation::Initiator.

Definition at line 115 of file Iterator.cc.

References Adaptation::Answer::akBlock, Adaptation::Answer::akError, Adaptation::Answer::akForward, Adaptation::Answer::final, RefCount< C >::getRaw(), Adaptation::Answer::kind, and Adaptation::Answer::message.

◆ noteInitiatorAborted()

void Adaptation::Iterator::noteInitiatorAborted ( )
overridevirtual

Implements Adaptation::Initiate.

Definition at line 159 of file Iterator.cc.

◆ RegisterWithCacheManager()

void AsyncJob::RegisterWithCacheManager ( )
staticinherited

Definition at line 215 of file AsyncJob.cc.

References Mgr::RegisterAction(), and AsyncJob::ReportAllJobs().

Referenced by mainInitialize().

◆ ReportAllJobs()

void AsyncJob::ReportAllJobs ( StoreEntry e)
staticprotectedinherited

Definition at line 198 of file AsyncJob.cc.

References AllJobs().

Referenced by AsyncJob::RegisterWithCacheManager().

◆ sendAnswer()

void Adaptation::Initiate::sendAnswer ( const Answer answer)
protectedinherited

Definition at line 79 of file Initiate.cc.

References Adaptation::Initiator::noteAdaptationAnswer(), and ScheduleCallHere.

◆ start()

void Adaptation::Iterator::start ( )
overrideprotectedvirtual

◆ Start()

◆ status()

const char * Adaptation::Initiate::status ( ) const
overrideprotectedvirtualinherited

for debugging, starts with space

Reimplemented from AsyncJob.

Definition at line 92 of file Initiate.cc.

References AsyncJob::status().

◆ step()

◆ swanSong()

void Adaptation::Iterator::swanSong ( )
overrideprotectedvirtual

Reimplemented from Adaptation::Initiate.

Definition at line 215 of file Iterator.cc.

References Adaptation::Initiate::swanSong().

◆ tellQueryAborted()

void Adaptation::Initiate::tellQueryAborted ( bool  final)
protectedinherited

Definition at line 87 of file Initiate.cc.

References Adaptation::Answer::Error().

◆ toCbdata()

virtual void * CbdataParent::toCbdata ( )
pure virtualinherited

◆ updatePlan()

Member Data Documentation

◆ adapted

bool Adaptation::Iterator::adapted
protected

Definition at line 73 of file Iterator.h.

◆ al

AccessLogEntryPointer Adaptation::Iterator::al
protected

Definition at line 70 of file Iterator.h.

◆ id

const InstanceId<AsyncJob> AsyncJob::id
inherited

Definition at line 75 of file AsyncJob.h.

◆ inCall

AsyncCall::Pointer AsyncJob::inCall
protectedinherited

◆ iterations

int Adaptation::Iterator::iterations
protected

Definition at line 72 of file Iterator.h.

◆ started_

bool AsyncJob::started_ = false
protectedinherited

Definition at line 88 of file AsyncJob.h.

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

◆ stopReason

const char* AsyncJob::stopReason
protectedinherited

◆ swanSang_

bool AsyncJob::swanSang_ = false
protectedinherited

Definition at line 89 of file AsyncJob.h.

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

◆ theCause

HttpRequest* Adaptation::Iterator::theCause
protected

Definition at line 69 of file Iterator.h.

Referenced by Iterator().

◆ theGroup

ServiceGroupPointer Adaptation::Iterator::theGroup
protected

Definition at line 66 of file Iterator.h.

◆ theInitiator

CbcPointer<Initiator> Adaptation::Initiate::theInitiator
protectedinherited

Definition at line 51 of file Initiate.h.

◆ theLauncher

CbcPointer<Adaptation::Initiate> Adaptation::Iterator::theLauncher
protected

Definition at line 71 of file Iterator.h.

◆ theMsg

Http::Message* Adaptation::Iterator::theMsg
protected

Definition at line 68 of file Iterator.h.

Referenced by Iterator().

◆ thePlan

ServicePlan Adaptation::Iterator::thePlan
protected

Definition at line 67 of file Iterator.h.

◆ typeName


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors