String getFilter() { Filter filter = registration.filter; return filter != NoFilter.INSTANCE ? filter.toString() : null; }
/** * Create a {@code ServiceTracker} on the specified {@code Filter} object. * * <p> * Services which match the specified {@code Filter} object will be tracked * by this {@code ServiceTracker}. * * @param context The {@code ModuleContext} against which the tracking is * done. * @param filter The {@code Filter} to select the services to be tracked. * @param customizer The customizer object to call when services are added, * modified, or removed in this {@code ServiceTracker}. If customizer * is null, then this {@code ServiceTracker} will be used as the * {@code ServiceTrackerCustomizer} and this {@code ServiceTracker} * will call the {@code ServiceTrackerCustomizer} methods on itself. */ public ServiceTracker(final ModuleContext context, final Filter filter, final ServiceTrackerCustomizer<S, T> customizer) { this.context = context; this.trackReference = null; this.trackClass = null; this.listenerFilter = filter.toString(); this.filter = filter; this.customizer = (customizer == null) ? this : customizer; if ((context == null) || (filter == null)) { // we throw a NPE here to be consistent with the other constructors throw new NullPointerException(); } }