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

A generic holder class that manages objects of type T. More...

Inheritance diagram for TdjGenericHolder:
TdjLifeCycle ILifeCycle TdjWebComponentHolder TdjWebFilterHolder TdjWebComponentHolders TdjWebFilterHolders

Public Member Functions

 TdjGenericHolder (TInterfacedClass AClass)
 Constructor for creating an instance of the class.
Boolean IsStarted ()
Boolean IsStopped ()
 Start ()
 Starts the component.
 Stop ()
 Stops the component.

Public Attributes

string Name
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

A generic holder class that manages objects of type T.

Template Parameters
TA type parameter constrained to TInterfacedObject.
Note
This class inherits from TdjLifeCycle.

Constructor & Destructor Documentation

◆ TdjGenericHolder()

TdjGenericHolder::TdjGenericHolder ( TInterfacedClass AClass)

Constructor for creating an instance of the class.

Parameters
AClassThe class type to be used for initialization.

References TdjGenericHolder().

Referenced by TdjGenericHolder().

Member Function Documentation

◆ CheckNotStarted()

TdjLifeCycle::CheckNotStarted ( )
protectedinherited

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

References Started, and Stopped.

Referenced by TdjWebFilterHolders::TdjWebFilterHolders().

◆ CheckNotStopped()

TdjLifeCycle::CheckNotStopped ( )
protectedinherited

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

References TdjLifeCycle().

◆ DoStart()

TdjLifeCycle::DoStart ( )
protectedinherited

Execute the custom start code.

◆ DoStop()

TdjLifeCycle::DoStop ( )
protectedinherited

Execute the custom stop code.

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

◆ IsStarted()

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

Implements ILifeCycle.

References TdjLifeCycle().

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

◆ IsStopped()

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

Implements ILifeCycle.

References Stopped.

Referenced by DoStop().

◆ Start()

TdjLifeCycle::Start ( )
inherited

Starts the component.

Implements ILifeCycle.

References TdjLifeCycle().

Referenced by DoStop().

◆ Stop()

TdjLifeCycle::Stop ( )
inherited

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

◆ Name

string TdjGenericHolder::Name

◆ Started

Boolean TdjLifeCycle::Started
inherited

Referenced by CheckNotStarted(), and Stop().

◆ Stopped

Boolean TdjLifeCycle::Stopped
inherited

Referenced by CheckNotStarted(), and IsStopped().