class ServiceRegistrationImpl.ServiceReferenceImpl extends BundleCapabilityImpl implements ServiceReference
| Modifier and Type | Field and Description |
|---|---|
private ServiceRegistrationImpl.ServiceReferenceMap |
m_map |
VERSION_ATTR| Modifier | Constructor and Description |
|---|---|
private |
ServiceReferenceImpl() |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(java.lang.Object reference)
Compares this
ServiceReference with the specified
ServiceReference for order. |
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes()
Returns the attributes of this capability.
|
Bundle |
getBundle()
Returns the bundle that registered the service referenced by this
ServiceReference object. |
java.util.Map<java.lang.String,java.lang.String> |
getDirectives()
Returns the directives of this capability.
|
java.lang.String |
getNamespace()
Returns the namespace of this capability.
|
java.lang.Object |
getProperty(java.lang.String s)
Returns the property value to which the specified property key is mapped
in the properties
Dictionary object of the service referenced by
this ServiceReference object. |
java.lang.String[] |
getPropertyKeys()
Returns an array of the keys in the properties
Dictionary object
of the service referenced by this ServiceReference object. |
(package private) ServiceRegistrationImpl |
getRegistration() |
BundleRevision |
getRevision()
Returns the bundle revision declaring this capability.
|
java.util.List<java.lang.String> |
getUses() |
Bundle[] |
getUsingBundles()
Returns the bundles that are using the service referenced by this
ServiceReference object. |
boolean |
isAssignableTo(Bundle requester,
java.lang.String className)
Tests if the bundle that registered the service referenced by this
ServiceReference and the specified bundle use the same source for
the package of the specified class name. |
java.lang.String |
toString() |
getResource, isAttributeMandatory, isIncludedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitequals, hashCodeprivate final ServiceRegistrationImpl.ServiceReferenceMap m_map
ServiceRegistrationImpl getRegistration()
public BundleRevision getRevision()
BundleCapabilitygetRevision in interface BundleCapabilitygetRevision in class BundleCapabilityImplpublic java.lang.String getNamespace()
BundleCapabilitygetNamespace in interface BundleCapabilitygetNamespace in interface CapabilitygetNamespace in class BundleCapabilityImplpublic java.util.Map<java.lang.String,java.lang.String> getDirectives()
BundleCapability
All capability directives not specified by the
wiring namespaces have no specified
semantics and are considered extra user defined information.
getDirectives in interface BundleCapabilitygetDirectives in interface CapabilitygetDirectives in class BundleCapabilityImplpublic java.util.Map<java.lang.String,java.lang.Object> getAttributes()
BundleCapabilitygetAttributes in interface BundleCapabilitygetAttributes in interface CapabilitygetAttributes in class BundleCapabilityImplpublic java.util.List<java.lang.String> getUses()
getUses in class BundleCapabilityImplpublic java.lang.Object getProperty(java.lang.String s)
ServiceReferenceDictionary object of the service referenced by
this ServiceReference object.
Property keys are case-insensitive.
This method must continue to return property values after the service has
been unregistered. This is so references to unregistered services (for
example, ServiceReference objects stored in the log) can still be
interrogated.
getProperty in interface ServiceReferences - The property key.null if
there is no property named after the key.public java.lang.String[] getPropertyKeys()
ServiceReferenceDictionary object
of the service referenced by this ServiceReference object.
This method will continue to return the keys after the service has been
unregistered. This is so references to unregistered services (for
example, ServiceReference objects stored in the log) can still be
interrogated.
This method is case-preserving ; this means that every key in the
returned array must have the same case as the corresponding key in the
properties Dictionary that was passed to the
BundleContext.registerService(String[],Object,Dictionary) or
ServiceRegistration.setProperties(Dictionary) methods.
getPropertyKeys in interface ServiceReferencepublic Bundle getBundle()
ServiceReferenceServiceReference object.
This method must return null when the service has been
unregistered. This can be used to determine if the service has been
unregistered.
getBundle in interface ServiceReferenceServiceReference object; null if that service has
already been unregistered.BundleContext.registerService(String[],Object,Dictionary)public Bundle[] getUsingBundles()
ServiceReferenceServiceReference object. Specifically, this method returns the
bundles whose usage count for that service is greater than zero.getUsingBundles in interface ServiceReferenceServiceReference object is greater than zero;
null if no bundles are currently using that service.public java.lang.String toString()
toString in class BundleCapabilityImplpublic boolean isAssignableTo(Bundle requester, java.lang.String className)
ServiceReferenceServiceReference and the specified bundle use the same source for
the package of the specified class name.
This method performs the following checks:
ServiceReference (registrant bundle); find the source for the
package. If no source is found then return true if the registrant
bundle is equal to the specified bundle; otherwise return false.true;
otherwise return false.isAssignableTo in interface ServiceReferencerequester - The Bundle object to check.className - The class name to check.true if the bundle which registered the service
referenced by this ServiceReference and the specified
bundle use the same source for the package of the specified class
name. Otherwise false is returned.public int compareTo(java.lang.Object reference)
ServiceReferenceServiceReference with the specified
ServiceReference for order.
If this ServiceReference and the specified
ServiceReference have the same service id they are equal. This ServiceReference is less than
the specified ServiceReference if it has a lower
service ranking and greater if it has a
higher service ranking. Otherwise, if this ServiceReference and
the specified ServiceReference have the same
service ranking, this
ServiceReference is less than the specified
ServiceReference if it has a higher service id and greater if it has a lower service id.
compareTo in interface java.lang.ComparablecompareTo in interface ServiceReferencereference - The ServiceReference to be compared.ServiceReference is less than, equal to, or greater than
the specified ServiceReference.