/** * Called when the session posts the notification "SessionDidTimeOutNotification". This method * calls subclasses' {@link #didTimeOutSession} method. * * @param n - the Session instance. */ public final void sessionDidTimeOut(NSNotification n) { if (n.object().equals(sessionID())) { logger.trace("!-- " + WOSession.SessionDidTimeOutNotification + " [" + n.object() + "]"); sessionDidTimeOut(); this.application.addSession(this, sessionID()); } }
/** * Called when the session posts the notification "SessionDidCreateNotification". Note, since this * notification reports EVERY session creation, we need to check that the one we react to is our * own. * * <p>This method calls subclasses' {@link #didCreateSession} method. * * @param n - the Session instance. */ public final void sessionDidCreate(NSNotification n) { if (((WOSession) n.object()).sessionID().equals(sessionID())) { logger.trace( "!-- " + WOSession.SessionDidCreateNotification + " [" + ((WOSession) n.object()).sessionID() + "]"); sessionDidCreate(); this.application.addSession(this, sessionID()); } }
/** * Called when the session posts the notification "SessionDidCreateNotification". Note, since this * notification reports EVERY session creation, we need to check that the one we react to is our * own. * * <p>This method calls subclasses' {@link #didCreateSession} method. * * @param n - the Session instance. */ public final void sessionWillAwake(NSNotification n) { if (((WOSession) n.object()).sessionID().equals(sessionID())) { logger.trace( "!-- " + ERXSession.SessionWillAwakeNotification + " [" + ((WOSession) n.object()).sessionID() + "]"); if (null == this.sessionInfo) { this.sessionInfo = new NSMutableDictionary<String, Object>(); this.sessionInfo.takeValueForKey(0, "HitCount"); SessionInfoDict.add_SessionInfo(sessionID(), this.sessionInfo); } sessionWillAwake(); this.application.addSession(this, sessionID()); } }
/*------------------------------------------------------------------------------------------------* * A L L N O T I F I C A T I O N S [ N O T I F I C A T I O N ] *------------------------------------------------------------------------------------------------*/ public void allNotifications(NSNotification notification) { if (!ERXProperties.booleanForKey("pachy.logAllNotifications")) return; if (notification.name().equalsIgnoreCase("EOEditingContextDidCreate")) { EOEditingContext eo = (EOEditingContext) notification.object(); EOObjectStore eos = eo.rootObjectStore(); LOG.info("[-NOTIFY-] {} rootCoordinator={}", notification.name(), eos); NSArray<EOCooperatingObjectStore> storeArray = ((EOObjectStoreCoordinator) eos).cooperatingObjectStores(); if (storeArray.count() > 0) { for (EOCooperatingObjectStore store : storeArray) { LOG.info("[OBSERVER] rootCoordinator contains={}", store); } } else LOG.info("[OBSERVER] rootCoordinator contains no cooperatingObjectStores"); } else { LOG.info( "[-NOTIFY-] " + notification.name() + ((notification.name().equalsIgnoreCase("EOEntityLoadedNotification") || (notification.name().equalsIgnoreCase("EOModelAddedNotification"))) ? "" : " [" + notification.object() + "]")); } }