コード例 #1
0
  public synchronized void addOpenFactory(IOpenFactoryConfiguration opfc)
      throws OpenConfigurationException {
    if (openFactories == null) {
      openFactories = new HashMap<String, IOpenFactoryConfiguration>();
    }

    if (opfc.getName() == null) {
      throw new OpenConfigurationException("The factory must have a name", opfc.getUri(), null);
    }
    if (openFactories.containsKey(opfc.getName())) {
      throw new OpenConfigurationException(
          "Duplicated name: " + opfc.getName(), opfc.getUri(), null);
    }

    openFactories.put(opfc.getName(), opfc);
  }