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
com.webobjects.appserver.WOApplication._EventLoggingEnabler, com.webobjects.appserver.WOApplication.Event, com.webobjects.appserver.WOApplication.TimeoutTask
com.webobjects.foundation.NSKeyValueCodingAdditions.DefaultImplementation, com.webobjects.foundation.NSKeyValueCodingAdditions.Utility
com.webobjects.foundation.NSKeyValueCoding._BooleanFieldBinding, com.webobjects.foundation.NSKeyValueCoding._BooleanMethodBinding, com.webobjects.foundation.NSKeyValueCoding._FieldBinding, com.webobjects.foundation.NSKeyValueCoding._ForwardingBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding._MethodBinding, com.webobjects.foundation.NSKeyValueCoding._NumberFieldBinding, com.webobjects.foundation.NSKeyValueCoding._NumberMethodBinding, com.webobjects.foundation.NSKeyValueCoding._ReflectionKeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCoding.MapImplementation, com.webobjects.foundation.NSKeyValueCoding.Null<T>, com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException, com.webobjects.foundation.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 com.webobjects.appserver.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 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 Logger |
requestHandlingLog
request logging support
|
static 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 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
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(com.webobjects.appserver.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(com.webobjects.appserver.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.
|
com.webobjects.appserver.WOAdaptor |
adaptorWithName(String aClassName,
NSDictionary<String,Object> anArgsDictionary) |
void |
addBalancerRouteCookie(com.webobjects.appserver.WOContext context) |
void |
addBalancerRouteCookieByNotification(com.webobjects.foundation.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(com.webobjects.appserver.WOResponse response,
com.webobjects.appserver.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.
|
com.webobjects.foundation.NSKeyValueCodingAdditions |
constants()
Makes ERXConstants available for binding in the UI.
|
com.webobjects.appserver.WOContext |
createContextForRequest(com.webobjects.appserver.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,
com.webobjects.foundation.NSData aContent,
Map<String,Object> someInfo) |
com.webobjects.appserver.WOResourceManager |
createResourceManager() |
com.webobjects.appserver.WOResponse |
createResponseInContext(com.webobjects.appserver.WOContext context) |
com.webobjects.appserver.WOSession |
createSessionForRequest(com.webobjects.appserver.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(com.webobjects.foundation.NSNotification n)
Notification method called when the application posts the notification
WOApplication.ApplicationDidFinishLaunchingNotification . |
String |
directConnectURL()
Returns the directConnecURL, optionally rewritten.
|
com.webobjects.appserver.WOResponse |
dispatchRequest(com.webobjects.appserver.WORequest request)
Overridden to allow for redirected responses and null the thread local
storage.
|
com.webobjects.appserver.WOResponse |
dispatchRequestImmediately(com.webobjects.appserver.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,
com.webobjects.appserver.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(com.webobjects.foundation.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) |
com.webobjects.appserver.WOResponse |
genericHandleException(Exception exception,
com.webobjects.appserver.WOContext context)
Standard exception page.
|
void |
gracefulTerminate()
Override to perform any last minute cleanup before the application
terminates.
|
com.webobjects.appserver.WOResponse |
handleActionRequestError(com.webobjects.appserver.WORequest aRequest,
Exception exception,
String reason,
com.webobjects.appserver.WORequestHandler aHandler,
String actionClassName,
String actionName,
Class actionClass,
com.webobjects.appserver.WOAction actionInstance)
Workaround for WO 5.2 DirectAction lock-ups.
|
com.webobjects.appserver.WOResponse |
handleException(Exception exception,
com.webobjects.appserver.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 com.webobjects.appserver.WOComponent |
instantiatePage(String pageName)
Used to instantiate a WOComponent when no context is available, typically
outside of a session
|
com.webobjects.appserver.WOActionResults |
invokeAction(com.webobjects.appserver.WORequest request,
com.webobjects.appserver.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 com.webobjects.appserver.WOComponent> |
pageWithName(Class<T> componentClass)
Calls pageWithName with ERXWOContext.currentContext() for the current
thread.
|
<T extends com.webobjects.appserver.WOComponent> |
pageWithName(Class<T> componentClass,
com.webobjects.appserver.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) |
com.webobjects.appserver.WOResponse |
reportException(Throwable exception,
com.webobjects.appserver.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. |
com.webobjects.appserver.WOSession |
restoreSessionWithID(String sessionID,
com.webobjects.appserver.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(com.webobjects.appserver.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 Logger log
public static final Logger requestHandlingLog
public static final Logger statsLog
public static final 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 com.webobjects.appserver.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 com.webobjects.appserver.WOResourceManager createResourceManager()
createResourceManager
in class com.webobjects.appserver.WOApplication
public String _newLocationForRequest(com.webobjects.appserver.WORequest aRequest)
_newLocationForRequest
in class com.webobjects.appserver.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(com.webobjects.foundation.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(com.webobjects.foundation.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 com.webobjects.appserver.WOApplication
public ERXRequest createRequest(String aMethod, String aURL, String anHTTPVersion, Map<String,? extends List<String>> someHeaders, com.webobjects.foundation.NSData aContent, Map<String,Object> someInfo)
createRequest
in class com.webobjects.appserver.WOApplication
public static com.webobjects.appserver.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 com.webobjects.appserver.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 com.webobjects.appserver.WOApplication
public void refuseNewSessions(boolean value)
refuseNewSessions
in class com.webobjects.appserver.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 com.webobjects.appserver.WOApplication
public String rawName()
WOApplication
's name
method.public NSMutableDictionary extraInformationForExceptionInContext(Exception e, com.webobjects.appserver.WOContext context)
e
- exceptioncontext
- the current contextpublic com.webobjects.appserver.WOResponse reportException(Throwable exception, com.webobjects.appserver.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 com.webobjects.appserver.WOResponse handleActionRequestError(com.webobjects.appserver.WORequest aRequest, Exception exception, String reason, com.webobjects.appserver.WORequestHandler aHandler, String actionClassName, String actionName, Class actionClass, com.webobjects.appserver.WOAction actionInstance)
handleActionRequestError
in class com.webobjects.appserver.WOApplication
WOApplication.handleActionRequestError(WORequest, Exception, String,
WORequestHandler, String, String, Class, WOAction)
public com.webobjects.appserver.WOResponse handleException(Exception exception, com.webobjects.appserver.WOContext context)
handleException
in class com.webobjects.appserver.WOApplication
exception
- to be handledcontext
- current contextpublic com.webobjects.appserver.WOResponse genericHandleException(Exception exception, com.webobjects.appserver.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 com.webobjects.appserver.WOActionResults invokeAction(com.webobjects.appserver.WORequest request, com.webobjects.appserver.WOContext context)
invokeAction
in class ERXAjaxApplication
request
- objectcontext
- objectpublic void appendToResponse(com.webobjects.appserver.WOResponse response, com.webobjects.appserver.WOContext context)
appendToResponse
in class com.webobjects.appserver.WOApplication
response
- objectcontext
- objectpublic static void _startRequest()
public static void _endRequest()
public static boolean isInRequest()
public ERXDelayedRequestHandler delayedRequestHandler()
public com.webobjects.appserver.WOResponse dispatchRequest(com.webobjects.appserver.WORequest request)
dispatchRequest
in class com.webobjects.appserver.WOApplication
request
- objectpublic com.webobjects.appserver.WOResponse dispatchRequestImmediately(com.webobjects.appserver.WORequest request)
request
- public com.webobjects.appserver.WOContext createContextForRequest(com.webobjects.appserver.WORequest request)
createContextForRequest
in class com.webobjects.appserver.WOApplication
request
- the requestpublic com.webobjects.appserver.WOResponse createResponseInContext(com.webobjects.appserver.WOContext context)
createResponseInContext
in class com.webobjects.appserver.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 com.webobjects.appserver.WOSession createSessionForRequest(com.webobjects.appserver.WORequest worequest)
createSessionForRequest
in class com.webobjects.appserver.WOApplication
public void saveSessionForContext(com.webobjects.appserver.WOContext wocontext)
saveSessionForContext
in class com.webobjects.appserver.WOApplication
public com.webobjects.appserver.WOSession restoreSessionWithID(String sessionID, com.webobjects.appserver.WOContext wocontext)
restoreSessionWithID
in class com.webobjects.appserver.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 com.webobjects.appserver.WOApplication
public void setDefaultEncoding(String encoding)
encoding
- public <T extends com.webobjects.appserver.WOComponent> T pageWithName(Class<T> componentClass, com.webobjects.appserver.WOContext context)
T
- the type of component tocomponentClass
- the component class to lookupcontext
- the contextpublic <T extends com.webobjects.appserver.WOComponent> T pageWithName(Class<T> componentClass)
T
- the type of component tocomponentClass
- the component class to lookuppublic com.webobjects.foundation.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 com.webobjects.appserver.WOApplication
public com.webobjects.appserver.WOAdaptor adaptorWithName(String aClassName, NSDictionary<String,Object> anArgsDictionary)
adaptorWithName
in class com.webobjects.appserver.WOApplication
protected void _debugValueForDeclarationNamed(com.webobjects.appserver.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 com.webobjects.appserver.WOApplication
public void logSetValueForDeclarationNamed(String aDeclarationName, String aDeclarationType, String aBindingName, String anAssociationDescription, Object aValue)
logSetValueForDeclarationNamed
in class com.webobjects.appserver.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 com.webobjects.appserver.WOApplication
public String[] adaptorExtensions()
adaptorExtensions
in class com.webobjects.appserver.WOApplication
public void addBalancerRouteCookieByNotification(com.webobjects.foundation.NSNotification notification)
public void addBalancerRouteCookie(com.webobjects.appserver.WOContext context)
public String publicHost()
Copyright © 2002 – 2020 Project Wonder.