NSNotificationCenter.defaultCenter().addObserver(observer,                                                              new NSSelector("modelWasAddedNotification", ERXConstant.NotificationClassArray),                                                              EOModelGroup.ModelAddedNotification,                                                              null); NSNotificationCenter.defaultCenter().addObserver(observer,                                                              new NSSelector("classDescriptionNeededForEntityName",                                                                              ERXConstant.NotificationClassArray), EOClassDescription.ClassDescriptionNeededForEntityNameNotification, null);
NSNotificationCenter.defaultCenter().addObserver(observer, new NSSelector("modelWasAddedNotification", ERXConstant.NotificationClassArray), EOModelGroup.ModelAddedNotification, null); NSNotificationCenter.defaultCenter().addObserver(observer, new NSSelector("applicationDidFinishLaunching", ERXConstant.NotificationClassArray), WOApplication.ApplicationWillFinishLaunchingNotification, null); NSNotificationCenter.defaultCenter().addObserver(observer, new NSSelector("classDescriptionNeededForEntityName", ERXConstant.NotificationClassArray), EOClassDescription.ClassDescriptionNeededForEntityNameNotification, null);
    public static void registerDescription() {        if (!_registered) {            Factory observer = null;            try {                String className = System.getProperty("er.extensions.ERXClassDescription.factoryClass");                if (className != null) {                    observer = (Factory)Class.forName(className).newInstance();                }            } catch(Exception ex) {                log.warn("Exception while registering factory, using default: " + ex );            }                        if(observer == null)                observer=new Factory();            ERXRetainer.retain(observer);            // Need to be able to preempt the model registering descriptions.            NSNotificationCenter.defaultCenter().addObserver(observer,                                                              new NSSelector("modelWasAddedNotification", ERXConstant.NotificationClassArray),                                                              EOModelGroup.ModelAddedNotification,                                                              null);            NSNotificationCenter.defaultCenter().addObserver(observer,                                                              new NSSelector("classDescriptionNeededForEntityName",                                                                              ERXConstant.NotificationClassArray), EOClassDescription.ClassDescriptionNeededForEntityNameNotification, null);            NSNotificationCenter.defaultCenter().addObserver(observer, new NSSelector("classDescriptionNeededForClass", ERXConstant.NotificationClassArray), EOClassDescription.ClassDescriptionNeededForClassNotification, null);            NSNotificationCenter.defaultCenter().addObserver(observer, new NSSelector("compilerProxyDidCompileClasses", new Class[] { NSNotification.class } ), ERXCompilerProxy.CompilerProxyDidCompileClassesNotification, null);            _registered = true;        }    }