|
Daraja HTTP Framework 3.0.7-SNAPSHOT
HTTP server framework for Object Pascal
|
Web Component handler. More...
Public Member Functions | |
| TdjWebComponentHandler () | |
| ~TdjWebComponentHandler () | |
| TdjWebComponentHolder | AddWebComponent (TdjWebComponentClass ComponentClass, const string UrlPattern) |
| Add a Web Component. | |
| AddWebFilter (TdjWebFilterHolder Holder, const string UrlPattern) | |
| Add a Web Filter, specifying a WebFilter class and the mapped path. | |
| AddWithMapping (TdjWebComponentHolder Holder, const string UrlPattern) | |
| Add a Web Component holder with mapping. | |
| TdjWebComponentHolder | FindHolder (TdjWebComponentClass WebComponentClass) |
| Find a TdjWebComponentHolder for a WebComponentClass. | |
| InvokeService (TdjWebComponent Comp, TdjServerContext Context, TdjRequest Request, TdjResponse Response) | |
| Invokes a service for the specified web component. | |
| Boolean | IsStarted () |
| Boolean | IsStopped () |
| SetContext (const IContext Context) | |
| Sets the context for the component handler. | |
| Start () | |
| Starts the component. | |
| Stop () | |
| Stops the component. | |
Public Attributes | |
| Boolean | Started |
| Boolean | Stopped |
Protected Member Functions | |
| AddMapping (TdjWebComponentMapping Mapping) | |
| Adds a new web component mapping to the handler. | |
| CheckStarted () | |
| Raises an exception if the lifecycle is in "started" state. | |
| CheckStopped () | |
| Raises an exception if the lifecycle is in "stopped" state. | |
| DoStart () | |
| Starts the web component handler. | |
| DoStop () | |
| Stops the web component handler. | |
| TdjWebComponentHolder | FindComponent (const string ATarget) |
| Finds a web component holder by its target identifier. | |
| Handle (const string Target, TdjServerContext Context, TdjRequest Request, TdjResponse Response) | |
| Handles an HTTP request. | |
Protected Attributes | |
| TdjWebComponentHolders | WebComponents |
| TdjWebFilterHolders | WebFilters |
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.
| TdjWebComponentHandler::TdjWebComponentHandler | ( | ) |
Referenced by AddWebFilter(), AddWithMapping(), FindHolder(), and InvokeService().
| TdjWebComponentHandler::~TdjWebComponentHandler | ( | ) |
|
protected |
Adds a new web component mapping to the handler.
| Mapping | The TdjWebComponentMapping instance to be added. |
Referenced by InvokeService().
| TdjWebComponentHolder TdjWebComponentHandler::AddWebComponent | ( | TdjWebComponentClass | ComponentClass, |
| const string | UrlPattern ) |
Add a Web Component.
| ComponentClass | WebComponent class |
| UrlPattern | path specification |
| EWebComponentException | if the Web Component can not be added |
| TdjWebComponentHandler::AddWebFilter | ( | TdjWebFilterHolder | Holder, |
| const string | UrlPattern ) |
Add a Web Filter, specifying a WebFilter class and the mapped path.
| Holder | WebFilter holder |
| UrlPattern | mapped path |
| Exception | if the WebFilter can not be added |
References TdjWebComponentHandler().
| TdjWebComponentHandler::AddWithMapping | ( | TdjWebComponentHolder | Holder, |
| const string | UrlPattern ) |
Add a Web Component holder with mapping.
| Holder | a Web Component holder |
| UrlPattern | a path spec |
References TdjWebComponentHandler(), and Create().
Referenced by InvokeService().
|
protectedinherited |
Raises an exception if the lifecycle is in "started" state.
References TdjLifeCycle().
|
protectedinherited |
Raises an exception if the lifecycle is in "stopped" state.
References TdjLifeCycle(), and Started.
|
protected |
Starts the web component handler.
This method is called to initialize and start the handler.
|
protected |
Stops the web component handler.
This method is called to clean up and stop the handler.
|
protected |
Finds a web component holder by its target identifier.
| ATarget | The identifier of the target component to find. |
| TdjWebComponentHolder TdjWebComponentHandler::FindHolder | ( | TdjWebComponentClass | WebComponentClass | ) |
Find a TdjWebComponentHolder for a WebComponentClass.
| WebComponentClass | the Web Component class |
References TdjWebComponentHandler(), and TdjLifeCycle::IsStarted().
|
protected |
Handles an HTTP request.
| Target | Target path or resource identifier |
| Context | Server context for this request |
| Request | HTTP request object |
| Response | HTTP response object to populate |
| EWebComponentException | if an exception occurs that interferes with the component's normal operation. |
Implements IHandler.
| TdjWebComponentHandler::InvokeService | ( | TdjWebComponent | Comp, |
| TdjServerContext | Context, | ||
| TdjRequest | Request, | ||
| TdjResponse | Response ) |
Invokes a service for the specified web component.
| Comp | The web component instance to handle. |
| Context | The server context in which the service is invoked. |
| Request | The incoming request to be processed. |
| Response | The outgoing response to be sent. |
References TdjWebComponentHandler(), AddMapping(), AddWithMapping(), ROOT_CONTEXT, TdjLifeCycle::Started, TdjLifeCycle::Stop(), WebComponents, and WebFilters.
|
inherited |
Implements ILifeCycle.
References Create().
Referenced by DoStart(), and TdjWebComponentHandler::FindHolder().
|
inherited |
| TdjWebComponentHandler::SetContext | ( | const IContext | Context | ) |
Sets the context for the component handler.
| Context | The context to be set, implementing the IContext interface. |
|
inherited |
|
inherited |
Stops the component.
Implements ILifeCycle.
References TdjLifeCycle().
Referenced by DoStart(), and TdjWebComponentHandler::InvokeService().
|
inherited |
|
protected |
Referenced by InvokeService().
|
protected |
Referenced by InvokeService().