Contents - Events - Methods - Properties
ISAPI DLL application incapsulation
Description
TISAPIApp component is not visible at design time.At runtime, TISAPIApp is available through global variable ISAPIApp .
Purpose of TISAPIApp is to manage incoming requests (threads): create and initialize request handling objects (dispatchers), cache control, logging, etc.
For every incoming request, TISAPIApp creates a new pre-registered dispatcher-module.
Contents - TISAPIApp - Properties - Methods
OnTerminateExtension
TerminateExtension event, may (depends on the server) be called before terminating (unloading) DLL.Delphi declaration
property OnTerminateExtension: TOnTerminateExtensionEvent read FOnTerminateExtension write FOnTerminateExtension;
C++ declaration
__property TOnTerminateExtensionEvent OnTerminateExtension={ read=FOnTerminateExtension, write=FOnTerminateExtension }
Description
Event value is taken from the dispatcher.
Contents - TISAPIApp - Properties - Events
~TISAPIApp
DestructorActivateDispatchModuleC++ declaration
__fastcall virtual ~TISAPIApp(void)
Description
Normally you should not need to destroy TISAPIApp object, it will be done at shutdown.
Delphi declarationActivateModuleDispatcher
function ActivateDispatchModule: TDataModule;
C++ declaration
Forms::TDataModule *__fastcall ActivateDispatchModule(void)
Delphi declarationCreate
function ActivateModuleDispatcher(DataModule: TDataModule): TISAPIDispatcher;
C++ declaration
TISAPIDispatcher *__fastcall ActivateModuleDispatcher(Forms::TDataModule *DataModule)
ConstructorDeactivateDispatchModuleDelphi declaration
constructor Create(AOwner: TComponent);
Description
Normally you should not create TSAPIApp object, it will be created automatically at startup.
Delphi declarationDestroy
procedure DeactivateDispatchModule(DataModule: TDataModule);
C++ declaration
void __fastcall DeactivateDispatchModule(Forms::TDataModule *DataModule)
DestructorGetActiveRequestsDelphi declaration
destructor Destroy;
Description
Normally you should not need to destroy TISAPIApp object, it will be done at shutdown.
Delphi declarationGetConfigParam
function GetActiveRequests: Integer;
C++ declaration
int __fastcall GetActiveRequests(void)
Delphi declarationGetExtensionVersion
function GetConfigParam(SectionName, ItemName: AnsiString): AnsiString;
C++ declaration
System::AnsiString __fastcall GetConfigParam(System::AnsiString SectionName, System::AnsiString ItemName)
Delphi declarationGetInactiveRequests
function GetExtensionVersion(pVer: PHSE_VERSION_INFO): Boolean;
C++ declaration
bool __fastcall GetExtensionVersion(Isapi::PHSE_VERSION_INFO pVer)
Description
Called by the server.
Delphi declarationGetStatusString
function GetInactiveRequests: Integer;
C++ declaration
int __fastcall GetInactiveRequests(void)
HTTP status string from statuscodeHandleRequestDelphi declaration
function GetStatusString(StatusCode: Integer): AnsiString;
C++ declaration
System::AnsiString __fastcall GetStatusString(int StatusCode)
Description
For example: 200: 'OK', ..., 400: 'Bad Request',....Used internally to generate HTTP response header.
Delphi declarationHttpExtensionProc
function HandleRequest(Request: TFRISAPIRequest; Response: TFRISAPIResponse): Boolean;
C++ declaration
bool __fastcall HandleRequest(TFRISAPIRequest *Request, TFRISAPIResponse *Response)
Start point for request handlingInitWebModuleDelphi declaration
function HttpExtensionProc(pECB: PEXTENSION_CONTROL_BLOCK): DWORD;
C++ declaration
int __fastcall HttpExtensionProc(Isapi::PEXTENSION_CONTROL_BLOCK pECB)
Description
Forced by the server's call to exported function HttpExtensionProc
Registering (data)module class, where the dispatcher residesLoadConfigDelphi declaration
procedure InitWebModule(clWebMod: TComponentClass);
C++ declaration
void __fastcall InitWebModule(System::TMetaClass *clWebMod)
Description
This function must be called immediately after DLL is loaded.(librarys initialization code block in Delphi, or DllEntryPoint with Reason parameter value DLL_PROCESS_ATTACH in C++Builder)
Delphi declarationLoadInternalConfig
function LoadConfig: Boolean;
C++ declaration
bool __fastcall LoadConfig(void)
Delphi declarationLock
function LoadInternalConfig: Boolean;
C++ declaration
bool __fastcall LoadInternalConfig(void)
Locking before a thread-unsafe operationTerminateExtensionDelphi declaration
procedure Lock;
C++ declaration
void __fastcall Lock(void)
Description
Must always call UnLock to release the lock.It is safer to use TFRISAPIRequest.Lock !
Delphi declarationTISAPIApp
function TerminateExtension(dwFlags: DWORD): Boolean;
C++ declaration
bool __fastcall TerminateExtension(int dwFlags)
Description
Called by the server.
ConstructorUnLockC++ declaration
__fastcall virtual TISAPIApp(Classes::TComponent *AOwner)
Description
Normally you should not create TSAPIApp object, it will be created automatically at startup.
Unlocking after a thread-unsafe operationWriteLogDelphi declaration
procedure UnLock;
C++ declaration
void __fastcall UnLock(void)
Description
Call this after Lock, if locking isn't needed any more.It is safer to use TFRISAPIRequest.UnLock !
Write string to logfileWriteLogExDelphi declaration
function WriteLog(LogString: AnsiString; pECB: PEXTENSION_CONTROL_BLOCK): Boolean;
C++ declaration
bool __fastcall WriteLog(System::AnsiString LogString, Isapi::PEXTENSION_CONTROL_BLOCK pECB)
Description
For debug purposes.Parameter pECB is optional. If set, request parameters will be added to LogString.
The preferred method is TFRISAPIRequest.WriteLog !
Writes exception class name and error text to logfileDelphi declaration
function WriteLogEx(E: Exception; pECB: PEXTENSION_CONTROL_BLOCK): Boolean;
C++ declaration
bool __fastcall WriteLogEx(Sysutils::Exception *E, Isapi::PEXTENSION_CONTROL_BLOCK pECB)
Description
For debug purposes.Parameter pECB is optional. If set, request parameters will be added to exception message.
The preferred method is TFRISAPIRequest.WriteLogEx !
Contents - TISAPIApp - Methods - Events
ActiveRequests
Currently active (processed) requests (dispatcher-modules) countCacheConnectionsDelphi declaration
property ActiveRequests: Integer read GetActiveRequests;
C++ declaration
__property int ActiveRequests={ read=GetActiveRequests, nodefault }
Description
For statistical purposes.
Enables internal cacheConfigParamsDelphi declaration
property CacheConnections: Boolean read FCacheConnections write FCacheConnections;
C++ declaration
__property bool CacheConnections={ read=FCacheConnections, write=FCacheConnections, nodefault }
Description
Parameter value is taken from the dispatcher.If caching is enabled, dispatcher-module will, after current request is handled, be stored into the internal cache instead of destroying it, and will be taken from cache when a new request arrives.
Caching may increase the speed a couple of times, especially if the dispatcher-module contains many components.
Get configuration parameter value from external configuration file by section name and parameter nameExtDescriptionDelphi declaration
property ConfigParams[SectionName, ItemName: AnsiString]: AnsiString read GetConfigParam;
C++ declaration
__property System::AnsiString ConfigParams[System::AnsiString SectionName][System::AnsiString ItemName]={ read=GetConfigParam }
Description
Configuration is loaded at startup from the configuration file that resides in the same directory where DLL and has the same filename, the filename extension must be '.frc'.The configuration file can contain 1...N parameters, every parameter in a separate row.
Row structure: <SectionName>+'_'+<ItemName>+'='<Parameter value>.
Configuration file can be edited with any text editor (for example Notepad) or with our Configuration file editor for TISAPIApp .
DLLs short descriptionInactiveRequestsDelphi declaration
property ExtDescription: AnsiString read FExtDescription write FExtDescription;
C++ declaration
__property System::AnsiString ExtDescription={ read=FExtDescription, write=FExtDescription, nodefault }
Description
The parameter value is taken from TISAPIDispatcher .Used in GetExtensionVersion .
Currently cached (inactive) dispatcher-modules countLoggingEnabledDelphi declaration
property InactiveRequests: Integer read GetInactiveRequests;
C++ declaration
__property int InactiveRequests={ read=GetInactiveRequests, nodefault }
Description
For statistical purposes.
Enables loggingDelphi declaration
property LoggingEnabled: Boolean read FLoggingEnabled write FLoggingEnabled;
C++ declaration
__property bool LoggingEnabled={ read=FLoggingEnabled, write=FLoggingEnabled, nodefault }
Description
Parameter value is taken from TISAPIDispatcher .Logs will be added to the logfile that resides in the same directory than DLL and has the same filename, the filename extension is '.log'.
A file will be created, if it doesn't exist.