Definition at line 49 of file ServiceReferenceImpl.java.
Public Member Functions | |
Object | getProperty (String key) |
Get the value of a service's property. | |
String[] | getPropertyKeys () |
Get the list of key names for the service's properties. | |
Bundle | getBundle () |
Return the bundle which registered the service. | |
boolean | equals (Object o) |
Test if ServiceReferences points to same service. | |
int | hashCode () |
Return a hashcode for the service. | |
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. | |
boolean | isAssignableTo (Bundle bundle, 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. | |
Package Functions | |
ServiceReferenceImpl (ServiceRegistrationImpl reg) | |
Construct a ServiceReference based on given ServiceRegistration. | |
Object | getService (final BundleImpl bundle) |
Get the service object. | |
boolean | ungetService (BundleImpl bundle, boolean checkRefCounter) |
Unget the service object. | |
PropertiesDictionary | getProperties () |
Get all properties registered with this service. | |
Object | cloneObject (Object val) |
Clone object. |
org.knopflerfish.framework.ServiceReferenceImpl.ServiceReferenceImpl | ( | ServiceRegistrationImpl | reg | ) | [package] |
Construct a ServiceReference based on given ServiceRegistration.
reg | ServiceRegistration pointed to be this reference. |
Definition at line 63 of file ServiceReferenceImpl.java.
Object org.knopflerfish.framework.ServiceReferenceImpl.getProperty | ( | String | key | ) |
Get the value of a service's property.
Implements org.osgi.framework.ServiceReference.
Definition at line 76 of file ServiceReferenceImpl.java.
References org.knopflerfish.framework.ServiceReferenceImpl.cloneObject(), org.knopflerfish.framework.PropertiesDictionary.get(), and org.knopflerfish.framework.ServiceRegistrationImpl.properties.
Referenced by org.knopflerfish.framework.ServiceListenerState.getMatchingListeners(), and org.knopflerfish.framework.Listeners.serviceChanged().
String [] org.knopflerfish.framework.ServiceReferenceImpl.getPropertyKeys | ( | ) |
Get the list of key names for the service's properties.
Implements org.osgi.framework.ServiceReference.
Definition at line 92 of file ServiceReferenceImpl.java.
References org.knopflerfish.framework.PropertiesDictionary.keyArray(), and org.knopflerfish.framework.ServiceRegistrationImpl.properties.
Bundle org.knopflerfish.framework.ServiceReferenceImpl.getBundle | ( | ) |
Return the bundle which registered the service.
Implements org.osgi.framework.ServiceReference.
Definition at line 104 of file ServiceReferenceImpl.java.
References org.knopflerfish.framework.ServiceRegistrationImpl.bundle.
boolean org.knopflerfish.framework.ServiceReferenceImpl.equals | ( | Object | o | ) |
Test if ServiceReferences points to same service.
Definition at line 114 of file ServiceReferenceImpl.java.
int org.knopflerfish.framework.ServiceReferenceImpl.hashCode | ( | ) |
Return a hashcode for the service.
Definition at line 127 of file ServiceReferenceImpl.java.
Bundle [] org.knopflerfish.framework.ServiceReferenceImpl.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.
null
if no bundles currently are using this serviceImplements org.osgi.framework.ServiceReference.
Definition at line 146 of file ServiceReferenceImpl.java.
References org.knopflerfish.framework.ServiceRegistrationImpl.dependents, org.knopflerfish.framework.ServiceRegistrationImpl.properties, and org.knopflerfish.framework.ServiceRegistrationImpl.reference.
Object org.knopflerfish.framework.ServiceReferenceImpl.getService | ( | final BundleImpl | bundle | ) | [package] |
Get the service object.
bundle | requester of service. |
Definition at line 168 of file ServiceReferenceImpl.java.
References org.knopflerfish.framework.ServiceRegistrationImpl.available, org.knopflerfish.framework.ServiceRegistrationImpl.bundle, org.knopflerfish.framework.PermissionOps.callGetService(), org.knopflerfish.framework.PermissionOps.checkGetServicePerms(), org.knopflerfish.framework.ServiceRegistrationImpl.dependents, org.knopflerfish.framework.BundleImpl.framework, org.knopflerfish.framework.Listeners.frameworkError(), org.knopflerfish.framework.PropertiesDictionary.get(), org.knopflerfish.framework.BundleImpl.getClassLoader(), org.knopflerfish.framework.Framework.listeners, org.knopflerfish.framework.BundleClassLoader.loadClass(), org.knopflerfish.framework.Framework.perm, org.knopflerfish.framework.ServiceRegistrationImpl.properties, org.knopflerfish.framework.ServiceRegistrationImpl.service, and org.knopflerfish.framework.ServiceRegistrationImpl.serviceInstances.
boolean org.knopflerfish.framework.ServiceReferenceImpl.ungetService | ( | BundleImpl | bundle, | |
boolean | checkRefCounter | |||
) | [package] |
Unget the service object.
bundle | Bundle who wants remove service. | |
checkRefCounter | If true decrement refence counter and remove service if we reach zero. If false remove service without checking refence counter. |
Definition at line 227 of file ServiceReferenceImpl.java.
References org.knopflerfish.framework.ServiceRegistrationImpl.bundle, org.knopflerfish.framework.ServiceRegistrationImpl.dependents, org.knopflerfish.framework.BundleImpl.framework, org.knopflerfish.framework.Listeners.frameworkError(), org.knopflerfish.framework.Framework.listeners, org.knopflerfish.framework.ServiceRegistrationImpl.properties, org.knopflerfish.framework.ServiceRegistrationImpl.reference, org.knopflerfish.framework.ServiceRegistrationImpl.service, and org.knopflerfish.framework.ServiceRegistrationImpl.serviceInstances.
PropertiesDictionary org.knopflerfish.framework.ServiceReferenceImpl.getProperties | ( | ) | [package] |
Get all properties registered with this service.
Definition at line 259 of file ServiceReferenceImpl.java.
References org.knopflerfish.framework.ServiceRegistrationImpl.properties.
Referenced by org.knopflerfish.framework.ServiceListenerState.getMatchingListeners().
Object org.knopflerfish.framework.ServiceReferenceImpl.cloneObject | ( | Object | val | ) | [package] |
Clone object.
Handles all service property types and does this recursivly.
bundle | Object to clone. |
Definition at line 274 of file ServiceReferenceImpl.java.
Referenced by org.knopflerfish.framework.ServiceReferenceImpl.getProperty().
boolean org.knopflerfish.framework.ServiceReferenceImpl.isAssignableTo | ( | Bundle | bundle, | |
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.
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
.
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.Implements org.osgi.framework.ServiceReference.
Definition at line 309 of file ServiceReferenceImpl.java.
References org.knopflerfish.framework.BundleImpl.bpkgs, org.knopflerfish.framework.ServiceRegistrationImpl.bundle, org.knopflerfish.framework.BundleImpl.framework, org.knopflerfish.framework.Packages.getPkg(), org.knopflerfish.framework.BundlePackages.getProviderBundlePackages(), org.knopflerfish.framework.Framework.packages, and org.knopflerfish.framework.Pkg.providers.
Referenced by org.knopflerfish.framework.Listeners.serviceChanged().