コード例 #1
0
  @Override
  protected void doConfigure(
      ServiceProfile<?> profile,
      Map<String, String> desiredProperties,
      Map<String, String> desiredEnvironmentVariables)
      throws InterruptedException, IOException {
    Map<String, String> conf = profile.getConfiguration();
    String trackerClassName = conf.get(ExecutionTracker.KEY_CLASS);
    String trackingId = conf.get(ExecutionTracker.KEY_ID);

    assertThat(trackerClassName, is(notNullValue()));
    assertThat(trackingId, is(notNullValue()));

    try {
      Class<?> trackerClass = profile.getContext().getClassLoader().loadClass(trackerClassName);
      this.tracker = trackerClass.asSubclass(ExecutionTracker.class).newInstance();
      this.id = ExecutionTracker.Id.get(trackingId);
    } catch (Exception e) {
      throw new AssertionError(e);
    }
  }