Class BundleContextPropertyResolver

  • All Implemented Interfaces:
    org.ops4j.util.property.PropertyResolver

    public class BundleContextPropertyResolver
    extends org.ops4j.util.property.FallbackPropertyResolver
    Resolves properties by first looking in an optional configured dictionary then if property not found looking in bundle context.
    Since:
    0.1.0, January 16, 2008
    Author:
    Alin Dreghiciu
    • Constructor Summary

      Constructors 
      Constructor Description
      BundleContextPropertyResolver​(org.osgi.framework.BundleContext bundleContext)
      Creates a property resolver without a fallback resolver.
      BundleContextPropertyResolver​(org.osgi.framework.BundleContext bundleContext, org.ops4j.util.property.PropertyResolver fallbackResolver)
      Creates a property resolver with a fallback resolver.
    • Constructor Detail

      • BundleContextPropertyResolver

        public BundleContextPropertyResolver​(org.osgi.framework.BundleContext bundleContext)
        Creates a property resolver without a fallback resolver.
        Parameters:
        bundleContext - bundle context; cannot be null
      • BundleContextPropertyResolver

        public BundleContextPropertyResolver​(org.osgi.framework.BundleContext bundleContext,
                                             org.ops4j.util.property.PropertyResolver fallbackResolver)
        Creates a property resolver with a fallback resolver.
        Parameters:
        bundleContext - bundle context; cannot be null
        fallbackResolver - fallback property resolver; can be null
    • Method Detail

      • findProperty

        public String findProperty​(String propertyName)
        Resolves a property based on it's name by:
        1. if there is a configuration available look for the property;
        2. if property is not set or there is no configuration available look for a framework / system property.
        Specified by:
        findProperty in class org.ops4j.util.property.FallbackPropertyResolver
        Parameters:
        propertyName - property name to be resolved
        Returns:
        value of property or null if property is not set or is empty.