Class MultiPropertyFilterIndex
- All Implemented Interfaces:
FilterIndex,ServiceTrackerCustomizer
- Author:
- Felix Project Team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddedService(org.osgi.framework.ServiceReference reference, Object service) marrs: A service has been added to the ServiceTracker.addingService(org.osgi.framework.ServiceReference reference) A service is being added to theServiceTracker.voidaddServiceListener(org.osgi.framework.ServiceListener listener, String filter) Adds a service listener to this filter index.voidclose()Closes this filter index.protected MultiPropertyKeycreateKeyFromFilter(String clazz, String filterString) createKeys(org.osgi.framework.ServiceReference reference) List<org.osgi.framework.ServiceReference> getAllServiceReferences(String clazz, String filter) Returns all service references that match the specified class and filter.protected Collection<Property> protected Collection<org.osgi.framework.ServiceListener> protected voidhandleServiceAdd(org.osgi.framework.ServiceReference reference) protected voidhandleServicePropertiesChange(org.osgi.framework.ServiceReference reference) protected voidhandleServiceRemove(org.osgi.framework.ServiceReference reference) booleanisApplicable(String clazz, String filterString) Determines if the combination of class and filter is applicable for this filter index.booleanisApplicable(org.osgi.framework.ServiceReference ref) voidmodifiedService(org.osgi.framework.ServiceReference reference, Object service) A service tracked by theServiceTrackerhas been modified.voidopen(org.osgi.framework.BundleContext context) Opens this filter index.voidremovedService(org.osgi.framework.ServiceReference reference, Object service) A service tracked by theServiceTrackerhas been removed.voidremoveServiceListener(org.osgi.framework.ServiceListener listener) Removes a service listener from this filter index.voidserviceChanged(org.osgi.framework.ServiceEvent event) Invoked whenever a service event occurs.protected booleanshouldBeIndexed(org.osgi.framework.ServiceReference reference) voidswappedService(org.osgi.framework.ServiceReference reference, Object service, org.osgi.framework.ServiceReference newReference, Object newService) A service tracked by theServiceTrackerhas an aspect service added or removed for a tracked service.protected MultiPropertyKeyprotected MultiPropertyKeytoString()
-
Constructor Details
-
MultiPropertyFilterIndex
-
-
Method Details
-
isApplicable
Description copied from interface:FilterIndexDetermines if the combination of class and filter is applicable for this filter index.- Specified by:
isApplicablein interfaceFilterIndex
-
isApplicable
public boolean isApplicable(org.osgi.framework.ServiceReference ref) -
getProperties
-
createKeyFromFilter
-
createKeys
-
toKey
-
toKey
-
addingService
Description copied from interface:ServiceTrackerCustomizerA service is being added to theServiceTracker.This method is called before a service which matched the search parameters of the
ServiceTrackeris added to theServiceTracker. This method should return the service object to be tracked for the specifiedServiceReference. The returned service object is stored in theServiceTrackerand is available from thegetServiceandgetServicesmethods.- Specified by:
addingServicein interfaceServiceTrackerCustomizer- Parameters:
reference- The reference to the service being added to theServiceTracker.- Returns:
- The service object to be tracked for the specified referenced
service or
nullif the specified referenced service should not be tracked.
-
addedService
Description copied from interface:ServiceTrackerCustomizermarrs: A service has been added to the ServiceTracker.- Specified by:
addedServicein interfaceServiceTrackerCustomizer
-
modifiedService
Description copied from interface:ServiceTrackerCustomizerA service tracked by theServiceTrackerhas been modified.This method is called when a service being tracked by the
ServiceTrackerhas had it properties modified.- Specified by:
modifiedServicein interfaceServiceTrackerCustomizer- Parameters:
reference- The reference to the service that has been modified.service- The service object for the specified referenced service.
-
removedService
Description copied from interface:ServiceTrackerCustomizerA service tracked by theServiceTrackerhas been removed.This method is called after a service is no longer being tracked by the
ServiceTracker.- Specified by:
removedServicein interfaceServiceTrackerCustomizer- Parameters:
reference- The reference to the service that has been removed.service- The service object for the specified referenced service.
-
handleServiceAdd
protected void handleServiceAdd(org.osgi.framework.ServiceReference reference) -
handleServicePropertiesChange
protected void handleServicePropertiesChange(org.osgi.framework.ServiceReference reference) -
handleServiceRemove
protected void handleServiceRemove(org.osgi.framework.ServiceReference reference) -
shouldBeIndexed
protected boolean shouldBeIndexed(org.osgi.framework.ServiceReference reference) -
open
public void open(org.osgi.framework.BundleContext context) Description copied from interface:FilterIndexOpens this filter index.- Specified by:
openin interfaceFilterIndex
-
close
public void close()Description copied from interface:FilterIndexCloses this filter index.- Specified by:
closein interfaceFilterIndex
-
getAllServiceReferences
public List<org.osgi.framework.ServiceReference> getAllServiceReferences(String clazz, String filter) Description copied from interface:FilterIndexReturns all service references that match the specified class and filter. Never returns null.- Specified by:
getAllServiceReferencesin interfaceFilterIndex
-
serviceChanged
public void serviceChanged(org.osgi.framework.ServiceEvent event) Description copied from interface:FilterIndexInvoked whenever a service event occurs.- Specified by:
serviceChangedin interfaceFilterIndex
-
addServiceListener
Description copied from interface:FilterIndexAdds a service listener to this filter index.- Specified by:
addServiceListenerin interfaceFilterIndex
-
removeServiceListener
public void removeServiceListener(org.osgi.framework.ServiceListener listener) Description copied from interface:FilterIndexRemoves a service listener from this filter index. If the listener is not present in the filter index, this method does nothing.- Specified by:
removeServiceListenerin interfaceFilterIndex
-
getServiceListeners
-
toString
-
swappedService
public void swappedService(org.osgi.framework.ServiceReference reference, Object service, org.osgi.framework.ServiceReference newReference, Object newService) Description copied from interface:ServiceTrackerCustomizerA service tracked by theServiceTrackerhas an aspect service added or removed for a tracked service.This method is called when an aspect service has been either added or removed for a tracked service. This method will only be called when there's a new highest ranked service as result of adding or removal of the aspect service. In this case the previously highest ranked service is 'swapped' for the new highest ranked service ensuring the client always gets the highest ranked aspect.
- Specified by:
swappedServicein interfaceServiceTrackerCustomizer- Parameters:
reference- The reference for the old highest ranked service.service- The service object for the old highest ranked service.newReference- The reference to the new highest ranked service.newService- The service object for the new highest ranked service.
-