}
@Override
public void doDynamicMethods() {
long time = System.currentTimeMillis();
GrailsConsole console = GrailsConsole.getInstance();
console.addStatus("doWithDynamicMethods started");
checkInitialised();
// remove common meta classes just to be sure
MetaClassRegistry registry = GroovySystem.getMetaClassRegistry();
for (Class<?> COMMON_CLASS : COMMON_CLASSES) {
registry.removeMetaClass(COMMON_CLASS);
}
for (GrailsPlugin plugin : pluginList) {
if (plugin.supportsCurrentScopeAndEnvironment()) {
try {
long pluginTime = System.currentTimeMillis();
console.addStatus("doWithDynamicMethods for plugin [" + plugin.getName() + "] started");
plugin.doWithDynamicMethods(applicationContext);
console.addStatus("doWithDynamicMethods for plugin [" + plugin.getName() + "] took " + (System.currentTimeMillis() - pluginTime));
}
catch (Throwable t) {
console.error(t);
console.error("Error configuring dynamic methods for plugin " + plugin + ": " + t.getMessage());
}
}
}
console.addStatus("doWithDynamicMethods took " + (System.currentTimeMillis() - time));
}