Daraja HTTP Framework 3.1.1-SNAPSHOT
HTTP server framework for Object Pascal
Loading...
Searching...
No Matches
TdjAbstractConnector Class Reference

Interface for HTTP connectors. More...

Inheritance diagram for TdjAbstractConnector:
TdjLifeCycle IConnector ILifeCycle TdjHTTPConnector

Public Member Functions

 TdjAbstractConnector (const IHandler Handler)
 Constructor.
 ~TdjAbstractConnector ()
 Destructor.
Boolean IsStarted ()
Boolean IsStopped ()
 SetStarted (const Boolean Value)
 SetStopped (const Boolean Value)
 Start ()
 Starts the component.
 Stop ()
 Stops the component.

Public Attributes

TCriticalSection CS
string FHost
Integer FPort
Boolean FStopped
string Host
 The host address for the connector.
Integer Port
 The port number for the connector.
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 connector.
 DoStop ()
 Stop the connector.

Protected Attributes

IHandler Handler
 Handler for incoming requests.

Detailed Description

Interface for HTTP connectors.

Abstract connector class for handling incoming requests. This class provides the basic structure for connectors, including properties for host and port, and methods for starting and stopping the connector.

Constructor & Destructor Documentation

◆ TdjAbstractConnector()

TdjAbstractConnector::TdjAbstractConnector ( const IHandler Handler)

Constructor.

Initializes the connector with the specified request handler.

Parameters
HandlerThe request handler. The connector will call the "Handle" method for incoming requests.
Exceptions
AssertionErrorif the handler is not assigned.

References TdjAbstractConnector().

Referenced by TdjAbstractConnector().

◆ ~TdjAbstractConnector()

TdjAbstractConnector::~TdjAbstractConnector ( )

Destructor.

Cleans up resources and ensures the connector is stopped before destruction.

References Handler.

Member Function Documentation

◆ CheckStarted()

TdjLifeCycle::CheckStarted ( )
protectedinherited

Raises an exception if the lifecycle is in "started" state.

◆ CheckStopped()

TdjLifeCycle::CheckStopped ( )
protectedinherited

Raises an exception if the lifecycle is in "stopped" state.

References TdjLifeCycle().

◆ DoStart()

TdjAbstractConnector::DoStart ( )
protected

Start the connector.

This method is called to initialize and start the connector's operations.

◆ DoStop()

TdjAbstractConnector::DoStop ( )
protected

Stop the connector.

This method is called to terminate the connector's operations.

◆ IsStarted()

Boolean TdjLifeCycle::IsStarted ( )
inherited
Returns
True if component is started

Implements ILifeCycle.

References TdjLifeCycle().

Referenced by DoStart(), and TdjWebComponentHandler::InvokeService().

◆ IsStopped()

Boolean TdjLifeCycle::IsStopped ( )
inherited
Returns
True if component is stopped

Implements ILifeCycle.

References Create().

Referenced by DoStart().

◆ SetStarted()

TdjLifeCycle::SetStarted ( const Boolean Value)
inherited

Referenced by DoStop().

◆ SetStopped()

TdjLifeCycle::SetStopped ( const Boolean Value)
inherited

Referenced by DoStop().

◆ Start()

TdjLifeCycle::Start ( )
inherited

Starts the component.

Implements ILifeCycle.

References TdjLifeCycle().

Referenced by DoStart().

◆ Stop()

TdjLifeCycle::Stop ( )
inherited

Stops the component.

Implements ILifeCycle.

References Stopped.

Referenced by DoStart(), and TdjWebComponentHandler::InvokeService().

Member Data Documentation

◆ CS

TCriticalSection TdjLifeCycle::CS
inherited

Referenced by ~TdjLifeCycle().

◆ FHost

string TdjAbstractConnector::FHost

◆ FPort

Integer TdjAbstractConnector::FPort

◆ FStopped

Boolean TdjLifeCycle::FStopped
inherited

Referenced by ~TdjLifeCycle(), and DoStop().

◆ Handler

IHandler TdjAbstractConnector::Handler
protected

◆ Host

string TdjAbstractConnector::Host

The host address for the connector.

◆ Port

Integer TdjAbstractConnector::Port

The port number for the connector.

◆ Started

Boolean TdjLifeCycle::Started
inherited

◆ Stopped

Boolean TdjLifeCycle::Stopped
inherited

Referenced by DoStop(), and Stop().