Top Description Methods
org.osgi.framework.hooks.service

public Interface FindHook

Annotations
@ConsumerType
Imports
java.util.Collection, org.osgi.annotation.versioning.ConsumerType, org.osgi.framework.BundleContext, .ServiceReference

OSGi Framework Service Find Hook Service.

Bundles registering this service will be called during framework service find (get service references) operations.

Author
$Id: 4325a49f8c29ac9e7f32e8450db26148bbda5642 $

Method Summary

Modifier and TypeMethod and Description
public void
find(BundleContext
The bundle context of the bundle performing the find operation.
context
,
String
The class name of the services to find or null to find all services.
name
,
String
The filter criteria of the services to find or null for no filter criteria.
filter
,
boolean
true if the find operation is the result of a call to BundleContext#getAllServiceReferences(String, String)
allServices
,
Collection<ServiceReference<?>>
A collection of Service References to be returned as a result of the find operation. The implementation of this method may remove service references from the collection to prevent the references from being returned to the bundle performing the find operation. The collection supports all the optional Collection operations except add and addAll. Attempting to add to the collection will result in an UnsupportedOperationException. The collection is not synchronized.
references
)

Find hook method.

Method Detail

findback to summary
public void find(BundleContext context, String name, String filter, boolean allServices, Collection<ServiceReference<?>> references)

Find hook method. This method is called during the service find operation (for example, BundleContext#getServiceReferences(String, String) ). This method can filter the result of the find operation.

Parameters
context:BundleContext

The bundle context of the bundle performing the find operation.

name:String

The class name of the services to find or null to find all services.

filter:String

The filter criteria of the services to find or null for no filter criteria.

allServices:boolean

true if the find operation is the result of a call to BundleContext#getAllServiceReferences(String, String)

references:Collection<ServiceReference<?>>

A collection of Service References to be returned as a result of the find operation. The implementation of this method may remove service references from the collection to prevent the references from being returned to the bundle performing the find operation. The collection supports all the optional Collection operations except add and addAll. Attempting to add to the collection will result in an UnsupportedOperationException. The collection is not synchronized.