public BindServiceReferenceImpl addingService()

in cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/BindServiceReferenceImpl.java [52:83]


	public BindServiceReferenceImpl<T> addingService(ServiceReference<T> reference) {
		if (_enqueue.get()) {
			_queue.add(reference);
			return this;
		}

		BundleContext bundleContext = _containerState.bundleContext();
		service = bundleContext.getService(reference);

		onAdding.ifPresent(
			c -> {
				try {
					c.accept(reference);
				}
				catch (Throwable t) {
					_log.error(l -> l.error("CCR error in {}", this, t));
				}
			}
		);
		onAddingBi.ifPresent(
			c -> {
				try {
					c.accept(reference, service);
				}
				catch (Throwable t) {
					_log.error(l -> l.error("CCR error in {}", this, t));
				}
			}
		);

		return this;
	}