text
stringlengths
0
234
-- ------------------------------
-- Close the application.
-- ------------------------------
overriding
procedure Close (App : in out Application) is
begin
App.Events.Stop;
ASF.Applications.Main.Application (App).Close;
end Close;
-- ------------------------------
-- Register the module in the application
-- ------------------------------
procedure Register (App : in Application_Access;
Module : access AWA.Modules.Module'Class;
Name : in String;
URI : in String := "") is
begin
App.Register (Module.all'Unchecked_Access, Name, URI);
end Register;
-- ------------------------------
-- Get the database connection for reading
-- ------------------------------
function Get_Session (App : Application)
return ADO.Sessions.Session is
begin
return App.DB_Factory.Get_Session;
end Get_Session;
-- ------------------------------
-- Get the database connection for writing
-- ------------------------------
function Get_Master_Session (App : Application)
return ADO.Sessions.Master_Session is
begin
return App.DB_Factory.Get_Master_Session;
end Get_Master_Session;
-- ------------------------------
-- Find the module with the given name
-- ------------------------------
function Find_Module (App : in Application;
Name : in String) return AWA.Modules.Module_Access is
begin
return AWA.Modules.Find_By_Name (App.Modules, Name);
end Find_Module;
-- ------------------------------
-- Register the module in the application
-- ------------------------------
procedure Register (App : in out Application;
Module : in AWA.Modules.Module_Access;
Name : in String;
URI : in String := "") is
begin
AWA.Modules.Register (App.Modules'Unchecked_Access, App'Unchecked_Access, Module, Name, URI);
end Register;
-- ------------------------------
-- Send the event in the application event queues.
-- ------------------------------
procedure Send_Event (App : in Application;
Event : in AWA.Events.Module_Event'Class) is
begin
App.Events.Send (Event);
end Send_Event;
-- ------------------------------
-- Execute the <tt>Process</tt> procedure with the event manager used by the application.
-- ------------------------------
procedure Do_Event_Manager (App : in out Application;
Process : access procedure
(Events : in out AWA.Events.Services.Event_Manager)) is
begin
Process (App.Events);
end Do_Event_Manager;
-- ------------------------------
-- Initialize the parser represented by <b>Parser</b> to recognize the configuration
-- that are specific to the plugins that have been registered so far.
-- ------------------------------
procedure Initialize_Parser (App : in out Application'Class;
Parser : in out Util.Serialize.IO.Parser'Class) is
procedure Process (Module : in out AWA.Modules.Module'Class);
procedure Process (Module : in out AWA.Modules.Module'Class) is
begin
Module.Initialize_Parser (Parser);
end Process;
begin
AWA.Modules.Iterate (App.Modules, Process'Access);
end Initialize_Parser;
-- ------------------------------
-- Get the current application from the servlet context or service context.
-- ------------------------------
function Current return Application_Access is
use type AWA.Services.Contexts.Service_Context_Access;