+/*
+ * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
package org.opendaylight.controller.cluster.common.actor;
import com.google.common.base.Preconditions;
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
-
import java.util.HashMap;
import java.util.Map;
public abstract class AbstractConfig implements UnifiedConfig {
- private Config config;
+ private final Config config;
public AbstractConfig(Config config){
this.config = config;
return (T)this;
}
- protected Config merge(){
- if (fallback == null)
- fallback = ConfigFactory.load().getConfig(actorSystemName);
+ protected Config merge() {
+ Config config = ConfigFactory.parseMap(configHolder);
+ if (fallback != null) {
+ config = config.withFallback(fallback);
+ }
- return ConfigFactory.parseMap(configHolder).withFallback(fallback);
+ return config;
}
}
}