ERXApplication Class Reference

Inherits er::extensions::appserver::ajax::ERXAjaxApplication, and er::extensions::components::ERXGracefulShutdown::GracefulApplication.

Inherited by Application, Application, Application, Application, Application, Application, Application, Application, Application, Application, Application, Application, Application, Application, Application, ERXMainRunner, Application, Application, Application, Application, Application, Application, Application, Application, Application, Application, Application, Application, Application, Application, Application, and Application.

Collaboration diagram for ERXApplication:

Collaboration graph
[legend]

List of all members.

Classes

class  AppClassLoader
class  JarChecker
class  Loader
class  SessionInfo

Public Member Functions

WOComponentDefinition _componentDefinition (String s, NSArray nsarray)
String _newLocationForRequest (WORequest aRequest)
String _rewriteURL (String url)
void _setSslHost (String sslHost)
void _setSslPort (int sslPort)
NSArray< NSDictionary< String,
Object > > 
additionalAdaptors ()
void appendToResponse (WOResponse response, WOContext context)
void clearDebugEnabledForAllComponents ()
void configureStatisticsLogging ()
NSKeyValueCodingAdditions constants ()
WOContext createContextForRequest (WORequest request)
WORequest createRequest (String method, String aurl, String anHTTPVersion, Map< String,?extends List< String >> someHeaders, NSData content, Map< String, Object > someInfo)
WORequest createRequest (String aMethod, String aURL, String anHTTPVersion, NSDictionary someHeaders, NSData aContent, NSDictionary someInfo)
WOResourceManager createResourceManager ()
WOResponse createResponseInContext (WOContext context)
WOSession createSessionForRequest (WORequest worequest)
boolean debugEnabledForComponent (String componentName)
ERXDelayedRequestHandler delayedRequestHandler ()
void didFinishLaunching ()
final void didFinishLaunching (NSNotification n)
String directConnectURL ()
WOResponse dispatchRequest (WORequest request)
WOResponse dispatchRequestImmediately (WORequest request)
 ERXApplication ()
NSMutableDictionary extraInformationForExceptionInContext (Exception e, WOContext context)
void finishInitialization ()
final void finishInitialization (NSNotification n)
ERXFormatterFactory formatterFactory ()
WOResponse genericHandleException (Exception exception, WOContext context)
void gracefulTerminate ()
WOResponse handleActionRequestError (WORequest aRequest, Exception exception, String reason, WORequestHandler aHandler, String actionClassName, String actionName, Class actionClass, WOAction actionInstance)
WOResponse handleException (Exception exception, WOContext context)
void handlePotentiallyFatalException (Exception exception)
void installPatches ()
WOActionResults invokeAction (WORequest request, WOContext context)
boolean isDevelopmentMode ()
boolean isRefusingNewSessions ()
boolean isStreamingRequestHandlerKey (String s)
void killInstance ()
void logSetValueForDeclarationNamed (String aDeclarationName, String aDeclarationType, String aBindingName, String anAssociationDescription, Object aValue)
void logTakeValueForDeclarationNamed (String aDeclarationName, String aDeclarationType, String aBindingName, String anAssociationDescription, Object aValue)
ERXMigrator migrator ()
String name ()
String nameSuffix ()
String rawName ()
synchronized void refuseNewSessions (boolean value)
void registerStreamingRequestHandlerKey (String s)
WOResponse reportException (Throwable exception, WOContext context, NSDictionary extraInfo)
boolean responseCompressionEnabled ()
NSSet< StringresponseCompressionTypes ()
WOSession restoreSessionWithID (String sessionID, WOContext wocontext)
boolean rewriteDirectConnectURL ()
void run ()
void saveSessionForContext (WOContext wocontext)
Number sessionTimeOutInMinutes ()
void setDebugEnabledForComponent (boolean debugEnabled, String componentName)
void setDefaultEncoding (String encoding)
boolean sslEnabled ()
String sslHost ()
int sslPort ()
void startRefusingSessions ()
void terminate ()
Boolean traceOpenEditingContextLocks ()
boolean useComponentActionRedirection ()
Boolean useEditingContextUnlocker ()
boolean useSessionStoreDeadlockDetection ()

Static Public Member Functions

static void _endRequest ()
static void _startRequest ()
static String erAjaxRequestHandlerKey ()
static ERXApplication erxApplication ()
static WOComponent instantiatePage (String pageName)
static boolean isDevelopmentModeSafe ()
static boolean isInRequest ()
static boolean isWO54 ()
static void main (String argv[], Class applicationClass)
static void setup (String[] argv)

Static Public Attributes

static final String AllBundlesLoadedNotification = "NSBundleAllBundlesLoaded"
static final String ApplicationDidCreateNotification = "NSApplicationDidCreateNotification"
static final String ApplicationDidFinishInitializationNotification = "NSApplicationDidFinishInitializationNotification"
static final String ApplicationWillTerminateNotification = "ApplicationWillTerminateNotification"
static final String AppShouldExitOnOutOfMemoryError = "er.extensions.AppShouldExitOnOutOfMemoryError"
static final Logger log = Logger.getLogger(ERXApplication.class)
static final String LowMemoryNotification = "LowMemoryNotification"
static final String LowMemoryResolvedNotification = "LowMemoryResolvedNotification"
static final Logger requestHandlingLog = Logger.getLogger("er.extensions.ERXApplication.RequestHandling")
static final Logger startupLog = Logger.getLogger("er.extensions.ERXApplication.Startup")
static final String StarvedMemoryNotification = "StarvedMemoryNotification"
static final String StarvedMemoryResolvedNotification = "StarvedMemoryResolvedNotification"
static final Logger statsLog = Logger.getLogger("er.extensions.ERXApplication.Statistics")

Protected Member Functions

void _addAdditionalAdaptors (NSMutableArray< NSDictionary< String, Object >> additionalAdaptors)
WORequest _createRequest (String aMethod, String aURL, String anHTTPVersion, NSDictionary someHeaders, NSData aContent, NSDictionary someInfo)
void _debugValueForDeclarationNamed (WOComponent component, String verb, String aDeclarationName, String aDeclarationType, String aBindingName, String anAssociationDescription, Object aValue)
boolean checkMemory (BigDecimal memoryThreshold, boolean attemptGC)
void checkMemory ()
void migrationsDidRun (ERXMigrator migrator)
void migrationsWillRun (ERXMigrator migrator)
boolean refuseSessionsOnStarvedMemory ()

Static Protected Member Functions

static boolean _defaultIsDevelopmentMode ()

Protected Attributes

boolean _initializedAdaptors = false
WOTimer _killTimer
BigDecimal _memoryLowThreshold
BigDecimal _memoryStarvedThreshold
String _replaceApplicationPathPattern
String _replaceApplicationPathReplace
Boolean _responseCompressionEnabled
NSSet< String_responseCompressionTypes
String _sslHost
Integer _sslPort
NSMutableArray< String_streamingRequestHandlerKeys = new NSMutableArray<String>(streamActionRequestHandlerKey())
Boolean _useSessionStoreDeadlockDetection
Boolean useComponentActionRedirection

Static Protected Attributes

static final ERXFormatterFactory _formatterFactory = new ERXFormatterFactory()
static NSDictionary propertiesFromArgv

Package Functions

public< T extends WOComponent > T pageWithName (Class< T > componentClass)
public< T extends WOComponent > T pageWithName (Class< T > componentClass, WOContext context)

Private Member Functions

void _displayMainMethodWarning ()
void resetKillTimer (boolean install)

Static Private Member Functions

static void insertCommandLineArguments ()

Private Attributes

NSMutableSet< String_debugComponents = new NSMutableSet<String>()
boolean _isMemoryLow = false
boolean _isMemoryStarved = false
long _lastGC = 0
String _nameSuffix
boolean _nameSuffixLookedUp = false
Map< String, SessionInfo_sessions = new HashMap<String, SessionInfo>()
String _userDefaultName

Static Private Attributes

static Loader _loader
static ThreadLocal< Boolean > isInRequest = new ThreadLocal<Boolean>()
static Boolean isWO54 = null
static byte lowMemBuffer []
static int lowMemBufferSize = 0
static boolean wasERXApplicationMainInvoked = false


Detailed Description

ERXApplication is the abstract superclass of WebObjects applications built with the ER frameworks.

Useful enhancements include the ability to change the deployed name of the application, support for automatic application restarting at given intervals and more context information when handling exceptions.

Constructor & Destructor Documentation

ERXApplication (  ) 

The ERXApplication contructor.


Member Function Documentation

void _addAdditionalAdaptors ( NSMutableArray< NSDictionary< String, Object >>  additionalAdaptors  )  [protected]

Injects additional adaptors into the WOAdditionalAdaptors setting. Subclasses can extend this method, but should call super._addAdditionalAdaptors.

Parameters:
additionalAdaptors the mutable adaptors array

WOComponentDefinition _componentDefinition ( String  s,
NSArray  nsarray 
)

Bugfix for WO component loading. It fixes:

  • when isCachingEnabled is ON, and you have a new browser language that hasn't been seen so far, the component gets re-read from the disk, which can wreak havoc if you overwrite your html/wod with a new version.
  • when caching enabled is OFF, and you make a change, you only see the change in the first browser that touches the page. You need to re-save if you want it seen in the second one.
You need to set er.extensions.ERXApplication.fixCachingEnabled=false is you don't want it to load.

Author:
ak

WORequest _createRequest ( String  aMethod,
String  aURL,
String  anHTTPVersion,
NSDictionary  someHeaders,
NSData  aContent,
NSDictionary  someInfo 
) [protected]

Bottleneck for WORequest creation in WO 5.3 and 5.4 to use an ERXRequest object that fixes a bug with localization.

void _debugValueForDeclarationNamed ( WOComponent  component,
String  verb,
String  aDeclarationName,
String  aDeclarationType,
String  aBindingName,
String  anAssociationDescription,
Object  aValue 
) [protected]

static boolean _defaultIsDevelopmentMode (  )  [static, protected]

Returns whether or not this application is running in development-mode. If you are using Xcode, you should add a WOIDE=Xcode setting to your launch parameters.

void _displayMainMethodWarning (  )  [private]

Logs the warning message if the main method was not called during the startup.

static void _endRequest (  )  [static]

Cleans up the current thread after a request is complete.

String _newLocationForRequest ( WORequest  aRequest  ) 

Called, for example, when refuse new sessions is enabled and the request contains an expired session. If mod_rewrite is being used we don't want the adaptor prefix being part of the redirect.

See also:
com.webobjects.appserver.WOApplication._newLocationForRequest(com.webobjects.appserver.WORequest)

String _rewriteURL ( String  url  ) 

This method is called by ERXWOContext and provides the application a hook to rewrite generated URLs.

You can also set "er.extensions.replaceApplicationPath.pattern" to the pattern to match and "er.extensions.replaceApplicationPath.replace" to the value to replace it with.

For example, in Properties: er.extensions.ERXApplication.replaceApplicationPath.pattern=/cgi-bin/WebObjects/YourApp.woa er.extensions.ERXApplication.replaceApplicationPath.replace=/yourapp

and in Apache 2.2: RewriteRule ^/yourapp(.*)$ /cgi-bin/WebObjects/YourApp.woa$1 [PT,L]

or Apache 1.3: RewriteRule ^/yourapp(.*)$ /cgi-bin/WebObjects/YourApp.woa$1 [P,L]

Parameters:
url the URL to rewrite
Returns:
the rewritten URL

Reimplemented in Application.

void _setSslHost ( String  sslHost  ) 

Sets an SSL host override.

Parameters:
sslHost an SSL host override

void _setSslPort ( int  sslPort  ) 

Sets an SSL port override (called back by the ERXSecureAdaptor)

Parameters:
sslPort an ssl port override

static void _startRequest (  )  [static]

Initializes the current thread for a request.

NSArray<NSDictionary<String, Object> > additionalAdaptors (  ) 

Returns the additionalAdaptors, but calls _addAdditionalAdaptors to give the runtime an opportunity to programmatically force adaptors into the list.

void appendToResponse ( WOResponse  response,
WOContext  context 
)

Overridden to allow for redirected responses.

Parameters:
response object
context object

boolean checkMemory ( BigDecimal  memoryThreshold,
boolean  attemptGC 
) [protected]

void checkMemory (  )  [protected]

Checks if the free memory is less than the threshold given in er.extensions.ERXApplication.memoryStarvedThreshold (should be set to around 0.90 meaning 90% of total memory or 100 meaning 100 MB of minimal available memory) and if it is greater start to refuse new sessions until more memory becomes available. This helps when the application is becoming unresponsive because it's more busy garbage collecting than processing requests. The default is to do nothing unless the property is set. This method is called on each request, but garbage collection will be done only every minute.

Additionally, you can set er.extensions.ERXApplication.memoryLowThreshold, which you can set at a higher "warning" level, before the situation is critical.

Both of these methods post notifications both at the start of the event as well as the end of the event (LowMemoryNotification/LowMemoryResolvedNotification and StarvedMemoryNotification and StarvedMemoryResolvedNotification).

Author:
ak

void clearDebugEnabledForAllComponents (  ) 

Turns off binding debugging for all components.

void configureStatisticsLogging (  ) 

Configures the statistics logging for a given application. By default will log to a file <base log="" directory>="">/<WOApp name>="">-<host>-<port>.log if the base log path is defined. The base log path is defined by the property er.extensions.ERXApplication.StatisticsBaseLogPath The default log rotation frequency is 24 hours, but can be changed by setting in milliseconds the property er.extensions.ERXApplication.StatisticsLogRotationFrequency

NSKeyValueCodingAdditions constants (  ) 

Makes ERXConstants available for binding in the UI. Bind to application.constants.MyConstantClass.

WOContext createContextForRequest ( WORequest  request  ) 

When a context is created we push it into thread local storage. This handles the case for direct actions.

Parameters:
request the request
Returns:
the newly created context

WORequest createRequest ( String  method,
String  aurl,
String  anHTTPVersion,
Map< String,?extends List< String >>  someHeaders,
NSData  content,
Map< String, Object >  someInfo 
)

Creates the request object for this loop. Calls _createRequest(). For WO 5.4.

WORequest createRequest ( String  aMethod,
String  aURL,
String  anHTTPVersion,
NSDictionary  someHeaders,
NSData  aContent,
NSDictionary  someInfo 
)

Creates the request object for this loop. Calls _createRequest(). For WO 5.3.

Reimplemented in Application.

WOResourceManager createResourceManager (  ) 

WOResponse createResponseInContext ( WOContext  context  ) 

WOSession createSessionForRequest ( WORequest  worequest  ) 

Overridden to check the sessions

boolean debugEnabledForComponent ( String  componentName  ) 

Returns whether or not binding debugging is enabled for the given component

Parameters:
componentName the component name
Returns:
whether or not binding debugging is enabled for the given componen

ERXDelayedRequestHandler delayedRequestHandler (  ) 

Returns the delayedRequestHandler, if any is registered.

void didFinishLaunching (  ) 

Called when the application posts WOApplication#ApplicationDidFinishLaunchingNotification. Override this to perform application specific tasks after the application has been initialized. THis is a good spot to perform batch application tasks.

Reimplemented in Application, ERXMainRunner, and Application.

final void didFinishLaunching ( NSNotification  n  ) 

Notification method called when the application posts the notification WOApplication#ApplicationDidFinishLaunchingNotification. This method calls subclasse's didFinishLaunching method.

Parameters:
n notification that is posted after the WOApplication has finished launching and is ready for accepting requests.

String directConnectURL (  ) 

Returns the directConnecURL, optionally rewritten.

WOResponse dispatchRequest ( WORequest  request  ) 

Overridden to allow for redirected responses and null the thread local storage.

Parameters:
request object
Returns:
response

Reimplemented in Application, Application, Application, and Application.

WOResponse dispatchRequestImmediately ( WORequest  request  ) 

Dispatches the request without checking for the delayedRequestHandler()

Parameters:
request 

static String erAjaxRequestHandlerKey (  )  [static]

Workaround for method missing in 5.3. Misnamed because static methods can't override client methods.

Returns:
the request handler key for ajax.

static ERXApplication erxApplication (  )  [static]

The ERXApplication singleton.

Returns:
returns the WOApplication.application() cast as an ERXApplication

NSMutableDictionary extraInformationForExceptionInContext ( Exception  e,
WOContext  context 
)

Puts together a dictionary with a bunch of useful information relative to the current state when the exception occurred. Potentially added information:

  1. the current page name
  2. the current component
  3. the complete hierarchy of nested components
  4. the requested uri
  5. the D2W page configuration
  6. the previous page list (from the WOStatisticsStore)
Also, in case the top-level exception was a EOGeneralAdaptorException, then you also get the failed ops and the sql exception.

Returns:
dictionary containing extra information for the current context.

void finishInitialization (  ) 

Called when the application posts WOApplication#ApplicationWillFinishLaunchingNotification. Override this to perform application initialization. (optional)

Reimplemented in Application, Application, Application, Application, Application, and Application.

final void finishInitialization ( NSNotification  n  ) 

Notification method called when the application posts the notification WOApplication#ApplicationWillFinishLaunchingNotification. This method calls subclasses' finishInitialization method.

Parameters:
n notification that is posted after the WOApplication has been constructed, but before the application is ready for accepting requests.

ERXFormatterFactory formatterFactory (  ) 

Getting formatters into KVC: bind to application.formatterFactory.(60/#,##0.00)

WOResponse genericHandleException ( Exception  exception,
WOContext  context 
)

Standard exception page. Also logs error to standard out.

Parameters:
exception to be handled
context current context
Returns:
the WOResponse of the generic exception page.

void gracefulTerminate (  ) 

WOResponse handleActionRequestError ( WORequest  aRequest,
Exception  exception,
String  reason,
WORequestHandler  aHandler,
String  actionClassName,
String  actionName,
Class  actionClass,
WOAction  actionInstance 
)

Workaround for WO 5.2 DirectAction lock-ups. As the super-implementation is empty, it is fairly safe to override here to call the normal exception handling earlier than usual.

See also:
WOApplication.handleActionRequestError(WORequest, Exception, String, WORequestHandler, String, String, Class, WOAction)

WOResponse handleException ( Exception  exception,
WOContext  context 
)

Logs extra information about the current state.

Parameters:
exception to be handled
context current context
Returns:
the WOResponse of the generated exception page.

Reimplemented in Application.

void handlePotentiallyFatalException ( Exception  exception  ) 

Handles the potentially fatal OutOfMemoryError by quitting the application ASAP. Broken out into a separate method to make custom error handling easier, ie. generating your own error pages in production, etc.

Parameters:
exception to check if it is a fatal exception.

static void insertCommandLineArguments (  )  [static, private]

Copies the props from the command line to the static dict propertiesFromArgv.

void installPatches (  ) 

Installs several bufixes and enhancements to WODynamicElements. Sets the Context class name to "er.extensions.ERXWOContext" if it is "WOContext". Patches ERXWOForm, ERXWOFileUpload, ERXWOText to be used instead of WOForm, WOFileUpload, WOText.

static WOComponent instantiatePage ( String  pageName  )  [static]

Used to instantiate a WOComponent when no context is available, typically outside of a session

Parameters:
pageName - The name of the WOComponent that must be instantiated.
Returns:
created WOComponent with the given name

WOActionResults invokeAction ( WORequest  request,
WOContext  context 
)

Overridden to allow for redirected responses.

Parameters:
request object
context object

Reimplemented from ERXAjaxApplication.

boolean isDevelopmentMode (  ) 

Returns whether or not this application is running in development-mode. If you are using Xcode, you should add a WOIDE=Xcode setting to your launch parameters.

static boolean isDevelopmentModeSafe (  )  [static]

Returns whether or not this application is in development mode. This one is named "Safe" because it does not require you to be running an ERXApplication (and because you can't have a static and not-static method of the same name. bah). If you are using ERXApplication, this will call isDevelopmentMode on your application. If not, it will call ERXApplication_defaultIsDevelopmentMode() which checks for the system properties "er.extensions.ERXApplication.developmentMode" and/or "WOIDE".

Returns:
whether or not the current application is in development mode

static boolean isInRequest (  )  [static]

Returns true if the current thread is dispatching a request.

Returns:
true if the current thread is dispatching a request

boolean isRefusingNewSessions (  ) 

Overridden to return the super value OR true if the app is memory starved.

boolean isStreamingRequestHandlerKey ( String  s  ) 

static boolean isWO54 (  )  [static]

Returns true if this app is running in WO 5.4.

Returns:
true if this app is running in WO 5.4

void killInstance (  ) 

Killing the instance will log a 'Forcing exit' message and then call System.exit(1)

void logSetValueForDeclarationNamed ( String  aDeclarationName,
String  aDeclarationType,
String  aBindingName,
String  anAssociationDescription,
Object  aValue 
)

Little bit better binding debug output than the original.

void logTakeValueForDeclarationNamed ( String  aDeclarationName,
String  aDeclarationType,
String  aBindingName,
String  anAssociationDescription,
Object  aValue 
)

Little bit better binding debug output than the original.

static void main ( String  argv[],
Class  applicationClass 
) [static]

Called when the application starts up and saves the command line arguments for ERXConfigurationManager.

See also:
WOApplication.main(String[], Class)

void migrationsDidRun ( ERXMigrator  migrator  )  [protected]

Called after migrations finish running.

Parameters:
migrator the migrator that was used

void migrationsWillRun ( ERXMigrator  migrator  )  [protected]

Called prior to migrations running.

Parameters:
migrator the migrator that will be used

ERXMigrator migrator (  ) 

Returns an ERXMigrator with the lock owner name "appname-instancenumber".

String name (  ) 

Adds the ability to completely change the applications name by setting the System property ERApplicationName. Will also append the nameSuffix if one is set.

Returns:
the computed name of the application.

Reimplemented in Application.

String nameSuffix (  ) 

The name suffix is appended to the current name of the application. This adds the ability to add a useful suffix to differentiate between different sets of applications on the same machine.

The name suffix is set via the System property ERApplicationNameSuffix.

For example if the name of an application is Buyer and you want to have a training instance appear with the name BuyerTraining then you would set the ERApplicationNameSuffix to Training.

Returns:
the System property ERApplicationNameSuffix or null

public<T extends WOComponent> T pageWithName ( Class< T >  componentClass  )  [package]

Calls pageWithName with ERXWOContext.currentContext() for the current thread.

Parameters:
<T> the type of component to
componentClass the component class to lookup
Returns:
the created component

public<T extends WOComponent> T pageWithName ( Class< T >  componentClass,
WOContext  context 
) [package]

Returns the component for the given class without having to cast. For example: MyPage page = ERXApplication.erxApplication().pageWithName(MyPage.class, context);

Parameters:
<T> the type of component to
componentClass the component class to lookup
context the context
Returns:
the created component

String rawName (  ) 

This method returns WOApplication's name method.

Returns:
the name of the application executable.

synchronized void refuseNewSessions ( boolean  value  ) 

Overridden to fix that direct connect apps can't refuse new sessions.

boolean refuseSessionsOnStarvedMemory (  )  [protected]

Override and return false if you do not want sessions to be refused when memory is starved.

Returns:
whether or not sessions should be refused on starved memory

void registerStreamingRequestHandlerKey ( String  s  ) 

WOResponse reportException ( Throwable  exception,
WOContext  context,
NSDictionary  extraInfo 
)

Reports an exception. This method only logs the error and could be overriden to return a valid error page.

Parameters:
exception to be reported
context for the exception
extraInfo dictionary of extra information about what was happening when the exception was thrown.
Returns:
a valid response to display or null. In that case the superclasses handleException(Exception, WOContext) is called

void resetKillTimer ( boolean  install  )  [private]

Sets the kill timer.

Parameters:
install 

boolean responseCompressionEnabled (  ) 

checks the value of er.extensions.ERXApplication.responseCompressionEnabled and if true turns on response compression by gzip

NSSet<String> responseCompressionTypes (  ) 

checks the value of er.extensions.ERXApplication.responseCompressionTypes for mime types that allow response compression in addition to text/* types. The default is ("application/x-javascript")

Returns:
an array of mime type strings

WOSession restoreSessionWithID ( String  sessionID,
WOContext  wocontext 
)

Overridden to check the sessions

boolean rewriteDirectConnectURL (  ) 

Returns whether or not to rewrite direct connect URLs.

Returns:
whether or not to rewrite direct connect URLs

void run (  ) 

Adds support for automatic application cycling. Applications can be configured to cycle in two ways:

The first way is by setting the System property ERTimeToLive to the number of seconds (+ a random interval of 10 minutes) that the application should be up before terminating. Note that when the application's time to live is up it will quit calling the method killInstance.

The second way is by setting the System property ERTimeToDie to the time in seconds after midnight when the app should be starting to refuse new sessions. In this case when the application starts to refuse new sessions it will also register a kill timer that will terminate the application between 0 minutes and 1:00 minutes.

void saveSessionForContext ( WOContext  wocontext  ) 

Overridden to check the sessions

Number sessionTimeOutInMinutes (  ) 

void setDebugEnabledForComponent ( boolean  debugEnabled,
String  componentName 
)

Turns on/off binding debugging for the given component. Binding debugging requires using the WOOgnl template parser and setting ognl.debugSupport=true.

Parameters:
debugEnabled whether or not to enable debugging
componentName the component name to enable debugging for

void setDefaultEncoding ( String  encoding  ) 

Set the default encoding of the app (message encodings)

Parameters:
encoding 

static void setup ( String[]  argv  )  [static]

Called prior to actually initializing the app. Defines framework load order, class path order, checks patches etc.

boolean sslEnabled (  ) 

String sslHost (  ) 

int sslPort (  ) 

void startRefusingSessions (  ) 

Stops the application from handling any new requests. Will still handle requests from existing sessions.

void terminate (  ) 

Sends out a ApplicationWillTerminateNotification before actually starting to terminate.

Boolean traceOpenEditingContextLocks (  ) 

Decides whether or not to keep track of open editing context locks.

Returns:
true if editing context locks should be tracked
Deprecated:
use er.extensions.ERXEC.traceOpenLocks property instead

Set the er.extensions.ERXComponentActionRedirector.enabled=true property to actually the redirect feature.

Returns:
flag if to use the redirect feature

Boolean useEditingContextUnlocker (  ) 

Decides whether to use editing context unlocking.

Returns:
true if ECs should be unlocked after each RR-loop
Deprecated:
use er.extensions.ERXEC.useUnlocker property instead

boolean useSessionStoreDeadlockDetection (  ) 

Deadlock in session-store detection. Note that the detection only work in single-threaded mode, and is mostly useful to find cases when a session is checked out twice in a single RR-loop, which will lead to a session store lockup. Set the er.extensions.ERXApplication.useSessionStoreDeadlockDetection=true property to actually the this feature.

Returns:
flag if to use the this feature


Member Data Documentation

The set of component names that have binding debug enabled

final ERXFormatterFactory _formatterFactory = new ERXFormatterFactory() [static, protected]

boolean _initializedAdaptors = false [protected]

Tracks whether or not _addAdditionalAdaptors has been called yet.

boolean _isMemoryLow = false [private]

boolean _isMemoryStarved = false [private]

WOTimer _killTimer [protected]

long _lastGC = 0 [private]

Time that garbage collection was last called when checking memory.

Loader _loader [static, private]

BigDecimal _memoryLowThreshold [protected]

Holds the value of the property er.extensions.ERXApplication.memoryLowThreshold

BigDecimal _memoryStarvedThreshold [protected]

Holds the value of the property er.extensions.ERXApplication.memoryStarvedThreshold

String _nameSuffix [private]

cached name suffix

boolean _nameSuffixLookedUp = false [private]

has the name suffix been cached?

The path rewriting pattern to match (

See also:
_rewriteURL)

The path rewriting replacement to apply to the matched pattern (

See also:
_rewriteURL)

Boolean _responseCompressionEnabled [protected]

NSSet<String> _responseCompressionTypes [protected]

Map<String, SessionInfo> _sessions = new HashMap<String, SessionInfo>() [private]

holds the info on checked-out sessions

String _sslHost [protected]

The SSL host used by this application.

Integer _sslPort [protected]

The SSL port used by this application.

NSMutableArray<String> _streamingRequestHandlerKeys = new NSMutableArray<String>(streamActionRequestHandlerKey()) [protected]

improved streaming support

cached computed name

Boolean _useSessionStoreDeadlockDetection [protected]

use the redirect feature

final String AllBundlesLoadedNotification = "NSBundleAllBundlesLoaded" [static]

Notification to post when all bundles were loaded but before their principal was called

final String ApplicationDidCreateNotification = "NSApplicationDidCreateNotification" [static]

Notification to post when all bundles were loaded but before their principal was called

final String ApplicationDidFinishInitializationNotification = "NSApplicationDidFinishInitializationNotification" [static]

Notification to post when all application initialization processes are complete (including migrations)

final String ApplicationWillTerminateNotification = "ApplicationWillTerminateNotification" [static]

Notification to get posted when terminate() is called.

final String AppShouldExitOnOutOfMemoryError = "er.extensions.AppShouldExitOnOutOfMemoryError" [static]

Property to control whether to exit on an OutOfMemoryError.

ThreadLocal<Boolean> isInRequest = new ThreadLocal<Boolean>() [static, private]

ThreadLocal that designates that the given thread is currently dispatching a request. This is not stored in ERXThreadStorage, because it defaults to an inheritable thread local, which would defeat the purpose of this check.

Boolean isWO54 = null [static, private]

final Logger log = Logger.getLogger(ERXApplication.class) [static]

logging support

Reimplemented in Application, Application, and Application.

byte lowMemBuffer[] [static, private]

Buffer we reserve lowMemBufSize KB to release when we get an OutOfMemoryError, so we can post our notification and do other stuff

int lowMemBufferSize = 0 [static, private]

Size of the memory in KB to reserve for low-mem situations, pulled form the system property er.extensions.ERXApplication.lowMemBufferSize. Default is 0, indicating no reserve.

final String LowMemoryNotification = "LowMemoryNotification" [static]

Notification to get posted when we get an OutOfMemoryError or when memory passes the low memory threshold set in er.extensions.ERXApplication.memoryLowThreshold. You should register your caching classes for this notification so you can release memory. Registration should happen at launch time.

final String LowMemoryResolvedNotification = "LowMemoryResolvedNotification" [static]

Notification to get posted when we have recovered from a LowMemory condition.

NSDictionary propertiesFromArgv [static, protected]

final Logger requestHandlingLog = Logger.getLogger("er.extensions.ERXApplication.RequestHandling") [static]

request logging support

final Logger startupLog = Logger.getLogger("er.extensions.ERXApplication.Startup") [static]

startup logging support

final String StarvedMemoryNotification = "StarvedMemoryNotification" [static]

Notification to get posted when we are on the brink of running out of memory. By default, sessions will begin to be refused when this happens as well.

final String StarvedMemoryResolvedNotification = "StarvedMemoryResolvedNotification" [static]

Notification to get posted when we have recovered from a StarvedMemory condition.

final Logger statsLog = Logger.getLogger("er.extensions.ERXApplication.Statistics") [static]

statistic logging support

Boolean useComponentActionRedirection [protected]

use the redirect feature

boolean wasERXApplicationMainInvoked = false [static, private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:01 2012 for Project Wonder by  doxygen 1.5.8