# Uses of Interface
org.osgi.framework.ServiceReference

Packages that use ServiceReference
Package
Description
org.apache.felix.framework
org.apache.felix.framework.util
org.osgi.framework
Framework Package Version 1.8.
org.osgi.framework.hooks.service
Framework Service Hooks Package Version 1.1.
org.osgi.util.tracker
Tracker Package Version 1.5.

## Uses of ServiceReference in org.apache.felix.framework

Methods in org.apache.felix.framework that return ServiceReference
Modifier and Type
Method
Description
`ServiceReference<?>[]`
ServiceRegistry.`getRegisteredServices(Bundle bundle)`
`ServiceReference<?>[]`
ServiceRegistry.`getServicesInUse(Bundle bundle)`
Methods in org.apache.felix.framework that return types with arguments of type ServiceReference
Modifier and Type
Method
Description
`<S> Set<ServiceReference<S>>`
Felix.`getHooks(Class<S> hookClass)`
`<S> Set<ServiceReference<S>>`
ServiceRegistry.`getHooks(Class<S> hookClass)`
Methods in org.apache.felix.framework with parameters of type ServiceReference
Modifier and Type
Method
Description
`protected void`
Logger.`doLog(Bundle bundle, ServiceReference sr, int level, String msg, Throwable throwable)`
`<S> S`
ServiceRegistry.`getService(Bundle bundle, ServiceReference<S> ref, boolean isServiceObjects)`
`Bundle[]`
ServiceRegistry.`getUsingBundles(ServiceReference<?> ref)`
`final void`
Logger.`log(ServiceReference sr, int level, String msg)`
`final void`
Logger.`log(ServiceReference sr, int level, String msg, Throwable throwable)`
`boolean`
FilterImpl.`match(ServiceReference sr)`
`boolean`
ServiceRegistry.`ungetService(Bundle bundle, ServiceReference<?> ref, Object svcObj)`
Method parameters in org.apache.felix.framework with type arguments of type ServiceReference
Modifier and Type
Method
Description
`protected void`
BundleWiringImpl.BundleClassLoader.`callWovenClassListeners(Felix felix, Set<ServiceReference<WovenClassListener>> wovenClassListeners, WovenClass wovenClass)`

## Uses of ServiceReference in org.apache.felix.framework.util

Methods in org.apache.felix.framework.util with parameters of type ServiceReference
Modifier and Type
Method
Description
`static boolean`
Util.`isServiceAssignable(Bundle requester, ServiceReference ref)`
This method determines if the requesting bundle is able to cast the specified service reference based on class visibility rules of the underlying modules.
Method parameters in org.apache.felix.framework.util with type arguments of type ServiceReference
Modifier and Type
Method
Description
`void`
SecureAction.`invokeServiceFindHook(FindHook fh, BundleContext context, String name, String filter, boolean allServices, Collection<ServiceReference<?>> references)`

## Uses of ServiceReference in org.osgi.framework

Methods in org.osgi.framework that return ServiceReference
Modifier and Type
Method
Description
`ServiceReference<?>[]`
BundleContext.`getAllServiceReferences(String clazz, String filter)`
Returns an array of `ServiceReference` objects.
`ServiceReference<S>`
ServiceRegistration.`getReference()`
Returns a `ServiceReference` object for a service being registered.
`ServiceReference<?>[]`
Bundle.`getRegisteredServices()`
Returns this bundle's `ServiceReference` list for all services it has registered or `null` if this bundle has no registered services.
`<S> ServiceReference<S>`
BundleContext.`getServiceReference(Class<S> clazz)`
Returns a `ServiceReference` object for a service that implements and was registered under the name of the specified class.
`ServiceReference<?>`
BundleContext.`getServiceReference(String clazz)`
Returns a `ServiceReference` object for a service that implements and was registered under the specified class.
`ServiceReference<?>`
ServiceEvent.`getServiceReference()`
Returns a reference to the service that had a change occur in its lifecycle.
`ServiceReference<S>`
ServiceObjects.`getServiceReference()`
Returns the `ServiceReference` for the service associated with this `ServiceObjects` object.
`ServiceReference<?>[]`
BundleContext.`getServiceReferences(String clazz, String filter)`
Returns an array of `ServiceReference` objects.
`ServiceReference<?>[]`
Bundle.`getServicesInUse()`
Returns this bundle's `ServiceReference` list for all services it is using or returns `null` if this bundle is not using any services.
Methods in org.osgi.framework that return types with arguments of type ServiceReference
Modifier and Type
Method
Description
`<S> Collection<ServiceReference<S>>`
BundleContext.`getServiceReferences(Class<S> clazz, String filter)`
Returns a collection of `ServiceReference` objects.
Methods in org.osgi.framework with parameters of type ServiceReference
Modifier and Type
Method
Description
`<S> S`
BundleContext.`getService(ServiceReference<S> reference)`
Returns the service object for the service referenced by the specified `ServiceReference` object.
`<S> ServiceObjects<S>`
BundleContext.`getServiceObjects(ServiceReference<S> reference)`
Returns the `ServiceObjects` object for the service referenced by the specified `ServiceReference` object.
`boolean`
Filter.`match(ServiceReference<?> reference)`
Filter using a service's properties.
`boolean`
BundleContext.`ungetService(ServiceReference<?> reference)`
Releases the service object for the service referenced by the specified `ServiceReference` object.
Constructors in org.osgi.framework with parameters of type ServiceReference
Modifier
Constructor
Description
``
`ServiceEvent(int type, ServiceReference<?> reference)`
Creates a new service event object.
``
`ServicePermission(ServiceReference<?> reference, String actions)`
Creates a new requested `ServicePermission` object to be used by code that must perform `checkPermission` for the `get` action.

## Uses of ServiceReference in org.osgi.framework.hooks.service

Method parameters in org.osgi.framework.hooks.service with type arguments of type ServiceReference
Modifier and Type
Method
Description
`void`
FindHook.`find(BundleContext context, String name, String filter, boolean allServices, Collection<ServiceReference<?>> references)`
Find hook method.

## Uses of ServiceReference in org.osgi.util.tracker

Methods in org.osgi.util.tracker that return ServiceReference
Modifier and Type
Method
Description
`ServiceReference<S>`
ServiceTracker.`getServiceReference()`
Returns a `ServiceReference` for one of the services being tracked by this `ServiceTracker`.
`ServiceReference<S>[]`
ServiceTracker.`getServiceReferences()`
Return an array of `ServiceReference`s for all services being tracked by this `ServiceTracker`.
Methods in org.osgi.util.tracker that return types with arguments of type ServiceReference
Modifier and Type
Method
Description
`SortedMap<ServiceReference<S>,T>`
ServiceTracker.`getTracked()`
Return a `SortedMap` of the `ServiceReference`s and service objects for all services being tracked by this `ServiceTracker`.
Methods in org.osgi.util.tracker with parameters of type ServiceReference
Modifier and Type
Method
Description
`T`
ServiceTracker.`addingService(ServiceReference<S> reference)`
Default implementation of the `ServiceTrackerCustomizer.addingService` method.
`T`
ServiceTrackerCustomizer.`addingService(ServiceReference<S> reference)`
A service is being added to the `ServiceTracker`.
`T`
ServiceTracker.`getService(ServiceReference<S> reference)`
Returns the service object for the specified `ServiceReference` if the specified referenced service is being tracked by this `ServiceTracker`.
`void`
ServiceTracker.`modifiedService(ServiceReference<S> reference, T service)`
Default implementation of the `ServiceTrackerCustomizer.modifiedService` method.
`void`
ServiceTrackerCustomizer.`modifiedService(ServiceReference<S> reference, T service)`
A service tracked by the `ServiceTracker` has been modified.
`void`
ServiceTracker.`remove(ServiceReference<S> reference)`
Remove a service from this `ServiceTracker`.
`void`
ServiceTracker.`removedService(ServiceReference<S> reference, T service)`
Default implementation of the `ServiceTrackerCustomizer.removedService` method.
`void`
ServiceTrackerCustomizer.`removedService(ServiceReference<S> reference, T service)`
A service tracked by the `ServiceTracker` has been removed.
Constructors in org.osgi.util.tracker with parameters of type ServiceReference
Modifier
Constructor
Description
``
`ServiceTracker(BundleContext context, ServiceReference<S> reference, ServiceTrackerCustomizer<S,T> customizer)`
Create a `ServiceTracker` on the specified `ServiceReference` .