public String getProperty()

in components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintPropertiesSource.java [56:84]


    public String getProperty(String name) {
        String answer = null;

        for (PropertyPlaceholderWrapper placeholder : placeholders) {
            boolean isDefault = false;
            if (placeholders.size() > 1) {
                // okay we have multiple placeholders and we want to return the answer that
                // is not the default placeholder if there is multiple keys
                Map map = placeholder.getDefaultProperties();
                isDefault = map != null && map.containsKey(name);
                LOG.trace("Blueprint property key: {} is part of default properties: {}", name, isDefault);
            }

            try {
                String candidate = placeholder.retrieveValue(name);
                if (candidate != null) {
                    if (answer == null || !isDefault) {
                        LOG.trace("Blueprint candidate property key: {} as value: {}", name, answer);
                        answer = candidate;
                    }
                }
            } catch (Exception ex) {
                // Here we just catch the exception and try to use other candidate
            }
        }
        LOG.debug("Blueprint getProperty: {}={}", name, answer);

        return answer;
    }