home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue60 / Construc / RDataMod.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-07-04  |  1.1 KB  |  42 lines

  1. unit RDataMod;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Classes, ComServ, ComObj, VCLCom, DataBkr,
  5.   DBClient, TDM60_TLB, StdVcl;
  6.  
  7. type
  8.   TPoolingMidasServer = class(TRemoteDataModule, IPoolingMidasServer)
  9.   private
  10.     { Private declarations }
  11.   protected
  12.     class procedure UpdateRegistry(Register: Boolean; const ClassID, ProgID: string); override;
  13.   public
  14.     { Public declarations }
  15.   end;
  16.  
  17. implementation
  18.  
  19. {$R *.DFM}
  20.  
  21. class procedure TPoolingMidasServer.UpdateRegistry(Register: Boolean; const ClassID, ProgID: string);
  22. begin
  23.   if Register then
  24.   begin
  25.     inherited UpdateRegistry(Register, ClassID, ProgID);
  26.     EnableSocketTransport(ClassID);
  27.     EnableWebTransport(ClassID);
  28.     RegisterPooled(ClassID,10,42); // max. 10 instances, timeout = 42 minutes
  29.   end else
  30.   begin
  31.     UnregisterPooled(ClassID);
  32.     DisableSocketTransport(ClassID);
  33.     DisableWebTransport(ClassID);
  34.     inherited UpdateRegistry(Register, ClassID, ProgID);
  35.   end;
  36. end;
  37.  
  38. initialization
  39.   TComponentFactory.Create(ComServer, TPoolingMidasServer,
  40.     Class_PoolingMidasServer, ciMultiInstance, tmApartment);
  41. end.
  42.