Elements menu

 

The best components for the best developers

Development framework
How to implement the repository functionality in an application server

Repository server
The repository server

Management console
Some of the features of the management console

Development framework

How to implement the repository functionality in an application server

Any kbmMW based application server can be repository enabled very simply by adding a few lines of codes in its start up code.

Using the standard BDE application server demo, it is repository enabled by adding at least one repository component (optionally more can be added) and the following code:

procedure TForm1.Button1Click(Sender: TObject);
var
   id:string;
begin
     // Try to get configuration from remote repository.
     // If that fails, get from local.
     id:=kbmMWServer1.GetUniqueIdentifier;
     if kbmMWMServerRemoteRepository1.LoadFromRepository(id) then
        kbmMWMServerRemoteRepository1.Apply
     else if kbmMWMServerFileRepository1.LoadFromRepository(id) then
        kbmMWMServerFileRepository1.Apply;

     // Activate server.
     kbmMWServer1.Active:=true;
     Label3.Caption := 'Listening';    
end;

Essentially this tries to load the configuration from a remote repository server, and if that fails of some reason, it will load the configuration from a local file based repository. More repositories can be defined and can be accessed in similar way. Its even possible to distribute parts of the configuration to different repositories if that is desirable.

If the application server should be accessible from a management console, a management service must be included in the application server. That is done by including one additional service registration line at the place where services normally are registered:

     sd:=kbmMWServer1.RegisterService(TkbmMWInventoryService,false);
     sd:=kbmMWServer1.RegisterServiceByName('KBMMW_QUERY',TTestQuery,false);
     sd:=kbmMWServer1.RegisterService(TkbmMWMgmtService,false);

Its as simple as that.

 

 


(Top)

 
 

User comments

I am currently making an application for a customer.
IMHO, kbmMW™ is better than Asta, Datasnap, dbOvernet....
(more)

Before I ask my questions and give my comments, I want to say that I've had two job interviews this week and you ...
(more)

 



 



 
 
 
Embarcadero Technology Partner Components4Developers is an Embarcadero Technology Partner approved n-tier vendor!

Copyright© 2001-2012 Components4Developers - All rights reserved