Package org.forgerock.openidm.core
Class ServicePropertyAccessor
java.lang.Object
org.forgerock.openidm.core.ServicePropertyAccessor
- All Implemented Interfaces:
PropertyAccessor
A ServicePropertyAccessor tracks services with
ServiceTracker<Map<String, Object>, Map<String, Object>> and gets the
Properties.-
Constructor Summary
ConstructorsConstructorDescriptionServicePropertyAccessor(org.osgi.framework.BundleContext context, org.osgi.util.tracker.ServiceTracker<Map<String, Object>, Map<String, Object>> serviceTracker, PropertyAccessor delegate) -
Method Summary
Modifier and TypeMethodDescription<T> TgetProperty(String key, T defaultValue, Class<T> expected) Returns the value of the specified property.
-
Constructor Details
-
ServicePropertyAccessor
-
-
Method Details
-
getProperty
Returns the value of the specified property. If the key is not found in the tracked services, thedelegateis then requested. The method returnsnullif the property is not found.- Specified by:
getPropertyin interfacePropertyAccessor- Type Parameters:
T- The type of the expected property.- Parameters:
key- The name of the requested property.defaultValue- The value to return if the property is not found.expected- The type of the expected value.- Returns:
- The value of the requested property, or
nullif the property is undefined. - Throws:
SecurityException- If the caller does not have the appropriatePropertyPermissionto read the property, and the Java Runtime Environment supports permissions.
-