|
Daraja HTTP Framework 3.1.1-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. | |
| CheckUniqueName (TdjWebComponentHolder Holder) | |
| CreateOrUpdateMapping (const string UrlPattern, TdjWebComponentHolder Holder) | |
| TdjWebComponentHolder | FindHolder (TdjWebComponentClass WebComponentClass) |
| Find a TdjWebComponentHolder for a WebComponentClass. | |
| TdjWebComponentMapping | FindMapping (const string WebComponentName) |
| IWebFilterChain | GetFilterChain (const string PathInContext, TdjRequest Request, TdjWebComponentHolder Holder) |
| InitializeHolders (TdjWebFilterHolders Holders) | |
| InvokeService (TdjWebComponent Comp, TdjServerContext Context, TdjRequest Request, TdjResponse Response) | |
| Invokes a service for the specified web component. | |
| Boolean | IsStarted () |
| Boolean | IsStopped () |
| IWebFilterChain | NewFilterChain (TdjWebFilterHolder Holder, IWebFilterChain Chain) |
| SetContext (const IContext Context) | |
| Sets the context for the component handler. | |
| SetFilters (TdjWebFilterHolders Holders) | |
| SetStarted (const Boolean Value) | |
| SetStopped (const Boolean Value) | |
| Start () | |
| Starts the component. | |
| Stop () | |
| Stops the component. | |
| string | StripContext (const string Doc) |
| UpdateMappings () | |
| UpdateNameMappings () | |
| ValidateMappingUrlPattern (const string UrlPattern, TdjWebComponentHolder Holder) | |
Public Attributes | |
| TCriticalSection | CS |
| TdjPathMap | FPathMap |
| Boolean | FStopped |
| IContext | FWebComponentContext |
| TdjWebComponentHolders | FWebComponentHolders |
| TdjWebComponentMappings | FWebComponentMappings |
| TdjWebFilterHolders | FWebFilterHolders |
| TdjWebFilterMappings | FWebFilterMappings |
| < ><> TdjWebFilterMappings | FWebFilterPathMappings |
| Boolean | Started |
| Boolean | Stopped |
| IContext | WebComponentContext |
| TdjWebComponentMappings | WebComponentMappings |
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(), FindHolder(), and InvokeService().
| TdjWebComponentHandler::~TdjWebComponentHandler | ( | ) |
|
protected |
Adds a new web component mapping to the handler.
| Mapping | The TdjWebComponentMapping instance to be added. |
Referenced by GetFilterChain().
| 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 |
Referenced by DoStop(), and InvokeService().
|
protectedinherited |
Raises an exception if the lifecycle is in "started" state.
|
protectedinherited |
Raises an exception if the lifecycle is in "stopped" state.
References TdjLifeCycle().
| TdjWebComponentHandler::CheckUniqueName | ( | TdjWebComponentHolder | Holder | ) |
| TdjWebComponentHandler::CreateOrUpdateMapping | ( | const string | UrlPattern, |
| TdjWebComponentHolder | Holder ) |
|
protected |
Starts the web component handler.
This method is called to initialize and start the handler.
References Add().
|
protected |
Stops the web component handler.
This method is called to clean up and stop the handler.
References Add(), and AddWithMapping().
|
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(), FPathMap, FWebComponentMappings, FWebFilterHolders, and FWebFilterMappings.
| TdjWebComponentMapping TdjWebComponentHandler::FindMapping | ( | const string | WebComponentName | ) |
| IWebFilterChain TdjWebComponentHandler::GetFilterChain | ( | const string | PathInContext, |
| TdjRequest | Request, | ||
| TdjWebComponentHolder | Holder ) |
References AddMapping(), FWebComponentHolders, FWebFilterHolders, WebComponents, and WebFilters.
|
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.
References InvokeService().
Referenced by NewFilterChain().
| TdjWebComponentHandler::InitializeHolders | ( | TdjWebFilterHolders | Holders | ) |
References FWebComponentMappings, and WebComponentMappings.
| 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(), AddWithMapping(), FPathMap, FWebComponentContext, FWebComponentHolders, FWebComponentMappings, FWebFilterHolders, FWebFilterMappings, FWebFilterPathMappings, TdjLifeCycle::IsStarted(), and TdjLifeCycle::Stop().
Referenced by Handle().
|
inherited |
Implements ILifeCycle.
References TdjLifeCycle().
Referenced by DoStart(), and TdjWebComponentHandler::InvokeService().
|
inherited |
Implements ILifeCycle.
References Create().
Referenced by DoStart().
| IWebFilterChain TdjWebComponentHandler::NewFilterChain | ( | TdjWebFilterHolder | Holder, |
| IWebFilterChain | Chain ) |
| TdjWebComponentHandler::SetContext | ( | const IContext | Context | ) |
Sets the context for the component handler.
| Context | The context to be set, implementing the IContext interface. |
| TdjWebComponentHandler::SetFilters | ( | TdjWebFilterHolders | Holders | ) |
References FWebComponentContext, UpdateMappings(), and WebComponentContext.
|
inherited |
Referenced by DoStop().
|
inherited |
Referenced by DoStop().
|
inherited |
|
inherited |
Stops the component.
Implements ILifeCycle.
References Stopped.
Referenced by DoStart(), and TdjWebComponentHandler::InvokeService().
| string TdjWebComponentHandler::StripContext | ( | const string | Doc | ) |
| TdjWebComponentHandler::UpdateMappings | ( | ) |
Referenced by SetFilters().
| TdjWebComponentHandler::UpdateNameMappings | ( | ) |
| TdjWebComponentHandler::ValidateMappingUrlPattern | ( | const string | UrlPattern, |
| TdjWebComponentHolder | Holder ) |
|
inherited |
Referenced by ~TdjLifeCycle().
| TdjPathMap TdjWebComponentHandler::FPathMap |
Referenced by FindHolder(), and InvokeService().
|
inherited |
Referenced by ~TdjLifeCycle(), and DoStop().
| IContext TdjWebComponentHandler::FWebComponentContext |
Referenced by InvokeService(), and SetFilters().
| TdjWebComponentHolders TdjWebComponentHandler::FWebComponentHolders |
Referenced by GetFilterChain(), and InvokeService().
| TdjWebComponentMappings TdjWebComponentHandler::FWebComponentMappings |
Referenced by FindHolder(), InitializeHolders(), and InvokeService().
| TdjWebFilterHolders TdjWebComponentHandler::FWebFilterHolders |
Referenced by FindHolder(), GetFilterChain(), and InvokeService().
| TdjWebFilterMappings TdjWebComponentHandler::FWebFilterMappings |
Referenced by FindHolder(), and InvokeService().
| < ><> TdjWebFilterMappings TdjWebComponentHandler::FWebFilterPathMappings |
Referenced by InvokeService().
|
inherited |
Referenced by TdjHandlerCollection::~TdjHandlerCollection(), and DoStop().
| IContext TdjWebComponentHandler::WebComponentContext |
Referenced by SetFilters().
| TdjWebComponentMappings TdjWebComponentHandler::WebComponentMappings |
Referenced by InitializeHolders().
|
protected |
Referenced by GetFilterChain().
|
protected |
Referenced by GetFilterChain().