org.ops4j.pax.swissbox.property
Class BundleContextPropertyResolver

java.lang.Object
  extended by org.ops4j.util.property.FallbackPropertyResolver
      extended by org.ops4j.pax.swissbox.property.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
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.
 
Method Summary
 java.lang.String findProperty(java.lang.String propertyName)
          Resolves a property based on it's name by:
1.
 
Methods inherited from class org.ops4j.util.property.FallbackPropertyResolver
get
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 java.lang.String findProperty(java.lang.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.


Copyright © 2006-2011 OPS4J - Open Participation Software for Java. All Rights Reserved.