2 * Copyright 2016 ZTE Corporation.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.openo.carbon.bpel.config;
18 import org.apache.commons.lang3.StringUtils;
20 public class ConfigManager {
21 private static BpsExtraProperties extraProperties;
22 private static BpsCommonProperties commonProperties;
23 private static ConfigManager instance = null;
25 private ConfigManager() {
26 commonProperties = BpsCommonProperties.getInstance();
27 extraProperties = BpsExtraProperties.getInstance();
30 public static synchronized ConfigManager getInstance() {
31 if (instance == null) {
32 instance = new ConfigManager();
37 public String getProperty(String key) {
38 String value = extraProperties.getProperty(key);
39 value = StringUtils.trimToEmpty(value);
40 if (StringUtils.isBlank(value)) {
41 return commonProperties.getProperty(key);