Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSNotificationCenter


    }
    _registerForAdaptorContextNotifications();
  }

  public void _registerForAdaptorContextNotifications() {
    NSNotificationCenter notificationCenter = NSNotificationCenter.defaultCenter();
    notificationCenter.addObserver(this, ERXForwardingAdaptorContext._beginTransactionSelector, EOAdaptorContext.AdaptorContextBeginTransactionNotification, _forwardedContext);
    notificationCenter.addObserver(this, ERXForwardingAdaptorContext._commitTransactionSelector, EOAdaptorContext.AdaptorContextCommitTransactionNotification, _forwardedContext);
    notificationCenter.addObserver(this, ERXForwardingAdaptorContext._rollbackTransactionSelector, EOAdaptorContext.AdaptorContextRollbackTransactionNotification, _forwardedContext);
  }
View Full Code Here


    notificationCenter.addObserver(this, ERXForwardingAdaptorContext._commitTransactionSelector, EOAdaptorContext.AdaptorContextCommitTransactionNotification, _forwardedContext);
    notificationCenter.addObserver(this, ERXForwardingAdaptorContext._rollbackTransactionSelector, EOAdaptorContext.AdaptorContextRollbackTransactionNotification, _forwardedContext);
  }

  public void _unregisterForAdaptorContextNotifications() {
    NSNotificationCenter notificationCenter = NSNotificationCenter.defaultCenter();
    notificationCenter.removeObserver(this, EOAdaptorContext.AdaptorContextBeginTransactionNotification, _forwardedContext);
    notificationCenter.removeObserver(this, EOAdaptorContext.AdaptorContextCommitTransactionNotification, _forwardedContext);
    notificationCenter.removeObserver(this, EOAdaptorContext.AdaptorContextRollbackTransactionNotification, _forwardedContext);
  }
View Full Code Here

        }
    }


    protected static void initialize() {
        NSNotificationCenter center = NSNotificationCenter.defaultCenter();
        NSSelector sel = ERXSelectorUtilities.notificationSelector("updateTimestampForEditingContext");
        Observer observer = new Observer();
        ERXRetainer.retain(observer);
        center.addObserver(observer, sel, ERXExtensions.objectsWillChangeInEditingContext, null);
    }
View Full Code Here

   * on the session's object store.
   *
   * @param session
   */
  protected void postNotification(ERXSession session) {
    NSNotificationCenter nc = NSNotificationCenter.defaultCenter();
    nc.postNotification(MODERNIZR_UPDATED_NOTIFICATION, session);
  }
View Full Code Here

    public void configureFactory() {
        // CHECKME: This might be better configured in a static init block of ERXValidationFactory.       
        ERXValidation.setPushChangesDefault(ERXValueUtilities.booleanValueWithDefault(ERXSystem.getProperty("er.extensions.ERXValidationShouldPushChangesToObject"), ERXValidation.DO_NOT_PUSH_INCORRECT_VALUE_ON_EO));

        if (WOApplication.application()!=null && !WOApplication.application().isCachingEnabled()) {
            NSNotificationCenter center = NSNotificationCenter.defaultCenter();
            center.addObserver(this,
                               new NSSelector("resetTemplateCache",  ERXConstant.NotificationClassArray),
                               ERXLocalizer.LocalizationDidResetNotification,
                               null);
        }
    }
View Full Code Here

        }
        try {
          // NSLog.debug.appendln("Loaded items: " + initializedFrameworks);
            if(observer == null) {
                observer = new Observer();
                NSNotificationCenter center = NSNotificationCenter.defaultCenter();
                center.addObserver(observer,
                        new NSSelector("willFinishInitialization",  ERXConstant.NotificationClassArray),
                        // WOApplication.ApplicationWillFinishLaunchingNotification,
                        ERXApplication.ApplicationDidCreateNotification,
                        null);
                center.addObserver(observer,
                        new NSSelector("didFinishInitialization",  ERXConstant.NotificationClassArray),
                        // WOApplication.ApplicationWillFinishLaunchingNotification,
                        ERXApplication.ApplicationDidFinishInitializationNotification,
                        null);
            }
View Full Code Here

   
    //Create the persistent session store
    WOApplication.application().setSessionStore(store);
   
    //Set up notifications for newly created sessions
    NSNotificationCenter nc = NSNotificationCenter.defaultCenter();
    NSSelector<Void> sel = new NSSelector<Void>("enableSessionDistribution", new Class[] {NSNotification.class});
    nc.addObserver(this, sel, WOSession.SessionDidCreateNotification, null);
  }
View Full Code Here

     * notification to the ec which still contains the eo in insertedObjects.
     *
     * When this happens, the ec throws an exception. To prevent this, the ec
     * is removed here as an observer for notifications when it is serialized.
     */
    NSNotificationCenter nc = NSNotificationCenter.defaultCenter();
    nc.removeObserver(this);
  }
View Full Code Here

    static {
        setUpFrameworkPrincipalClass(Ajax.class);
    }

    public Ajax() {
      NSNotificationCenter center = NSNotificationCenter.defaultCenter();
      // This is needed when ERXAjaxApplication is sub-classed
      center.addObserver(this,
          new NSSelector("finishAjaxInitialization", ERXConstant.NotificationClassArray),
          WOApplication.ApplicationWillFinishLaunchingNotification,
          null);
  }
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSNotificationCenter

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.