Package com.webobjects.appserver

Examples of com.webobjects.appserver.WOStatisticsStore


    if ((!anApplication.isRefusingNewSessions()) || (aSessionID != null)) {
      String aSenderID = (String)requestHandlerValues.objectForKey("woeid");

      String oldContextID = (String)requestHandlerValues.objectForKey("wocid");

      WOStatisticsStore aStatisticsStore = anApplication.statisticsStore();
      if (aStatisticsStore != null)
        aStatisticsStore.applicationWillHandleComponentActionRequest();

      try {
        aContext = anApplication.createContextForRequest(aRequest);

        aContext._setRequestContextID(oldContextID);
        aContext._setSenderID(aSenderID);
        anApplication.awake();
        aResponse = _dispatchWithPreparedApplication(anApplication, aContext, requestHandlerValues);
        NSNotificationCenter.defaultCenter().postNotification(WORequestHandler.DidHandleRequestNotification, aContext);

        anApplication.sleep();
      }
      catch (Exception exception)
      {
        try
        {
          NSLog.err.appendln("<" + getClass().getName() + ">: Exception occurred while handling request:\n" + exception.toString());
          if (NSLog.debugLoggingAllowedForLevelAndGroups(1, 4L)) {
            NSLog.debug.appendln(exception);
          }

          if (aContext == null)
            aContext = anApplication.createContextForRequest(aRequest);
          else {
            aContext._putAwakeComponentsToSleep();
          }
          WOSession aSession = aContext._session();
          aResponse = anApplication.handleException(exception, aContext);
          if (aSession != null)
          {
            try
            {
              anApplication.saveSessionForContext(aContext);
              anApplication.sleep();
            } catch (Exception eAgain) {
              NSLog.err.appendln("<WOApplication '" + anApplication.name() + "'>: Another Exception  occurred while trying to clean the application:\n" + eAgain.toString());
              if (NSLog.debugLoggingAllowedForLevelAndGroups(1, 4L))
                NSLog.debug.appendln(eAgain);
            }
          }
        }
        finally
        {
          if ((aContext != null) && (aContext._session() != null))
            anApplication.saveSessionForContext(aContext);
        }
      }
      if (aResponse != null) {
        aResponse._finalizeInContext(aContext);
      }

      if (aStatisticsStore != null) {
        WOComponent aPage = aContext.page();
        String aName = null;
        if (aPage != null) {
          aName = aPage.name();
        }
        aStatisticsStore.applicationDidHandleComponentActionRequestWithPageNamed(aName);
      }
    }
    else {
      String newLocationURL = anApplication._newLocationForRequest(aRequest);
      String contentString = "Sorry, your request could not immediately be processed. Please try this URL: <a href=\"" + newLocationURL + "\">" + newLocationURL + "</a>";
View Full Code Here

TOP

Related Classes of com.webobjects.appserver.WOStatisticsStore

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.