Daraja HTTP Framework 3.0.7-SNAPSHOT
HTTP server framework for Object Pascal
Loading...
Searching...
No Matches
TdjHandlerList Class Reference

Iterates handler list and exits when the response code is set. More...

Inheritance diagram for TdjHandlerList:
TdjHandlerCollection TdjAbstractHandlerContainer TdjAbstractHandler IHandlerContainer TdjLifeCycle IHandler ILifeCycle TdjContextHandlerCollection

Public Member Functions

 TdjHandlerList ()
 Constructor.
Boolean IsStarted ()
Boolean IsStopped ()
 Start ()
 Starts the component.
 Stop ()
 Stops the component.

Public Attributes

Boolean Started
Boolean Stopped

Protected Member Functions

 AddHandler (const IHandler Handler)
 Adds a handler to this container.
 CheckStarted ()
 Raises an exception if the lifecycle is in "started" state.
 CheckStopped ()
 Raises an exception if the lifecycle is in "stopped" state.
 Handle (const string Target, TdjServerContext Context, TdjRequest Request, TdjResponse Response)
 Handles an HTTP request.
 RemoveHandler (const IHandler Handler)
 Removes a handler from this container.

Protected Attributes

TdjHandlers FHandlers
 The handler collection.

Detailed Description

Iterates handler list and exits when the response code is set.

If the response code is still -1, it returns 404

This extension of TdjHandlerCollection will call each contained handler in turn until either an exception is thrown or a positive response status is set.

Constructor & Destructor Documentation

◆ TdjHandlerList()

TdjHandlerList::TdjHandlerList ( )

Constructor.

Referenced by Handle().

Member Function Documentation

◆ AddHandler()

TdjHandlerCollection::AddHandler ( const IHandler Handler)
protectedinherited

Adds a handler to this container.

Parameters
HandlerHandler to add

Implements IHandlerContainer.

References Create().

◆ CheckStarted()

TdjLifeCycle::CheckStarted ( )
protectedinherited

Raises an exception if the lifecycle is in "started" state.

References TdjLifeCycle().

◆ CheckStopped()

TdjLifeCycle::CheckStopped ( )
protectedinherited

Raises an exception if the lifecycle is in "stopped" state.

References TdjLifeCycle(), and Started.

◆ Handle()

TdjHandlerList::Handle ( const string Target,
TdjServerContext Context,
TdjRequest Request,
TdjResponse Response )
protected

Handles an HTTP request.

Parameters
TargetTarget path or resource identifier
ContextServer context for this request
RequestHTTP request object
ResponseHTTP response object to populate
Exceptions
EWebComponentExceptionif an exception occurs that interferes with the component's normal operation.

Implements IHandler.

References TdjHandlerList().

◆ IsStarted()

Boolean TdjLifeCycle::IsStarted ( )
inherited
Returns
True if component is started

Implements ILifeCycle.

References Create().

Referenced by DoStart(), and TdjWebComponentHandler::FindHolder().

◆ IsStopped()

Boolean TdjLifeCycle::IsStopped ( )
inherited
Returns
True if component is stopped

Implements ILifeCycle.

Referenced by DoStart().

◆ RemoveHandler()

TdjHandlerCollection::RemoveHandler ( const IHandler Handler)
protectedinherited

Removes a handler from this container.

Parameters
HandlerHandler to remove

Implements IHandlerContainer.

◆ Start()

TdjLifeCycle::Start ( )
inherited

Starts the component.

Implements ILifeCycle.

References Stopped.

◆ Stop()

TdjLifeCycle::Stop ( )
inherited

Stops the component.

Implements ILifeCycle.

References TdjLifeCycle().

Referenced by DoStart(), and TdjWebComponentHandler::InvokeService().

Member Data Documentation

◆ FHandlers

TdjHandlers TdjHandlerCollection::FHandlers
protectedinherited

The handler collection.

Referenced by TdjHandlerCollection(), and ~TdjHandlerCollection().

◆ Started

◆ Stopped

Boolean TdjLifeCycle::Stopped
inherited

Referenced by DoStop(), and Start().