@Override
	public W addingService(final ServiceReference<T> serviceReference) {
		LOG.debug("Service available {}", serviceReference);
		T registered = bundleContext.getService(serviceReference);

		Boolean sharedHttpContext = ServicePropertiesUtils.extractSharedHttpContext(serviceReference);

		W webElement = createWebElement(serviceReference, registered);
		if (webElement != null) {
			String httpContextId = webElement.getHttpContextId();
			final WebApplication webApplication = extenderContext.getWebApplication(serviceReference.getBundle(),
					httpContextId, sharedHttpContext);
            if (httpContextId == null && !webApplication.hasHttpContextMapping()
                    // PAXWEB-1090 create DefaultHttpContext when default-whiteboard-contextId available without mapping
                    || HttpWhiteboardConstants.HTTP_WHITEBOARD_DEFAULT_CONTEXT_NAME.equalsIgnoreCase(httpContextId)) {
				webApplication.setHttpContextMapping(new DefaultHttpContextMapping());
			}
			webApplication.addWebElement(webElement);
			return webElement;
		} else {
			// if no element was created release the service
			bundleContext.ungetService(serviceReference);
			return null;
		}
	}
@ Override public W addingService ( final ServiceReference < T > serviceReference ) { LOG . debug ( "Service available {}" , serviceReference ) ; T registered = bundleContext . getService ( serviceReference ) ; Boolean sharedHttpContext = ServicePropertiesUtils . extractSharedHttpContext ( serviceReference ) ; W webElement = createWebElement ( serviceReference , registered ) ; if ( webElement != null ) { String httpContextId = webElement . getHttpContextId ( ) ; final WebApplication webApplication = extenderContext . getWebApplication ( serviceReference . getBundle ( ) , httpContextId , sharedHttpContext ) ; if ( httpContextId == null && ! webApplication . hasHttpContextMapping ( ) || HttpWhiteboardConstants . HTTP_WHITEBOARD_DEFAULT_CONTEXT_NAME . equalsIgnoreCase ( httpContextId ) ) { webApplication . setHttpContextMapping ( new DefaultHttpContextMapping ( ) ) ; } webApplication . addWebElement ( webElement ) ; return webElement ; } else { bundleContext . ungetService ( serviceReference ) ; return null ; } }
@see ServiceTracker#addingService(ServiceReference)