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

Interface for web components that process HTTP requests and generate responses. More...

Inheritance diagram for IWebComponent:
TdjGenericWebComponent TdjWebComponent TdjWebComponentHolder TdjWebComponentHolders

Public Member Functions

IWebComponentConfig GetWebComponentConfig ()
 Returns a IWebComponentConfig object, which contains initialization parameters for this component.
 Init (const IWebComponentConfig Config)
 Called by the container on startup.
 Service (TdjServerContext Context, TdjRequest Request, TdjResponse Response)
 Handle a HTTP request.

Public Attributes

IWebComponentConfig Config
 Component configuration property.

Detailed Description

Interface for web components that process HTTP requests and generate responses.

Member Function Documentation

◆ GetWebComponentConfig()

IWebComponentConfig IWebComponent::GetWebComponentConfig ( )

Returns a IWebComponentConfig object, which contains initialization parameters for this component.

Exceptions
EWebComponentExceptionif the method is called before the component has been initialized.

Implemented in TdjGenericWebComponent.

◆ Init()

IWebComponent::Init ( const IWebComponentConfig Config)

Called by the container on startup.

Note
if this method is overridden, the overriding code must also call inherited Init.
Parameters
Configthe configuration
Exceptions
EWebComponentExceptionif initialization failed

Implemented in TdjGenericWebComponent.

◆ Service()

IWebComponent::Service ( TdjServerContext Context,
TdjRequest Request,
TdjResponse Response )

Handle a HTTP request.

The status code of the response always should be set for a component that throws or sends an error.

Note
a custom Web Component should not override this method.
Parameters
ContextHTTP server context
RequestHTTP request
ResponseHTTP response
Exceptions
EWebComponentExceptionif an exception occurs that interferes with the component's normal operation

Implemented in TdjGenericWebComponent, and TdjWebComponent.

References Config.

Member Data Documentation

◆ Config

IWebComponentConfig IWebComponent::Config

Component configuration property.

Referenced by Service().