Java Dictionary Usage addReferenceIdsToServiceProperties(String prefix, Map referenceProps, Dictionary serviceProps)

Here you can find the source of addReferenceIdsToServiceProperties(String prefix, Map referenceProps, Dictionary serviceProps)

Description

add Reference Ids To Service Properties

License

Open Source License

Declaration

public static void addReferenceIdsToServiceProperties(String prefix, Map<String, Object> referenceProps,
            Dictionary<String, Object> serviceProps) 

Method Source Code

//package com.java2s;
/**// ww w.j  a va 2s. com
 * This file is part of Everit - Commons DBCP Components.
 *
 * Everit - Commons DBCP Components is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Everit - Commons DBCP Components is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Everit - Commons DBCP Components.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.util.Dictionary;
import java.util.Map;

public class Main {
    public static void addReferenceIdsToServiceProperties(String prefix, Map<String, Object> referenceProps,
            Dictionary<String, Object> serviceProps) {

        Object serviceId = referenceProps.get("service.id");
        if (serviceId != null) {
            serviceProps.put(prefix + ".service.id", serviceId);
        }

        Object servicedPid = referenceProps.get("service.pid");
        if (servicedPid != null) {
            serviceProps.put(prefix + ".service.pid", servicedPid);
        }
    }
}

Related

  1. containsKey(Dictionary dict, String key)
  2. getBoolean(Dictionary p, Object key, Boolean defaultValue)
  3. getSpringContextHeader(Dictionary headers)
  4. getState(Dictionary conf, String property)