TISAPIDispatcherContents - Events - Methods - Properties
FR ISAPI Dispatcher component
Description
Purpose of the dispatcher is to find the appropriate request handler (actionitem) depending on the request parameters. It also manages user sessions and is responsible for handling unhandled requests.At design time, the dispatcher enables the setting properties for TISAPIApp.
The dispatcher resides in the dispatcher-module (TDataModule).
For every request, TISAPIApp creates a new dispatcher-module object.
Contents - TISAPIDispatcher - Properties - Methods
AfterAction
Notify after request handlingBeforeActionDelphi declaration
property AfterAction: TFRSessionEvent read FAfterAction write FAfterAction;
C++ declaration
__property TFRSessionEvent AfterAction={ read=FAfterAction, write=FAfterAction }
Description
This event is called after all request handling events are passed.
Notify about new requestOnActivateSessionDelphi declaration
property BeforeAction: TFRSessionEvent read FBeforeAction write FBeforeAction;
C++ declaration
__property TFRSessionEvent BeforeAction={ read=FBeforeAction, write=FBeforeAction }
Description
This event is called before any request handling event.
Notify about session activatedOnCheckSessionIDDelphi declaration
property OnActivateSession: TFRSessionEvent read FOnActivateSession write FOnActivateSession;
C++ declaration
__property TFRSessionEvent OnActivateSession={ read=FOnActivateSession, write=FOnActivateSession }
Description
Forced when a new or existing session becomes active.
Checking session IDOnCheckUserRightsDelphi declaration
property OnCheckSessionID: TFRChSessionID read FOnCheckSessionID write FOnCheckSessionID;
C++ declaration
__property TFRChSessionID OnCheckSessionID={ read=FOnCheckSessionID, write=FOnCheckSessionID }
Description
Called:from the CreateSession method to quarantee a unique session ID,
or from the DispatchRequest method before other events to check that the session ID is valid.
Checking user rights against the tableOnCreateSessionDelphi declaration
property OnCheckUserRights: TFRChUserRights read FOnCheckUserRights write FOnCheckUserRights;
C++ declaration
__property TFRChUserRights OnCheckUserRights={ read=FOnCheckUserRights, write=FOnCheckUserRights }
Description
Called inside the CheckUserRights method.
Notify after a new session is createdOnDeactivateSessionDelphi declaration
property OnCreateSession: TFRSessionEvent read FOnCreateSession write FOnCreateSession;
C++ declaration
__property TFRSessionEvent OnCreateSession={ read=FOnCreateSession, write=FOnCreateSession }
Description
Forced by the CreateSession method, when a new session has successfully been created.
Notify about current session deactivatedOnDefaultRequestDelphi declaration
property OnDeactivateSession: TFRSessionEvent read FOnDeactivateSession write FOnDeactivateSession;
C++ declaration
__property TFRSessionEvent OnDeactivateSession={ read=FOnDeactivateSession, write=FOnDeactivateSession }
Description
Forced, when a request has successfully been handled, or by the DestroySession method.
Default request handlerOnDestroySessionDelphi declaration
property OnDefaultRequest: TOnNewRequestEvent read FOnDefaultRequest write FOnDefaultRequest;
C++ declaration
__property TOnNewRequestEvent OnDefaultRequest={ read=FOnDefaultRequest, write=FOnDefaultRequest }
Description
Called, if the request pathinfo is empty.
Notify before current session is destroyedOnTerminateExtensionDelphi declaration
property OnDestroySession: TFRSessionEvent read FOnDestroySession write FOnDestroySession;
C++ declaration
__property TFRSessionEvent OnDestroySession={ read=FOnDestroySession, write=FOnDestroySession }
Description
Forced by the DestroySession method.
TerminateExtension event holder at design timeOnUnExpectedRequestDelphi declaration
property OnTerminateExtension: TOnTerminateExtensionEvent read FOnTerminateExtension write FOnTerminateExtension;
C++ declaration
__property TOnTerminateExtensionEvent OnTerminateExtension={ read=FOnTerminateExtension, write=FOnTerminateExtension }
Description
At runtime, this event may be called by TISAPIApp before terminating (unloading) DLL (depends of server).
Unexpected requests handlerOnUnhandledRequestDelphi declaration
property OnUnExpectedRequest: TOnNewRequestEvent read FOnUnExpectedRequest write FOnUnExpectedRequest;
C++ declaration
__property TOnNewRequestEvent OnUnExpectedRequest={ read=FOnUnExpectedRequest, write=FOnUnExpectedRequest }
Description
Called, if actionitem for the request path is not found.
Unhandled request eventDelphi declaration
property OnUnhandledRequest: TOnNewRequestEvent read FOnUnhandledRequest write FOnUnhandledRequest;
C++ declaration
__property TOnNewRequestEvent OnUnhandledRequest={ read=FOnUnhandledRequest, write=FOnUnhandledRequest }
Description
Called, if the request is not handled by actionitem or by OnUnExpectedRequest or OnDefaultRequest handlers.
Contents - TISAPIDispatcher - Properties - Events
~TISAPIDispatcher
DestructorActivateSessionC++ declaration
__fastcall virtual ~TISAPIDispatcher(void)
Description
Normally you should not free dispatcher objects yourself, it will be done by TISAPIApp.
Delphi declarationCheckUserRights
procedure ActivateSession;
C++ declaration
void __fastcall ActivateSession(void)
Checking current user rights against the table and actionCreateDelphi declaration
function CheckUserRights(Sender: TComponent; Action, TableName: AnsiString): Boolean;
C++ declaration
bool __fastcall CheckUserRights(Classes::TComponent *Sender, System::AnsiString Action, System::AnsiString TableName)
Description
Forces the OnCheckUserRights event for the actual checking.The result is TRUE, when user rights are ok.
ConstructorCreateSessionDelphi declaration
constructor Create(AOwner: TComponent);
Description
Normally you should not create dispatcher objects, it will be created by TISAPIApp for every request.
Creates a new sessionDeactivateSessionDelphi declaration
procedure CreateSession;
C++ declaration
void __fastcall CreateSession(void)
Description
Must be called manually, when a new session is required.If a session is already active, it destroys the session by calling DestroySession.
Forces the events: OnCheckSessionID, OnCreateSession, OnActivateSession, and activates the session.
Delphi declarationDestroy
procedure DeactivateSession;
C++ declaration
void __fastcall DeactivateSession(void)
DestructorDestroySessionDelphi declaration
destructor Destroy;
Description
Normally you should not free dispatcher objects yourself, it will be done by TISAPIApp.
Destroying sessionDispatchRequestDelphi declaration
procedure DestroySession;
C++ declaration
void __fastcall DestroySession(void)
Description
Must be called manually, when session is required to be destroyed.Forces the events: OnDeactivateSession, OnDestroySession
Internal request dispatchingGenerateSessionIDDelphi declaration
function DispatchRequest(Request: TFRISAPIRequest; Response: TFRISAPIResponse): Boolean;
C++ declaration
bool __fastcall DispatchRequest(TFRISAPIRequest *Request, TFRISAPIResponse *Response)
Description
Called by TISAPIApp
Delphi declarationGetCacheConnections
function GenerateSessionID: AnsiString;
C++ declaration
System::AnsiString __fastcall GenerateSessionID(void)
Delphi declarationGetExtDescription
function GetCacheConnections: Boolean;
C++ declaration
bool __fastcall GetCacheConnections(void)
Delphi declarationGetLoggingEnabled
function GetExtDescription: AnsiString;
C++ declaration
System::AnsiString __fastcall GetExtDescription(void)
Delphi declarationGetSessName
function GetLoggingEnabled: Boolean;
C++ declaration
bool __fastcall GetLoggingEnabled(void)
Delphi declarationIsSession
function GetSessName: AnsiString;
C++ declaration
System::AnsiString __fastcall GetSessName(void)
Delphi declarationSetCacheConnections
function IsSession(ASessionID: AnsiString): Boolean;
C++ declaration
bool __fastcall IsSession(System::AnsiString ASessionID)
Delphi declarationSetExtDescription
procedure SetCacheConnections(Value: Boolean);
C++ declaration
void __fastcall SetCacheConnections(bool Value)
Delphi declarationSetLoggingEnabled
procedure SetExtDescription(Value: AnsiString);
C++ declaration
void __fastcall SetExtDescription(System::AnsiString Value)
Delphi declarationTISAPIDispatcher
procedure SetLoggingEnabled(Value: Boolean);
C++ declaration
void __fastcall SetLoggingEnabled(bool Value)
ConstructorC++ declaration
__fastcall virtual TISAPIDispatcher(Classes::TComponent *AOwner)
Description
Normally you should not create dispatcher objects, it will be created by TISAPIApp for every request.
Contents - TISAPIDispatcher - Methods - Events
AppSessions
Enable sessions managingCacheConnectionsDelphi declaration
property AppSessions: Boolean read FAppSessions write FAppSessions;
C++ declaration
__property bool AppSessions={ read=FAppSessions, write=FAppSessions, nodefault }
Description
Set TRUE, if you want to use session-managing.Sessions are usable for checking the users and user rights.
Internally, the session managing uses HTTP Cookies.
Enable cachingExtDescriptionDelphi declaration
property CacheConnections: Boolean read GetCacheConnections write SetCacheConnections;
C++ declaration
__property bool CacheConnections={ read=GetCacheConnections, write=SetCacheConnections, nodefault }
Description
At runtime, will be used by TISAPIApp.TISAPIApp caches dispatcher-modules: modules will be put into cache after they have finished request handling and will be re-used (taken from cache), when a new request arrives, instead of creating and destroying them. This may increase the speed.
Warning: don't try to use cache for TForm objects. TForm must be destroyed inside the same thread where it was created!
DLLs short descriptionLicenceKeyDelphi declaration
property ExtDescription: AnsiString read GetExtDescription write SetExtDescription;
C++ declaration
__property System::AnsiString ExtDescription={ read=GetExtDescription, write=SetExtDescription, nodefault }
Description
At runtime, will be used by TISAPIApp inside the GetExtensionVersion .
Licence keyLoggingEnabledDelphi declaration
property LicenceKey: TEKeyProp read FKeyProp write FKeyProp;
C++ declaration
__property Unkeyprop::TEKeyProp *LicenceKey={ read=FKeyProp, write=FKeyProp, nodefault }
Description
Set the licence key at design time.You don't need to distribute the licence key with your application, it will be compiled into executable.
Unlicensed component adds a small notice at the end of each processed HTML page.
A licence key can be obtained from the component distributors: http://www.platoo.ee
Enable error-loggingRequestDelphi declaration
property LoggingEnabled: Boolean read GetLoggingEnabled write SetLoggingEnabled;
C++ declaration
__property bool LoggingEnabled={ read=GetLoggingEnabled, write=SetLoggingEnabled, nodefault }
Description
When enabled, at runtime, TISAPIApp creates and enables writing to logfile.Logfile name is the same as the DLL name, the extension is ".log".
TISAPIApp writes unhandled errors (catched exceptions) to logfile.
Additionally, you can write to log by using the functions TFRISAPIRequest.WriteLog , TFRISAPIRequest.WriteLogEx .
Warning: don't overuse it, usually the server creates logs itself. This feature is mainly used for debugging purposes and may decrease speed.
Current requestResponseDelphi declaration
property Request: TFRISAPIRequest read FRequest;
C++ declaration
__property TFRISAPIRequest *Request={ read=FRequest, nodefault }
Description
Created by TISAPIApp
Current responseSessionActiveDelphi declaration
property Response: TFRISAPIResponse read FResponse;
C++ declaration
__property TFRISAPIResponse *Response={ read=FResponse, nodefault }
Description
Created by TISAPIApp
Session activity flagSessionIDDelphi declaration
property SessionActive: Boolean read FSessionActive;
C++ declaration
__property bool SessionActive={ read=FSessionActive, nodefault }
Description
Shows that the session is currently active.
Current session IDSessionNameDelphi declaration
property SessionID: AnsiString read FSessID;
C++ declaration
__property System::AnsiString SessionID={ read=FSessID, nodefault }
Description
Will be generated automatically in the CreateSession procedure .Empty, if there is no active session ( SessionActive = FALSE).
Current session nameDelphi declaration
property SessionName: AnsiString read GetSessName;
C++ declaration
__property System::AnsiString SessionName={ read=GetSessName, nodefault }
Description
SessionName = Dispatcher-component name + SessionID