Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSNotification


            }
            if (log.isDebugEnabled()) {
              log.info("Received POST from " + ERXStringUtilities.byteArrayToHexString(identifier));
            }
            if(!self.equals(remote)) {
              NSNotification notification = readNotification(dis);
              if (log.isDebugEnabled()) {
                log.debug("Received notification: " + notification);
              }
              else if (log.isInfoEnabled()) {
                log.info("Received " + notification.name() + " notification from " + remote);
              }
              postLocalNotification(notification);
            }
          }
        }
View Full Code Here


        userInfo.setObjectForKey(new String(valueBytes), new String(keyBytes));

      }

      NSNotification notification = new NSNotification(new String(nameBytes), null, userInfo);
      return notification;
    }
View Full Code Here

                    ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
                    ObjectInputStream dis = new ObjectInputStream(bais);
                    String name = (String) dis.readObject();
                    Object object = dis.readObject();
                    NSDictionary userInfo = (NSDictionary) dis.readObject();
                    NSNotification notification = new NSNotification(name, object, userInfo);
                    if (log.isDebugEnabled()) {
                        log.debug("Received notification: " + notification);
                    } else if (log.isInfoEnabled()) {
                        log.info("Received " + notification.name() + " notification.");
                    }
                    postLocalNotification(notification);
                } catch (IOException e) {
                    log.error("Failed to read notification: " + e, e);
                } catch (ClassNotFoundException e) {
View Full Code Here

    protected void fileHasChanged(File file) {
        NSMutableSet observers = (NSMutableSet)_observersByFilePath.objectForKey(cacheKeyForFile(file));
        if (observers == null)
            log.warn("Unable to find observers for file: " + file);
        else {
            NSNotification notification = new NSNotification(FileDidChange, file);
            for (Enumeration e = observers.objectEnumerator(); e.hasMoreElements();) {
                _ObserverSelectorHolder holder = (_ObserverSelectorHolder)e.nextElement();
                try {
                    holder.selector.invoke(holder.observer, notification);
                } catch (Exception ex) {
View Full Code Here

     */
    public static void setAdaptorLogging(boolean onOff) {
      Boolean targetState = Boolean.valueOf(onOff);
      if (NSLog.debugLoggingAllowedForGroups(NSLog.DebugGroupSQLGeneration|NSLog.DebugGroupDatabaseAccess) != targetState.booleanValue()) {
      // Post a notification to give us a hook to perform other operations necessary to get logging going, e.g. change Logger settings, etc.
      NSNotificationCenter.defaultCenter().postNotification(new NSNotification(eoAdaptorLoggingWillChangeNotification, targetState));
        if (targetState.booleanValue()) {
          NSLog.allowDebugLoggingForGroups(NSLog.DebugGroupSQLGeneration|NSLog.DebugGroupDatabaseAccess);
        } else {
          NSLog.refuseDebugLoggingForGroups(NSLog.DebugGroupSQLGeneration|NSLog.DebugGroupDatabaseAccess);
        }
View Full Code Here

   * <span class="ja">
   * メール送信失敗のアプリケーションのコールバックを実行します。
   * </span>
   */
  protected void notifyInvalidEmails(NSArray<String> invalidEmails) {
    NSNotification notification = new NSNotification(InvalidEmailNotification, invalidEmails);
    NSNotificationCenter.defaultCenter().postNotification(notification);
  }
View Full Code Here

    if(_loader != null) {
      _loader._checker.reportErrors();
      _loader._checker = null;
    }
    didCreateApplication();
    NSNotificationCenter.defaultCenter().postNotification(new NSNotification(ApplicationDidCreateNotification, this));
    installPatches();
    lowMemBufferSize = ERXProperties.intForKeyWithDefault("er.extensions.ERXApplication.lowMemBufferSize", 0);
    if (lowMemBufferSize > 0) {
      lowMemBuffer = new byte[lowMemBufferSize];
    }
View Full Code Here

      ERXMigrator migrator = migrator();
      migrationsWillRun(migrator);
      migrator.migrateToLatest();
      migrationsDidRun(migrator);
    }
    NSNotificationCenter.defaultCenter().postNotification(new NSNotification(ERXApplication.ApplicationDidFinishInitializationNotification, this));
  }
View Full Code Here

  protected void checkMemory() {
    boolean memoryLow = checkMemory(_memoryLowThreshold, false);
    if(memoryLow != _isMemoryLow) {
      if(!memoryLow) {
        log.warn("App is no longer low on memory");
        NSNotificationCenter.defaultCenter().postNotification(new NSNotification(LowMemoryResolvedNotification, this));
      } else {
        log.error("App is low on memory");
        NSNotificationCenter.defaultCenter().postNotification(new NSNotification(LowMemoryNotification, this));
      }
      _isMemoryLow = memoryLow;
    }
   
    boolean memoryStarved = checkMemory(_memoryStarvedThreshold, true);
    if(memoryStarved != _isMemoryStarved) {
      if(!memoryStarved) {
        log.warn("App is no longer starved, handling new sessions again");
        NSNotificationCenter.defaultCenter().postNotification(new NSNotification(StarvedMemoryResolvedNotification, this));
      } else {
        log.error("App is starved, starting to refuse new sessions");
        NSNotificationCenter.defaultCenter().postNotification(new NSNotification(StarvedMemoryNotification, this));
      }
      _isMemoryStarved = memoryStarved;
    }
  }
View Full Code Here

          try {
            lowMemBuffer = null;
            System.gc();
            log.error("Ran out of memory, sending notification to clear caches");
            log.error("Ran out of memory, sending notification to clear caches", throwable);
            NSNotificationCenter.defaultCenter().postNotification(new NSNotification(LowMemoryNotification, this));
            shouldQuit = false;
            // try to reclaim our twice of our buffer
            // if this worked maybe we can continue running
            lowMemBuffer = new byte[lowMemBufferSize * 2];
            // shrink buffer to normal size
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSNotification

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.