|
Daraja HTTP Framework 3.2.1-SNAPSHOT
HTTP server framework for Object Pascal
|
Basic server class for the Web Component framework. More...
Public Member Functions | |
| TdjServer () | |
| Create a TdjServer using the default host and port. | |
| TdjServer (const Integer APort) | |
| Create a TdjServer, using the specified port and the default host. | |
| TdjServer (const string AHost, const Integer APort=DEFAULT_BINDING_PORT) | |
| Create a TdjServer, using the specfied host and port. | |
| ~TdjServer () | |
| Destructor. | |
| Add (TdjWebComponentContextHandler Context) | |
| Add a new context. | |
| AddConnector (const IConnector Connector) | |
| Add a preconfigured connector. | |
| AddConnector (const string Host, Integer Port=DEFAULT_BINDING_PORT) | |
| Create and add a connector for a host and port. | |
| AddHandler (const IHandler Handler) | |
| Add a handler to the container. | |
| Integer | ConnectorCount () |
| The number of connectors. | |
| IConnector | GetConnector (Integer Index) |
| The connector at the given position, in the order the connectors were added. | |
| RemoveConnector (const IConnector Connector) | |
| Remove a previously added connector. | |
| RemoveHandler (const IHandler Handler) | |
Public Attributes | |
| IHandler | Handler |
Protected Member Functions | |
| 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) | |
Basic server class for the Web Component framework.
| TdjServer::TdjServer | ( | ) |
Create a TdjServer using the default host and port.
Referenced by Add(), ConnectorCount(), and GetConnector().
| TdjServer::TdjServer | ( | const Integer | APort | ) |
Create a TdjServer, using the specified port and the default host.
| APort | the port to be used. |
| TdjServer::TdjServer | ( | const string | AHost, |
| const Integer | APort = DEFAULT_BINDING_PORT ) |
Create a TdjServer, using the specfied host and port.
| AHost | the host to be used. |
| APort | the port to be used. |
| TdjServer::~TdjServer | ( | ) |
Destructor.
References ConnectorCount().
| TdjServer::Add | ( | TdjWebComponentContextHandler | Context | ) |
Add a new context.
Ownership: the server takes ownership of the context. It is destroyed together with the server; do not free it yourself. If a context with the same path is already registered, the passed context is freed and an EWebComponentException is raised.
| Context | the context handler. |
| EWebComponentException | if the context path is already registered. |
References TdjServer().
Referenced by ConnectorCount().
| TdjServer::AddConnector | ( | const IConnector | Connector | ) |
Add a preconfigured connector.
Ownership: the connector is held by an interface reference and is released when the server is destroyed. Do not free it yourself.
| Connector | the connector |
| EWebComponentException | if a connector for the same host and port is already registered. |
Referenced by ConnectorCount().
| TdjServer::AddConnector | ( | const string | Host, |
| Integer | Port = DEFAULT_BINDING_PORT ) |
Create and add a connector for a host and port.
| Host | the connector host name |
| Port | the connector port number |
| EWebComponentException | if a connector for the same host and port is already registered. |
|
inherited |
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 |
Referenced by TdjWebComponentContextHandler::AddWebFilter(), TdjServer::GetConnector(), and GetSession().
| Integer TdjServer::ConnectorCount | ( | ) |
The number of connectors.
References TdjServer(), Add(), AddConnector(), DEFAULT_BINDING_PORT, TdjHandlerWrapper::Handler, ILifeCycle::IsStarted(), and ILifeCycle::Stop().
Referenced by ~TdjServer().
| IConnector TdjServer::GetConnector | ( | Integer | Index | ) |
The connector at the given position, in the order the connectors were added.
Use together with ConnectorCount to enumerate the connectors.
| Index | zero-based position, 0 <= Index < ConnectorCount |
| EWebComponentException | if Index is out of range. |
References TdjServer(), TdjHandlerWrapper::AddHandler(), and DEFAULT_BINDING_PORT.
|
protectedinherited |
Get a HTTP session.
References AddHandler(), and Handler.
|
protectedinherited |
| TdjServer::RemoveConnector | ( | const IConnector | Connector | ) |
Remove a previously added connector.
If the server is started, the connector is stopped before it is removed.
| Connector | the connector to remove |
| EWebComponentException | if the connector is not registered. |
|
inherited |
|
inherited |
Referenced by TdjServer::ConnectorCount(), DoStart(), and GetSession().