public class ServiceReferenceImpl<S> extends java.lang.Object implements ServiceReference<S>
ServiceReference
限定符和类型 | 方法和说明 |
---|---|
int |
compareTo(java.lang.Object obj)
Compare two ServiceReferences
|
boolean |
equals(java.lang.Object o)
Test if ServiceReferences points to same service.
|
Bundle |
getBundle()
Return the bundle which registered the service.
|
java.lang.Object |
getProperty(java.lang.String key)
Get the value of a service's property.
|
java.lang.String[] |
getPropertyKeys()
Get the list of key names for the service's properties.
|
Bundle[] |
getUsingBundles()
Return the bundles that are using the service wrapped by this
ServiceReference, i.e., whose usage count for this service
is greater than zero.
|
int |
hashCode()
Return a hashcode for the service.
|
boolean |
isAssignableTo(Bundle bundle,
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. |
public java.lang.Object getProperty(java.lang.String key)
getProperty
在接口中 ServiceReference<S>
key
- The property key.null
if
there is no property named after the key.ServiceReference.getProperty(java.lang.String)
public java.lang.String[] getPropertyKeys()
getPropertyKeys
在接口中 ServiceReference<S>
ServiceReference.getPropertyKeys()
public Bundle getBundle()
getBundle
在接口中 ServiceReference<S>
ServiceReference
object; null
if that service has
already been unregistered.ServiceReference.getBundle()
public boolean equals(java.lang.Object o)
equals
在类中 java.lang.Object
ServiceReference
public int compareTo(java.lang.Object obj)
compareTo
在接口中 java.lang.Comparable<java.lang.Object>
compareTo
在接口中 ServiceReference<S>
obj
- The ServiceReference
to be compared.ServiceReference
is less than, equal to, or greater than
the specified ServiceReference
.ServiceReference
public int hashCode()
hashCode
在类中 java.lang.Object
ServiceReference
public Bundle[] getUsingBundles()
getUsingBundles
在接口中 ServiceReference<S>
public boolean isAssignableTo(Bundle bundle, java.lang.String className)
ServiceReference
ServiceReference
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
在接口中 ServiceReference<S>
bundle
- 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.