Daraja HTTP Framework 3.2.1-SNAPSHOT
HTTP server framework for Object Pascal
Loading...
Searching...
No Matches
IHandler Interface Reference

A collection of handlers. More...

Inheritance diagram for IHandler:
TdjAbstractHandlerContainer ILifeCycle IHandlerContainer TdjAbstractHandler TdjServerBase TdjWebComponentHandler TdjServer

Public Member Functions

 IHandler ()
 Create a TdjHandlerCollection.
 ~IHandler ()
 Destructor.
 Handle (const string Target, TdjServerContext Context, TdjRequest Request, TdjResponse Response)
 Handles an HTTP request.
boolean IsStarted ()
boolean IsStopped ()
 Start ()
 Starts the component.
 Stop ()
 Stops the component.

Protected Member Functions

 AddHandler (const IHandler Handler)
 Handle (const string Target, TdjServerContext Context, TdjRequest Request, TdjResponse Response)
 RemoveHandler (const IHandler Handler)

Protected Attributes

TdjHandlers FHandlers
 The handler collection.

Detailed Description

A collection of handlers.

Interface for HTTP request handlers.

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

Constructor & Destructor Documentation

◆ IHandler()

IHandler::IHandler ( )

Create a TdjHandlerCollection.

References FHandlers.

Referenced by ~IHandler().

◆ ~IHandler()

IHandler::~IHandler ( )

Destructor.

References IHandler(), and FHandlers.

Member Function Documentation

◆ AddHandler()

IHandler::AddHandler ( const IHandler Handler)
protected

Implemented in IHandlerContainer.

◆ Handle() [1/2]

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

◆ Handle() [2/2]

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

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.

Implemented in TdjAbstractHandler, TdjServerBase, and TdjWebComponentHandler.

◆ IsStarted()

boolean ILifeCycle::IsStarted ( )
inherited
Returns
True if component is started

Implemented in TdjLifeCycle.

Referenced by TdjServer::ConnectorCount(), and Stop().

◆ IsStopped()

boolean ILifeCycle::IsStopped ( )
inherited
Returns
True if component is stopped

Implemented in TdjLifeCycle.

◆ RemoveHandler()

IHandler::RemoveHandler ( const IHandler Handler)
protected

Implemented in IHandlerContainer.

◆ Start()

ILifeCycle::Start ( )
inherited

Starts the component.

Implemented in TdjLifeCycle.

References Start().

Referenced by Start().

◆ Stop()

ILifeCycle::Stop ( )
inherited

Stops the component.

Note
Unlike Start, a failure in the custom stop code is logged and swallowed rather than re-raised; the component is still marked stopped.

Implemented in TdjLifeCycle.

References IsStarted().

Referenced by TdjServer::ConnectorCount().

Member Data Documentation

◆ FHandlers

TdjHandlers IHandler::FHandlers
protected

The handler collection.

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