@Test public void testNullFilter() throws Exception { BundleContext hookBC = mockBundleContext(5L); GuardProxyCatalog gpc = new GuardProxyCatalog(hookBC); GuardingFindHook gfh = new GuardingFindHook(hookBC, gpc, null); gfh.find(null, null, null, true, null); }
public void find(BundleContext bundleContext, String name, String filter, boolean allServices, Collection<ServiceReference<?>> references) { if (servicesFilter == null) { return; } if (this.bundleContext.equals(bundleContext) || bundleContext.getBundle().getBundleId() == 0) { return; } for (Iterator<ServiceReference<?>> i = references.iterator(); i.hasNext(); ) { ServiceReference<?> sr = i.next(); if (!servicesFilter.match(sr)) { continue; } if (guardProxyCatalog.handleProxificationForHook(sr)) { i.remove(); } } }
GuardingFindHook implements FindHook { public void find(BundleContext bundleContext, String name, String filter, boolean allServices, Collection<ServiceReference<?>> references) { if (servicesFilter == null) { return; } if (this.bundleContext.equals(bundleContext) || bundleContext.getBundle().getBundleId() == 0) { return; } for (Iterator<ServiceReference<?>> i = references.iterator(); i.hasNext(); ) { ServiceReference<?> sr = i.next(); if (!servicesFilter.match(sr)) { continue; } if (guardProxyCatalog.handleProxificationForHook(sr)) { i.remove(); } } } }
GuardingFindHook implements FindHook { public void find(BundleContext bundleContext, String name, String filter, boolean allServices, Collection<ServiceReference<?>> references) { if (servicesFilter == null) { return; } if (this.bundleContext.equals(bundleContext) || bundleContext.getBundle().getBundleId() == 0) { return; } for (Iterator<ServiceReference<?>> i = references.iterator(); i.hasNext(); ) { ServiceReference<?> sr = i.next(); if (!servicesFilter.match(sr)) { continue; } if (guardProxyCatalog.handleProxificationForHook(sr)) { i.remove(); } } } GuardingFindHook(BundleContext bundleContext, GuardProxyCatalog guardProxyCatalog, Filter securedServicesFilter); }
GuardingFindHook implements FindHook { public void find(BundleContext bundleContext, String name, String filter, boolean allServices, Collection<ServiceReference<?>> references) { if (servicesFilter == null) { return; } if (this.bundleContext.equals(bundleContext) || bundleContext.getBundle().getBundleId() == 0) { return; } for (Iterator<ServiceReference<?>> i = references.iterator(); i.hasNext(); ) { ServiceReference<?> sr = i.next(); if (!servicesFilter.match(sr)) { continue; } if (guardProxyCatalog.handleProxificationForHook(sr)) { i.remove(); } } } GuardingFindHook(BundleContext bundleContext, GuardProxyCatalog guardProxyCatalog, Filter securedServicesFilter); void find(BundleContext bundleContext, String name, String filter, boolean allServices, Collection<ServiceReference<?>> references); }
GuardingFindHook implements FindHook { public void find(BundleContext bundleContext, String name, String filter, boolean allServices, Collection<ServiceReference<?>> references) { if (servicesFilter == null) { return; } if (this.bundleContext.equals(bundleContext) || bundleContext.getBundle().getBundleId() == 0) { return; } for (Iterator<ServiceReference<?>> i = references.iterator(); i.hasNext(); ) { ServiceReference<?> sr = i.next(); if (!servicesFilter.match(sr)) { continue; } if (guardProxyCatalog.handleProxificationForHook(sr)) { i.remove(); } } } GuardingFindHook(BundleContext bundleContext, GuardProxyCatalog guardProxyCatalog, Filter securedServicesFilter); void find(BundleContext bundleContext, String name, String filter, boolean allServices, Collection<ServiceReference<?>> references);  }