http/inventoryprinter/src/main/java/org/apache/felix/http/inventoryprinter/impl/Activator.java [55:86]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void start(final BundleContext context) throws Exception {
        final ServiceTracker<HttpServiceRuntime, HttpServiceRuntime> tracker = new ServiceTracker<>(context, HttpServiceRuntime.class, new ServiceTrackerCustomizer<HttpServiceRuntime,HttpServiceRuntime>() {

            @Override
            public HttpServiceRuntime addingService(final ServiceReference<HttpServiceRuntime> reference) {
                final HttpServiceRuntime runtime = context.getService(reference);
                if ( runtime != null ) {
                    register(context, runtime);
                }
                return runtime;
            }

            @Override
            public void modifiedService(final ServiceReference<HttpServiceRuntime> reference, final HttpServiceRuntime service) {
                // ignore
            }

            @Override
            public void removedService(final ServiceReference<HttpServiceRuntime> reference, final HttpServiceRuntime service) {
                if ( serviceReg != null ) {
                    try {
                        serviceReg.unregister();
                    } catch ( final IllegalStateException ignore) {
                        // ignore
                    }
                    serviceReg = null;
                }
            }
            
        });
        tracker.open();        
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



http/webconsoleplugin/src/main/java/org/apache/felix/http/webconsoleplugin/impl/Activator.java [54:85]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void start(final BundleContext context) throws Exception {
        final ServiceTracker<HttpServiceRuntime, HttpServiceRuntime> tracker = new ServiceTracker<>(context, HttpServiceRuntime.class, new ServiceTrackerCustomizer<HttpServiceRuntime,HttpServiceRuntime>() {

            @Override
            public HttpServiceRuntime addingService(final ServiceReference<HttpServiceRuntime> reference) {
                final HttpServiceRuntime runtime = context.getService(reference);
                if ( runtime != null ) {
                    register(context, runtime);
                }
                return runtime;
            }

            @Override
            public void modifiedService(final ServiceReference<HttpServiceRuntime> reference, final HttpServiceRuntime service) {
                // ignore
            }

            @Override
            public void removedService(final ServiceReference<HttpServiceRuntime> reference, final HttpServiceRuntime service) {
                if ( serviceReg != null ) {
                    try {
                        serviceReg.unregister();
                    } catch ( final IllegalStateException ignore) {
                        // ignore
                    }
                    serviceReg = null;
                }
            }
            
        });
        tracker.open();        
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



