public synchronized boolean hasService ( Class serviceClass ) { // todo: for multithreaded usage this block needs to be synchronized ServiceProvider sp = _serviceProviders . get ( serviceClass ) ; if ( sp != null && ! sp . isRevoked ( ) ) { return true ; } // if service not found locally check in nested context BeanContext bc = getBeanContext ( ) ; if ( bc instanceof BeanContextServices ) { return ( ( BeanContextServices ) bc ) . hasService ( serviceClass ) ; } return false ; // end synchronized }
Reports whether or not a given service is currently available from this context .