Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSNotificationCenter.addObserver()


    _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);
  }

  public void _unregisterForAdaptorContextNotifications() {
View Full Code Here


  }

  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);
  }

  public void _unregisterForAdaptorContextNotifications() {
    NSNotificationCenter notificationCenter = NSNotificationCenter.defaultCenter();
View Full Code Here

  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);
  }

  public void _unregisterForAdaptorContextNotifications() {
    NSNotificationCenter notificationCenter = NSNotificationCenter.defaultCenter();
    notificationCenter.removeObserver(this, EOAdaptorContext.AdaptorContextBeginTransactionNotification, _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);
    }


    public EOEnterpriseObject insertionLogEntry=null;
   
View Full Code Here

        // 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,
View Full Code Here

                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

    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);
  }
 
  /**
   * Sets distribution enabled on new sessions
   * @param n a session created notification
View Full Code Here

    }

    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
Copyright © 2018 www.massapi.com. 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.