public T addingService()

in src/main/java/org/apache/sling/rewriter/impl/HashingServiceTrackerCustomizer.java [113:130]


    public T addingService(final ServiceReference<T> reference) {
        final String type = this.getType(reference);
        final T factory = (type == null ? null : this.context.getService(reference));
        if ( factory != null ) {
            if ( FactoryCache.LOGGER.isDebugEnabled() ) {
                FactoryCache.LOGGER.debug("Found service {}, type={}.", factory, type);
            }
            synchronized ( this ) {
                Entry<T> entry = this.services.get(type);
                if ( entry == null ) {
                    entry = new Entry<T>();
                    this.services.put(type, entry);
                }
                entry.add(reference, factory);
            }
        }
        return factory;
    }