|
Daraja HTTP Framework 3.1.1-SNAPSHOT
HTTP server framework for Object Pascal
|
A HandlerWrapper acts as a IHandler but delegates the handle method and life cycle events to a delegate. More...
Public Member Functions | |
| TdjHandlerWrapper () | |
| AddHandler (const IHandler Handler) | |
| Add a handler to the container. | |
| IHandler | GetHandler () |
| Boolean | IsStarted () |
| Boolean | IsStopped () |
| RemoveHandler (const IHandler Handler) | |
| Removes a handler from this container. | |
| SetHandler (const IHandler Value) | |
| SetStarted (const Boolean Value) | |
| SetStopped (const Boolean Value) | |
| Start () | |
| Starts the component. | |
| Stop () | |
| Stops the component. | |
Public Attributes | |
| TCriticalSection | CS |
| IHandler | FHandler |
| Boolean | FStopped |
| IHandler | Handler |
| Boolean | Started |
| Boolean | Stopped |
Protected Member Functions | |
| CheckStarted () | |
| Raises an exception if the lifecycle is in "started" state. | |
| CheckStopped () | |
| Raises an exception if the lifecycle is in "stopped" state. | |
| DoStart () | |
| Start the handler. | |
| DoStop () | |
| Start the handler. | |
| TIdHTTPSession | GetSession (TdjServerContext Context, TdjRequest Request, TdjResponse Response, const Boolean Create) |
| Get a HTTP session. | |
| Handle (const string Target, TdjServerContext Context, TdjRequest Request, TdjResponse Response) | |
| Handles an HTTP request. | |
A HandlerWrapper acts as a IHandler but delegates the handle method and life cycle events to a delegate.
This is primarily used to implement the Decorator pattern.
| TdjHandlerWrapper::TdjHandlerWrapper | ( | ) |
Referenced by GetSession(), and SetHandler().
| TdjHandlerWrapper::AddHandler | ( | const IHandler | Handler | ) |
Add a handler to the container.
This implementation of AddHandler calls SetHandler with the passed handler. If this HandlerWrapper had a previous wrapped handler, then it is passed to a call to AddHandler on the passed handler.
| Handler | the handler to be added |
Implements IHandlerContainer.
|
protectedinherited |
Raises an exception if the lifecycle is in "started" state.
|
protectedinherited |
Raises an exception if the lifecycle is in "stopped" state.
References TdjLifeCycle().
|
protected |
Start the handler.
|
protected |
Start the handler.
| IHandler TdjHandlerWrapper::GetHandler | ( | ) |
References Handler, and SetHandler().
|
protected |
Get a HTTP session.
References TdjHandlerWrapper(), FHandler, Handler, and SetHandler().
Referenced by TdjWebComponentContextHandler::Add().
|
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.
|
inherited |
Implements ILifeCycle.
References TdjLifeCycle().
Referenced by DoStart(), and TdjWebComponentHandler::InvokeService().
|
inherited |
Implements ILifeCycle.
References Create().
Referenced by DoStart().
| TdjHandlerWrapper::RemoveHandler | ( | const IHandler | Handler | ) |
Removes a handler from this container.
| Handler | Handler to remove |
Implements IHandlerContainer.
| TdjHandlerWrapper::SetHandler | ( | const IHandler | Value | ) |
References TdjHandlerWrapper(), Create(), and Handler.
Referenced by GetHandler(), and GetSession().
|
inherited |
Referenced by DoStop().
|
inherited |
Referenced by DoStop().
|
inherited |
|
inherited |
Stops the component.
Implements ILifeCycle.
References Stopped.
Referenced by DoStart(), and TdjWebComponentHandler::InvokeService().
|
inherited |
Referenced by ~TdjLifeCycle().
| IHandler TdjHandlerWrapper::FHandler |
Referenced by GetSession().
|
inherited |
Referenced by ~TdjLifeCycle(), and DoStop().
| IHandler TdjHandlerWrapper::Handler |
Referenced by GetHandler(), GetSession(), and SetHandler().
|
inherited |
Referenced by TdjHandlerCollection::~TdjHandlerCollection(), and DoStop().