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

A generic holder class for managing instances of TdjWebFilter. More...

Inheritance diagram for TdjWebFilterHolder:
TdjGenericHolder TdjWebFilter TdjLifeCycle ILifeCycle TdjWebFilterHolders

Public Member Functions

 TdjWebFilterHolder (TdjWebFilterClass WebFilterClass)
 Constructor for creating an instance of TdjWebFilterHolder.
 ~TdjWebFilterHolder ()
 DoFilter (TdjServerContext Context, TdjRequest Request, TdjResponse Response, const IWebFilterChain Chain)
 Executes the filter logic for the given server context, request, and response.
Boolean IsStarted ()
Boolean IsStopped ()
 SetContext (const IContext Context)
 Set the context.
 SetInitParameter (const string Key, const string Value)
 Set initialization parameter.
 Start ()
 Starts the component.
 Stop ()
 Stops the component.

Public Attributes

string Name
Boolean Started
Boolean Stopped
TdjWebFilter WebFilter
 The instance of the filter.
TdjWebFilterClass WebFilterClass
 The filter class.

Protected Member Functions

 CheckNotStarted ()
 Raises an exception if the lifecycle is already in "started" state.
 CheckNotStopped ()
 Raises an exception if the lifecycle is already in "stopped" state.

Detailed Description

A generic holder class for managing instances of TdjWebFilter.

This class is a specialization of TdjGenericHolder, designed to hold and manage objects of type TdjWebFilter.

Constructor & Destructor Documentation

◆ TdjWebFilterHolder()

TdjWebFilterHolder::TdjWebFilterHolder ( TdjWebFilterClass WebFilterClass)

Constructor for creating an instance of TdjWebFilterHolder.

Parameters
WebFilterClassThe class reference of type TdjWebFilterClass used to initialize the web filter holder.

References SetInitParameter().

Referenced by TdjWebFilterHolders::TdjWebFilterHolders(), and SetInitParameter().

◆ ~TdjWebFilterHolder()

TdjWebFilterHolder::~TdjWebFilterHolder ( )

Member Function Documentation

◆ CheckNotStarted()

TdjLifeCycle::CheckNotStarted ( )
protectedinherited

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

References Started, and Stopped.

Referenced by TdjWebFilterHolders::TdjWebFilterHolders().

◆ CheckNotStopped()

TdjLifeCycle::CheckNotStopped ( )
protectedinherited

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

References TdjLifeCycle().

◆ DoFilter()

TdjWebFilterHolder::DoFilter ( TdjServerContext Context,
TdjRequest Request,
TdjResponse Response,
const IWebFilterChain Chain )

Executes the filter logic for the given server context, request, and response.

Parameters
ContextThe server context in which the filter is executed.
RequestThe HTTP request being processed.
ResponseThe HTTP response to be sent back to the client.
ChainThe filter chain to pass control to the next filter in the chain.

Implements IWebFilter.

◆ IsStarted()

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

Implements ILifeCycle.

References TdjLifeCycle().

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

◆ IsStopped()

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

Implements ILifeCycle.

References Stopped.

Referenced by DoStop().

◆ SetContext()

TdjWebFilterHolder::SetContext ( const IContext Context)

Set the context.

Parameters
Contextthe Web Filter context

Referenced by TdjWebFilterHolders::TdjWebFilterHolders().

◆ SetInitParameter()

TdjWebFilterHolder::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

References TdjWebFilterHolder().

Referenced by TdjWebFilterHolder().

◆ Start()

TdjLifeCycle::Start ( )
inherited

Starts the component.

Implements ILifeCycle.

References TdjLifeCycle().

Referenced by DoStop().

◆ Stop()

TdjLifeCycle::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.

Implements ILifeCycle.

References Started.

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

Member Data Documentation

◆ Name

string TdjGenericHolder::Name
inherited

◆ Started

Boolean TdjLifeCycle::Started
inherited

Referenced by CheckNotStarted(), and Stop().

◆ Stopped

Boolean TdjLifeCycle::Stopped
inherited

Referenced by CheckNotStarted(), and IsStopped().

◆ WebFilter

TdjWebFilter TdjWebFilterHolder::WebFilter

The instance of the filter.

◆ WebFilterClass

TdjWebFilterClass TdjWebFilterHolder::WebFilterClass

The filter class.