aboutsummaryrefslogtreecommitdiffstats
path: root/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/impl/AgglomerateConfiguration.java
blob: d50948c2014fffb624ded7c346fab5992bb63c45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package org.openecomp.config.impl;

import org.apache.commons.configuration2.DatabaseConfiguration;

import java.util.Collections;
import java.util.Map;
import java.util.WeakHashMap;

/**
 * The type Agglomerate configuration.
 */
public class AgglomerateConfiguration extends DatabaseConfiguration {

  private final Map<String, Object> store =
      Collections.synchronizedMap(new WeakHashMap<String, Object>());

  /**
   * Gets property value.
   *
   * @param key the key
   * @return the property value
   */
  public Object getPropertyValue(String key) {
    Object objToReturn = null;
    objToReturn = store.get(key);
    if (objToReturn == null && !store.containsKey(key)) {
      store.put(key, objToReturn = super.getProperty(key));
    }
    return objToReturn;
  }

}