Package org.apache.jackrabbit.oak.osgi
Class OsgiWhiteboard
- java.lang.Object
-
- org.apache.jackrabbit.oak.osgi.OsgiWhiteboard
-
- All Implemented Interfaces:
Whiteboard
public class OsgiWhiteboard extends Object implements Whiteboard
OSGi-based whiteboard implementation.
-
-
Constructor Summary
Constructors Constructor Description OsgiWhiteboard(@NotNull org.osgi.framework.BundleContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Registration
register(Class<T> type, T service, Map<?,?> properties)
Publishes the given service to the whiteboard.<T> Tracker<T>
track(Class<T> type)
Returns a tracker for services of the given type.<T> Tracker<T>
track(Class<T> type, Map<String,String> filterProperties)
Starts tracking services of the given type, with given attributes.
-
-
-
Method Detail
-
register
public <T> Registration register(Class<T> type, T service, Map<?,?> properties)
Description copied from interface:Whiteboard
Publishes the given service to the whiteboard. Use the returned registration object to unregister the service.- Specified by:
register
in interfaceWhiteboard
- Parameters:
type
- type of the serviceservice
- service instanceproperties
- service properties. Those need to useString
keys, but for backwards compatibility reasons this is not enforced via generics.- Returns:
- service registration
-
track
public <T> Tracker<T> track(Class<T> type)
Returns a tracker for services of the given type. The returned tracker is optimized for frequentTracker.getServices()
calls through the use of a pre-compiled list of services that's atomically updated whenever services are added, modified or removed.- Specified by:
track
in interfaceWhiteboard
- Parameters:
type
- type of the services to track- Returns:
- service tracker
-
track
public <T> Tracker<T> track(Class<T> type, Map<String,String> filterProperties)
Description copied from interface:Whiteboard
Starts tracking services of the given type, with given attributes.- Specified by:
track
in interfaceWhiteboard
- Parameters:
type
- type of the services to trackfilterProperties
- only services with these properties will be tracked. Null keys are not permitted. Null values means that the property should be absent.- Returns:
- service tracker
-
-