Exemplo n.º 1
0
  /**
   * Creates a Managed Service that is created from a Managed Service Factory. Waits for the
   * asynchronous call that the properties have been updated and the service can be used.
   *
   * <p>For Managed Services not created from a Managed Service Factory, use {@link
   * #startManagedService(String, Map)} instead.
   *
   * @param factoryPid the factory pid of the Managed Service Factory
   * @param properties the service properties for the Managed Service
   * @throws IOException if access to persistent storage fails
   */
  public void createManagedService(String factoryPid, Map<String, Object> properties)
      throws IOException {

    final Configuration sourceConfig = adminConfig.createFactoryConfiguration(factoryPid, null);

    startManagedService(sourceConfig, properties);
  }
Exemplo n.º 2
0
  public void setFanout(boolean fanoutEnabled) throws IOException {
    Map<String, Object> properties =
        adminConfig.getDdfConfigAdmin().getProperties(CATALOG_FRAMEWORK_PID);
    if (properties == null) {
      properties = new Hashtable<>();
    }
    if (fanoutEnabled) {
      properties.put("fanoutEnabled", "True");
    } else {
      properties.put("fanoutEnabled", "False");
    }

    serviceManager.startManagedService(CATALOG_FRAMEWORK_PID, properties);
  }
Exemplo n.º 3
0
  /**
   * Starts a Managed Service. Waits for the asynchronous call that the properties have been updated
   * and the service can be used.
   *
   * <p>For Managed Services created from a Managed Service Factory, use {@link
   * #createManagedService(String, Map)} instead.
   *
   * @param servicePid persistent identifier of the Managed Service to start
   * @param properties service configuration properties
   * @throws IOException thrown if if access to persistent storage fails
   */
  public void startManagedService(String servicePid, Map<String, Object> properties)
      throws IOException {
    Configuration sourceConfig = adminConfig.getConfiguration(servicePid, null);

    startManagedService(sourceConfig, properties);
  }