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

Abstract LifeCycle implementation. More...

Inheritance diagram for TdjLifeCycle:
ILifeCycle TdjAbstractConnector TdjAbstractHandler TdjGenericHolder TdjHTTPConnector TdjWebComponentHandler TdjWebComponentHolder TdjWebFilterHolder TdjWebComponentHolders TdjWebFilterHolders

Public Member Functions

 TdjLifeCycle ()
 ~TdjLifeCycle ()
Boolean IsStarted ()
Boolean IsStopped ()
 Start ()
 Starts the component.
 Stop ()
 Stops the component.

Public Attributes

Boolean Started
Boolean Stopped

Protected Member Functions

 CheckNotStarted ()
 Raises an exception if the lifecycle is already in "started" state.
 CheckNotStopped ()
 Raises an exception if the lifecycle is already in "stopped" state.
 DoStart ()
 Execute the custom start code.
 DoStop ()
 Execute the custom stop code.

Detailed Description

Abstract LifeCycle implementation.

Constructor & Destructor Documentation

◆ TdjLifeCycle()

TdjLifeCycle::TdjLifeCycle ( )

◆ ~TdjLifeCycle()

TdjLifeCycle::~TdjLifeCycle ( )

Member Function Documentation

◆ CheckNotStarted()

TdjLifeCycle::CheckNotStarted ( )
protected

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

References Started, and Stopped.

Referenced by TdjWebFilterHolders::TdjWebFilterHolders().

◆ CheckNotStopped()

TdjLifeCycle::CheckNotStopped ( )
protected

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

References TdjLifeCycle().

◆ DoStart()

TdjLifeCycle::DoStart ( )
protected

Execute the custom start code.

◆ DoStop()

TdjLifeCycle::DoStop ( )
protected

Execute the custom stop code.

References IsStarted(), IsStopped(), Start(), and Stop().

◆ IsStarted()

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

Implements ILifeCycle.

References TdjLifeCycle().

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

◆ IsStopped()

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

Implements ILifeCycle.

References Stopped.

Referenced by DoStop().

◆ Start()

TdjLifeCycle::Start ( )

Starts the component.

Implements ILifeCycle.

References TdjLifeCycle().

Referenced by DoStop().

◆ Stop()

TdjLifeCycle::Stop ( )

Stops the component.

Note
Unlike Start, a failure in the custom stop code is logged and swallowed rather than re-raised; the component is still marked stopped.

Implements ILifeCycle.

References Started.

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

Member Data Documentation

◆ Started

Boolean TdjLifeCycle::Started

Referenced by CheckNotStarted(), and Stop().

◆ Stopped

Boolean TdjLifeCycle::Stopped

Referenced by CheckNotStarted(), and IsStopped().