Daraja HTTP Framework 2.8
HTTP server framework for Object Pascal
Loading...
Searching...
No Matches
TdjWebComponentHandler Class Reference

Web Component handler. More...

+ Inheritance diagram for TdjWebComponentHandler:

Public Member Functions

 SetContext (const IContext Context)
 
TdjWebComponentHolder AddWebComponent (TdjWebComponentClass ComponentClass, const string PathSpec)
 Add a Web Component.
 
 AddWithMapping (TdjWebComponentHolder Holder, const string PathSpec)
 Add a Web Component holder with mapping.
 
 AddFilterWithMapping (TdjWebFilterHolder Holder, const string PathSpec)
 Add a Web Filter, specifying a WebFilter holder instance and the mapped WebComponent name.
 
TdjWebComponentHolder FindHolder (TdjWebComponentClass WebComponentClass)
 Create a TdjWebComponentHolder for a WebComponentClass.
 
 Handle (const string Target, TdjServerContext Context, TdjRequest Request, TdjResponse Response)
 Find a TdjWebFilterMapping for a named WebFilter.
 
 InvokeService (TdjWebComponent Comp, TdjServerContext Context, TdjRequest Request, TdjResponse Response)
 
 DoStart ()
 
 DoStop ()
 
- 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 Member Functions

TdjWebComponentHolder FindComponent (const string ATarget)
 
 AddMapping (TdjWebComponentMapping Mapping)
 
- 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.
 

Protected Attributes

TdjWebComponentHolders WebComponents
 
TdjWebFilterHolders WebFilters
 

Additional Inherited Members

- Public Attributes inherited from TdjLifeCycle
Boolean Started
 True if the state is "started".
 
Boolean Stopped
 True if the state is "stopped".
 

Detailed Description

Web Component handler.

An instance of this class is created per context.

It holds a list of web components and their path mappings, and passes incoming requests to the matching web component.

Member Function Documentation

◆ AddFilterWithMapping()

TdjWebComponentHandler::AddFilterWithMapping ( TdjWebFilterHolder Holder,
const string PathSpec )

Add a Web Filter, specifying a WebFilter holder instance and the mapped WebComponent name.

Parameters
FilterClassWebFilter class
WebComponentname
Exceptions
Exceptionif the WebFilter can not be added Add a Web Filter, specifying a WebFilter class and the mapped path.
Parameters
FilterClassWebFilter class
PathSpecmapped path
Exceptions
Exceptionif the WebFilter can not be added

Referenced by TdjWebComponentContextHandler::AddFilterWithMapping(), and TdjWebComponentContextHandler::AddWebFilter().

◆ AddWebComponent()

TdjWebComponentHolder TdjWebComponentHandler::AddWebComponent ( TdjWebComponentClass ComponentClass,
const string PathSpec )

Add a Web Component.

Parameters
ComponentClassWebComponent class
PathSpecpath specification
Exceptions
EWebComponentExceptionif the Web Component can not be added

Referenced by TdjWebComponentContextHandler::AddWebComponent().

◆ AddWithMapping()

TdjWebComponentHandler::AddWithMapping ( TdjWebComponentHolder Holder,
const string PathSpec )

Add a Web Component holder with mapping.

Parameters
Holdera Web Component holder
PathSpeca path spec

Referenced by TdjWebComponentContextHandler::AddWebComponent(), and TdjWebComponentContextHandler::AddWebComponent().

◆ FindHolder()

TdjWebComponentHolder TdjWebComponentHandler::FindHolder ( TdjWebComponentClass WebComponentClass)

Create a TdjWebComponentHolder for a WebComponentClass.

Parameters
WebComponentClassthe Web Component class
Returns
a TdjWebComponentHolder with the WebComponentClass. Find a TdjWebComponentHolder for a WebComponentClass.
Parameters
WebComponentClassthe Web Component class
Returns
a TdjWebComponentHolder with the WebComponentClass or nil if the WebComponentClass is not registered

Referenced by TdjWebComponentContextHandler::AddWebComponent().

◆ Handle()

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

Find a TdjWebFilterMapping for a named WebFilter.

Parameters
WebFilterNamethe Web Filter name
Returns
a TdjWebFilterMapping or nil if the WebFilter is not mapped Handle a HTTP request.
Parameters
TargetRequest target
ContextHTTP server context
RequestHTTP request
ResponseHTTP response
Exceptions
EWebComponentExceptionif an exception occurs that interferes with the component's normal operation
See also
IHandler

Referenced by TdjWebComponentContextHandler::DoHandle().

Member Data Documentation

◆ WebComponents

TdjWebComponentHolders TdjWebComponentHandler::WebComponents
protected
See also
FWebComponentHolders For reading

◆ WebFilters

TdjWebFilterHolders TdjWebComponentHandler::WebFilters
protected
See also
FWebFilterHolders For reading