home *** CD-ROM | disk | FTP | other *** search
/ Delphi Anthology / aDELPHI.iso / Runimage / Delphi50 / Demos / Corba / Datamodule / corbaserverimpl.pas < prev   
Pascal/Delphi Source File  |  1999-08-11  |  2KB  |  64 lines

  1. unit CORBAServerImpl;
  2.  
  3. {
  4.   This is the Implementation Unit of the CORBA Server.
  5.   In the initialization section of this unit, the wizard writes a call to
  6.   CORBAFactory constructor which creates an instance of the Object DemoCORBA.
  7.   The third parameter to the method is the Repository ID and is of
  8.   the format 'IDL:ProjectName/ClassNameFactory:1.0'
  9.   This is what any CORBA client uses to connect to any CORBA Server.
  10.   In order to view the IDL file, use the 'Export to CORBA IDL' button
  11.   on the Type Library Form.
  12. }
  13.  
  14. interface
  15.  
  16. uses
  17.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  18.   ComObj, VCLCom, StdVcl, DataBkr, CorbaRdm, CorbaObj,
  19.   CORBAServer_TLB, Db, DBTables, Provider;
  20.  
  21. type
  22.  
  23.   TDemoCORBA = class(TCorbaDataModule, IDemoCORBA)
  24.     CustTable: TTable;
  25.     CustomerSource: TDataSource;
  26.     OrderTable: TTable;
  27.     CustomerTable: TDataSetProvider;
  28.     procedure DemoCORBACreate(Sender: TObject);
  29.     procedure DemoCORBADestroy(Sender: TObject);
  30.   private
  31.     { Private declarations }
  32.   public
  33.     { Public declarations }
  34.   end;
  35.  
  36. var
  37.   DemoCORBA: TDemoCORBA;
  38.  
  39. implementation
  40.  
  41. {$R *.DFM}
  42.  
  43. uses CorbInit, CorbaVcl, CORBAServerForm;
  44.  
  45.  
  46. { These Create/Destroy methods are optional. These are here for the purpose
  47.   of counting the clients connected to the CORBA Server
  48.   Disabling IDE debugger would allow running multiple copies of the client.}
  49.  
  50. procedure TDemoCORBA.DemoCORBACreate(Sender: TObject);
  51. begin
  52.   MainServerForm.UpdateClientCount(1);
  53. end;
  54.  
  55. procedure TDemoCORBA.DemoCORBADestroy(Sender: TObject);
  56. begin
  57.   MainServerForm.UpdateClientCount(-1);
  58. end;
  59.  
  60. initialization
  61.   TCorbaVclComponentFactory.Create('DemoCORBAFactory', 'DemoCORBA', 'IDL:CORBAServer/DemoCORBAFactory:1.0', IDemoCORBA,
  62.     TDemoCORBA, iMultiInstance, tmSingleThread);
  63. end.
  64.