@ Override public HttpService addingService ( final ServiceReference < HttpService > serviceReference ) { LOG . debug ( "HttpService available {}" , serviceReference ) ; lock . lock ( ) ; HttpService addedHttpService = null ; try { if ( httpService != null ) { return super . addingService ( serviceReference ) ; } httpService = super . addingService ( serviceReference ) ; addedHttpService = httpService ; } finally { lock . unlock ( ) ; } try { listener . available ( addedHttpService ) ; } catch ( Exception ignore ) { // CHECKSTYLE:SKIP LOG . error ( "Cannot register" , ignore ) ; } return addedHttpService ; }
Gets the service if one is not already available and notify listeners .