Exemple #1
0
  /**
   * 获得价格数据服务
   *
   * @return PriceDataService
   */
  private PriceDataService getService() {

    PriceDataService priceDataService = null;

    try {
      // 获得数据库的引用
      DatabaseFactory databaseFactory = (DatabaseFactory) Naming.lookup(RMIConnect.RMI);
      FinanceFactory financeFactory = databaseFactory.getFinanceFactory();
      priceDataService = financeFactory.getPriceDataService();
    } catch (MalformedURLException e) {
      e.printStackTrace();
    } catch (RemoteException e) {
      e.printStackTrace();
    } catch (NotBoundException e) {
      e.printStackTrace();
    }

    return priceDataService;
  }