use of groovy.lang.MetaClassRegistryChangeEventListener in project grails-core by grails.
the class MetaClassRegistryCleaner method createAndRegister.
public static MetaClassRegistryCleaner createAndRegister() {
MetaClassRegistry metaClassRegistry = GroovySystem.getMetaClassRegistry();
MetaClassRegistryChangeEventListener[] listeners = metaClassRegistry.getMetaClassRegistryChangeEventListeners();
boolean registered = false;
for (MetaClassRegistryChangeEventListener listener : listeners) {
if (listener == INSTANCE) {
registered = true;
break;
}
}
if (!registered) {
GroovySystem.getMetaClassRegistry().addMetaClassRegistryChangeEventListener(INSTANCE);
}
return INSTANCE;
}
Aggregations