/** * Instantiates an uberspector class and adds it to the chain. Also set the log and runtime services, if the class * implements the proper interfaces. The {@link Uberspect#init()} method is not called. * * @param classname The name of the uberspector class to add to the chain. */ protected void initializeUberspector(String classname) { // Avoids direct recursive calls if (!StringUtils.isEmpty(classname) && !classname.equals(this.getClass().getCanonicalName())) { Uberspect u = instantiateUberspector(classname); if (u == null) { return; } // Set the log and runtime services, if applicable if (u instanceof UberspectLoggable) { ((UberspectLoggable) u).setLog(this.log); } if (u instanceof RuntimeServicesAware) { ((RuntimeServicesAware) u).setRuntimeServices(this.runtime); } // Link it in the chain if (u instanceof ChainableUberspector) { ((ChainableUberspector) u).wrap(this.inner); } this.inner = u; } }
((UberspectLoggable) uberSpect).setRuntimeLogger(this);
((UberspectLoggable) u).setLog(this.log);
((UberspectLoggable)u).setLog(getLog());
((UberspectLoggable)u).setLog(getLog());