public abstract class ERXApplication extends ERXAjaxApplication implements ERXGracefulShutdown.GracefulApplication
Name | Description |
---|---|
AppShouldExitOnOutOfMemoryError | AppShouldExitOnOutOfMemoryError |
ERApplicationName | ERApplicationName |
ERApplicationNameSuffix | ERApplicationNameSuffix |
ERTimeToDie | ERTimeToDie |
ERTimeToKill | ERTimeToKill |
ERTimeToLive | ERTimeToLive |
NSProjectBundleEnabled | NSProjectBundleEnabled |
WOIDE | WOIDE |
_DisableClasspathReorder | _DisableClasspathReorder |
er.extensions.ERXApplication.DefaultEncoding | er.extensions.ERXApplication.DefaultEncoding |
er.extensions.ERXApplication.DefaultMessageEncoding | er.extensions.ERXApplication.DefaultMessageEncoding |
er.extensions.ERXApplication.StatisticsBaseLogPath | er.extensions.ERXApplication.StatisticsBaseLogPath |
er.extensions.ERXApplication.StatisticsLogRotationFrequency | er.extensions.ERXApplication.StatisticsLogRotationFrequency |
er.extensions.ERXApplication.developmentMode | er.extensions.ERXApplication.developmentMode |
er.extensions.ERXApplication.enableERXShutdownHook | er.extensions.ERXApplication.enableERXShutdownHook |
er.extensions.ERXApplication.fixCachingEnabled | er.extensions.ERXApplication.fixCachingEnabled |
er.extensions.ERXApplication.lowMemBufferSize | er.extensions.ERXApplication.lowMemBufferSize |
er.extensions.ERXApplication.memoryLowThreshold | er.extensions.ERXApplication.memoryLowThreshold |
er.extensions.ERXApplication.memoryStarvedThreshold | er.extensions.ERXApplication.memoryStarvedThreshold |
er.extensions.ERXApplication.memoryThreshold | er.extensions.ERXApplication.memoryThreshold |
er.extensions.ERXApplication.redirectOnMissingObjects | er.extensions.ERXApplication.redirectOnMissingObjects |
er.extensions.ERXApplication.replaceApplicationPath.pattern | er.extensions.ERXApplication.replaceApplicationPath.pattern |
er.extensions.ERXApplication.replaceApplicationPath.replace | er.extensions.ERXApplication.replaceApplicationPath.replace |
er.extensions.ERXApplication.responseCompressionEnabled | er.extensions.ERXApplication.responseCompressionEnabled |
er.extensions.ERXApplication.responseCompressionTypes | er.extensions.ERXApplication.responseCompressionTypes |
er.extensions.ERXApplication.rewriteDirectConnect | er.extensions.ERXApplication.rewriteDirectConnect |
er.extensions.ERXApplication.ssl.enabled | er.extensions.ERXApplication.ssl.enabled |
er.extensions.ERXApplication.ssl.host | er.extensions.ERXApplication.ssl.host |
er.extensions.ERXApplication.ssl.port | er.extensions.ERXApplication.ssl.port |
er.extensions.ERXApplication.useSessionStoreDeadlockDetection | er.extensions.ERXApplication.useSessionStoreDeadlockDetection |
er.extensions.ERXComponentActionRedirector.enabled | er.extensions.ERXComponentActionRedirector.enabled |
er.extensions.ERXApplication.allowMultipleDevInstances | er.extensions.ERXApplication.allowMultipleDevInstances |
Modifier and Type | Class and Description |
---|---|
static class |
ERXApplication.JarChecker
Utility class to track down duplicate items in the class path.
|
static class |
ERXApplication.Loader
Responsible for classpath munging and ensuring all bundles are loaded
|
ERXAjaxApplication.ERXAjaxResponseDelegate
WOApplication._EventLoggingEnabler, WOApplication.Event, WOApplication.TimeoutTask
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
NSKeyValueCoding._BooleanFieldBinding, NSKeyValueCoding._BooleanMethodBinding, NSKeyValueCoding._FieldBinding, NSKeyValueCoding._ForwardingBinding, NSKeyValueCoding._KeyBinding, NSKeyValueCoding._KeyBindingCreation, NSKeyValueCoding._MethodBinding, NSKeyValueCoding._NumberFieldBinding, NSKeyValueCoding._NumberMethodBinding, NSKeyValueCoding._ReflectionKeyBindingCreation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.MapImplementation, NSKeyValueCoding.Null<T>, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.ValueAccessor
Modifier and Type | Field and Description |
---|---|
protected static ERXFormatterFactory |
_formatterFactory |
protected boolean |
_initializedAdaptors
Tracks whether or not _addAdditionalAdaptors has been called yet.
|
protected WOTimer |
_killTimer |
protected BigDecimal |
_memoryLowThreshold
Holds the value of the property
er.extensions.ERXApplication.memoryLowThreshold
|
protected BigDecimal |
_memoryStarvedThreshold
Holds the value of the property
er.extensions.ERXApplication.memoryStarvedThreshold
|
protected String |
_replaceApplicationPathPattern
The path rewriting pattern to match (@see _rewriteURL)
|
protected String |
_replaceApplicationPathReplace
The path rewriting replacement to apply to the matched pattern (@see _rewriteURL)
|
protected Boolean |
_responseCompressionEnabled |
protected NSSet<String> |
_responseCompressionTypes |
protected String |
_sslHost
The SSL host used by this application.
|
protected Integer |
_sslPort
The SSL port used by this application.
|
protected NSMutableArray<String> |
_streamingRequestHandlerKeys
improved streaming support
|
protected Boolean |
_useSessionStoreDeadlockDetection
use the redirect feature
|
static String |
AllBundlesLoadedNotification
Notification to post when all bundles were loaded but before their
principal was called
|
static String |
ApplicationDidCreateNotification
Notification to post when all bundles were loaded but before their
principal was called
|
static String |
ApplicationDidFinishInitializationNotification
Notification to post when all application initialization processes are complete (including migrations)
|
static String |
ApplicationWillTerminateNotification
Notification to get posted when terminate() is called.
|
static String |
AppShouldExitOnOutOfMemoryError
Property to control whether to exit on an OutOfMemoryError.
|
static org.apache.log4j.Logger |
log
logging support
|
static String |
LowMemoryNotification
Notification to get posted when we get an OutOfMemoryError or when memory passes
the low memory threshold set in er.extensions.ERXApplication.memoryLowThreshold.
|
static String |
LowMemoryResolvedNotification
Notification to get posted when we have recovered from a LowMemory condition.
|
protected static NSDictionary |
propertiesFromArgv |
static org.apache.log4j.Logger |
requestHandlingLog
request logging support
|
static org.apache.log4j.Logger |
startupLog
startup logging support
|
static String |
StarvedMemoryNotification
Notification to get posted when we are on the brink of running out of memory.
|
static String |
StarvedMemoryResolvedNotification
Notification to get posted when we have recovered from a StarvedMemory condition.
|
static org.apache.log4j.Logger |
statsLog
statistic logging support
|
protected Boolean |
useComponentActionRedirection
use the redirect feature
|
KEY_AJAX_SUBMIT_BUTTON, KEY_PARTIAL_FORM_SENDER_ID, KEY_REPLACED, KEY_UPDATE_CONTAINER_ID
_adminRequestHandlerKey, _cgiAdaptorURLParsed, _classPathURLs, _launchServices, _terminating, _TheLastApplicationAccessTime, _unsetHost, _wasMainInvoked, ApplicationDidDispatchRequestNotification, ApplicationDidFinishLaunchingNotification, ApplicationWillDispatchRequestNotification, ApplicationWillFinishLaunchingNotification, CGIAdaptorURLProperty, DirectoryAliasProperty, DocumentRootProperty
_CLASS
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator
NullValue
Constructor and Description |
---|
ERXApplication()
The ERXApplication constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_addAdditionalAdaptors(NSMutableArray<NSDictionary<String,Object>> additionalAdaptors)
Injects additional adaptors into the WOAdditionalAdaptors setting.
|
com.webobjects.appserver._private.WOComponentDefinition |
_componentDefinition(String s,
NSArray nsarray)
Bugfix for WO component loading.
|
protected void |
_debugValueForDeclarationNamed(WOComponent component,
String verb,
String aDeclarationName,
String aDeclarationType,
String aBindingName,
String anAssociationDescription,
Object aValue) |
protected static boolean |
_defaultIsDevelopmentMode()
Returns whether or not this application is running in development-mode.
|
static void |
_endRequest()
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.
|
String |
_rewriteResourceURL(String url,
com.webobjects.appserver._private.WODeployedBundle bundle)
This method is called by ERXResourceManager and provides the application a hook
to rewrite generated URLs for resources.
|
String |
_rewriteURL(String url)
This method is called by ERXWOContext and provides the application a hook
to rewrite generated URLs.
|
void |
_setSslHost(String sslHost)
Sets an SSL host override.
|
void |
_setSslPort(int sslPort)
Sets an SSL port override (called back by the ERXSecureAdaptor)
|
static void |
_startRequest()
Initializes the current thread for a request.
|
String[] |
adaptorExtensions()
Override default implementation that returns {".dll", ".exe"} and therefor prohibits IIS
as WebServer.
|
WOAdaptor |
adaptorWithName(String aClassName,
NSDictionary<String,Object> anArgsDictionary) |
void |
addBalancerRouteCookie(WOContext context) |
void |
addBalancerRouteCookieByNotification(NSNotification notification) |
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.
|
protected void |
checkMemory()
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. |
protected boolean |
checkMemory(BigDecimal memoryThreshold,
boolean attemptGC) |
void |
clearDebugEnabledForAllComponents()
Turns off binding debugging for all components.
|
void |
configureStatisticsLogging()
Configures the statistics logging for a given application.
|
NSKeyValueCodingAdditions |
constants()
Makes ERXConstants available for binding in the UI.
|
WOContext |
createContextForRequest(WORequest request)
When a context is created we push it into thread local storage.
|
ERXRequest |
createRequest(String aMethod,
String aURL,
String anHTTPVersion,
Map<String,? extends List<String>> someHeaders,
NSData aContent,
Map<String,Object> someInfo) |
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
|
ERXDelayedRequestHandler |
delayedRequestHandler()
Returns the delayedRequestHandler, if any is registered.
|
protected void |
didCreateApplication() |
void |
didFinishLaunching()
Called when the application posts
WOApplication.ApplicationDidFinishLaunchingNotification . |
void |
didFinishLaunching(NSNotification n)
Notification method called when the application posts the notification
WOApplication.ApplicationDidFinishLaunchingNotification . |
String |
directConnectURL()
Returns the directConnecURL, optionally rewritten.
|
WOResponse |
dispatchRequest(WORequest request)
Overridden to allow for redirected responses and null the thread local
storage.
|
WOResponse |
dispatchRequestImmediately(WORequest request)
Dispatches the request without checking for the delayedRequestHandler()
|
protected static boolean |
enableERXShutdownHook() |
static String |
erAjaxRequestHandlerKey()
Deprecated.
use
WOApplication.ajaxRequestHandlerKey() instead |
static ERXApplication |
erxApplication()
The ERXApplication singleton.
|
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.
|
void |
finishInitialization()
Called when the application posts
WOApplication.ApplicationWillFinishLaunchingNotification . |
void |
finishInitialization(NSNotification n)
Notification method called when the application posts the notification
WOApplication.ApplicationWillFinishLaunchingNotification . |
ERXFormatterFactory |
formatterFactory()
Getting formatters into KVC: bind to
application.formatterFactory.(60/#,##0.00) |
WOResponse |
genericHandleException(Exception exception,
WOContext context)
Standard exception page.
|
void |
gracefulTerminate()
Override to perform any last minute cleanup before the application
terminates.
|
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.
|
WOResponse |
handleException(Exception exception,
WOContext context)
Logs extra information about the current state.
|
void |
handlePotentiallyFatalException(Exception exception)
Handles the potentially fatal OutOfMemoryError by quitting the
application ASAP.
|
void |
installPatches()
Installs several bugfixes and enhancements to WODynamicElements.
|
static WOComponent |
instantiatePage(String pageName)
Used to instantiate a WOComponent when no context is available, typically
outside of a session
|
WOActionResults |
invokeAction(WORequest request,
WOContext context)
Overridden to allow for redirected responses.
|
boolean |
isDeployedAsServlet()
This heuristic to determine if an application is deployed as servlet relays on the fact,
that contextClassName() is set WOServletContext or ERXWOServletContext
|
boolean |
isDevelopmentMode()
Returns whether or not this application is running in development-mode.
|
static boolean |
isDevelopmentModeSafe()
Returns whether or not this application is in development mode.
|
static boolean |
isInRequest()
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) |
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)
Called when the application starts up and saves the command line
arguments for
ERXConfigurationManager . |
protected void |
migrationsDidRun(ERXMigrator migrator)
Called after migrations finish running.
|
protected void |
migrationsWillRun(ERXMigrator migrator)
Called prior to migrations running.
|
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.
|
String |
nameSuffix()
The name suffix is appended to the current name of the application.
|
<T extends WOComponent> |
pageWithName(Class<T> componentClass)
Calls pageWithName with ERXWOContext.currentContext() for the current
thread.
|
<T extends WOComponent> |
pageWithName(Class<T> componentClass,
WOContext context)
Returns the component for the given class without having to cast.
|
String |
publicHost() |
String |
rawName()
This method returns
WOApplication 's name method. |
void |
refuseNewSessions(boolean value)
Overridden to fix that direct connect apps can't refuse new sessions.
|
protected boolean |
refuseSessionsOnStarvedMemory()
Override and return false if you do not want sessions to be refused when memory is starved.
|
void |
registerStreamingRequestHandlerKey(String s) |
WOResponse |
reportException(Throwable exception,
WOContext context,
NSDictionary extraInfo)
Reports an exception.
|
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. |
WOSession |
restoreSessionWithID(String sessionID,
WOContext wocontext)
Overridden to check the sessions
|
boolean |
rewriteDirectConnectURL()
Returns whether or not to rewrite direct connect URLs.
|
void |
run()
Adds support for automatic application cycling.
|
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.
|
void |
setDefaultEncoding(String encoding)
Set the default encoding of the app (message encodings)
|
static void |
setup(String[] argv)
Called prior to actually initializing the app.
|
boolean |
sslEnabled()
Returns whether or not DirectConnect SSL should be enabled.
|
String |
sslHost()
Returns the host name that will be used to bind the SSL socket to (defaults to host()).
|
int |
sslPort()
Returns the SSL port that will be used for DirectConnect SSL (defaults to 443).
|
void |
startRefusingSessions()
Stops the application from handling any new requests.
|
void |
terminate()
Sends out a ApplicationWillTerminateNotification before actually starting to terminate.
|
boolean |
useComponentActionRedirection()
Set the
er.extensions.ERXComponentActionRedirector.enabled=true
property to actually the redirect feature. |
boolean |
useSessionStoreDeadlockDetection()
Deadlock in session-store detection.
|
ajaxSubmitButtonName, cleanUpHeaders, enableShouldNotStorePage, forceStorePage, isAjaxReplacement, isAjaxRequest, isAjaxSubmit, isAjaxUpdate, partialFormSenderID, setForceStorePage, setResponseDelegate, shouldIgnoreResults, shouldNotStorePage, shouldNotStorePage, takeValuesFromRequest
_addToExpectedLanguages, _allowsCacheControlHeader, _checksForSpecialHeaders, _componentDefinitionFromClassNamed, _debugString, _discountTerminatedSession, _expectedLanguages, _finishInitializingSession, _initializeSessionInContext, _isDebuggingEnabled, _isDomesticSupportedDevelopmentPlatform, _isForeignSupportedDevelopmentPlatform, _isPageRecreationEnabled, _isSupportedDevelopmentPlatform, _lockDefaultEditingContext, _openInitialURL, _parseCGIAdaptorURL, _quitTimer, _rapidTurnaroundActiveForAnyProject, _removeComponentDefinitionCacheContents, _runLoop, _sessionClass, _setAllowsCacheControlHeader, _setChecksForSpecialHeaders, _setHost, _setHostAddress, _setLifebeatDestinationPort, _setLockDefaultEditingContext, _terminateFromMonitor, _terminateOrResetTimer, activeSessionsCount, adaptor, adaptorName, adaptorPath, adaptors, adaptorsDispatchRequestsConcurrently, ajaxRequestHandlerKey, allowsConcurrentRequestHandling, application, applicationBaseURL, applicationExtension, associationFactory, associationFactoryRegistry, autoOpenClientApplication, autoOpenInBrowser, awake, baseURL, canAccessFieldsDirectly, cgiAdaptorURL, combinedComponentPathURL, componentRequestHandlerKey, contextClassName, createDefaultAssociationFactoryRegistry, createDefaultNamespaceProvider, debugString, defaultAdaptor, defaultRequestHandler, defaultRequestHandlerClassName, defaultUndoStackLimit, directActionRequestHandlerKey, documentRoot, dynamicElementWithName, frameworksBaseURL, getAdaptorsDispatchRequestsConcurrently, getAdditionalAdaptors, getAgentID, getAllowsConcurrentRequestHandling, getApplicationBaseURL, getApplicationExtension, getAutoOpenClientApplication, getBaseURL, getCGIAdaptorURL, getClassPaths, getComponentRequestHandlerKey, getDefaultAdaptor, getDefaultUndoStackLimit, getDirectConnectURL, getFrameworkVersions, getHost, getHostAddress, getIncludeCommentsInResponses, getIsCachingEnabled, getIsMonitorEnabled, getIsPageRefreshOnBacktrackEnabled, getIsRefusingNewSessions, getIsTerminating, getJMXDomain, getLifebeatDestinationPort, getLifebeatInterval, getListenQueueSize, getMaxSocketIdleTime, getMBeanServer, getMinimumActiveSessionsCount, getName, getOutputPath, getPageCacheSize, getPageFragmentCacheSize, getPort, getServletConnectURL, getSessionTimeOut, getTimeOut, getWebObjectsVersion, getWebserverConnectURL, getWorkerThreadCountMax, getWorkerThreadCountMin, handleMalformedCookieString, handlePageRestorationErrorInContext, handleQueryWithUnboundKey, handlerForRequest, handleSessionCreationErrorInContext, handleSessionRestorationErrorInContext, handleTakeValueForUnboundKey, host, hostAddress, includeCommentsInResponses, instanceIdKey, isCachingEnabled, isConcurrentRequestHandlingEnabled, isDebuggingEnabled, isDirectConnectEnabled, isMonitorEnabled, isPageRefreshOnBacktrackEnabled, isTerminating, launchArguments, licensedRequestLimit, licensedRequestWindow, licensingAllowsMultipleInstances, licensingAllowsMultipleThreads, lifebeatDestinationPort, lifebeatEnabled, lifebeatInterval, listenQueueSize, loadFrameworks, lock, logString, main, maxSocketIdleTime, minimumActiveSessionsCount, monitorEnabled, monitorHost, monitoringEnabled, namespaceProvider, newDynamicURL, newDynamicURL, number, outputPath, pageCacheSize, pageFragmentCacheSize, pageWithName, path, permanentPageCacheSize, port, primeApplication, primeApplication, printsHTMLParserDiagnostics, projectSearchPath, recordingPath, registeredRequestHandlerKeys, registerMBean, registerMBean, registerRequestHandler, removeRequestHandlerForKey, requestHandlerForKey, requestHandlingLock, resourceManager, resourceRequestHandlerKey, responseForComponentWithName, responseForDirectActionWithNameAndClass, servletConnectURL, sessionIdKey, sessionStore, sessionStoreClassName, sessionTimeOut, setAdaptor, setAdditionalAdaptors, setAllowsConcurrentRequestHandling, setApplicationBaseURL, setAutoOpenClientApplication, setAutoOpenInBrowser, setCachingEnabled, setCGIAdaptorURL, setComponentRequestHandlerKey, setContextClassName, setDefaultRequestHandler, setDefaultUndoStackLimit, setDirectActionRequestHandlerKey, setDirectConnectEnabled, setFrameworksBaseURL, setIncludeCommentsInResponses, setJMXDomain, setListenQueueSize, setLoadFrameworks, setMaxSocketIdleTime, setMinimumActiveSessionsCount, setMonitorEnabled, setMonitorHost, setNamespaceProvider, setPageCacheSize, setPageFragmentCacheSize, setPageRefreshOnBacktrackEnabled, setPermanentPageCacheSize, setPort, setPrintsHTMLParserDiagnostics, setProjectSearchPath, setRecordingPath, setResourceManager, setResourceRequestHandlerKey, setSessionStore, setSessionStoreClassName, setSessionTimeOut, setSMTPHost, setSocketCacheSize, setSocketMonitorSleepTime, setStatisticsStore, setTimeOut, setWebServiceRequestHandlerKey, setWorkerThreadCount, setWorkerThreadCountMax, setWorkerThreadCountMin, sharedEditingContext, shouldRestoreSessionOnCleanEntry, sleep, SMTPHost, socketCacheSize, socketMonitorSleepTime, statistics, statisticsStore, streamActionRequestHandlerKey, takeValueForKey, takeValueForKeyPath, terminateAfterTimeInterval, timeOut, toString, unableToSetNullForKey, unlock, unregisterMBean, validationFailedWithException, valueForKey, valueForKeyPath, wasMainInvoked, webserverConnectURL, webServiceRequestHandlerKey, workerThreadCount, workerThreadCountMax, workerThreadCountMin
public static final org.apache.log4j.Logger log
public static final org.apache.log4j.Logger requestHandlingLog
public static final org.apache.log4j.Logger statsLog
public static final org.apache.log4j.Logger startupLog
public static final String LowMemoryNotification
public static final String LowMemoryResolvedNotification
public static final String StarvedMemoryNotification
public static final String StarvedMemoryResolvedNotification
public static final String ApplicationWillTerminateNotification
public static final String AppShouldExitOnOutOfMemoryError
public static final String AllBundlesLoadedNotification
public static final String ApplicationDidCreateNotification
public static final String ApplicationDidFinishInitializationNotification
protected static NSDictionary propertiesFromArgv
protected BigDecimal _memoryStarvedThreshold
protected BigDecimal _memoryLowThreshold
protected String _replaceApplicationPathPattern
protected String _replaceApplicationPathReplace
protected String _sslHost
protected Integer _sslPort
protected boolean _initializedAdaptors
protected WOTimer _killTimer
protected Boolean useComponentActionRedirection
protected NSMutableArray<String> _streamingRequestHandlerKeys
protected Boolean _useSessionStoreDeadlockDetection
protected static final ERXFormatterFactory _formatterFactory
protected Boolean _responseCompressionEnabled
protected static boolean enableERXShutdownHook()
public static void main(String[] argv, Class applicationClass)
ERXConfigurationManager
.WOApplication.main(String[], Class)
public boolean isDeployedAsServlet()
public static void setup(String[] argv)
public void installPatches()
public WOResourceManager createResourceManager()
createResourceManager
in class WOApplication
public String _newLocationForRequest(WORequest aRequest)
_newLocationForRequest
in class WOApplication
WOApplication._newLocationForRequest(com.webobjects.appserver.WORequest)
public void configureStatisticsLogging()
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
public final void finishInitialization(NSNotification n)
WOApplication.ApplicationWillFinishLaunchingNotification
. This
method calls subclasses' finishInitialization(com.webobjects.foundation.NSNotification)
method.n
- notification that is posted after the WOApplication has been
constructed, but before the application is ready for accepting
requests.protected void migrationsWillRun(ERXMigrator migrator)
migrator
- the migrator that will be usedprotected void migrationsDidRun(ERXMigrator migrator)
migrator
- the migrator that was usedpublic final void didFinishLaunching(NSNotification n)
WOApplication.ApplicationDidFinishLaunchingNotification
. This
method calls subclasse's didFinishLaunching(com.webobjects.foundation.NSNotification)
method.n
- notification that is posted after the WOApplication has
finished launching and is ready for accepting requests.public void finishInitialization()
WOApplication.ApplicationWillFinishLaunchingNotification
.
Override this to perform application initialization. (optional)protected void didCreateApplication()
public void didFinishLaunching()
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.public static ERXApplication erxApplication()
WOApplication.application()
cast as an
ERXApplicationpublic void run()
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.
run
in class WOApplication
public ERXRequest createRequest(String aMethod, String aURL, String anHTTPVersion, Map<String,? extends List<String>> someHeaders, NSData aContent, Map<String,Object> someInfo)
createRequest
in class WOApplication
public static WOComponent instantiatePage(String pageName)
pageName
- -
The name of the WOComponent that must be instantiated.public void startRefusingSessions()
public com.webobjects.appserver._private.WOComponentDefinition _componentDefinition(String s, NSArray nsarray)
er.extensions.ERXApplication.fixCachingEnabled=false
is
you don't want it to load._componentDefinition
in class WOApplication
protected void checkMemory()
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).
protected boolean checkMemory(BigDecimal memoryThreshold, boolean attemptGC)
protected boolean refuseSessionsOnStarvedMemory()
public boolean isRefusingNewSessions()
isRefusingNewSessions
in class WOApplication
public void refuseNewSessions(boolean value)
refuseNewSessions
in class WOApplication
public void killInstance()
System.exit(1)
public String nameSuffix()
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.
""
public String name()
nameSuffix
if one is set.name
in class WOApplication
public String rawName()
WOApplication
's name
method.public NSMutableDictionary extraInformationForExceptionInContext(Exception e, WOContext context)
e
- exceptioncontext
- the current contextpublic WOResponse reportException(Throwable exception, WOContext context, NSDictionary extraInfo)
exception
- to be reportedcontext
- for the exceptionextraInfo
- dictionary of extra information about what was happening when
the exception was thrown.handleException(Exception, WOContext)
is
calledpublic WOResponse handleActionRequestError(WORequest aRequest, Exception exception, String reason, WORequestHandler aHandler, String actionClassName, String actionName, Class actionClass, WOAction actionInstance)
public WOResponse handleException(Exception exception, WOContext context)
handleException
in class WOApplication
exception
- to be handledcontext
- current contextpublic WOResponse genericHandleException(Exception exception, WOContext context)
exception
- to be handledcontext
- current contextpublic void handlePotentiallyFatalException(Exception exception)
exception
- to check if it is a fatal exception.public boolean useComponentActionRedirection()
er.extensions.ERXComponentActionRedirector.enabled=true
property to actually the redirect feature.public WOActionResults invokeAction(WORequest request, WOContext context)
invokeAction
in class ERXAjaxApplication
request
- objectcontext
- objectpublic void appendToResponse(WOResponse response, WOContext context)
appendToResponse
in class WOApplication
response
- objectcontext
- objectpublic static void _startRequest()
public static void _endRequest()
public static boolean isInRequest()
public ERXDelayedRequestHandler delayedRequestHandler()
public WOResponse dispatchRequest(WORequest request)
dispatchRequest
in class WOApplication
request
- objectpublic WOResponse dispatchRequestImmediately(WORequest request)
request
- public WOContext createContextForRequest(WORequest request)
createContextForRequest
in class WOApplication
request
- the requestpublic WOResponse createResponseInContext(WOContext context)
createResponseInContext
in class WOApplication
public void gracefulTerminate()
ERXGracefulShutdown
for where
this is called if signal handling is enabled. Default implementation
calls terminate.gracefulTerminate
in interface ERXGracefulShutdown.GracefulApplication
public void registerStreamingRequestHandlerKey(String s)
public boolean isStreamingRequestHandlerKey(String s)
public boolean useSessionStoreDeadlockDetection()
er.extensions.ERXApplication.useSessionStoreDeadlockDetection=true
property to actually the this feature.public static boolean isDevelopmentModeSafe()
protected static boolean _defaultIsDevelopmentMode()
public boolean isDevelopmentMode()
true
if application is in dev modepublic WOSession createSessionForRequest(WORequest worequest)
createSessionForRequest
in class WOApplication
public void saveSessionForContext(WOContext wocontext)
saveSessionForContext
in class WOApplication
public WOSession restoreSessionWithID(String sessionID, WOContext wocontext)
restoreSessionWithID
in class WOApplication
public Number sessionTimeOutInMinutes()
public ERXFormatterFactory formatterFactory()
application.formatterFactory.(60/#,##0.00)
public boolean responseCompressionEnabled()
er.extensions.ERXApplication.responseCompressionEnabled
and if true turns on response compression by gzippublic NSSet<String> responseCompressionTypes()
er.extensions.ERXApplication.responseCompressionTypes
for
mime types that allow response compression in addition to text/* types.
The default is ("application/x-javascript")public ERXMigrator migrator()
public String _rewriteURL(String url)
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]
url
- the URL to rewritepublic String _rewriteResourceURL(String url, com.webobjects.appserver._private.WODeployedBundle bundle)
url
- the URL to rewritebundle
- the bundle the resource is located inpublic boolean rewriteDirectConnectURL()
public String directConnectURL()
directConnectURL
in class WOApplication
public void setDefaultEncoding(String encoding)
encoding
- public <T extends WOComponent> T pageWithName(Class<T> componentClass, WOContext context)
T
- the type of component tocomponentClass
- the component class to lookupcontext
- the contextpublic <T extends WOComponent> T pageWithName(Class<T> componentClass)
T
- the type of component tocomponentClass
- the component class to lookuppublic NSKeyValueCodingAdditions constants()
application.constants.MyConstantClass
.public boolean sslEnabled()
Name | Description |
---|---|
er.extensions.ERXApplication.ssl.enabled | er.extensions.ERXApplication.ssl.enabled |
public String sslHost()
Name | Description |
---|---|
er.extensions.ERXApplication.ssl.host | er.extensions.ERXApplication.ssl.host |
public void _setSslHost(String sslHost)
sslHost
- an SSL host overridepublic int sslPort()
Name | Description |
---|---|
er.extensions.ERXApplication.ssl.port | er.extensions.ERXApplication.ssl.port |
public void _setSslPort(int sslPort)
sslPort
- an ssl port overrideprotected void _addAdditionalAdaptors(NSMutableArray<NSDictionary<String,Object>> additionalAdaptors)
additionalAdaptors
- the mutable adaptors arraypublic NSArray<NSDictionary<String,Object>> additionalAdaptors()
additionalAdaptors
in class WOApplication
public WOAdaptor adaptorWithName(String aClassName, NSDictionary<String,Object> anArgsDictionary)
adaptorWithName
in class WOApplication
protected void _debugValueForDeclarationNamed(WOComponent component, String verb, String aDeclarationName, String aDeclarationType, String aBindingName, String anAssociationDescription, Object aValue)
public void logTakeValueForDeclarationNamed(String aDeclarationName, String aDeclarationType, String aBindingName, String anAssociationDescription, Object aValue)
logTakeValueForDeclarationNamed
in class WOApplication
public void logSetValueForDeclarationNamed(String aDeclarationName, String aDeclarationType, String aBindingName, String anAssociationDescription, Object aValue)
logSetValueForDeclarationNamed
in class WOApplication
public void setDebugEnabledForComponent(boolean debugEnabled, String componentName)
debugEnabled
- whether or not to enable debuggingcomponentName
- the component name to enable debugging forpublic boolean debugEnabledForComponent(String componentName)
componentName
- the component namepublic void clearDebugEnabledForAllComponents()
@Deprecated public static String erAjaxRequestHandlerKey()
WOApplication.ajaxRequestHandlerKey()
insteadpublic void terminate()
terminate
in class WOApplication
public String[] adaptorExtensions()
adaptorExtensions
in class WOApplication
public void addBalancerRouteCookieByNotification(NSNotification notification)
public void addBalancerRouteCookie(WOContext context)
public String publicHost()
Copyright © 2002 – 2024 Project Wonder.