Daraja HTTP Framework 3.0-MS1
HTTP server framework for Object Pascal
Loading...
Searching...
No Matches
TdjHandlerCollection Class Reference

A collection of handlers. More...

+ Inheritance diagram for TdjHandlerCollection:

Public Member Functions

 TdjHandlerCollection ()
 Create a TdjHandlerCollection.
 
 ~TdjHandlerCollection ()
 Destructor.
 
 Handle (const string Target, TdjServerContext Context, TdjRequest Request, TdjResponse Response)
 Handle a HTTP request.
 
 DoStart ()
 Start the handler.
 
 DoStop ()
 Start the handler.
 
 AddHandler (const IHandler Handler)
 Add a handler.
 
 RemoveHandler (const IHandler Handler)
 Remove a handler.
 
- Public Member Functions inherited from TdjAbstractHandler
 TdjAbstractHandler ()
 Constructor.
 
 DoStart ()
 Start the handler.
 
 DoStop ()
 Start the handler.
 
 Handle (const string Target, TdjServerContext Context, TdjRequest Request, TdjResponse Response)
 Handle a HTTP request.
 
- Public Member Functions inherited from TdjLifeCycle
 Start ()
 Start the handler.
 
 Stop ()
 Stop the handler.
 
Boolean IsStarted ()
 
Boolean IsStopped ()
 

Protected Attributes

TdjHandlers FHandlers
 The handler collection.
 

Additional Inherited Members

- Public Attributes inherited from TdjLifeCycle
Boolean Started
 True if the state is "started".
 
Boolean Stopped
 True if the state is "stopped".
 
- Protected Member Functions inherited from TdjAbstractHandlerContainer
 AddHandler (const IHandler Handler)
 Add a handler.
 
 RemoveHandler (const IHandler Handler)
 Remove a handler.
 
- Protected Member Functions inherited from TdjLifeCycle
 DoStart ()
 Execute the custom start code.
 
 DoStop ()
 Execute the custom stop code.
 
 CheckStarted ()
 Raises an exception if the lifecycle is in "started" state.
 
 CheckStopped ()
 Raises an exception if the lifecycle is in "stopped" state.
 

Detailed Description

A collection of handlers.

For each request, all handler are called, regardless of the response status or exceptions.

Member Function Documentation

◆ AddHandler()

TdjHandlerCollection::AddHandler ( const IHandler Handler)

Add a handler.

Parameters
Handlerthe handler to be added.

References FHandlers, and TdjLifeCycle::Started.

◆ Handle()

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

Handle a HTTP request.

Parameters
TargetRequest target
ContextHTTP server context
RequestHTTP request
ResponseHTTP response
See also
IHandler

References FHandlers, and TdjLifeCycle::IsStarted().

◆ RemoveHandler()

TdjHandlerCollection::RemoveHandler ( const IHandler Handler)

Remove a handler.

Parameters
Handlerthe handler to be removed.

References FHandlers.