|
WebObjects 5.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.webobjects.appserver.WOApplication
The primary role of the WOApplication class is to coordinate the handling of HTTP requests. Each application must have exactly one WOApplication object. The application object receives client requests from an HTTP server adaptor, manages the processing that generates a response, and returns that response to the adaptor. Typically, the response is an object representing a web page. The adaptor then packages the response in a form specific to the HTTP server that orginated the request and then forwards the response to that HTTP server.
In handling requests, an application object creates and manages one or more sessions. A session (represented by a WOSession object) dedicates resources to a period of access by a single user and stores persistent state during that period. Conceptually, each cycle of the request-response loop (or transaction) takes place within a session.
Besides mediating between the adaptor and the rest of the application during request handling, WOApplication performs many secondary functions. It returns pages based on component name, caches page instances and component definitions, provides some facilities for error handling and script debugging, coordinates the different levels of multi-threaded execution, and furnishes a variety of data.
Typical deployment schemes balance the processing load by having multiple application instances per web server adaptor. A single application can interact with multiple adaptors. For example, an application can simultaneously communicate with secure-socket adaptors and HTTP adaptors.
You can instantiate ready-made application objects from the WOApplication
class or you can obtain the application object from a custom subclass of
WOApplication. Custom WOApplication subclasses are common
in WebObjects applications since there is often a need
to override the awake, sleep, and request-handling methods.
Compiled WOApplication subclasses can take any name, but if the name
is anything other than "Application" you must implement
your own main
method to instantiate the application object from
this class. However, if the class name is "Application", you don't
need to modify main
.
awake()
,
sleep()
Inner Class Summary | |
static class |
WOApplication.Event
This is a subclass of WOEvent used by the WebObjects runtime to collect pageWithName events. |
Inner classes inherited from class com.webobjects.foundation.NSKeyValueCoding |
NSKeyValueCoding.DefaultImplementation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.Null, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.Utility, NSKeyValueCoding.ValueAccessor |
Inner classes inherited from class com.webobjects.foundation.NSKeyValueCodingAdditions |
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility |
Field Summary | |
static String |
ApplicationDidDispatchRequestNotification
Contains a String that names the notification posted at the end of WOApplication's dispatchRequest method. |
static String |
ApplicationDidFinishLaunchingNotification
Contains a String that names the notification posted by WOApplication's run method after the application is launched. |
static String |
ApplicationWillDispatchRequestNotification
Contains a String that names the notification posted at the very beginning of WOApplication's dispatchRequest method. |
static String |
ApplicationWillFinishLaunchingNotification
Contains a String that names the notification posted at the very beginning of WOApplication's run method. |
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding |
NullValue |
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions |
KeyPathSeparator |
Constructor Summary | |
WOApplication()
Creates and initializes the instance of WOApplication. |
Method Summary | |
int |
activeSessionsCount()
The number returned is only accurate if the application stores state in the server's memory, which is the default. |
String |
adaptor()
Returns the class name of the primary adaptor. |
NSArray |
adaptors()
Returns a list of the loaded application adaptors. |
boolean |
adaptorsDispatchRequestsConcurrently()
Return whether or not there is at least one multi-threaded adaptor which may attempt to dispatch requests concurrently. |
WOAdaptor |
adaptorWithName(String aClassName,
NSDictionary anArgsDictionary)
Invoked in the constructor to create an adaptor. |
NSArray |
additionalAdaptors()
Returns an array of adaptor description dictionaries. |
boolean |
allowsConcurrentRequestHandling()
Return whether or not concurrent request handling is allowed. |
void |
appendToResponse(WOResponse aResponse,
WOContext aContext)
The WOApplication object invokes this method on itself to initiate the final phase of request handling. |
static WOApplication |
application()
Return the application instance. |
String |
applicationBaseURL()
This is the cover method for the property WOApplicationBaseURL . |
boolean |
autoOpenClientApplication()
Returns whether automatic client application launching is enabled for Java Client applications. |
boolean |
autoOpenInBrowser()
Return whether starting the application instance will launch a browser pointing at the main page of the application. |
void |
awake()
Invoked at the beginning of each cycle of the request-response loop, affording the opportunity to perform initializations with application-wide scope. |
String |
baseURL()
Returns the application URL relative to the server's document root. |
static boolean |
canAccessFieldsDirectly()
WOApplication's implementation of this static method returns true, indicating that key-value coding is allowed to access fields in this object if an appropriate method isn't present. |
String |
cgiAdaptorURL()
Returns the URL for the web server including the path to the WebObjects CGI adaptor: for example, http://localhost/cgi-bin/WebObjects . |
String |
componentRequestHandlerKey()
Returns the key which identifies URLs directed at component-action based requests. |
String |
contextClassName()
Defaults to WOContext . |
WOContext |
createContextForRequest(WORequest aRequest)
Creates a new context object for a given request. |
WORequest |
createRequest(String aMethod,
String aURL,
String anHTTPVersion,
NSDictionary someHeaders,
NSData aContent,
NSDictionary someInfo)
Convenience method that instantiates and returns a new WORequest object. |
WOResourceManager |
createResourceManager()
Creates a new instance of WOResourceManager. |
WOResponse |
createResponseInContext(WOContext aContext)
Convenience method that instantiates and returns a new, empty WOResponse object. |
WOSession |
createSessionForRequest(WORequest aRequest)
Creates and returns a WOSession object to manage a session for the client. |
void |
debugString(String aString)
Deprecated. use NSLog instead. |
WORequestHandler |
defaultRequestHandler()
Returns the request handler to be used when no request handler key is found in the URL or WORequest. |
String |
defaultRequestHandlerClassName()
Returns the class name of the default request handler. |
Number |
defaultUndoStackLimit()
Return the number of levels of undo for a session's default editing context. |
String |
directActionRequestHandlerKey()
Returns the key which identifies URLs directed at Direct Action based requests. |
String |
directConnectURL()
Returns the URL to connect to the application directly without going through the web server and WOAdaptors. |
WOResponse |
dispatchRequest(WORequest aRequest)
The starting point of the request-response cycle in WOApplication. |
WOElement |
dynamicElementWithName(String aName,
NSDictionary someAssociations,
WOElement anElement,
NSArray aLanguageArray)
Creates and returns a WOElement object based on the element's name, a dictionary of associations, and a template of WOElements. |
String |
frameworksBaseURL()
This value is used to determine URLs that should be generated to reference Web Server Resources in those frameworks. |
WOResponse |
handleActionRequestError(WORequest aRequest,
Exception exception,
String reason,
WORequestHandler aHandler,
String actionClassName,
String actionName,
Class actionClass,
WOAction actionInstance)
Invoked when an action handler throws an exception in handleRequest. |
WOResponse |
handleException(Exception anException,
WOContext aContext)
Invoked when an unexpected exception is thrown in the request-response loop. |
NSMutableDictionary |
handleMalformedCookieString(RuntimeException anException,
String cookieString,
NSMutableDictionary aReturnDict)
Invoked when a malformed cookie is parsed. |
WOResponse |
handlePageRestorationErrorInContext(WOContext aContext)
Invoked when a page (WOComponent) instance cannot be restored, which typically happens when a user backtracks too far. |
Object |
handleQueryWithUnboundKey(String key)
Conformance to NSKeyValueCoding.ErrorHandling. |
WORequestHandler |
handlerForRequest(WORequest aRequest)
Returns the request handler to be used to handle a given request. |
WOResponse |
handleSessionCreationErrorInContext(WOContext aContext)
Invoked by the component request handler when a session (WOSession) instance cannot be created. |
WOResponse |
handleSessionRestorationErrorInContext(WOContext aContext)
Invoked when a session (WOSession) instance cannot be restored, which typically happens when the session times out. |
void |
handleTakeValueForUnboundKey(Object value,
String key)
Conformance to NSKeyValueCoding.ErrorHandling. |
String |
host()
Return the name of the host the instance is running on. |
InetAddress |
hostAddress()
Return the InetAddress for the host returned by host . |
boolean |
includeCommentsInResponses()
Returns whether or not HTML comments are appended to the response. |
WOActionResults |
invokeAction(WORequest aRequest,
WOContext aContext)
The WOApplication object invokes this method on itself to initiate the middle phase of request handling. |
boolean |
isCachingEnabled()
Returns whether or not component caching is enabled. |
boolean |
isConcurrentRequestHandlingEnabled()
Returns true if at least one adaptor may dispatch requests
concurrently and allowsConcurrentRequestHandling returns
true . |
boolean |
isDebuggingEnabled()
Do not use. |
boolean |
isDirectConnectEnabled()
Returns whether or not direct connect is enabled. |
boolean |
isMonitorEnabled()
This is a cover method for the property WOMonitorEnabled . |
boolean |
isPageRefreshOnBacktrackEnabled()
Returns whether caching of pages is disabled in the client. |
boolean |
isRefusingNewSessions()
Returns true if the application instance is refusing new
sessions, and false otherwise. |
boolean |
isTerminating()
Returns whether the application will terminate at the end of the current request-response loop. |
static int |
licensedRequestLimit()
Returns the maximum number of requests WebObjects will handle during the window returned by licensedRequestWindow . |
static long |
licensedRequestWindow()
Returns the interval over which the licensedRequestLimit
is calculated. |
static boolean |
licensingAllowsMultipleInstances()
This static final method returns a boolean indicating whether the license allows multiple instances of the application to run simultaneously. |
static boolean |
licensingAllowsMultipleThreads()
This static final method returns a boolean that indicates whether or not the application is allowed to run in multithreaded mode. |
int |
lifebeatDestinationPort()
Returns the port to which lifebeat signals will be sent. |
boolean |
lifebeatEnabled()
Return whether or not the application is sending lifebeats. |
int |
lifebeatInterval()
Return the interval at which the application instance will send lifebeat signals to wotaskd. |
Number |
listenQueueSize()
Returns the size of the listen queue which will created by the primary adaptor, usually WODefaultAdaptor. |
NSArray |
loadFrameworks()
Return the NSArray of frameworks to be loaded during application initialization. |
void |
lock()
Deprecated. synchronized(WOApplication.application()) should be used instead. |
void |
logSetValueForDeclarationNamed(String aDeclarationName,
String aDeclarationType,
String aBindingName,
String anAssociationDescription,
Object aValue)
Formats and logs a message anytime a value is set through a WOAssociation, when WODebug is set to true for the declaration in which the association appears. |
void |
logString(String aString)
Deprecated. Use NSLog instead |
void |
logTakeValueForDeclarationNamed(String aDeclarationName,
String aDeclarationType,
String aBindingName,
String anAssociationDescription,
Object aValue)
Formats and logs a message anytime a value is taken through a WOAssociation, when WODebug is set to true for the
declaration in which the association appears. |
static void |
main(String[] argv)
The WebObjects application's main method. |
static void |
main(String[] argv,
Class applicationClass)
An alternate main method for the WebObjects applications that allows you to specify a subclass of WOApplication to be instantiated and run instead of WOApplication. |
Number |
maxSocketIdleTime()
Returns the maximum interval in milliseconds for which a socket should be allowed to wait on incoming data. |
int |
minimumActiveSessionsCount()
If the number of active sessions is less than or equal to this number and isRefusingNewSessions returns true , the application
instance terminates. |
boolean |
monitorEnabled()
Deprecated. monitorEnabled no longer supported |
String |
monitorHost()
Deprecated. monitorHost no longer supported |
boolean |
monitoringEnabled()
Deprecated. monitoringEnabled is no longer supported |
String |
name()
Returns the name of the application, which is the name of the executable without any extensions. |
String |
number()
Provided for backwards compatibility only. |
String |
outputPath()
Return the path to which logs will be written. |
int |
pageCacheSize()
Provides the size of the default page cache. |
WOComponent |
pageWithName(String aName,
WOContext aContext)
Returns a new page instance (a WOComponent object) identified by aName . |
String |
path()
Returns the file system path of the application, which is an absolute path and includes the .woa extension; for example
"C:/NETSCAPE/ns-home/docs/WebObjects/Examples/HelloWorld.woa"
is a typical application path. |
int |
permanentPageCacheSize()
Provides the size of the permanent page cache. |
Number |
port()
Returns the port number on which the primary adaptor will listen This is the cover method for the property WOPort . |
static void |
primeApplication(String mainBundlePath,
String nameOfApplicationSubclass)
This is used when calling into WebObjects programmatically (typically to use responseForComponentWithName ) rather than running
a WebObjects application standalone. |
boolean |
printsHTMLParserDiagnostics()
Deprecated. See com.webobjects.foundation.NSLog |
NSArray |
projectSearchPath()
Returns an array of file system paths which are searched for projects for rapid turnaround mode. |
String |
recordingPath()
Returns a file system path which is where the recording information should be saved. |
void |
refuseNewSessions(boolean aVal)
Controls whether this application instance will create a session when it receives an HTTP request from a new user. |
NSArray |
registeredRequestHandlerKeys()
Returns an array of Strings containing the keys of all of the registered request handlers. |
void |
registerRequestHandler(WORequestHandler aHandler,
String aRequestHandlerKey)
Registers a new request handler. |
WORequestHandler |
removeRequestHandlerForKey(String aRequestHandlerKey)
Removes the specified request handler from the application. |
WORequestHandler |
requestHandlerForKey(String aKey)
Returns the request handler used to handle requests containing the specified key. |
Object |
requestHandlingLock()
Returns an Object suitable for a synchronization lock or null
if the application isn't multithreaded. |
WOResourceManager |
resourceManager()
Returns the WOResourceManager object that the application uses to manage resources. |
String |
resourceRequestHandlerKey()
Resource requests are only used during development of an application or when the application is being run without an HTTP server. |
WOResponse |
responseForComponentWithName(String name,
NSDictionary bindings,
NSDictionary headers,
NSDictionary userInfo,
String uriPrefix,
String appName)
Returns a WOResponse for the WOComponent named name , using bindings . |
WOResponse |
responseForDirectActionWithNameAndClass(String actionName,
String className,
NSDictionary formValueDict,
InputStream contentStream,
NSDictionary headers,
NSDictionary userInfo,
String uriPrefix,
String appName)
Returns a WOResponse for the Direct Action actionName in the class named
className (optional). |
WOSession |
restoreSessionWithID(String aSessionID,
WOContext aContext)
Restores the WOSession object representing a session. |
void |
run()
Runs the application in a near-indefinite run loop in the default run-loop mode. |
void |
saveSessionForContext(WOContext aContext)
Called at the end of the request handling loop when the current session object needs to be saved. |
String |
servletConnectURL()
Returns the URL to connect to the application through a servlet container. |
WOSessionStore |
sessionStore()
Returns the application's current WOSessionStore object. |
String |
sessionStoreClassName()
Return the name of the class that will be used to store sessions. |
Number |
sessionTimeOut()
Return the number of seconds for which a session may be idle before it times out. |
void |
setAdaptor(String aString)
Deprecated. Use the system property WOAdaptor instead |
void |
setAdditionalAdaptors(NSArray anAdaptorArray)
Deprecated. Use the system property WOAdditionalAdaptors instead |
void |
setAllowsConcurrentRequestHandling(boolean aValue)
Explicitly specifiy whether concurrent request handling is allowed. |
void |
setApplicationBaseURL(String aString)
Sets to aString the path to which the current application may
be found under the document root, with or without the .woa . |
void |
setAutoOpenClientApplication(boolean aBool)
Controls whether starting up an application instance also launches a Java Client client application. |
void |
setAutoOpenInBrowser(boolean aBool)
Controls whether starting up this application also launches a web browser. |
void |
setCachingEnabled(boolean aBool)
Sets whether or not component caching is enabled. |
void |
setCGIAdaptorURL(String aString)
Sets the URL through the web server to aString . |
void |
setComponentRequestHandlerKey(String aString)
Deprecated. Use the system property _ComponentRequestHandlerKey instead |
void |
setContextClassName(String name)
Sets the name of the WOContext subclass class. |
void |
setDefaultRequestHandler(WORequestHandler aRequestHandler)
Sets the default request handler. |
void |
setDefaultUndoStackLimit(int stackLimit)
Set the limit size for the undo stack for a session's default editing context. |
void |
setDirectActionRequestHandlerKey(String aString)
Deprecated. Use the system property _DirectActionRequestHandlerKey instead |
void |
setDirectConnectEnabled(boolean aBool)
Deprecated. Use the system property WODirectConnectEnabled instead |
void |
setFrameworksBaseURL(String aString)
Sets aString as the path under which all frameworks can be found
inside the document root. |
void |
setIncludeCommentsInResponses(boolean aBool)
Sets whether or not HTML comments are appended to the response. |
void |
setListenQueueSize(Number listenQueueSize)
Deprecated. Use the system property WOListenQueueSize instead |
void |
setLoadFrameworks(NSArray anArray)
Deprecated. Use the system property WOLoadFrameworks instead |
void |
setMaxSocketIdleTime(Number maxSocketIdleTime)
Deprecated. Use the system property WOMaxSocketIdleTime instead |
void |
setMinimumActiveSessionsCount(int aVal)
Sets the minimum number of active sessions to aVal . |
void |
setMonitorEnabled(boolean aBool)
Sets the value of the WOMonitorEnabled property. |
void |
setMonitorHost(String aString)
Deprecated. setMonitorHost no longer supported |
void |
setPageCacheSize(int anUnsigned)
Sets the number of page instances the cache will hold. |
void |
setPageRefreshOnBacktrackEnabled(boolean aFlag)
When aFlag is true , disables caching of pages by the
client by setting the page's expiration-time header to the current date and
time. |
void |
setPermanentPageCacheSize(int anUnsigned)
Sets the permanentPageCacheSize to anUnsigned . |
void |
setPort(Number port)
Deprecated. Use the system property WOPort instead |
void |
setPrintsHTMLParserDiagnostics(boolean aBOOL)
Deprecated. See com.webobjects.foundation.NSLog |
void |
setProjectSearchPath(NSArray aPathArray)
Sets the array of file system paths which are searched for projects for rapid turnaround mode. |
void |
setRecordingPath(String aString)
Sets the file system path to where the recording information should be saved. |
void |
setResourceManager(WOResourceManager aResourceManager)
Deprecated. use createResourceManager instead. |
void |
setResourceRequestHandlerKey(String aString)
Deprecated. Use the system property _ResourceRequestHandlerKey instead |
void |
setSessionStore(WOSessionStore aSessionStore)
Set the session-store object for the application. |
void |
setSessionStoreClassName(String aString)
Sets the name of the session store class to the specified name. |
void |
setSessionTimeOut(Number timeOut)
Set the interval, in seconds, during which a session may be idle before it times out. |
void |
setSMTPHost(String aString)
Sets the name of the host that will be used to send e-mail messages created by WOMailDelivery. |
void |
setSocketCacheSize(Number socketCacheSize)
Deprecated. setSocketCacheSize no longer supported |
void |
setSocketMonitorSleepTime(Number socketMonitorSleepTime)
Deprecated. setSocketMonitorSleepTime no longer supported |
void |
setStatisticsStore(WOStatisticsStore aStatisticsStore)
Sets the WOStatisticsStore object to aStatisticsStore . |
void |
setTimeOut(double aTimeInterval)
Sets the number of seconds the application can experience inactivity before it terminates execution. |
void |
setWebServiceRequestHandlerKey(String aString)
Deprecated. Use the system property _WebServiceRequestHandlerKey instead |
void |
setWorkerThreadCount(Number threadCount)
Deprecated. setWorkerThreadCount no longer supported |
void |
setWorkerThreadCountMax(Number threadCount)
Sets the value of the property WOWorkerThreadCountMax . |
void |
setWorkerThreadCountMin(Number threadCount)
Sets the value of the property WOWorkerThreadCountMin . |
EOSharedEditingContext |
sharedEditingContext()
Deprecated. EOSharedEditingContext.defaultSharedEditingContext should
be directly used instead. |
boolean |
shouldRestoreSessionOnCleanEntry(WORequest aRequest)
This is a delegate method for the developer to override for custom behavior. |
void |
sleep()
Invoked at the conclusion of a request-handling cycle to give an application the opportunity for releasing references to objects created and initialized in its awake method. |
String |
SMTPHost()
Returns the name of the host that will be used to send e-mail messages created by WOMailDelivery. |
Number |
socketCacheSize()
Deprecated. socketCacheSize no longer supported |
Number |
socketMonitorSleepTime()
Deprecated. socketMonitorSleepTime no longer supported |
NSDictionary |
statistics()
Returns a copy of the dictionary containing the application statistics maintained by WOStatisticsStore. |
WOStatisticsStore |
statisticsStore()
Returns the WOStatisticsStore object, which records statistics while the application runs. |
String |
streamActionRequestHandlerKey()
Returns the key which identifies URLs directed at Stream based requests. |
void |
takeValueForKey(Object value,
String key)
Conformance to NSKeyValueCoding. |
void |
takeValueForKeyPath(Object value,
String keyPath)
Conformance to NSKeyValueCodingAdditions. |
void |
takeValuesFromRequest(WORequest aRequest,
WOContext aContext)
WOComponentRequestHandler invokes this method on
WOApplication to initiate the first phase of request handling. |
void |
terminate()
Terminates the application process. |
void |
terminateAfterTimeInterval(double aTimeInterval)
Deprecated. This method is deprecated, and currently just calls setTimeOut . |
double |
timeOut()
Returns the application's time-out interval: a period (in seconds) of inactivity after which the application will terminate execution. |
String |
toString()
Returns a String containing a string representation of the receiver. |
void |
unableToSetNullForKey(String key)
Conformance to NSKeyValueCoding.ErrorHandling. |
void |
unlock()
Deprecated. synchronized(WOApplication.application()) should be used instead. |
void |
validationFailedWithException(Throwable t,
Object value,
String keyPath,
WOComponent component,
WOSession session)
Appends a validation failed message to NSLog.err. |
Object |
valueForKey(String key)
Conformance to NSKeyValueCoding. |
Object |
valueForKeyPath(String keyPath)
Conformance to NSKeyValueCodingAdditions. |
boolean |
wasMainInvoked()
Used to determine if the WO application was started standalone or not. |
String |
webserverConnectURL()
Returns the URL to connect to the application through the web server and WOAdaptors. |
String |
webServiceRequestHandlerKey()
Returns the key which identifies URLs directed at Web services. |
Number |
workerThreadCount()
Deprecated. workerThreadCount no longer supported |
Number |
workerThreadCountMax()
Returns the number of worker threads the default adaptor will create startup. |
Number |
workerThreadCountMin()
Returns the number of worker threads the default adaptor will create at startup. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String ApplicationDidDispatchRequestNotification
dispatchRequest
method.public static final String ApplicationDidFinishLaunchingNotification
run
method after the application is launched. This notification
is posted immediately before the run
method logs the
"Waiting for requests." message to the console.public static final String ApplicationWillDispatchRequestNotification
dispatchRequest
method.public static final String ApplicationWillFinishLaunchingNotification
run
method.Constructor Detail |
public WOApplication()
isPageRefreshOnBacktrackEnabled
returns true
). An NSForwardException is thrown if initialization does not succeed.
isPageRefreshOnBacktrackEnabled()
Method Detail |
public String SMTPHost()
WOSMTPHost
.setSMTPHost(java.lang.String)
public int activeSessionsCount()
minimumActiveSessionsCount()
,
setMinimumActiveSessionsCount(int)
public String adaptor()
WOAdaptor
.setAdaptor(java.lang.String)
public WOAdaptor adaptorWithName(String aClassName, NSDictionary anArgsDictionary)
WOAdditionalAdaptors
property. This property expects as its value
a properly formatted plist containing a dictionary of initialization values
for the adaptor. This method looks for a subclass of WOAdaptor
with the name aClassName
(which was supplied in the dictionary with
the key WOAdaptor
), and if such a class exists, creates a new instance.
The anArgsDictionary
dictionary is populated with any adaptor-specific
options.aClassName
- the WOAdaptor subclass nameanArgsDictionary
- the adaptor description dictionaryadaptors()
,
WOAdaptor
public NSArray adaptors()
adaptorWithName(java.lang.String, com.webobjects.foundation.NSDictionary)
public final boolean adaptorsDispatchRequestsConcurrently()
true
if at least one adaptor may attempt to concurrently invoke the request handlerspublic NSArray additionalAdaptors()
WOAdditionalAdaptors
The value of the property should be a plist of dictionaries, each of which should contain a key-value
pair whose key is
WOAdaptor
and whose value is a String containing the name of the
adaptor class. Other attributes such as WOPort
may also be specified,
but are adaptor specific. For example, WOWorkerThreadCount
is used
by the WODefaultAdaptor
class and may not be relevant for all adaptors.
setAdditionalAdaptors(com.webobjects.foundation.NSArray)
public boolean allowsConcurrentRequestHandling()
WOAllowsConcurrentRequestHandling
and will return false
by default.true
if concurrent request handling is allowed, false
otherwiseisConcurrentRequestHandlingEnabled()
,
setAllowsConcurrentRequestHandling(boolean)
public void appendToResponse(WOResponse aResponse, WOContext aContext)
invokeAction
method has completed, typically with the return
of a response page. In the append-to-response phase, the application
objects (particularly the response component itself) generate the
HTML content of the page. WOApplication's default implementation of
this method invokes appendToResponse
on the session.
Note This method is not called during a direct action request-response loop.aResponse
- the response being handledaContext
- a WOContext object that represents the
context of the transactioninvokeAction(com.webobjects.appserver.WORequest, com.webobjects.appserver.WOContext)
,
WOSession.appendToResponse(com.webobjects.appserver.WOResponse, com.webobjects.appserver.WOContext)
public static WOApplication application()
public String applicationBaseURL()
WOApplicationBaseURL
.
This method will return the path to where the application may be found under
the document root, not including the application name.
Will return "/WebObjects"
if the application is started
without explicitly specifying the WOApplicationBaseURL
property
(unless the application itself invokes setApplicationBaseURL
).
setApplicationBaseURL(java.lang.String)
public boolean autoOpenClientApplication()
WOAutoOpenClientApplication
.true
if a Java Client client application should be launched, false
otherwisesetAutoOpenClientApplication(boolean)
,
autoOpenInBrowser()
public boolean autoOpenInBrowser()
true
if automatic browser launching is enabled,
false
public void awake()
super
.sleep()
public String baseURL()
applicationBaseURL()
public static boolean canAccessFieldsDirectly()
true
alwayspublic String cgiAdaptorURL()
http://localhost/cgi-bin/WebObjects
.
This URL is used by the direct connect feature only. This is the
cover for the property WOCGIAdaptorURL
.setCGIAdaptorURL(java.lang.String)
public String componentRequestHandlerKey()
_ComponentRequestHandlerKey
.appendToResponse(com.webobjects.appserver.WOResponse, com.webobjects.appserver.WOContext)
,
setComponentRequestHandlerKey(java.lang.String)
,
directActionRequestHandlerKey()
,
setDirectActionRequestHandlerKey(java.lang.String)
,
resourceRequestHandlerKey()
,
setResourceRequestHandlerKey(java.lang.String)
,
webServiceRequestHandlerKey()
,
setWebServiceRequestHandlerKey(java.lang.String)
public String contextClassName()
WOContext
.public WOContext createContextForRequest(WORequest aRequest)
WOContext
. If
you override it, your implementation need not call super
.
Alternatively, use setContextClassName
and contextClassName
.
If you are using JSP or Servlet support (JavaWOJSPServlet.framework),
you must subclass WOServletContext
instead of WOContext
.
aRequest
- the WORequest that the WOContext is generated forsetContextClassName(java.lang.String)
,
contextClassName()
public WORequest createRequest(String aMethod, String aURL, String anHTTPVersion, NSDictionary someHeaders, NSData aContent, NSDictionary someInfo)
aMethod
- the HTTP method object used to send the requestaURL
- the URI request lineanHTTPVersion
- 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.WORequest
public WOResourceManager createResourceManager()
super
.
Do not use this method to get a reference to the WOResourceManager object.
Multiple calls to this method will result in multiple instantiations, which is memory intensive.
Use resourceManager
to get a reference instead.
resourceManager()
public WOResponse createResponseInContext(WOContext aContext)
aContext
- the context of the transactionpublic WOSession createSessionForRequest(WORequest aRequest)
The method then returns an initialized (using the default WOSession constructor) session instance of the selected class.
Note: An implication of the foregoing description is that
the names of WOSession subclasses should be "Session",
and that this class should be in the same package as the subclass
of WOApplication. If not, you will have to override this method
to use the proper class to create the session object.
The default implementation of createSessionForRequest
does not catch any exception thrown by the runtime if it is
unable to instantiate a new session. It never returns null
.
If you implement this method to return null
in certain conditions:
In component request handling, this will trigger a call to handleSessionCreationErrorInContext
.
In a direct action, WOContext.session
will throw an IllegalStateException
,
and you'll need to catch it yourself to call handleSessionCreationErrorInContext
if desired.
aRequest
- the WORequest being handledrestoreSessionWithID(java.lang.String, com.webobjects.appserver.WOContext)
,
saveSessionForContext(com.webobjects.appserver.WOContext)
,
handleSessionCreationErrorInContext(com.webobjects.appserver.WOContext)
,
WOContext.session
public void debugString(String aString)
aString
- message to be printed to the standard error deviceNSLog
public WORequestHandler defaultRequestHandler()
The way that URLs of this type are handled is determined by the default request handler.http://somehost/cgi-bin/WebObjects/AppName.woa
setDefaultRequestHandler(com.webobjects.appserver.WORequestHandler)
public String defaultRequestHandlerClassName()
public Number defaultUndoStackLimit()
WODefaultUndoStackLimit
setDefaultUndoStackLimit(int)
public String directActionRequestHandlerKey()
_DirectActionRequestHandlerKey
.appendToResponse(com.webobjects.appserver.WOResponse, com.webobjects.appserver.WOContext)
,
componentRequestHandlerKey()
,
setComponentRequestHandlerKey(java.lang.String)
,
setDirectActionRequestHandlerKey(java.lang.String)
,
resourceRequestHandlerKey()
,
setResourceRequestHandlerKey(java.lang.String)
,
webServiceRequestHandlerKey()
,
setWebServiceRequestHandlerKey(java.lang.String)
public String directConnectURL()
http://localhost:8888/cgi-bin/WebObjects
This URL is used in development mode.cgiAdaptorURL()
,
webserverConnectURL()
,
servletConnectURL()
public WOResponse dispatchRequest(WORequest aRequest)
aRequest
- the WORequest received by the adaptorpublic WOElement dynamicElementWithName(String aName, NSDictionary someAssociations, WOElement anElement, NSArray aLanguageArray)
The arguments aName
and someAssociations
are
derived from a corresponding line in the declarations file. aName
is a String that identifies the type of element to create. Generally
aName
specifies a standard WOElement such as WOString.
It may also identify a reusable component. For example, in the method
dynamicElementWithName
for the following declaration:
APP_STRING: WOString {value = applicationString;};
aName
contains the string "WOString"someAssociations
contains an entry for each attribute
specified in the corresponding declaration. For the declaration above,
someAssociations
contains a single entry for WOString's
value attribute. The keys of someAssociations
are the
attribute names and the values are WOAssociation objects.dynamicElementWithName
first
searches for a WOElement named aName
. If a WOElement is found,
the method creates an instance and returns it. Otherwise, it searches for a
component to return instead. If neither is found, this method returns null
.
The template parser uses this method to instantiate dynamic elements only;
WOSwitchComponent uses this method to instantiate either dynamic elements or
components.aName
- string that identifies the type of element
to createsomeAssociations
- a dictionary of associationsanElement
- a template of elementsaLanguageArray
- NSArray containing the language preferences
specified by the browserWODynamicElement.WODynamicElement(java.lang.String, com.webobjects.foundation.NSDictionary, com.webobjects.appserver.WOElement)
public String frameworksBaseURL()
WOFrameworksBaseURL
.setFrameworksBaseURL(java.lang.String)
public WOResponse handleActionRequestError(WORequest aRequest, Exception exception, String reason, WORequestHandler aHandler, String actionClassName, String actionName, Class actionClass, WOAction actionInstance)
aRequest
- the request being processedexception
- the exception that was thrownreason
- the reason that the exception was thrownaHandler
- the handler that threw the exceptionactionClassName
- the name of the WOAction subclassactionName
- the name of the action to invoke on the WOAction objectactionClass
- the class of the WOAction subclassactionInstance
- the actual WOAction objectWOActionRequestHandler#generateErrorResponse
public WOResponse handleException(Exception anException, WOContext aContext)
Override this method to display a more user-friendly error page.
anException
- the exception that occurred within the request-response loopaContext
- the context of the transactionhandleSessionCreationErrorInContext(com.webobjects.appserver.WOContext)
,
handleSessionRestorationErrorInContext(com.webobjects.appserver.WOContext)
,
handlePageRestorationErrorInContext(com.webobjects.appserver.WOContext)
public NSMutableDictionary handleMalformedCookieString(RuntimeException anException, String cookieString, NSMutableDictionary aReturnDict)
anException
- the exception thrown during parsingcookieString
- the cookie string being parsedaReturnDict
- the cookies that were successfully parsedpublic WOResponse handlePageRestorationErrorInContext(WOContext aContext)
Override this method to display a more user-friendly error page.
aContext
- the context of the transactionhandleException(java.lang.Exception, com.webobjects.appserver.WOContext)
,
handleSessionCreationErrorInContext(com.webobjects.appserver.WOContext)
,
handleSessionRestorationErrorInContext(com.webobjects.appserver.WOContext)
public Object handleQueryWithUnboundKey(String key)
valueForKey
when there is no property binding
for key
. WOApplication's implementation always throws
NSKeyValueCoding.UnknownKeyException
.handleQueryWithUnboundKey
in interface NSKeyValueCoding.ErrorHandling
key
- String identifying the property to be retrievedkey
valueForKey(java.lang.String)
,
NSKeyValueCoding
public WOResponse handleSessionCreationErrorInContext(WOContext aContext)
Override this method to display a more user-friendly error page. In the case of Direct Actions, you may call this method yourself.
aContext
- the context of the transactionhandleException(java.lang.Exception, com.webobjects.appserver.WOContext)
,
handlePageRestorationErrorInContext(com.webobjects.appserver.WOContext)
,
handleSessionRestorationErrorInContext(com.webobjects.appserver.WOContext)
,
WOContext.session
public WOResponse handleSessionRestorationErrorInContext(WOContext aContext)
Override this method to display a more user-friendly error page.
aContext
- the context of the transactionhandleException(java.lang.Exception, com.webobjects.appserver.WOContext)
,
handlePageRestorationErrorInContext(com.webobjects.appserver.WOContext)
,
handleSessionCreationErrorInContext(com.webobjects.appserver.WOContext)
public void handleTakeValueForUnboundKey(Object value, String key)
takeValueForKey
when there is no property
binding for key
. WOApplication's implementation always throws
NSKeyValueCoding.UnknownKeyException
.handleTakeValueForUnboundKey
in interface NSKeyValueCoding.ErrorHandling
key
- String identifying the property to be setvalue
- the value to which the property specified by key
should be settakeValueForKey(java.lang.Object, java.lang.String)
,
NSKeyValueCoding
public WORequestHandler handlerForRequest(WORequest aRequest)
aRequest
- a requestregisterRequestHandler(com.webobjects.appserver.WORequestHandler, java.lang.String)
,
registeredRequestHandlerKeys()
,
requestHandlerForKey(java.lang.String)
public String host()
WOHost
.null
public InetAddress hostAddress()
host
.null
public boolean includeCommentsInResponses()
WOIncludeCommentsInResponses
.true
if HTML comments are appended to the response, false
otherwisesetIncludeCommentsInResponses(boolean)
public WOActionResults invokeAction(WORequest aRequest, WOContext aContext)
invokeAction
is propagated through the objects of the application until the dynamic
element that has received the user action (for instance, a click
on a button) responds to the method by triggering the method in
the request component that is bound to the action. The default
WOApplication implementation of this method invokes invokeAction
on the session object.aRequest
- the request to be handledaContext
- the context of the transactionappendToResponse(com.webobjects.appserver.WOResponse, com.webobjects.appserver.WOContext)
,
WOSession.invokeAction(com.webobjects.appserver.WORequest, com.webobjects.appserver.WOContext)
,
WOActionResults
public boolean isCachingEnabled()
NSProjectSearchPath
. Note that
this has no effect on page caching. This is the cover method for
the property WOCachingEnabled
.true
if component caching is enabled, false
otherwisesetCachingEnabled(boolean)
,
projectSearchPath()
public final boolean isConcurrentRequestHandlingEnabled()
true
if at least one adaptor may dispatch requests
concurrently and allowsConcurrentRequestHandling
returns
true
.true
if concurrent request handling is enabled,
false
otherwiseallowsConcurrentRequestHandling()
,
adaptorsDispatchRequestsConcurrently()
public boolean isDebuggingEnabled()
NSLog
public boolean isDirectConnectEnabled()
WODirectConnectEnabled
.Direct Connect transforms the application instance into a simple web server. In particular, the instance is able to find and return its own images and resources as if it were a web server. This can be very useful in development mode, as developers can work without having to set up or maintain a web server.
To connect to an application instance using Direct Connect point the URL to the port where the instance is listening, and the instance will handle all urls.
If direct connect is enabled, the following happen:
autoOpenInBrowser
, a Direct Connect URL will be used.true
if direct connect is enabled, false
otherwisesetDirectConnectEnabled(boolean)
,
cgiAdaptorURL()
public boolean isMonitorEnabled()
WOMonitorEnabled
.
If the application was started by wotaskd, this method will return
true
, since wotaskd will set the WOMonitorEnabled property
to true
. However, if the application was started in any
other way, this method is not garanteed to return false
, only the
value of the WOMonitorEnabled property.WOMonitorEnabled
.setMonitorEnabled(boolean)
public boolean isPageRefreshOnBacktrackEnabled()
true
by default.true
if client caching is disabled, false
otherwisesetPageRefreshOnBacktrackEnabled(boolean)
public boolean isRefusingNewSessions()
true
if the application instance is refusing new
sessions, and false
otherwise. When the application
instance refuses new sessions, the WebObjects adaptor tries to create
the session in another instance of the same application. If no other
instance is running and accepting new sessions, the user receives an
error message.true
if the application instance is refusing new sessions,
false
otherwisepublic boolean isTerminating()
true
if the application will terminate, false
otherwisesetTimeOut(double)
,
defaultRequestHandler()
,
terminateAfterTimeInterval(double)
,
timeOut()
public static final int licensedRequestLimit()
licensedRequestWindow
. You will not
be able to exceed licensedRequestLimit
requests per
licensedRequestWindow
milliseconds.licensedRequestWindow()
public static final long licensedRequestWindow()
licensedRequestLimit
is calculated. You will not be able to exceed licensedRequestLimit
requests per licensedRequestWindow
milliseconds.licensedRequestLimit()
public static final boolean licensingAllowsMultipleInstances()
true
if multiple concurrent application instances are allowed, false
otherwisepublic static final boolean licensingAllowsMultipleThreads()
true
if the license allows multithreading, false
otherwisepublic int lifebeatDestinationPort()
WOLifebeatDestinationPort
property.public boolean lifebeatEnabled()
true
if the application is sending lifebeats, false
otherwisepublic int lifebeatInterval()
WOLifebeatInterval
.public Number listenQueueSize()
WOListenQueueSize
.setListenQueueSize(java.lang.Number)
public NSArray loadFrameworks()
WOLoadFrameworks
. The value of the property should be a plist
containing an array of strings.setLoadFrameworks(com.webobjects.foundation.NSArray)
public void lock()
public void logSetValueForDeclarationNamed(String aDeclarationName, String aDeclarationType, String aBindingName, String anAssociationDescription, Object aValue)
aDeclarationName
- the declaration name in which the
association appearsaDeclarationType
- the declaration type for the associationaBindingName
- binding name of the componentanAssociationDescription
- the description of the bindingaValue
- the value which is being pushed to or
pulled from the child to the parentlogTakeValueForDeclarationNamed(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.Object)
public void logString(String aString)
aString
- message to be printed to the standard out deviceNSLog
public void logTakeValueForDeclarationNamed(String aDeclarationName, String aDeclarationType, String aBindingName, String anAssociationDescription, Object aValue)
true
for the
declaration in which the association appears. Taking a value means
the child component/element is taking a value from the parent. Override
this method to alter the format of the log message. The arguments of this method are defined in the following example WebObjects declaration:
Also,aDeclarationName : aDeclarationType { aBindingName = anAssociationDescription; }
aValue
is the value which is being pushed to or pulled
from the child to the parent.aDeclarationName
- the declaration name in which the
association appearsaDeclarationType
- the declaration type for the associationaBindingName
- binding name of the componentanAssociationDescription
- the description of the bindingaValue
- the value which is being pushed to or
pulled from the child to the parentpublic static void main(String[] argv)
argv
- the command line argumentspublic static void main(String[] argv, Class applicationClass)
argv
- the command line arguments as a string arrayapplicationClass
- a subclass of WOApplication to run instead
of WOApplication.public Number maxSocketIdleTime()
WOMaxSocketIdleTime
property.setMaxSocketIdleTime(java.lang.Number)
public int minimumActiveSessionsCount()
isRefusingNewSessions
returns true
, the application
instance terminates. The default is 0.activeSessionsCount()
,
isRefusingNewSessions()
,
refuseNewSessions(boolean)
,
setMinimumActiveSessionsCount(int)
public boolean monitorEnabled()
isMonitorEnabled
.true
if the WOMonitorEnabled property is set, false
otherwiseisMonitorEnabled()
public String monitorHost()
public boolean monitoringEnabled()
isMonitorEnabled
.isMonitorEnabled()
public String name()
baseURL()
,
path()
public String number()
public String outputPath()
WOOutputPath
property, and
may be set to "/dev/null".public int pageCacheSize()
permanentPageCacheSize()
,
setPageCacheSize(int)
,
WOSession.restorePageForContextID(java.lang.String)
,
WOSession.savePage(com.webobjects.appserver.WOComponent)
public WOComponent pageWithName(String aName, WOContext aContext)
aName
. If aName
is null
, the Main component
is assumed. If the method cannot create a valid page instance,
an exception is thrown.aName
- the name of a page instance (a WOComponent object)aContext
- the context of a transactionWOSession.restorePageForContextID(java.lang.String)
,
WOSession.savePage(com.webobjects.appserver.WOComponent)
public String path()
.woa
extension; for example
"C:/NETSCAPE/ns-home/docs/WebObjects/Examples/HelloWorld.woa"
is a typical application path.baseURL()
,
name()
public int permanentPageCacheSize()
pageCacheSize()
,
setPermanentPageCacheSize(int)
,
WOSession.restorePageForContextID(java.lang.String)
,
WOSession.savePageInPermanentCache(com.webobjects.appserver.WOComponent)
public Number port()
WOPort
.setPort(java.lang.Number)
public static void primeApplication(String mainBundlePath, String nameOfApplicationSubclass)
responseForComponentWithName
) rather than running
a WebObjects application standalone. This must be called before
responseForComponentWithName
is called.mainBundlePath
- full path to the main bundle (e.g. HelloWorld.woa).
Defaults to JavaWebObjects.framework if path is
null
or doesn't exist.nameOfApplicationSubclass
- Name of the WOApplication subclass to use. Defaults
to WOApplication.public boolean printsHTMLParserDiagnostics()
true
in all casespublic NSArray projectSearchPath()
NSProjectSearchPath
.
Note that NSProjectSearchPath
is only used for ProjectBuilderWO projects,
not the version of Project Builder for Mac OS X. Also note that the behavior changed
for NSProjectSearchPath
between WebObjects 4.5.1 and 5.0. Previous to
WebObjects 5.0, WebObjects applications would search recursively down from
any directories included in NSProjectSearchPath
, looking for a PB.project
file.
As of WebObjects 5.0, WebObjects applications only search for a PB.project
file directly
within any directory identified in NSProjectSearchPath
(no more subdirectory searches).setProjectSearchPath(com.webobjects.foundation.NSArray)
public String recordingPath()
null
.
If this method returns a path, all requests and responses are recorded
in the HTTP format in numbered files: 0000-request, 0000-response,
0001-request, 0001-response
, etc, and saved under the recording
path specified. This directory is then used by the Playback tool
to test the application. You will most likely set this as a command
line argument -WORecordingPath pathname
, exercise your application
to record a scenario you would like to test, and then stop the application.
Afterward you can restart the application without the WORecordingPath
argument, and point Playback to the recording directory just created
to replay your sequence of requests and compare the responses received
with the ones recorded.
setRecordingPath(java.lang.String)
public void refuseNewSessions(boolean aVal)
aVal
is true
, the application does not create new sessions;
when it receives a request from a new user, it refuses that request,
and the adaptor must try to find another application instance that
can process the request. If aVal
is false
, the
application creates new sessions. false
is the default.
This method is used with setMinimumActiveSessionsCount
to
gracefully shut down application instances.
Use setMinimumActiveSessionsCount
to set the active
session minimum to a certain number. When the number of active sessions
reaches the number that is set and isRefusingNewSessions
returns true
, the application terminates.
aVal
- true
if the application should create new sessions,
false
otherwiseactiveSessionsCount()
,
isRefusingNewSessions()
,
minimumActiveSessionsCount()
,
setMinimumActiveSessionsCount(int)
public void registerRequestHandler(WORequestHandler aHandler, String aRequestHandlerKey)
aRequestHandlerKey
must
specify a key which can be found in the URL following the instance number
or application name.aHandler
- a request handleraRequestHandlerKey
- a String key which will be found in the URLremoveRequestHandlerForKey(java.lang.String)
,
registeredRequestHandlerKeys()
,
requestHandlerForKey(java.lang.String)
public NSArray registeredRequestHandlerKeys()
handlerForRequest(com.webobjects.appserver.WORequest)
,
requestHandlerForKey(java.lang.String)
public WORequestHandler removeRequestHandlerForKey(String aRequestHandlerKey)
aRequestHandlerKey
- a String key which will be found in the URLrequestHandlerForKey(java.lang.String)
,
registeredRequestHandlerKeys()
public WORequestHandler requestHandlerForKey(String aKey)
aKey
- a String key identifying the request handler to be usedhandlerForRequest(com.webobjects.appserver.WORequest)
,
registerRequestHandler(com.webobjects.appserver.WORequestHandler, java.lang.String)
,
registeredRequestHandlerKeys()
public Object requestHandlingLock()
null
if the application isn't multithreaded.null
public WOResourceManager resourceManager()
setResourceManager(com.webobjects.appserver.WOResourceManager)
public String resourceRequestHandlerKey()
_ResourceRequestHandlerKey
.appendToResponse(com.webobjects.appserver.WOResponse, com.webobjects.appserver.WOContext)
,
componentRequestHandlerKey()
,
setComponentRequestHandlerKey(java.lang.String)
,
directActionRequestHandlerKey()
,
setDirectActionRequestHandlerKey(java.lang.String)
,
setResourceRequestHandlerKey(java.lang.String)
,
webServiceRequestHandlerKey()
,
setWebServiceRequestHandlerKey(java.lang.String)
public WOResponse responseForComponentWithName(String name, NSDictionary bindings, NSDictionary headers, NSDictionary userInfo, String uriPrefix, String appName)
name
, using bindings
. URLs
in the component will be generated using uriPrefix
as a base URI and the appName
as the application name. Both these arguments are optional. headers
is a dictionary
containing headers to be passed into the created WORequest. userInfo
is used for any
additional info passed into the created WORequest. If no values are supplied, uriPrefix
defaults to cgiAdaptorURL
or if that is not set, /cgi-bin/WebObjects
,
and appName
defaults to name
.name
- the name of the component to usebindings
- the bindings for the componentheaders
- the headers passed to the created WORequestuserInfo
- the userInfo dictionary passed to the created WORequesturiPrefix
- the uri for the generated WORequestappName
- the application name for the generated WORequestWOResponse
public WOResponse responseForDirectActionWithNameAndClass(String actionName, String className, NSDictionary formValueDict, InputStream contentStream, NSDictionary headers, NSDictionary userInfo, String uriPrefix, String appName)
actionName
in the class named
className
(optional). The formValueDict
is a dictionary of form
values which are formed into a queryString. contentStream
is an InputStream
containing the content of the generated request. URLs will be generated using uriPrefix
as a base URI and the appName
as the application name; if uriPrefix
is
null
it will default first to cgiAdaptorURL
, and if that is null
to /cgi-bin/WebObjects
, if appName
is null
it will default to
name
. headers
is a dictionary containing headers to be passed into the
created WORequest. userInfo
is used for any additional info to be passed into the created
WORequest.actionName
- the name of the Direct Action to invokeclassName
- the class that the Direct Action is informValueDict
- the form values for the created WORequest or nullcontentStream
- the content of the created WORequest or nullheaders
- the headers passed to the created WORequestuserInfo
- the userInfo dictionary passed to the created WORequesturiPrefix
- the uri for the generated WORequestappName
- the application name for the generated WORequestWORequest
public WOSession restoreSessionWithID(String aSessionID, WOContext aContext)
checkOutSessionWithID
method, but raises
an exception if the WOSessionStore object is missing.
This method also posts a SessionDidRestoreNotification, with the session
restored passed as a parameter (null if the session was not restored).aSessionID
- the uniqued string that identifies the session objectaContext
- the context of a transactionaSessionID
createSessionForRequest(com.webobjects.appserver.WORequest)
,
saveSessionForContext(com.webobjects.appserver.WOContext)
,
WOSessionStore.checkOutSessionWithID(java.lang.String, com.webobjects.appserver.WORequest)
public void run()
registerForEvents
to the application's adaptors so that they can
begin receiving run-loop events. Normally, run
is invoked from the
main
method.setTimeOut(double)
,
defaultRequestHandler()
,
terminateAfterTimeInterval(double)
,
WOAdaptor.registerForEvents()
public void saveSessionForContext(WOContext aContext)
checkInSessionForContext
method, but
throws an exception if the WOSession object is missing or if there is
no WOSessionStore.aContext
- the context of a transactionWOSessionStore.checkInSessionForContext(com.webobjects.appserver.WOContext)
,
WOSessionStore.restoreSessionWithID(java.lang.String, com.webobjects.appserver.WORequest)
public String servletConnectURL()
http://localhost/cgi-bin/WebObjects/HelloWorld.woa
.
This URL is used mostly in servlet deployment mode.cgiAdaptorURL()
,
directConnectURL()
,
webserverConnectURL()
public WOSessionStore sessionStore()
setSessionStore(com.webobjects.appserver.WOSessionStore)
,
WOSessionStore
public String sessionStoreClassName()
WOSessionStoreClassName
property and
has a default value of "WOServerSessionStore".WOSessionStoreClassName
propertypublic Number sessionTimeOut()
WOSessionTimeOut
setSessionTimeOut(java.lang.Number)
public void setAdaptor(String aString)
WOAdaptor
instead
aString
- public void setAdditionalAdaptors(NSArray anAdaptorArray)
WOAdditionalAdaptors
instead
anAdaptorArray
- public void setAllowsConcurrentRequestHandling(boolean aValue)
aValue
- true
indicates that concurrent request handling is allowedallowsConcurrentRequestHandling()
public void setApplicationBaseURL(String aString)
aString
the path to which the current application may
be found under the document root, with or without the .woa
.aString
- the path to which the current application may
be foundapplicationBaseURL()
public void setAutoOpenClientApplication(boolean aBool)
aBool
is true, the application
launches the client. If it is false
, the application does not
launch the client. Automatic launching of a browser is disabled if client
application launching is active and successful. Starting the client application
requires the generation of a client launch script at build time. Client
application launching cannot be enabled unless there is a WOAdaptorURL
key in the file NeXT_ROOT/NextLibrary/WOAdaptors/Configuration/WebServerConfig.plist.
The value set here will override the property WOAutoOpenClientApplication
To disable client application launching, you must invoke this method in your
subclass's constructor, or set the WOAutoOpenClientApplication
property to false. Must be called from the your WOApplication subclass' constructor to have effect.
aBool
- true
to cause automatic client application launchautoOpenClientApplication()
,
autoOpenInBrowser()
public void setAutoOpenInBrowser(boolean aBool)
aBool
is true
, the application launches
the web browser. If false
, the application does not launch
the browser. Browser launching is enabled by default as long as there is
a WOAdaptorURL
key in the file
NeXT_ROOT/Library/WOAdaptors/Configuration/WebServerConfig.plist
.
To disable web browser launching, you must invoke this method in
your subclass's constructor, or set the WOAutoOpenInBrowser
property
to false. Must be called from the your WOApplication subclass' constructor to have effect.
aBool
- true
to cause automatic browser launchautoOpenInBrowser()
public void setCGIAdaptorURL(String aString)
aString
. The URL
must include the path to the WebObjects CGI adaptor: for example,
http://localhost/cgi-bin/WebObjects
.This URL is used by the direct connect feature only.
aString
- the URL for the web servercgiAdaptorURL()
public void setCachingEnabled(boolean aBool)
NSProjectSearchPath
. Note that this has
no effect on page caching.aBool
- boolean specifying whether or not component
caching is enabledisCachingEnabled()
,
projectSearchPath()
public void setComponentRequestHandlerKey(String aString)
_ComponentRequestHandlerKey
instead
aString
- public void setContextClassName(String name)
name
- the name of the WOContext subclass; ignored if nullpublic void setDefaultRequestHandler(WORequestHandler aRequestHandler)
aRequestHandler
- the default request handlerdefaultRequestHandler()
public void setDefaultUndoStackLimit(int stackLimit)
stackLimit
- the default undo stack limit for the editing contextdefaultUndoStackLimit()
public void setDirectActionRequestHandlerKey(String aString)
_DirectActionRequestHandlerKey
instead
aString
- public void setDirectConnectEnabled(boolean aBool)
WODirectConnectEnabled
instead
aBool
- public void setFrameworksBaseURL(String aString)
aString
as the path under which all frameworks can be found
inside the document root. This value is used to determine URLs that should be
generated to reference Web Server Resources in those frameworks.aString
- sets this to the path under which all frameworks can
be found under inside the document rootframeworksBaseURL()
public void setIncludeCommentsInResponses(boolean aBool)
aBool
- true
if HTML comments are appended to the response, false
otherwiseincludeCommentsInResponses()
public void setListenQueueSize(Number listenQueueSize)
WOListenQueueSize
instead
listenQueueSize
- public void setLoadFrameworks(NSArray anArray)
WOLoadFrameworks
instead
anArray
- an NSArray of frameworks to be loadedpublic void setMaxSocketIdleTime(Number maxSocketIdleTime)
WOMaxSocketIdleTime
instead
maxSocketIdleTime
- public void setMinimumActiveSessionsCount(int aVal)
aVal
. The default
value is 0.
Use this method in conjunction with refuseNewSessions
to gracefully shut down application instances. If the active sessions count
reaches the minimum active session count and isRefusingNewSessions
returns true
, the application terminates. It may be desirable to
terminate application instances periodically for performance reasons; some
applications leak a certain amount of memory per transaction, and shutting
down and restarting instances of those applications can free up that memory.
aVal
- the minimum number of active sessionsactiveSessionsCount()
,
isRefusingNewSessions()
,
minimumActiveSessionsCount()
,
refuseNewSessions(boolean)
public void setMonitorEnabled(boolean aBool)
WOMonitorEnabled
property.aBool
- the new value of the WOMonitorEnabled
propertyisMonitorEnabled()
public void setMonitorHost(String aString)
aString
- is not usedpublic void setPageCacheSize(int anUnsigned)
0
for anUnsigned
.
Pages that require state must be cached in order to access that
state for the very next request.
If you have components that hold state (which is the usual case),
disable page caching by passing 1
for anUnsigned
.anUnsigned
- the number of pages the cache will holdpageCacheSize()
,
setPermanentPageCacheSize(int)
public void setPageRefreshOnBacktrackEnabled(boolean aFlag)
aFlag
is true
, disables caching of pages by the
client by setting the page's expiration-time header to the current date and
time. By default, this attribute is set to true
. Disabling of
client caching affects what happens during backtracking. With client
caching disabled, the browser resends the URL to the server for the page
requested by backtracking. The application will then return a new page
to the browser (corresponding to a new WOComponent instance). This
behavior is desirable when you do not want the user to backtrack
to a page that might be obsolete because of changes that have occurred
in the session.When this flag is turned on and a request corresponding to a client backtrack occurs, the retrieved page will only be asked to regenerate its response. The first two phases of a normal request-response loop (value extraction from the request and action invocation) do not occur.
aFlag
- when true
caching of pages by the client is disabledisPageRefreshOnBacktrackEnabled()
public void setPermanentPageCacheSize(int anUnsigned)
anUnsigned
.
Setting the size to 0
disables the permanent page cache.anUnsigned
- the permanentPageCacheSize is set to this valuepermanentPageCacheSize()
,
setPageCacheSize(int)
public void setPort(Number port)
WOPort
instead
port
- public void setPrintsHTMLParserDiagnostics(boolean aBOOL)
aBOOL
- public void setProjectSearchPath(NSArray aPathArray)
aPathArray
- an NSArray of file system pathsprojectSearchPath()
public void setRecordingPath(String aString)
null
as the path if you don't want to save
recording information. By default, recording information is not saved.
If you save recording information, all requests and responses are
recorded in the HTTP format in numbered files: 0000-request,
0000-response, 0001-request, 0001-response
, etc, and saved
under the recording path specified. This directory is then used by the
Playback tool to test the application. You will most likely set this as a
command line argument -WORecordingPath pathname
, exercise your
application to record a scenario you would like to test, and then stop
the application. Afterwards you can restart the application without the
WORecordingPath argument, and point Playback to the recording directory
just created to replay your sequence of requests and compare the responses
received with the ones recorded.
aString
- the file system pathrecordingPath()
public void setResourceManager(WOResourceManager aResourceManager)
createResourceManager
instead.
createResourceManager
to replace the default WOResourceManager implementation with your own.aResourceManager
- an instance of a WOResourceManager subclassresourceManager()
,
createResourceManager()
public void setResourceRequestHandlerKey(String aString)
_ResourceRequestHandlerKey
instead
aString
- public void setSMTPHost(String aString)
aString
- the name of the SMTP hostSMTPHost()
public void setSessionStore(WOSessionStore aSessionStore)
aSessionStore
- the session-store for the applicationsessionStore()
,
WOSessionStore
public void setSessionStoreClassName(String aString)
WOSessionStoreClassName
property.aString
- the name of the session store classpublic void setSessionTimeOut(Number timeOut)
timeOut
- the default session timeOut in secondssessionTimeOut()
public void setSocketCacheSize(Number socketCacheSize)
setSocketCacheSize
no longer supported
socketCacheSize
- public void setSocketMonitorSleepTime(Number socketMonitorSleepTime)
WOSocketMonitorSleepTime
key will be used; the default
value for this key is 50 milliseconds.socketMonitorSleepTime
- the length of time that the socket
monitor will sleeppublic void setStatisticsStore(WOStatisticsStore aStatisticsStore)
aStatisticsStore
.
WOStatisticsStore objects record application statistics while the
application runs.aStatisticsStore
- the WOStatisticsStore object is set to thisstatisticsStore()
public void setTimeOut(double aTimeInterval)
aTimeInterval
- the number of seconds the application can experience
inactivity before it terminates executionterminateAfterTimeInterval(double)
,
timeOut()
public void setWebServiceRequestHandlerKey(String aString)
_WebServiceRequestHandlerKey
instead
aString
- public void setWorkerThreadCount(Number threadCount)
threadCount
- the number of worker threadspublic void setWorkerThreadCountMax(Number threadCount)
WOWorkerThreadCountMax
. Generally,
by the time this can be called, the WODefaultAdaptor has already been initialized.
However, if you have custom or additional adaptors, this method might be useful.
If the WODefaultAdaptor is initialized when this property is <= 0, there is no
upper limit to the number of worker threads it will create.threadCount
- the maximum number of worker threads the default adaptor can createworkerThreadCountMax()
,
workerThreadCountMin()
,
setWorkerThreadCountMin(java.lang.Number)
public void setWorkerThreadCountMin(Number threadCount)
WOWorkerThreadCountMin
. Generally,
by the time this can be called, the WODefaultAdaptor has already been initialized.
However, if you have custom or additional adaptors, this method might be useful.threadCount
- the number of worker threads to be created at startupworkerThreadCountMax()
,
workerThreadCountMin()
,
setWorkerThreadCountMax(java.lang.Number)
public EOSharedEditingContext sharedEditingContext()
EOSharedEditingContext.defaultSharedEditingContext
should
be directly used instead.
EOSharedEditingContext.defaultSharedEditingContext()
public boolean shouldRestoreSessionOnCleanEntry(WORequest aRequest)
aRequest
- the incoming request object.public void sleep()
public Number socketCacheSize()
public Number socketMonitorSleepTime()
setSocketMonitorSleepTime(java.lang.Number)
public NSDictionary statistics()
WOApplication.application().statisticsStore().statistics()
public WOStatisticsStore statisticsStore()
setStatisticsStore(com.webobjects.appserver.WOStatisticsStore)
public String streamActionRequestHandlerKey()
appendToResponse(com.webobjects.appserver.WOResponse, com.webobjects.appserver.WOContext)
,
componentRequestHandlerKey()
,
setComponentRequestHandlerKey(java.lang.String)
,
setDirectActionRequestHandlerKey(java.lang.String)
,
resourceRequestHandlerKey()
,
setResourceRequestHandlerKey(java.lang.String)
,
webServiceRequestHandlerKey()
,
setWebServiceRequestHandlerKey(java.lang.String)
public void takeValueForKey(Object value, String key)
key
to value
.takeValueForKey
in interface NSKeyValueCoding
key
- String identifying the property to be setvalue
- the value to which the property specified by key
should be setvalueForKey(java.lang.String)
,
handleTakeValueForUnboundKey(java.lang.Object, java.lang.String)
,
NSKeyValueCoding
public void takeValueForKeyPath(Object value, String keyPath)
keyPath
to value
. The key path has the form relationship.property
, with one or
more relationships. This method retrieves the destination object for each relationship using
valueForKey
, and invokes the method takeValueForKey
on the final object.takeValueForKeyPath
in interface NSKeyValueCodingAdditions
keyPath
- identifies a derived property of the receivervalue
- value to which the derived property identified by
keyPath
will be settakeValueForKey(java.lang.Object, java.lang.String)
,
valueForKeyPath(java.lang.String)
,
NSKeyValueCoding
,
NSKeyValueCodingAdditions
public void takeValuesFromRequest(WORequest aRequest, WOContext aContext)
WOComponentRequestHandler
invokes this method on
WOApplication to initiate the first phase of request handling. In this
phase, takeValuesFromRequest
is propagated to the session and
component objects involved in the request as well as the request page's
dynamic elements. Each dynamic element acquires any entered data or
changed state (such as a check in a check box) associated with an
attribute and assigns the value to the variable bound to the attribute.
The default WOApplication implementation of this method invokes
takeValuesFromRequest
on the session object.aRequest
- the request to be handledaContext
- the context of the transactionappendToResponse(com.webobjects.appserver.WOResponse, com.webobjects.appserver.WOContext)
,
invokeAction(com.webobjects.appserver.WORequest, com.webobjects.appserver.WOContext)
,
WOSession.takeValuesFromRequest(com.webobjects.appserver.WORequest, com.webobjects.appserver.WOContext)
public void terminate()
isTerminating()
,
setTimeOut(double)
public void terminateAfterTimeInterval(double aTimeInterval)
setTimeOut
.
setTimeOut(double)
public double timeOut()
setTimeOut(double)
public String toString()
toString
in class Object
public void unableToSetNullForKey(String key)
takeValueForKey
when it is given a null value for
a scalar property such as an int or a float. WOApplication's implementation
always throws an java.lang.IllegalArgumentException
.unableToSetNullForKey
in interface NSKeyValueCoding.ErrorHandling
key
- String identifying the property to be settakeValueForKey(java.lang.Object, java.lang.String)
,
NSKeyValueCoding
public void unlock()
public void validationFailedWithException(Throwable t, Object value, String keyPath, WOComponent component, WOSession session)
t
- the exception that was thrownvalue
- the value that was being setkeyPath
- the derived path that was being accessedcomponent
- the component that was being usedsession
- the session in which validation failedNSLog
public Object valueForKey(String key)
key
.valueForKey
in interface NSKeyValueCoding
key
- String identifying the property to be retrievedkey
takeValueForKey(java.lang.Object, java.lang.String)
,
handleQueryWithUnboundKey(java.lang.String)
,
NSKeyValueCoding
public Object valueForKeyPath(String keyPath)
keyPath
. The key path
has the form relationship.property
, with one or more relationships.
This method retrieves the destination object for each relationship using
valueForKey
, and returns the result of invoking
valueForKey
on the final object.valueForKeyPath
in interface NSKeyValueCodingAdditions
keyPath
- String identifying the derived property to be retrievedkeyPath
valueForKey(java.lang.String)
,
takeValueForKeyPath(java.lang.Object, java.lang.String)
,
NSKeyValueCoding
,
NSKeyValueCodingAdditions
public boolean wasMainInvoked()
public String webServiceRequestHandlerKey()
_WebServiceRequestHandlerKey
.appendToResponse(com.webobjects.appserver.WOResponse, com.webobjects.appserver.WOContext)
,
componentRequestHandlerKey()
,
setComponentRequestHandlerKey(java.lang.String)
,
setDirectActionRequestHandlerKey(java.lang.String)
,
resourceRequestHandlerKey()
,
setResourceRequestHandlerKey(java.lang.String)
,
setWebServiceRequestHandlerKey(java.lang.String)
public String webserverConnectURL()
http://localhost/cgi-bin/WebObjects/HelloWorld.woa/-4444
.
The negative port number ensures that using this URL
returns to the specific application that created it in a load-balancing scenario.
This URL is used mostly to test deployment mode on a development system.cgiAdaptorURL()
,
directConnectURL()
,
servletConnectURL()
public Number workerThreadCount()
workerThreadCountMin()
,
setWorkerThreadCountMin(java.lang.Number)
,
workerThreadCountMax()
,
setWorkerThreadCountMax(java.lang.Number)
public Number workerThreadCountMax()
WOWorkerThreadCountMax
.
Generally, by the time this can be called, the WODefaultAdaptor has
already been initialized. However, if you have custom or additional adaptors,
this method might be useful.workerThreadCountMin()
,
setWorkerThreadCountMax(java.lang.Number)
,
setWorkerThreadCountMin(java.lang.Number)
public Number workerThreadCountMin()
WOWorkerThreadCountMin
.
Generally, by the time this can be called, the WODefaultAdaptor has
already been initialized. However, if you have custom or additional adaptors,
this method might be useful.workerThreadCountMax()
,
setWorkerThreadCountMax(java.lang.Number)
,
setWorkerThreadCountMin(java.lang.Number)
|
Last updated Fri Feb 21 13:15:00 PST 2003. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |