home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 July / Chip_1998-07_cd.bin / zkuste / JBuilder / BDK / Win / bdk_sep97.exe / _SETUP.1 / QuoteServerApp.java < prev    next >
Encoding:
Java Source  |  1997-09-10  |  1.0 KB  |  52 lines

  1.  
  2. package sunw.demo.quote;
  3.  
  4. import java.util.Properties;
  5. import java.rmi.Naming;
  6. import java.rmi.RemoteException;
  7. import java.rmi.RMISecurityManager;
  8. import sun.rmi.registry.RegistryImpl;
  9.  
  10.  
  11. class QuoteServerApp
  12. {
  13.   static final int registryPort = 2330;
  14.   static QuoteServerImpl server = null;
  15.   static RegistryImpl registry = null;
  16.  
  17.   /** 
  18.    * Start a QuoteServer running and bind it to "QuoteServer"
  19.    * in the RMI name registry on the local machine.  
  20.    */
  21.   public static void main(String args[])
  22.   {
  23.     Properties systemProps = System.getProperties();
  24.     systemProps.put("http.proxyHost", "webcache1.Eng");
  25.     systemProps.put("http.proxyPort", "8080");
  26.  
  27.     QuoteServerApp app = new QuoteServerApp();
  28.     QuoteServerGUI gui = new QuoteServerGUI(app);
  29.     gui.show();
  30.  
  31.     try {
  32.       registry = new RegistryImpl(registryPort);
  33.       server = new QuoteServerImpl();
  34.       registry.rebind("QuoteServer", server);
  35.  
  36.       gui.refreshAll();
  37.     }
  38.     catch (Exception e) {
  39.       e.printStackTrace();
  40.       return;
  41.     }
  42.     
  43.     gui.showStatus("Ready");
  44.   }
  45. }
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.