home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / TRIAL / JBUILDER / JVISBRKR.Z / CreditApprovalServer.java < prev    next >
Encoding:
Java Source  |  1998-05-08  |  2.4 KB  |  69 lines

  1. /*
  2.  * Copyright (c) 1997-1998 Borland International, Inc. All Rights Reserved.
  3.  * 
  4.  * This SOURCE CODE FILE, which has been provided by Borland as part
  5.  * of a Borland product for use ONLY by licensed users of the product,
  6.  * includes CONFIDENTIAL and PROPRIETARY information of Borland.  
  7.  *
  8.  * USE OF THIS SOFTWARE IS GOVERNED BY THE TERMS AND CONDITIONS 
  9.  * OF THE LICENSE STATEMENT AND LIMITED WARRANTY FURNISHED WITH
  10.  * THE PRODUCT.
  11.  *
  12.  * IN PARTICULAR, YOU WILL INDEMNIFY AND HOLD BORLAND, ITS RELATED
  13.  * COMPANIES AND ITS SUPPLIERS, HARMLESS FROM AND AGAINST ANY CLAIMS
  14.  * OR LIABILITIES ARISING OUT OF THE USE, REPRODUCTION, OR DISTRIBUTION
  15.  * OF YOUR PROGRAMS, INCLUDING ANY CLAIMS OR LIABILITIES ARISING OUT OF
  16.  * OR RESULTING FROM THE USE, MODIFICATION, OR DISTRIBUTION OF PROGRAMS
  17.  * OR FILES CREATED FROM, BASED ON, AND/OR DERIVED FROM THIS SOURCE
  18.  * CODE FILE.
  19.  */
  20. //--------------------------------------------------------------------------------------------------
  21. // CORBA Reference Application
  22. // Copyright (c) 1997 by Borland International, All Rights Reserved
  23. //
  24. // Contains Main Server class for the Server portion of the CORBA
  25. // Reference Application
  26. //--------------------------------------------------------------------------------------------------
  27.  
  28. package borland.reference.creditapproval.server;
  29.  
  30. /**
  31. * CreditApprovalServer creates an instance of the credit approval object
  32. * dispenser and registers it with the ORB.
  33. */
  34. public class CreditApprovalServer {
  35.  
  36.   // Used as default if no command-line parameter is specified
  37.   static final int DEFAULT_COUNT = 1;
  38.  
  39.   static public void main(String[] args) {
  40.     int instanceCount;
  41.     try {
  42.       if (args.length == 0)
  43.         instanceCount = DEFAULT_COUNT;
  44.       else
  45.         instanceCount = Integer.parseInt(args[0]);
  46.  
  47.       // Initialize the ORB
  48.       org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
  49.  
  50.       // Initialize the BOA
  51.       org.omg.CORBA.BOA boa = orb.BOA_init();
  52.  
  53.       // Create the Credit Approval Dispenser Class
  54.       CreditApprovalDispenserImpl dispenser = new CreditApprovalDispenserImpl( "Main Dispenser",
  55.                                                instanceCount );
  56.  
  57.       // Export the dispenser Object
  58.       boa.obj_is_ready( dispenser );
  59.  
  60.        // Service Requests.
  61.        boa.impl_is_ready();
  62.     }
  63.     catch( org.omg.CORBA.SystemException e) {
  64.       System.err.println(e);
  65.     }
  66.   }
  67. }
  68.  
  69.