Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSSelector


    if (initialized) {
      return;
    }

    initialized = true;
    NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("modelAdded", NotificationClassArray),
        EOModelGroup.ModelAddedNotification, null);
    NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("modelRemoved", NotificationClassArray),
        EOModelGroup.ModelInvalidatedNotification, null);
    NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("storeCoordinatorAdded", NotificationClassArray),
        EOObjectStoreCoordinator.CooperatingObjectStoreWasAddedNotification, null);
    NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("storeCoordinatorRemoved", NotificationClassArray),
        EOObjectStoreCoordinator.CooperatingObjectStoreWasRemovedNotification, null);

    Class<?> ERXClass = _NSUtilities.classWithName("er.extensions.foundation.ERXUtilities");
    if (ERXClass != null) {
      try {
        _ERXEntityCache = ERXClass.getDeclaredField("_entityNameEntityCache");
        _ERXEntityCache.setAccessible(true);

        ERXClass = _NSUtilities.classWithName("er.extensions.eof.ERXEntityClassDescription");
        Method factory = ERXClass.getDeclaredMethod("factory");
        _ERXEntityClassDescriptionFactory = factory.invoke(null, new Object[0]);

        ERXClass = _NSUtilities.classWithName("er.extensions.eof.ERXEntityClassDescription$Factory");
        _ERXEntityClassDescriptionCacheReset = ERXClass.getDeclaredMethod("reset");
       
        NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("resetWonderEntityCache", NotificationClassArray), EO_ENTITY_CACHE_RESET, null);
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  }
View Full Code Here


        if (!WOApplication.application().isCachingEnabled() && !hasRegistered) {
            String filePath = ERXFileUtilities.pathForResourceNamed(navigationMenuFileName(), frameworkName, null);
            if (log.isDebugEnabled())
                log.debug("Registering observer for filePath: " + filePath);
            ERXFileNotificationCenter.defaultCenter().addObserver(this,
                                                                  new NSSelector("reloadNavigationMenu", ERXConstant.NotificationClassArray),
                                                                  filePath);
        }
    }
View Full Code Here

      developmentMode = ERXApplication.isDevelopmentModeSafe();

        if (developmentMode || checkFilesPeriod() > 0) {
            ERXRetainer.retain(this);
            log.debug("Caching disabled.  Registering for notification: " + WOApplication.ApplicationWillDispatchRequestNotification);
            NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("checkIfFilesHaveChanged", ERXConstant.NotificationClassArray), WOApplication.ApplicationWillDispatchRequestNotification, null);           
        }
       
        // MS: In case we are touching properties before they're fully materialized or messed up from a failed reload, lets use System.props here
        symlinkSupport = Boolean.valueOf(System.getProperty("ERXFileNotificationCenter.symlinkSupport", "true"));
    }
View Full Code Here

 
  public static class Observer {
    public void finishedLaunchingApp(NSNotification n) {
      try {
        WOJRebelClassReloadHandler.getInstance().initialize();
        NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("run", NotificationClassArray), WebObjectsPlugin.JREBEL_EVENT, null);
      } catch (NoClassDefFoundError e) {
        /* JRebel isn't in the classpath so we do nothing */
        return;
      }
    }
 
View Full Code Here

    /**
     * registers this observer object for
     * {@link er.extensions.localization.ERXLocalizer#LocalizationDidResetNotification}
     */
    protected void registerForLocalizationDidResetNotification() {
      NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("localizationDidReset", ERXConstant.NotificationClassArray), ERXLocalizer.LocalizationDidResetNotification, null);
    }
View Full Code Here

     * Observer class manages the responses cache by watching the session.
     * Registers for sessionDidTimeout to maintain its data.
     */
    public static class Observer {
        protected Observer() {
            NSSelector sel = new NSSelector("sessionDidTimeout", ERXConstant.NotificationClassArray);
            NSNotificationCenter.defaultCenter().addObserver(this, sel, WOSession.SessionDidTimeOutNotification, null);
        }
View Full Code Here

        if(!ERSelenium.testsEnabled()) {
            return new ERXResponse(ERXHttpStatusCodes.STATUS_FORBIDDEN);
        }
        if("default".equals(anActionName)) {
            anActionName = null;
        } else if(new NSSelector(anActionName + "Action").implementedByObject(this)) {
            return super.performActionNamed(anActionName);
        }
        return result(anActionName, false);
    }
View Full Code Here

     * This delegate is configured when this framework is loaded.
     */
    @Override
    protected void initialize() {
      NSNotificationCenter.defaultCenter().addObserver(this,
          new NSSelector("bundleDidLoad", ERXConstant.NotificationClassArray),
          ERXApplication.AllBundlesLoadedNotification,
          null);
    }
View Full Code Here

          EODatabaseContext.setDefaultDelegate(ERXDatabaseContextDelegate.defaultDelegate());
        }
      }
       
        ERXAdaptorChannelDelegate.setupDelegate();
        NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("sharedEditingContextWasInitialized", ERXConstant.NotificationClassArray), EOSharedEditingContext.DefaultSharedEditingContextWasInitializedNotification, null);

        ERXEntityClassDescription.registerDescription();
        ERXPartialInitializer.registerModelGroupListener();
      } catch (Exception e) {
        throw NSForwardException._runtimeExceptionForThrowable(e);
View Full Code Here

    ERXProperties.pathsForUserAndBundleProperties(true);

    try {
      // MS: initialize these with Class.forName(Whatever.class.getName()) because the .class class literal does not trigger static initializers to run in 1.5,
      // which means that the sql generation support classes are not registered
      registerSQLSupportForSelector(new NSSelector(ERXPrimaryKeyListQualifier.IsContainedInArraySelectorName), EOQualifierSQLGeneration.Support.supportForClass(Class.forName(ERXPrimaryKeyListQualifier.class.getName())));
      registerSQLSupportForSelector(new NSSelector(ERXToManyQualifier.MatchesAllInArraySelectorName), EOQualifierSQLGeneration.Support.supportForClass(Class.forName(ERXToManyQualifier.class.getName())));
          registerSQLSupportForSelector(new NSSelector(ERXRegExQualifier.MatchesSelectorName), EOQualifierSQLGeneration.Support.supportForClass(Class.forName(ERXRegExQualifier.class.getName())));
          registerSQLSupportForSelector(new NSSelector(ERXFullTextQualifier.FullTextContainsSelectorName), EOQualifierSQLGeneration.Support.supportForClass(Class.forName(ERXFullTextQualifier.class.getName())));
    }
    catch (Throwable t) {
      throw NSForwardException._runtimeExceptionForThrowable(t);
    }
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSSelector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.