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, AccessLogEntry::Pointer &alp, const Adaptation::ServiceGroupPointer &aGroup)
 
virtual ~Iterator ()
 
void noteInitiatorAborted ()
 
virtual void noteAdaptationAnswer (const Answer &answer)
 
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...
 
virtual void * toCbdata ()=0
 
virtual void noteAdaptationAclCheckDone (Adaptation::ServiceGroupPointer group)
 

Static Public Member Functions

static Pointer Start (AsyncJob *job)
 starts a freshly created job (i.e., makes the job asynchronous) More...
 

Protected Member Functions

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 ()
 
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 ()
 
virtual const char * status () const
 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...
 

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...
 
AccessLogEntry::Pointer 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...
 
const InstanceId< AsyncJobid
 job identifier More...
 

Private Member Functions

 CBDATA_CLASS (Iterator)
 

Detailed Description

Definition at line 31 of file Iterator.h.

Member Typedef Documentation

Definition at line 34 of file AsyncJob.h.

Constructor & Destructor Documentation

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

Definition at line 22 of file Iterator.cc.

References HTTPMSGLOCK(), NULL, theCause, and theMsg.

Adaptation::Iterator::~Iterator ( )
virtual

Definition at line 43 of file Iterator.cc.

References assert, and HTTPMSGUNLOCK().

Member Function Documentation

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

Definition at line 38 of file Initiator.cc.

References CallJobHere.

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

void AsyncJob::callEnd ( )
virtualinherited
void AsyncJob::callStart ( AsyncCall call)
inherited
bool AsyncJob::canBeCalled ( AsyncCall call) const
inherited

Definition at line 101 of file AsyncJob.cc.

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

Adaptation::Iterator::CBDATA_CLASS ( Iterator  )
private
void Adaptation::Initiator::clearAdaptation ( CbcPointer< Initiate > &  x)
protectedinherited
void Adaptation::Initiate::clearInitiator ( )
protectedinherited

Definition at line 74 of file Initiate.cc.

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

Definition at line 90 of file AsyncJob.cc.

References AsyncJob::doneAll(), NULL, and AsyncJob::stopReason.

Referenced by AsyncJob::callEnd(), and Downloader::downloadFinished().

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

Reimplemented from AsyncJob.

Definition at line 210 of file Iterator.cc.

References AsyncJob::doneAll().

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

Definition at line 166 of file Iterator.cc.

References debugs, and HERE().

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

Definition at line 175 of file Iterator.cc.

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

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

Definition at line 133 of file Iterator.cc.

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

CbcPointer< Adaptation::Initiate > Adaptation::Initiator::initiateAdaptation ( Initiate x)
protectedinherited
bool Adaptation::Initiator::initiated ( const CbcPointer< AsyncJob > &  job) const
inlineprotectedinherited

Definition at line 52 of file Initiator.h.

References CbcPointer< Cbc >::set().

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

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

Definition at line 54 of file Initiate.cc.

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

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

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 ClientHttpRequest, and Client.

Definition at line 17 of file Initiator.cc.

References Must.

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

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.

void Adaptation::Iterator::noteInitiatorAborted ( )
virtual

Implements Adaptation::Initiate.

Definition at line 159 of file Iterator.cc.

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

Definition at line 79 of file Initiate.cc.

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

void Adaptation::Iterator::start ( )
protectedvirtual
const char * Adaptation::Initiate::status ( ) const
protectedvirtualinherited

for debugging, starts with space

Reimplemented from AsyncJob.

Reimplemented in Adaptation::Icap::Xaction, and Adaptation::Ecap::XactionRep.

Definition at line 92 of file Initiate.cc.

References AsyncJob::status().

void Adaptation::Iterator::swanSong ( )
protectedvirtual

Reimplemented from Adaptation::Initiate.

Definition at line 215 of file Iterator.cc.

References Adaptation::Initiate::swanSong().

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

Definition at line 87 of file Initiate.cc.

References Adaptation::Answer::Error().

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited

Member Data Documentation

bool Adaptation::Iterator::adapted
protected

Definition at line 73 of file Iterator.h.

AccessLogEntry::Pointer Adaptation::Iterator::al
protected

Definition at line 70 of file Iterator.h.

const InstanceId<AsyncJob> AsyncJob::id
protectedinherited

Definition at line 70 of file AsyncJob.h.

AsyncCall::Pointer AsyncJob::inCall
protectedinherited
int Adaptation::Iterator::iterations
protected

Definition at line 72 of file Iterator.h.

const char* AsyncJob::stopReason
protectedinherited
HttpRequest* Adaptation::Iterator::theCause
protected

Definition at line 69 of file Iterator.h.

Referenced by Iterator().

ServiceGroupPointer Adaptation::Iterator::theGroup
protected

Definition at line 66 of file Iterator.h.

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

Definition at line 51 of file Initiate.h.

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

Definition at line 71 of file Iterator.h.

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

Definition at line 68 of file Iterator.h.

Referenced by Iterator().

ServicePlan Adaptation::Iterator::thePlan
protected

Definition at line 67 of file Iterator.h.


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors