Skip to content

Commit

Permalink
Don't attempt to write Executor to Typesafe Config object in Coordina…
Browse files Browse the repository at this point in the history
…torConfig.
  • Loading branch information
kuujo committed Feb 3, 2015
1 parent 0e0fcf4 commit 0207a6e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public class CoordinatorConfig extends AbstractConfigurable {

private final Executor DEFAULT_COORDINATOR_EXECUTOR = Executors.newSingleThreadExecutor(new NamedThreadFactory("copycat-coordinator-%d"));

private Executor executor;

public CoordinatorConfig() {
super();
}
Expand Down Expand Up @@ -123,7 +125,7 @@ public CoordinatorConfig withClusterConfig(ClusterConfig config) {
* @param executor The coordinator executor.
*/
public void setExecutor(Executor executor) {
this.config = config.withValue(COORDINATOR_EXECUTOR, ConfigValueFactory.fromAnyRef(executor));
this.executor = executor;
}

/**
Expand All @@ -132,7 +134,7 @@ public void setExecutor(Executor executor) {
* @return The coordinator executor or {@code null} if no executor was specified.
*/
public Executor getExecutor() {
return config.hasPath (COORDINATOR_EXECUTOR) ? (Executor) config.getValue(COORDINATOR_EXECUTOR).unwrapped() : DEFAULT_COORDINATOR_EXECUTOR;
return executor != null ? executor : DEFAULT_COORDINATOR_EXECUTOR;
}

/**
Expand Down

0 comments on commit 0207a6e

Please sign in to comment.