protected Interceptor ensureInterceptor ( String n ) { Interceptor i = null ; if ( _interceptors == null ) { _interceptors = new HashMap < String , Interceptor > ( ) ; } else { i = _interceptors . get ( n ) ; } if ( i == null ) { try { i = ( Interceptor ) getControlService ( getControlBeanContext ( ) . getClassLoader ( ) . loadClass ( n ) , null ) ; } catch ( Exception e ) { // Couldn't instantiate the desired service; usually this is because the service interface itself // isn't present on this system at runtime (ClassNotFoundException), or if the container of the // control didn't registers the service. /* TODO log a message here to that effect, but just swallow the exception for now. */ } finally { // We want to always return an interceptor, so if we can't get the one we want, we'll substitute // a "null" interceptor that does nothing. if ( i == null ) i = new NullInterceptor ( ) ; _interceptors . put ( n , i ) ; } } return i ; }
Retrieves interceptor instances creates them lazily .