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

Context handler. More...

Inheritance diagram for TdjContextHandler:
TdjHandlerWrapper TdjAbstractHandlerContainer TdjWebComponentContextHandler TdjWebAppContext

Public Member Functions

 TdjContextHandler (const string ContextPath)
 Create a ContextHandler.
 ~TdjContextHandler ()
 Destructor.
 AddHandler (const IHandler Handler)
 Add a handler to the container.
IContext GetCurrentContext ()
 The internal IContext field.
 RemoveHandler (const IHandler Handler)
 SetInitParameter (const string Key, const string Value)
 Set initialization parameter.

Public Attributes

TStrings ConnectorNames
string ContextPath
IHandler ErrorHandler
IHandler Handler

Protected Member Functions

Boolean ContextMatches (const string ConnectorName, const string Target)
 Check if the Document matches this context.
 DoStart ()
 Start the handler.
 DoStop ()
 Stop the handler.
TIdHTTPSession GetSession (TdjServerContext Context, TdjRequest Request, TdjResponse Response, const Boolean Create)
 Get a HTTP session.
 Handle (const string Target, TdjServerContext Context, TdjRequest Request, TdjResponse Response)
string ToConnectorName (TdjServerContext Context)
 Creates connector name in the form 'host:port'.

Detailed Description

Context handler.

Constructor & Destructor Documentation

◆ TdjContextHandler()

TdjContextHandler::TdjContextHandler ( const string ContextPath)

Create a ContextHandler.

◆ ~TdjContextHandler()

TdjContextHandler::~TdjContextHandler ( )

Destructor.

Member Function Documentation

◆ AddHandler()

TdjHandlerWrapper::AddHandler ( const IHandler Handler)
inherited

Add a handler to the container.

This implementation of AddHandler calls SetHandler with the passed handler. If this HandlerWrapper had a previous wrapped handler, then it is passed to a call to AddHandler on the passed handler.

Parameters
Handlerthe handler to be added

Referenced by TdjWebComponentContextHandler::AddWebFilter(), TdjServer::GetConnector(), and GetSession().

◆ ContextMatches()

Boolean TdjContextHandler::ContextMatches ( const string ConnectorName,
const string Target )
protected

Check if the Document matches this context.

Parameters
ConnectorNamethe connector name (like 'host:port'
Targetthe target URL document
Returns
True if the context matches the connector name and target URL document

◆ DoStart()

TdjContextHandler::DoStart ( )
protected

Start the handler.

See also
TdjLifeCycle

◆ DoStop()

TdjContextHandler::DoStop ( )
protected

Stop the handler.

See also
TdjLifeCycle

◆ GetCurrentContext()

IContext TdjContextHandler::GetCurrentContext ( )

The internal IContext field.

◆ GetSession()

TIdHTTPSession TdjHandlerWrapper::GetSession ( TdjServerContext Context,
TdjRequest Request,
TdjResponse Response,
const Boolean Create )
protectedinherited

Get a HTTP session.

References AddHandler(), and Handler.

◆ Handle()

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

◆ RemoveHandler()

TdjHandlerWrapper::RemoveHandler ( const IHandler Handler)
inherited

◆ SetInitParameter()

TdjContextHandler::SetInitParameter ( const string Key,
const string Value )

Set initialization parameter.

Parameters
Keyinit parameter name (case-sensitive)
Valueinit parameter value
Exceptions
EWebComponentExceptionif the key is already set

◆ ToConnectorName()

string TdjContextHandler::ToConnectorName ( TdjServerContext Context)
protected

Creates connector name in the form 'host:port'.

Returns
connector name

Member Data Documentation

◆ ConnectorNames

TStrings TdjContextHandler::ConnectorNames

◆ ContextPath

string TdjContextHandler::ContextPath

◆ ErrorHandler

IHandler TdjContextHandler::ErrorHandler

◆ Handler

IHandler TdjHandlerWrapper::Handler
inherited