diff options
Diffstat (limited to 'bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/ServiceReference.java')
-rw-r--r-- | bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/ServiceReference.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/ServiceReference.java b/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/ServiceReference.java index d561e9049..a5717304f 100644 --- a/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/ServiceReference.java +++ b/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/ServiceReference.java @@ -181,4 +181,34 @@ public interface ServiceReference<S> extends Comparable<Object> { */ @Override public int compareTo(Object reference); + + /** + * Returns a copy of the properties of the service referenced by this + * {@code ServiceReference} object. + * <p> + * This method will continue to return the properties after the service has + * been unregistered. This is so references to unregistered services (for + * example, {@code ServiceReference} objects stored in the log) can still be + * interrogated. + * <p> + * The returned {@code Dictionary} object: + * <ul> + * <li>Must map property values by using property keys in a + * <i>case-insensitive manner</i>.</li> + * <li>Must return property keys is a <i>case-preserving</i> manner. This + * means that the keys must have the same case as the corresponding key in + * the properties {@code Dictionary} that was passed to the + * {@link BundleContext#registerService(String[],Object,Dictionary)} or + * {@link ServiceRegistration#setProperties(Dictionary)} methods.</li> + * <li>Is the property of the caller and can be modified by the caller but + * any changes are not reflected in the properties of the service. + * {@link ServiceRegistration#setProperties(Dictionary)} must be called to + * modify the properties of the service.</li> + * </ul> + * + * @return A copy of the properties of the service referenced by this + * {@code ServiceReference} object + * @since 1.9 + */ + public Dictionary<String,Object> getProperties(); } |