|
Project Wonder 2.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.webobjects.appserver.WOApplication er.extensions.ERXApplication
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.
Nested Class Summary |
Nested classes inherited from class com.webobjects.appserver.WOApplication |
WOApplication._EventLoggingEnabler, WOApplication.Event |
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCodingAdditions |
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility |
Field Summary | |
protected WOTimer |
_killTimer
|
short |
_responseCompressionEnabled
|
NSMutableArray |
_streamingRequestHandlerKeys
improved streaming support |
protected Boolean |
_useSessionStoreDeadlockDetection
use the redirect feature |
protected EOModelGroup |
defaultModelGroup
holds the default model group |
static ERXLogger |
log
logging support |
static ERXLogger |
requestHandlingLog
request logging support |
protected Boolean |
useComponentActionRedirection
use the redirect feature |
Fields inherited from class com.webobjects.appserver.WOApplication |
_adminRequestHandlerKey, _TheLastApplicationAccessTime, _unsetHost, _wasMainInvoked, ApplicationDidDispatchRequestNotification, ApplicationDidFinishLaunchingNotification, ApplicationWillDispatchRequestNotification, ApplicationWillFinishLaunchingNotification |
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding |
_CLASS, NullValue |
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling |
_CLASS |
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions |
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator |
Constructor Summary | |
ERXApplication()
The ERXApplication contructor. |
Method Summary | |
void |
appendToResponse(WOResponse response,
WOContext context)
Overridden to allow for redirected responses. |
void |
configureStatisticsLogging()
Configures the statistics logging for a given application. |
WOContext |
createContextForRequest(WORequest request)
When a context is created we push it into thread local storage. |
WORequest |
createRequest(String aMethod,
String aURL,
String anHTTPVersion,
NSDictionary someHeaders,
NSData aContent,
NSDictionary someInfo)
Creates the request object for this loop. |
WOSession |
createSessionForRequest(WORequest worequest)
Overridden to check the sessions |
EOModelGroup |
defaultModelGroup()
Delegate method for the EOModelGroup class delegate. |
void |
didFinishLaunching()
Called when the application posts WOApplication.ApplicationDidFinishLaunchingNotification .
|
void |
didFinishLaunching(NSNotification n)
Notification method called when the application posts the notification WOApplication.ApplicationDidFinishLaunchingNotification .
|
WOResponse |
dispatchRequest(WORequest request)
Overridden to allow for redirected responses and null the thread local storage. |
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()
|
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 quiting the application ASAP. |
void |
installPatches()
Installs several bufixes and enhancements to WODynamicElements. |
static WOComponent |
instantiatePage(String pageName)
Used to instanciate a WOComponent when no context is available, typically ouside of a session |
WOActionResults |
invokeAction(WORequest request,
WOContext context)
Overridden to allow for redirected responses. |
boolean |
isStreamingRequestHandlerKey(String s)
|
void |
killInstance()
Killing the instance will log a 'Forcing exit' message and then call System.exit(1) |
static void |
main(String[] argv,
Class applicationClass)
Called when the application starts up and saves the command line arguments for ERXConfigurationManager . |
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. |
String |
rawName()
This method returns WOApplication 's name method. |
void |
refuseNewSessions(boolean value)
Overridden to install/uninstall a timer that will terminate the application in ERTimeToKill seconds from the time this method is called.
|
void |
registerStreamingRequestHandlerKey(String s)
|
WOResponse |
reportException(Throwable exception,
NSDictionary extraInfo)
Reports an exception. |
boolean |
responseCompressionEnabled()
|
WOSession |
restoreSessionWithID(String sessionID,
WOContext wocontext)
Overridden to check the sessions |
void |
run()
Adds support for automatic application cycling. |
void |
saveSessionForContext(WOContext wocontext)
Overridden to check the sessions |
Number |
sessionTimeOutInMinutes()
|
void |
startRefusingSessions()
Stops the application from handling any new requests. |
boolean |
useComponentActionRedirection()
Set the er.extensions.ERXComponentActionRedirector.enabled=true
property to actually the redirect feature. |
boolean |
useEditingContextUnlocker()
Decides whether to use editing context unlocking. |
boolean |
useSessionStoreDeadlockDetection()
Deadlock in session-store detection. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final ERXLogger log
public static final ERXLogger requestHandlingLog
public NSMutableArray _streamingRequestHandlerKeys
protected EOModelGroup defaultModelGroup
protected WOTimer _killTimer
protected Boolean useComponentActionRedirection
protected Boolean _useSessionStoreDeadlockDetection
public short _responseCompressionEnabled
Constructor Detail |
public ERXApplication()
Method Detail |
public static void main(String[] argv, Class applicationClass)
ERXConfigurationManager
.
WOApplication.main(String[], Class)
public void installPatches()
public EOModelGroup defaultModelGroup()
EOModelGroup
class delegate.
public boolean useEditingContextUnlocker()
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 subclasse's 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.public 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)
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()
killInstance
.
public WORequest createRequest(String aMethod, String aURL, String anHTTPVersion, NSDictionary someHeaders, NSData aContent, NSDictionary someInfo)
ERXRequest
object that fixes a bug
with localization.
aMethod
- the HTTP method object used to send the request, must be one of "GET", "POST" or "HEAD"aURL
- - must be non-nullanHTTPVersion
- - the version of HTTP usedsomeHeaders
- - dictionary whose String keys correspond to header namesaContent
- - the HTML content of the receiversomeInfo
- - an NSDictionary that can contain any kind of information related to the current response.
public static WOComponent instantiatePage(String pageName)
pageName
- - The name of the WOComponent that must be instanciated.
public void startRefusingSessions()
public void refuseNewSessions(boolean value)
ERTimeToKill
seconds from the time this method is called.
The timer will get uninstalled if you allow new sessions again during that
time span.
public void killInstance()
System.exit(1)
public String nameSuffix()
null
public String name()
nameSuffix
if one is set.
public String rawName()
WOApplication
's name
method.
public NSMutableDictionary extraInformationForExceptionInContext(Exception e, WOContext context)
public WOResponse reportException(Throwable exception, NSDictionary extraInfo)
exception
- to be reportedextraInfo
- 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)
WOApplication.handleActionRequestError(WORequest, Exception, String, WORequestHandler, String, String, Class, WOAction)
public WOResponse handleException(Exception exception, WOContext context)
exception
- to be handledcontext
- current context
public WOResponse genericHandleException(Exception exception, WOContext context)
exception
- to be handledcontext
- current context
public 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)
request
- objectcontext
- objectpublic void appendToResponse(WOResponse response, WOContext context)
response
- objectcontext
- objectpublic WOResponse dispatchRequest(WORequest request)
request
- object
public WOContext createContextForRequest(WORequest request)
request
- the request
public void gracefulTerminate()
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 WOSession createSessionForRequest(WORequest worequest)
public void saveSessionForContext(WOContext wocontext)
public WOSession restoreSessionWithID(String sessionID, WOContext wocontext)
public Number sessionTimeOutInMinutes()
public ERXFormatterFactory formatterFactory()
public boolean responseCompressionEnabled()
|
Last updated: Do, Dez 9, 2004 12:46 PM CET | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |