WebObjects 5.2

com.webobjects.appserver
Class WOApplication

java.lang.Object
  |
  +--com.webobjects.appserver.WOApplication
All Implemented Interfaces:
NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions

public class WOApplication
extends Object
implements NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions

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.

See Also:
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

ApplicationDidDispatchRequestNotification

public static final String ApplicationDidDispatchRequestNotification
Contains a String that names the notification posted at the end of WOApplication's dispatchRequest method.

ApplicationDidFinishLaunchingNotification

public static final String ApplicationDidFinishLaunchingNotification
Contains a String that names the notification posted by WOApplication's 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.

ApplicationWillDispatchRequestNotification

public static final String ApplicationWillDispatchRequestNotification
Contains a String that names the notification posted at the very beginning of WOApplication's dispatchRequest method.

ApplicationWillFinishLaunchingNotification

public static final String ApplicationWillFinishLaunchingNotification
Contains a String that names the notification posted at the very beginning of WOApplication's run method.
Constructor Detail

WOApplication

public WOApplication()
Creates and initializes the instance of WOApplication. Some of the interesting initializations that may happen:

An NSForwardException is thrown if initialization does not succeed.

See Also:
isPageRefreshOnBacktrackEnabled()
Method Detail

SMTPHost

public String SMTPHost()
Returns the name of the host that will be used to send e-mail messages created by WOMailDelivery. This is a cover method for the property WOSMTPHost.
Returns:
the name of the host that will be used to send e-mail messages from the application using WOMailDelivery
See Also:
setSMTPHost(java.lang.String)

activeSessionsCount

public int activeSessionsCount()
The number returned is only accurate if the application stores state in the server's memory, which is the default. If you use a custom state-storage strategy however, there may be no way to tell how many sessions are active for a given application instance.
Returns:
the number of currently active sessions (sessions that have not timed out)
See Also:
minimumActiveSessionsCount(), setMinimumActiveSessionsCount(int)

adaptor

public String adaptor()
Returns the class name of the primary adaptor. This is the cover method for the property WOAdaptor.
Returns:
the class name of the primary adaptor
See Also:
setAdaptor(java.lang.String)

adaptorWithName

public WOAdaptor adaptorWithName(String aClassName,
                                 NSDictionary anArgsDictionary)
Invoked in the constructor to create an adaptor. If you subclass WOAdaptor, you should specify the WOAdaptor subclass you want the application to use with the 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.
Parameters:
aClassName - the WOAdaptor subclass name
anArgsDictionary - the adaptor description dictionary
Returns:
a new instance is created if the specified subclass exists
See Also:
adaptors(), WOAdaptor

adaptors

public NSArray adaptors()
Returns a list of the loaded application adaptors. A WOApplication can have multiple adaptors. This allows you to design an application that can not only listen to a socket for incoming HTTP requests (using the WODefaultAdaptor), but can also receive remote request messages using more advanced RPC mechanisms such as CORBA and DCOM.
Returns:
a list of the loaded application adaptors
See Also:
adaptorWithName(java.lang.String, com.webobjects.foundation.NSDictionary)

adaptorsDispatchRequestsConcurrently

public final boolean adaptorsDispatchRequestsConcurrently()
Return whether or not there is at least one multi-threaded adaptor which may attempt to dispatch requests concurrently.
Returns:
true if at least one adaptor may attempt to concurrently invoke the request handlers

additionalAdaptors

public NSArray additionalAdaptors()
Returns an array of adaptor description dictionaries. This is the cover method for the property 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.

Returns:
an NSArray of adaptor description dictionaries
See Also:
setAdditionalAdaptors(com.webobjects.foundation.NSArray)

allowsConcurrentRequestHandling

public boolean allowsConcurrentRequestHandling()
Return whether or not concurrent request handling is allowed. This is a cover method for the property WOAllowsConcurrentRequestHandling and will return false by default.
Returns:
true if concurrent request handling is allowed, false otherwise
See Also:
isConcurrentRequestHandlingEnabled(), setAllowsConcurrentRequestHandling(boolean)

appendToResponse

public void appendToResponse(WOResponse aResponse,
                             WOContext aContext)
The WOApplication object invokes this method on itself to initiate the final phase of request handling. This occurs right after the 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.
Parameters:
aResponse - the response being handled
aContext - a WOContext object that represents the context of the transaction
See Also:
invokeAction(com.webobjects.appserver.WORequest, com.webobjects.appserver.WOContext), WOSession.appendToResponse(com.webobjects.appserver.WOResponse, com.webobjects.appserver.WOContext)

application

public static WOApplication application()
Return the application instance. Do not override this method.
Returns:
the WOApplication object

applicationBaseURL

public String applicationBaseURL()
This is the cover method for the property 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).

Returns:
the path to where the current application may be found under the document root
See Also:
setApplicationBaseURL(java.lang.String)

autoOpenClientApplication

public boolean autoOpenClientApplication()
Returns whether automatic client application launching is enabled for Java Client applications. By default, automatic browser launching is enabled. This method is a cover for the property WOAutoOpenClientApplication.
Returns:
true if a Java Client client application should be launched, false otherwise
See Also:
setAutoOpenClientApplication(boolean), autoOpenInBrowser()

autoOpenInBrowser

public boolean autoOpenInBrowser()
Return whether starting the application instance will launch a browser pointing at the main page of the application. By default, automatic browser launching is enabled.
Returns:
true if automatic browser launching is enabled, false

awake

public void awake()
Invoked at the beginning of each cycle of the request-response loop, affording the opportunity to perform initializations with application-wide scope. Since the default implementation does nothing, overridden implementations do not have to call super.
See Also:
sleep()

baseURL

public String baseURL()
Returns the application URL relative to the server's document root.
Returns:
the application URL relative to the server's document root
See Also:
applicationBaseURL()

canAccessFieldsDirectly

public 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.
Returns:
true always

cgiAdaptorURL

public String cgiAdaptorURL()
Returns the URL for the web server including the path to the WebObjects CGI adaptor: for example, http://localhost/cgi-bin/WebObjects. This URL is used by the direct connect feature only. This is the cover for the property WOCGIAdaptorURL.
Returns:
the URL for the web server
See Also:
setCGIAdaptorURL(java.lang.String)

componentRequestHandlerKey

public String componentRequestHandlerKey()
Returns the key which identifies URLs directed at component-action based requests. By default, this method returns the string "wo". This is a cover for the system property _ComponentRequestHandlerKey.
Returns:
the key which identifies URLs directed through the component request handler
See Also:
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)

contextClassName

public String contextClassName()
Defaults to WOContext.
Returns:
the name of the WOContext subclass

createContextForRequest

public WOContext createContextForRequest(WORequest aRequest)
Creates a new context object for a given request. Override this method if you need to provide your own subclass of 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.

Parameters:
aRequest - the WORequest that the WOContext is generated for
Returns:
an instance of the WOContext subclass
See Also:
setContextClassName(java.lang.String), contextClassName()

createRequest

public WORequest createRequest(String aMethod,
                               String aURL,
                               String anHTTPVersion,
                               NSDictionary someHeaders,
                               NSData aContent,
                               NSDictionary someInfo)
Convenience method that instantiates and returns a new WORequest object. Developers should override this method to either modify HTTP request data before the WORequest object is instantiated, or to create a custom subclass of WORequest. The default implementation directly invokes the WORequest constructor. Therefore aMethod, aURL and anHTTPVersion are required by the default version. If overridden to create a custom WORequest subclass, the subclass constructor will define the parameter requirements.
Parameters:
aMethod - the HTTP method object used to send the request
aURL - the URI request line
anHTTPVersion - the version of HTTP used
someHeaders - dictionary whose String keys correspond to header names
aContent - the HTML content of the receiver
someInfo - an NSDictionary that can contain any kind of information related to the current response.
Returns:
a new WORequest object
See Also:
WORequest

createResourceManager

public WOResourceManager createResourceManager()
Creates a new instance of WOResourceManager. The WOApplication constructor calls this method. Override this method if you need to provide your own subclass of WOResourceManager. If you override it, your implementation need not call 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.

Returns:
the instance of WOResourceManager (or subclass) that the application should use
See Also:
resourceManager()

createResponseInContext

public WOResponse createResponseInContext(WOContext aContext)
Convenience method that instantiates and returns a new, empty WOResponse object.
Parameters:
aContext - the context of the transaction
Returns:
a new, empty WOResponse object

createSessionForRequest

public WOSession createSessionForRequest(WORequest aRequest)
Creates and returns a WOSession object to manage a session for the client. The method goes through several steps to locate the class to use for instantiating this object:

  1. First it looks for a class of name "Session" that is a subclass of WOSession and is in the same package as the subclass of WOApplication being used.
  2. If such a class does not exist, it uses WOSession.
  3. 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.

    Parameters:
    aRequest - the WORequest being handled
    Returns:
    a WOSession object to manage a user session
    See Also:
    restoreSessionWithID(java.lang.String, com.webobjects.appserver.WOContext), saveSessionForContext(com.webobjects.appserver.WOContext), handleSessionCreationErrorInContext(com.webobjects.appserver.WOContext), WOContext.session

debugString

public void debugString(String aString)
Deprecated. use NSLog instead.

Deprecated. Use NSLog instead.
Parameters:
aString - message to be printed to the standard error device
See Also:
NSLog

defaultRequestHandler

public WORequestHandler defaultRequestHandler()
Returns the request handler to be used when no request handler key is found in the URL or WORequest. By default, returns the WOComponent request handler. When an application is contacted for the first time it is usually via a URL like the following:

 http://somehost/cgi-bin/WebObjects/AppName.woa
The way that URLs of this type are handled is determined by the default request handler.
Returns:
the default request handler
See Also:
setDefaultRequestHandler(com.webobjects.appserver.WORequestHandler)

defaultRequestHandlerClassName

public String defaultRequestHandlerClassName()
Returns the class name of the default request handler. By default, this method returns "com.webobjects.appserver._private.WOComponentRequestHandler". Override this method to return "com.webobjects.appserver._private.WODirectActionRequestHandler" to make the direct action request handler the default.
Returns:
the class name of the default request handler

defaultUndoStackLimit

public Number defaultUndoStackLimit()
Return the number of levels of undo for a session's default editing context. The default is 10. This value can be overriden by:
  • using the property WODefaultUndoStackLimit
  • setting the undo stack limit from the Session class' constructor
  • overriding this method.
Returns:
the number of undo levels for the session's default editing context
See Also:
setDefaultUndoStackLimit(int)

directActionRequestHandlerKey

public String directActionRequestHandlerKey()
Returns the key which identifies URLs directed at Direct Action based requests. By default, this method returns the string "wa". This is a cover for the system property _DirectActionRequestHandlerKey.
Returns:
the key which identifies URLs directed through the Direct Action request handler
See Also:
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)

directConnectURL

public String directConnectURL()
Returns the URL to connect to the application directly without going through the web server and WOAdaptors. It includes the path to the WebObjects CGI adaptor (although it ignores it), and the port number on which the application is listening. For example, http://localhost:8888/cgi-bin/WebObjects This URL is used in development mode.
Returns:
the URL for the web server
See Also:
cgiAdaptorURL(), webserverConnectURL(), servletConnectURL()

dispatchRequest

public WOResponse dispatchRequest(WORequest aRequest)
The starting point of the request-response cycle in WOApplication. Invoked by the adaptor.
Parameters:
aRequest - the WORequest received by the adaptor
Returns:
a WOResponse containing the response that the application will return to the client

dynamicElementWithName

public 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. This method is invoked automatically by the template parser to provide a WOElement object that represents a WEBOBJECT element in the HTML template. You don't ordinarily invoke this method, but you might override it to substitute your own WOElement or reusable component for one of the standard WOElements.

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.
WOApplication's implementation of 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.
Parameters:
aName - string that identifies the type of element to create
someAssociations - a dictionary of associations
anElement - a template of elements
aLanguageArray - NSArray containing the language preferences specified by the browser
Returns:
a WOElement object
See Also:
WODynamicElement.WODynamicElement(java.lang.String, com.webobjects.foundation.NSDictionary, com.webobjects.appserver.WOElement)

frameworksBaseURL

public String frameworksBaseURL()
This value is used to determine URLs that should be generated to reference Web Server Resources in those frameworks. This is the cover method for the property WOFrameworksBaseURL.
Returns:
a path to where all frameworks may be found under the doc root
See Also:
setFrameworksBaseURL(java.lang.String)

handleActionRequestError

public 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. Action handlers are subclasses of the WOActionRequestHandler, and include the WODirectActionRequestHandler.
exception is the actual exception that was thrown.
Typically, this is invoked in the following cases:
  • The Request URI couldn't be parsed. reason will be WOActionRequestHandler.INVALID_PATH.
  • The WOAction class couldn't be found. reason will be WOActionRequestHandler.INSTANTIATION.
  • The WOAction object couldn't be created. reason will be WOActionRequestHandler.INVOCATION.
  • The action couldn't be invoked on the WOAction object. In this case, the exception will likely be an InvocationTargetException. reason will be WOActionRequestHandler.CLASS_NOT_FOUND.
actionClassName, actionName, actionClass and actionInstance are self explanatory. They may be null, as they represent the state of the handler at the time of the throw.
If a WOContext object is needed, check if actionInstance isn't null and has a context object. Otherwise, simply invoke createContextForRequest to create an appropriate WOContext object.
The default behavior is to simply return null. This will cause the original code path to be taken, resulting in the appropriate generateErrorResponse method invocation.
Override this method to display a more user-friendly error page.
Parameters:
aRequest - the request being processed
exception - the exception that was thrown
reason - the reason that the exception was thrown
aHandler - the handler that threw the exception
actionClassName - the name of the WOAction subclass
actionName - the name of the action to invoke on the WOAction object
actionClass - the class of the WOAction subclass
actionInstance - the actual WOAction object
Returns:
a WOResponse containing a page with debugging information
See Also:
WOActionRequestHandler#generateErrorResponse

handleException

public WOResponse handleException(Exception anException,
                                  WOContext aContext)
Invoked when an unexpected exception is thrown in the request-response loop. The default behavior displays a page with debugging information.

Override this method to display a more user-friendly error page.

Parameters:
anException - the exception that occurred within the request-response loop
aContext - the context of the transaction
Returns:
a WOResponse containing a page with debugging information
See Also:
handleSessionCreationErrorInContext(com.webobjects.appserver.WOContext), handleSessionRestorationErrorInContext(com.webobjects.appserver.WOContext), handlePageRestorationErrorInContext(com.webobjects.appserver.WOContext)

handleMalformedCookieString

public NSMutableDictionary handleMalformedCookieString(RuntimeException anException,
                                                       String cookieString,
                                                       NSMutableDictionary aReturnDict)
Invoked when a malformed cookie is parsed. The default behavior is to parse as much of the string as possible and ignore the rest. Override this to implement a different recovery strategy.
Parameters:
anException - the exception thrown during parsing
cookieString - the cookie string being parsed
aReturnDict - the cookies that were successfully parsed
Returns:
an NSMutableDictionary containing cookie key value pairs

handlePageRestorationErrorInContext

public WOResponse handlePageRestorationErrorInContext(WOContext aContext)
Invoked when a page (WOComponent) instance cannot be restored, which typically happens when a user backtracks too far. Specifically, this method is invoked when the following occurs: the request is not the first of a session, page restoration by context ID fails, and page re-creation is disabled. The default behavior displays a page with debugging information.

Override this method to display a more user-friendly error page.

Parameters:
aContext - the context of the transaction
Returns:
a WOResponse containing a page with debugging information
See Also:
handleException(java.lang.Exception, com.webobjects.appserver.WOContext), handleSessionCreationErrorInContext(com.webobjects.appserver.WOContext), handleSessionRestorationErrorInContext(com.webobjects.appserver.WOContext)

handleQueryWithUnboundKey

public Object handleQueryWithUnboundKey(String key)
Conformance to NSKeyValueCoding.ErrorHandling. This method is invoked from valueForKey when there is no property binding for key. WOApplication's implementation always throws NSKeyValueCoding.UnknownKeyException.
Specified by:
handleQueryWithUnboundKey in interface NSKeyValueCoding.ErrorHandling
Parameters:
key - String identifying the property to be retrieved
Returns:
the receiver's value for the property identified by key
See Also:
valueForKey(java.lang.String), NSKeyValueCoding

handleSessionCreationErrorInContext

public WOResponse handleSessionCreationErrorInContext(WOContext aContext)
Invoked by the component request handler when a session (WOSession) instance cannot be created. The default behavior displays a page with debugging information.

Override this method to display a more user-friendly error page. In the case of Direct Actions, you may call this method yourself.

Parameters:
aContext - the context of the transaction
Returns:
a WOResponse containing a page with debugging information
See Also:
handleException(java.lang.Exception, com.webobjects.appserver.WOContext), handlePageRestorationErrorInContext(com.webobjects.appserver.WOContext), handleSessionRestorationErrorInContext(com.webobjects.appserver.WOContext), WOContext.session

handleSessionRestorationErrorInContext

public WOResponse handleSessionRestorationErrorInContext(WOContext aContext)
Invoked when a session (WOSession) instance cannot be restored, which typically happens when the session times out. The default behavior displays a page with debugging information.

Override this method to display a more user-friendly error page.

Parameters:
aContext - the context of the transaction
Returns:
a WOResponse containing a page with debugging information
See Also:
handleException(java.lang.Exception, com.webobjects.appserver.WOContext), handlePageRestorationErrorInContext(com.webobjects.appserver.WOContext), handleSessionCreationErrorInContext(com.webobjects.appserver.WOContext)

handleTakeValueForUnboundKey

public void handleTakeValueForUnboundKey(Object value,
                                         String key)
Conformance to NSKeyValueCoding.ErrorHandling. This method is invoked from takeValueForKey when there is no property binding for key. WOApplication's implementation always throws NSKeyValueCoding.UnknownKeyException.
Specified by:
handleTakeValueForUnboundKey in interface NSKeyValueCoding.ErrorHandling
Parameters:
key - String identifying the property to be set
value - the value to which the property specified by key should be set
See Also:
takeValueForKey(java.lang.Object, java.lang.String), NSKeyValueCoding

handlerForRequest

public WORequestHandler handlerForRequest(WORequest aRequest)
Returns the request handler to be used to handle a given request. This will either be the request handler identified by a request handler key in the URL, or the default request handler.
Parameters:
aRequest - a request
Returns:
the request handler used to handle the request
See Also:
registerRequestHandler(com.webobjects.appserver.WORequestHandler, java.lang.String), registeredRequestHandlerKeys(), requestHandlerForKey(java.lang.String)

host

public String host()
Return the name of the host the instance is running on. This is a cover method for the property WOHost.
Returns:
the name of the host the instance is running on, or null

hostAddress

public InetAddress hostAddress()
Return the InetAddress for the host returned by host.
Returns:
an InetAddress for the host the instance is running on, or null

includeCommentsInResponses

public boolean includeCommentsInResponses()
Returns whether or not HTML comments are appended to the response. This is the cover method for the property WOIncludeCommentsInResponses.
Returns:
a true if HTML comments are appended to the response, false otherwise
See Also:
setIncludeCommentsInResponses(boolean)

invokeAction

public WOActionResults invokeAction(WORequest aRequest,
                                    WOContext aContext)
The WOApplication object invokes this method on itself to initiate the middle phase of request handling. In this phase, 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.
Parameters:
aRequest - the request to be handled
aContext - the context of the transaction
Returns:
a WOActionResults
See Also:
appendToResponse(com.webobjects.appserver.WOResponse, com.webobjects.appserver.WOContext), WOSession.invokeAction(com.webobjects.appserver.WORequest, com.webobjects.appserver.WOContext), WOActionResults

isCachingEnabled

public boolean isCachingEnabled()
Returns whether or not component caching is enabled. If this is enabled, changes to a component will be reparsed after being saved, assuming the project is under the NSProjectSearchPath. Note that this has no effect on page caching. This is the cover method for the property WOCachingEnabled.
Returns:
true if component caching is enabled, false otherwise
See Also:
setCachingEnabled(boolean), projectSearchPath()

isConcurrentRequestHandlingEnabled

public final boolean isConcurrentRequestHandlingEnabled()
Returns true if at least one adaptor may dispatch requests concurrently and allowsConcurrentRequestHandling returns true.
Returns:
true if concurrent request handling is enabled, false otherwise
See Also:
allowsConcurrentRequestHandling(), adaptorsDispatchRequestsConcurrently()

isDebuggingEnabled

public boolean isDebuggingEnabled()
Do not use. Use NSLog instead.
Returns:
a boolean
See Also:
NSLog

isDirectConnectEnabled

public boolean isDirectConnectEnabled()
Returns whether or not direct connect is enabled. By default it is enabled. This is a cover for the system property 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:

  • when using autoOpenInBrowser, a Direct Connect URL will be used.
  • when using WOMailDelivery to mail pages with dynamic links in them, these links will be generated with a complete direct connect URL format. People receiving these mails will be able to access the application with Direct Connect.
  • all files on the system become accessible through the resource request handler.
On the other hand, if direct connect is not enabled, the resource request handler can be used to retrieve data objects from memory only, and no more reading in the file system is permitted. For security reasons, it is recommended that Direct Connect be disabled when an application is deployed.
Returns:
true if direct connect is enabled, false otherwise
See Also:
setDirectConnectEnabled(boolean), cgiAdaptorURL()

isMonitorEnabled

public boolean isMonitorEnabled()
This is a cover method for the property 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.
Returns:
the value of the property WOMonitorEnabled.
See Also:
setMonitorEnabled(boolean)

isPageRefreshOnBacktrackEnabled

public boolean isPageRefreshOnBacktrackEnabled()
Returns whether caching of pages is disabled in the client. If it is, the client does not restore request pages from its cache but re-creates them "from scratch" by resending the URL to the server. This flag is set to true by default.
Returns:
true if client caching is disabled, false otherwise
See Also:
setPageRefreshOnBacktrackEnabled(boolean)

isRefusingNewSessions

public boolean isRefusingNewSessions()
Returns 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.
Returns:
true if the application instance is refusing new sessions, false otherwise

isTerminating

public boolean isTerminating()
Returns whether the application will terminate at the end of the current request-response loop.
Returns:
true if the application will terminate, false otherwise
See Also:
setTimeOut(double), defaultRequestHandler(), terminateAfterTimeInterval(double), timeOut()

licensedRequestLimit

public static final int licensedRequestLimit()
Returns the maximum number of requests WebObjects will handle during the window returned by licensedRequestWindow. You will not be able to exceed licensedRequestLimit requests per licensedRequestWindow milliseconds.
Returns:
the request limit license value
See Also:
licensedRequestWindow()

licensedRequestWindow

public static final long licensedRequestWindow()
Returns the interval over which the licensedRequestLimit is calculated. You will not be able to exceed licensedRequestLimit requests per licensedRequestWindow milliseconds.
Returns:
a long (the license value in milliseconds)
See Also:
licensedRequestLimit()

licensingAllowsMultipleInstances

public static final boolean licensingAllowsMultipleInstances()
This static final method returns a boolean indicating whether the license allows multiple instances of the application to run simultaneously.
Returns:
true if multiple concurrent application instances are allowed, false otherwise

licensingAllowsMultipleThreads

public static final boolean licensingAllowsMultipleThreads()
This static final method returns a boolean that indicates whether or not the application is allowed to run in multithreaded mode.
Returns:
true if the license allows multithreading, false otherwise

lifebeatDestinationPort

public int lifebeatDestinationPort()
Returns the port to which lifebeat signals will be sent. This port is controlled by the WOLifebeatDestinationPort property.
Returns:
an int indicating the port to which lifebeat signals will be sent

lifebeatEnabled

public boolean lifebeatEnabled()
Return whether or not the application is sending lifebeats.
Returns:
true if the application is sending lifebeats, false otherwise

lifebeatInterval

public int lifebeatInterval()
Return the interval at which the application instance will send lifebeat signals to wotaskd. This is controled by the property WOLifebeatInterval.
Returns:
the interval between lifebeat signals

listenQueueSize

public Number listenQueueSize()
Returns the size of the listen queue which will created by the primary adaptor, usually WODefaultAdaptor. This is the cover method for the property WOListenQueueSize.
Returns:
the size of the listen queue
See Also:
setListenQueueSize(java.lang.Number)

loadFrameworks

public NSArray loadFrameworks()
Return the NSArray of frameworks to be loaded during application initialization. This is a cover for the property WOLoadFrameworks. The value of the property should be a plist containing an array of strings.
Returns:
the NSArray of frameworks to be loaded during application initialization
See Also:
setLoadFrameworks(com.webobjects.foundation.NSArray)

lock

public void lock()
Deprecated. synchronized(WOApplication.application()) should be used instead.


logSetValueForDeclarationNamed

public 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. Setting a value means the child component/element is setting a value in the parent).
Parameters:
aDeclarationName - the declaration name in which the association appears
aDeclarationType - the declaration type for the association
aBindingName - binding name of the component
anAssociationDescription - the description of the binding
aValue - the value which is being pushed to or pulled from the child to the parent
See Also:
logTakeValueForDeclarationNamed(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.Object)

logString

public void logString(String aString)
Deprecated. Use NSLog instead

Deprecated. Use NSLog instead.
Parameters:
aString - message to be printed to the standard out device
See Also:
NSLog

logTakeValueForDeclarationNamed

public 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. 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:

aDeclarationName : aDeclarationType
 { aBindingName = anAssociationDescription; }
Also, aValue is the value which is being pushed to or pulled from the child to the parent.
Parameters:
aDeclarationName - the declaration name in which the association appears
aDeclarationType - the declaration type for the association
aBindingName - binding name of the component
anAssociationDescription - the description of the binding
aValue - the value which is being pushed to or pulled from the child to the parent

main

public static void main(String[] argv)
The WebObjects application's main method.
Parameters:
argv - the command line arguments

main

public 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.
Parameters:
argv - the command line arguments as a string array
applicationClass - a subclass of WOApplication to run instead of WOApplication.

maxSocketIdleTime

public Number maxSocketIdleTime()
Returns the maximum interval in milliseconds for which a socket should be allowed to wait on incoming data. This is a cover for the WOMaxSocketIdleTime property.
Returns:
a Number indicating the maximum amount of time a socket is allowed to idle
See Also:
setMaxSocketIdleTime(java.lang.Number)

minimumActiveSessionsCount

public int minimumActiveSessionsCount()
If the number of active sessions is less than or equal to this number and isRefusingNewSessions returns true, the application instance terminates. The default is 0.
Returns:
the minimum number of active sessions allowed
See Also:
activeSessionsCount(), isRefusingNewSessions(), refuseNewSessions(boolean), setMinimumActiveSessionsCount(int)

monitorEnabled

public boolean monitorEnabled()
Deprecated. monitorEnabled no longer supported

This is a deprecated cover method for isMonitorEnabled.
Returns:
true if the WOMonitorEnabled property is set, false otherwise
See Also:
isMonitorEnabled()

monitorHost

public String monitorHost()
Deprecated. monitorHost no longer supported

This method always returns "localhost".
Returns:
"localhost"

monitoringEnabled

public boolean monitoringEnabled()
Deprecated. monitoringEnabled is no longer supported

This is a deprecated cover method for isMonitorEnabled.
Returns:
isMonitorEnabled()
See Also:
isMonitorEnabled()

name

public String name()
Returns the name of the application, which is the name of the executable without any extensions.
Returns:
the name of the application
See Also:
baseURL(), path()

number

public String number()
Provided for backwards compatibility only. Do not use.
Returns:
"-1"

outputPath

public String outputPath()
Return the path to which logs will be written. This path may is controlled by the WOOutputPath property, and may be set to "/dev/null".
Returns:
the path to the application logs

pageCacheSize

public int pageCacheSize()
Provides the size of the default page cache. The default cache size is 30. When page caching is enabled, the session object holds the WOComponent instance corresponding to the response page. When a browser backtracks to the page, the session restores it from the session to act as the request page. The state of the page is retained. If the page is not in the cache or if page caching is disabled, the page is not stored in the session and cannot be reaccessed if the browser backtracks to it.

Returns:
the size of the internal cache for page instances
See Also:
permanentPageCacheSize(), setPageCacheSize(int), WOSession.restorePageForContextID(java.lang.String), WOSession.savePage(com.webobjects.appserver.WOComponent)

pageWithName

public WOComponent pageWithName(String aName,
                                WOContext aContext)
Returns a new page instance (a WOComponent object) identified by aName. If aName is null, the Main component is assumed. If the method cannot create a valid page instance, an exception is thrown.
Parameters:
aName - the name of a page instance (a WOComponent object)
aContext - the context of a transaction
Returns:
a new page instance
See Also:
WOSession.restorePageForContextID(java.lang.String), WOSession.savePage(com.webobjects.appserver.WOComponent)

path

public 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.
Returns:
the file system path of the application
See Also:
baseURL(), name()

permanentPageCacheSize

public int permanentPageCacheSize()
Provides the size of the permanent page cache. The default size is 30.
Returns:
the permanent page cache size
See Also:
pageCacheSize(), setPermanentPageCacheSize(int), WOSession.restorePageForContextID(java.lang.String), WOSession.savePageInPermanentCache(com.webobjects.appserver.WOComponent)

port

public Number port()
Returns the port number on which the primary adaptor will listen This is the cover method for the property WOPort.
Returns:
the port number on which the primary adaptor will listen
See Also:
setPort(java.lang.Number)

primeApplication

public 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. This must be called before responseForComponentWithName is called.
Parameters:
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.

printsHTMLParserDiagnostics

public boolean printsHTMLParserDiagnostics()
Deprecated. See com.webobjects.foundation.NSLog

Deprecated. Does nothing.
Returns:
true in all cases

projectSearchPath

public NSArray projectSearchPath()
Returns an array of file system paths which are searched for projects for rapid turnaround mode. This is the cover method for the property 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).
Returns:
an NSArray of file system paths
See Also:
setProjectSearchPath(com.webobjects.foundation.NSArray)

recordingPath

public String recordingPath()
Returns a file system path which is where the recording information should be saved. By default, this method returns 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.

Returns:
a file system path which is where the recording information should be saved
See Also:
setRecordingPath(java.lang.String)

refuseNewSessions

public void refuseNewSessions(boolean aVal)
Controls whether this application instance will create a session when it receives an HTTP request from a new user. If 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.

Parameters:
aVal - true if the application should create new sessions, false otherwise
See Also:
activeSessionsCount(), isRefusingNewSessions(), minimumActiveSessionsCount(), setMinimumActiveSessionsCount(int)

registerRequestHandler

public void registerRequestHandler(WORequestHandler aHandler,
                                   String aRequestHandlerKey)
Registers a new request handler. aRequestHandlerKey must specify a key which can be found in the URL following the instance number or application name.
Parameters:
aHandler - a request handler
aRequestHandlerKey - a String key which will be found in the URL
See Also:
removeRequestHandlerForKey(java.lang.String), registeredRequestHandlerKeys(), requestHandlerForKey(java.lang.String)

registeredRequestHandlerKeys

public NSArray registeredRequestHandlerKeys()
Returns an array of Strings containing the keys of all of the registered request handlers.
Returns:
an NSArray of Strings containing the keys of all registered request handlers
See Also:
handlerForRequest(com.webobjects.appserver.WORequest), requestHandlerForKey(java.lang.String)

removeRequestHandlerForKey

public WORequestHandler removeRequestHandlerForKey(String aRequestHandlerKey)
Removes the specified request handler from the application.
Parameters:
aRequestHandlerKey - a String key which will be found in the URL
Returns:
the removed WORequestHandler
See Also:
requestHandlerForKey(java.lang.String), registeredRequestHandlerKeys()

requestHandlerForKey

public WORequestHandler requestHandlerForKey(String aKey)
Returns the request handler used to handle requests containing the specified key.
Parameters:
aKey - a String key identifying the request handler to be used
Returns:
the request handler
See Also:
handlerForRequest(com.webobjects.appserver.WORequest), registerRequestHandler(com.webobjects.appserver.WORequestHandler, java.lang.String), registeredRequestHandlerKeys()

requestHandlingLock

public Object requestHandlingLock()
Returns an Object suitable for a synchronization lock or null if the application isn't multithreaded.
Returns:
an Object suitable for a synchronization lock or null

resourceManager

public WOResourceManager resourceManager()
Returns the WOResourceManager object that the application uses to manage resources.
Returns:
the WOResourceManager object that the application uses to manage resources
See Also:
setResourceManager(com.webobjects.appserver.WOResourceManager)

resourceRequestHandlerKey

public String resourceRequestHandlerKey()
Resource requests are only used during development of an application or when the application is being run without an HTTP server. This is a cover for the system property _ResourceRequestHandlerKey.
Returns:
the key which identifies URLs directed through the resource request handler
See Also:
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)

responseForComponentWithName

public WOResponse responseForComponentWithName(String name,
                                               NSDictionary bindings,
                                               NSDictionary headers,
                                               NSDictionary userInfo,
                                               String uriPrefix,
                                               String appName)
Returns a WOResponse for the WOComponent named 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.
Parameters:
name - the name of the component to use
bindings - the bindings for the component
headers - the headers passed to the created WORequest
userInfo - the userInfo dictionary passed to the created WORequest
uriPrefix - the uri for the generated WORequest
appName - the application name for the generated WORequest
See Also:
WOResponse

responseForDirectActionWithNameAndClass

public 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). 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.
Parameters:
actionName - the name of the Direct Action to invoke
className - the class that the Direct Action is in
formValueDict - the form values for the created WORequest or null
contentStream - the content of the created WORequest or null
headers - the headers passed to the created WORequest
userInfo - the userInfo dictionary passed to the created WORequest
uriPrefix - the uri for the generated WORequest
appName - the application name for the generated WORequest
See Also:
WORequest

restoreSessionWithID

public WOSession restoreSessionWithID(String aSessionID,
                                      WOContext aContext)
Restores the WOSession object representing a session. In normal request handling, this method is invoked at the start of a cycle of the request-response loop. The default implementation simply invokes WOSessionStore's 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).
Parameters:
aSessionID - the uniqued string that identifies the session object
aContext - the context of a transaction
Returns:
the WOSession object with id aSessionID
See Also:
createSessionForRequest(com.webobjects.appserver.WORequest), saveSessionForContext(com.webobjects.appserver.WOContext), WOSessionStore.checkOutSessionWithID(java.lang.String, com.webobjects.appserver.WORequest)

run

public void run()
Runs the application in a near-indefinite run loop in the default run-loop mode. Before starting the run loop, the method sends registerForEvents to the application's adaptors so that they can begin receiving run-loop events. Normally, run is invoked from the main method.
See Also:
setTimeOut(double), defaultRequestHandler(), terminateAfterTimeInterval(double), WOAdaptor.registerForEvents()

saveSessionForContext

public void saveSessionForContext(WOContext aContext)
Called at the end of the request handling loop when the current session object needs to be saved. The default implementation simply invokes WOSessionStore's checkInSessionForContext method, but throws an exception if the WOSession object is missing or if there is no WOSessionStore.
Parameters:
aContext - the context of a transaction
See Also:
WOSessionStore.checkInSessionForContext(com.webobjects.appserver.WOContext), WOSessionStore.restoreSessionWithID(java.lang.String, com.webobjects.appserver.WORequest)

servletConnectURL

public String servletConnectURL()
Returns the URL to connect to the application through a servlet container. It includes the path to the WebObjects CGI adaptor and the application name. For example, http://localhost/cgi-bin/WebObjects/HelloWorld.woa. This URL is used mostly in servlet deployment mode.
Returns:
the URL for the web server
See Also:
cgiAdaptorURL(), directConnectURL(), webserverConnectURL()

sessionStore

public WOSessionStore sessionStore()
Returns the application's current WOSessionStore object. By default, an object that stores session state in process memory (that is, in the server) is used.
Returns:
the application's current WOSessionStore object
See Also:
setSessionStore(com.webobjects.appserver.WOSessionStore), WOSessionStore

sessionStoreClassName

public String sessionStoreClassName()
Return the name of the class that will be used to store sessions. This method is a cover for the WOSessionStoreClassName property and has a default value of "WOServerSessionStore".
Returns:
the value of the WOSessionStoreClassName property

sessionTimeOut

public Number sessionTimeOut()
Return the number of seconds for which a session may be idle before it times out. The default is 3600. This value can be overriden by:
  • using the property WOSessionTimeOut
  • setting the session timeOut from the Session class' constructor
  • overriding this method.
Returns:
the number (of seconds) which will be used as the default timeout for each newly created session
See Also:
setSessionTimeOut(java.lang.Number)

setAdaptor

public void setAdaptor(String aString)
Deprecated. Use the system property WOAdaptor instead

Deprecated. Do not use.
Parameters:
aString -  

setAdditionalAdaptors

public void setAdditionalAdaptors(NSArray anAdaptorArray)
Deprecated. Use the system property WOAdditionalAdaptors instead

Deprecated. Do not use.
Parameters:
anAdaptorArray -  

setAllowsConcurrentRequestHandling

public void setAllowsConcurrentRequestHandling(boolean aValue)
Explicitly specifiy whether concurrent request handling is allowed.
Parameters:
aValue - true indicates that concurrent request handling is allowed
See Also:
allowsConcurrentRequestHandling()

setApplicationBaseURL

public 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.
Parameters:
aString - the path to which the current application may be found
See Also:
applicationBaseURL()

setAutoOpenClientApplication

public void setAutoOpenClientApplication(boolean aBool)
Controls whether starting up an application instance also launches a Java Client client application. If 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.

Parameters:
aBool - true to cause automatic client application launch
See Also:
autoOpenClientApplication(), autoOpenInBrowser()

setAutoOpenInBrowser

public void setAutoOpenInBrowser(boolean aBool)
Controls whether starting up this application also launches a web browser. If 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.

Parameters:
aBool - true to cause automatic browser launch
See Also:
autoOpenInBrowser()

setCGIAdaptorURL

public void setCGIAdaptorURL(String aString)
Sets the URL through the web server to 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.

Parameters:
aString - the URL for the web server
See Also:
cgiAdaptorURL()

setCachingEnabled

public void setCachingEnabled(boolean aBool)
Sets whether or not component caching is enabled. If this is enabled, changes to a component will be reparsed after being saved, assuming the project is under the NSProjectSearchPath. Note that this has no effect on page caching.
Parameters:
aBool - boolean specifying whether or not component caching is enabled
See Also:
isCachingEnabled(), projectSearchPath()

setComponentRequestHandlerKey

public void setComponentRequestHandlerKey(String aString)
Deprecated. Use the system property _ComponentRequestHandlerKey instead

Deprecated, do not use.
Parameters:
aString -  

setContextClassName

public void setContextClassName(String name)
Sets the name of the WOContext subclass class.
Parameters:
name - the name of the WOContext subclass; ignored if null

setDefaultRequestHandler

public void setDefaultRequestHandler(WORequestHandler aRequestHandler)
Sets the default request handler.
Parameters:
aRequestHandler - the default request handler
See Also:
defaultRequestHandler()

setDefaultUndoStackLimit

public void setDefaultUndoStackLimit(int stackLimit)
Set the limit size for the undo stack for a session's default editing context. The default is 10.
Parameters:
stackLimit - the default undo stack limit for the editing context
See Also:
defaultUndoStackLimit()

setDirectActionRequestHandlerKey

public void setDirectActionRequestHandlerKey(String aString)
Deprecated. Use the system property _DirectActionRequestHandlerKey instead

Deprecated, do not use.
Parameters:
aString -  

setDirectConnectEnabled

public void setDirectConnectEnabled(boolean aBool)
Deprecated. Use the system property WODirectConnectEnabled instead

Deprecated, do not use.
Parameters:
aBool -  

setFrameworksBaseURL

public void setFrameworksBaseURL(String aString)
Sets 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.
Parameters:
aString - sets this to the path under which all frameworks can be found under inside the document root
See Also:
frameworksBaseURL()

setIncludeCommentsInResponses

public void setIncludeCommentsInResponses(boolean aBool)
Sets whether or not HTML comments are appended to the response.
Parameters:
aBool - true if HTML comments are appended to the response, false otherwise
See Also:
includeCommentsInResponses()

setListenQueueSize

public void setListenQueueSize(Number listenQueueSize)
Deprecated. Use the system property WOListenQueueSize instead

Deprecated, do not use.
Parameters:
listenQueueSize -  

setLoadFrameworks

public void setLoadFrameworks(NSArray anArray)
Deprecated. Use the system property WOLoadFrameworks instead

Deprecated, do not use.
Parameters:
anArray - an NSArray of frameworks to be loaded

setMaxSocketIdleTime

public void setMaxSocketIdleTime(Number maxSocketIdleTime)
Deprecated. Use the system property WOMaxSocketIdleTime instead

Deprecated, do not use.
Parameters:
maxSocketIdleTime -  

setMinimumActiveSessionsCount

public void setMinimumActiveSessionsCount(int aVal)
Sets the minimum number of active sessions to 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.

Parameters:
aVal - the minimum number of active sessions
See Also:
activeSessionsCount(), isRefusingNewSessions(), minimumActiveSessionsCount(), refuseNewSessions(boolean)

setMonitorEnabled

public void setMonitorEnabled(boolean aBool)
Sets the value of the WOMonitorEnabled property.
Parameters:
aBool - the new value of the WOMonitorEnabled property
See Also:
isMonitorEnabled()

setMonitorHost

public void setMonitorHost(String aString)
Deprecated. setMonitorHost no longer supported

This method does nothing.
Parameters:
aString - is not used

setPageCacheSize

public void setPageCacheSize(int anUnsigned)
Sets the number of page instances the cache will hold. Disable page caching by passing 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.
Parameters:
anUnsigned - the number of pages the cache will hold
See Also:
pageCacheSize(), setPermanentPageCacheSize(int)

setPageRefreshOnBacktrackEnabled

public 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. 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.

Parameters:
aFlag - when true caching of pages by the client is disabled
See Also:
isPageRefreshOnBacktrackEnabled()

setPermanentPageCacheSize

public void setPermanentPageCacheSize(int anUnsigned)
Sets the permanentPageCacheSize to anUnsigned. Setting the size to 0 disables the permanent page cache.
Parameters:
anUnsigned - the permanentPageCacheSize is set to this value
See Also:
permanentPageCacheSize(), setPageCacheSize(int)

setPort

public void setPort(Number port)
Deprecated. Use the system property WOPort instead

Deprecated, do not use.
Parameters:
port -  

setPrintsHTMLParserDiagnostics

public void setPrintsHTMLParserDiagnostics(boolean aBOOL)
Deprecated. See com.webobjects.foundation.NSLog

Deprecated. Does nothing.
Parameters:
aBOOL -  

setProjectSearchPath

public void setProjectSearchPath(NSArray aPathArray)
Sets the array of file system paths which are searched for projects for rapid turnaround mode.
Parameters:
aPathArray - an NSArray of file system paths
See Also:
projectSearchPath()

setRecordingPath

public void setRecordingPath(String aString)
Sets the file system path to where the recording information should be saved. Use 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.

Parameters:
aString - the file system path
See Also:
recordingPath()

setResourceManager

public void setResourceManager(WOResourceManager aResourceManager)
Deprecated. use createResourceManager instead.

Do not use this method. Use createResourceManager to replace the default WOResourceManager implementation with your own.
Parameters:
aResourceManager - an instance of a WOResourceManager subclass
See Also:
resourceManager(), createResourceManager()

setResourceRequestHandlerKey

public void setResourceRequestHandlerKey(String aString)
Deprecated. Use the system property _ResourceRequestHandlerKey instead

Deprecated, do not use.
Parameters:
aString -  

setSMTPHost

public void setSMTPHost(String aString)
Sets the name of the host that will be used to send e-mail messages created by WOMailDelivery.
Parameters:
aString - the name of the SMTP host
See Also:
SMTPHost()

setSessionStore

public void setSessionStore(WOSessionStore aSessionStore)
Set the session-store object for the application. By default, an object that stores session state in process memory (that is, in the server) is used. The session-store object specifies the state storage strategy for the whole application. This object is responsible for making session objects persistent. You should set the session store object when the application starts up, before the first request is handled.
Parameters:
aSessionStore - the session-store for the application
See Also:
sessionStore(), WOSessionStore

setSessionStoreClassName

public void setSessionStoreClassName(String aString)
Sets the name of the session store class to the specified name. The value specified to this method takes precedence over the WOSessionStoreClassName property.
Parameters:
aString - the name of the session store class

setSessionTimeOut

public void setSessionTimeOut(Number timeOut)
Set the interval, in seconds, during which a session may be idle before it times out. The default is 3600.
Parameters:
timeOut - the default session timeOut in seconds
See Also:
sessionTimeOut()

setSocketCacheSize

public void setSocketCacheSize(Number socketCacheSize)
Deprecated. setSocketCacheSize no longer supported

Deprecated, do not use.
Parameters:
socketCacheSize -  

setSocketMonitorSleepTime

public void setSocketMonitorSleepTime(Number socketMonitorSleepTime)
Deprecated. setSocketMonitorSleepTime no longer supported

Sets the length of time in milliseconds that the socket monitor will sleep in order to allow the worker threads to operate. If you don't invoke this method, the value of the WOSocketMonitorSleepTime key will be used; the default value for this key is 50 milliseconds.
Parameters:
socketMonitorSleepTime - the length of time that the socket monitor will sleep

setStatisticsStore

public void setStatisticsStore(WOStatisticsStore aStatisticsStore)
Sets the WOStatisticsStore object to aStatisticsStore. WOStatisticsStore objects record application statistics while the application runs.
Parameters:
aStatisticsStore - the WOStatisticsStore object is set to this
See Also:
statisticsStore()

setTimeOut

public void setTimeOut(double aTimeInterval)
Sets the number of seconds the application can experience inactivity before it terminates execution.

Parameters:
aTimeInterval - the number of seconds the application can experience inactivity before it terminates execution
See Also:
terminateAfterTimeInterval(double), timeOut()

setWebServiceRequestHandlerKey

public void setWebServiceRequestHandlerKey(String aString)
Deprecated. Use the system property _WebServiceRequestHandlerKey instead

Deprecated, do not use.
Parameters:
aString -  

setWorkerThreadCount

public void setWorkerThreadCount(Number threadCount)
Deprecated. setWorkerThreadCount no longer supported

This method no longer does anything.
Parameters:
threadCount - the number of worker threads

setWorkerThreadCountMax

public void setWorkerThreadCountMax(Number threadCount)
Sets the value of the property 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.
Parameters:
threadCount - the maximum number of worker threads the default adaptor can create
See Also:
workerThreadCountMax(), workerThreadCountMin(), setWorkerThreadCountMin(java.lang.Number)

setWorkerThreadCountMin

public void setWorkerThreadCountMin(Number threadCount)
Sets the value of the property 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.
Parameters:
threadCount - the number of worker threads to be created at startup
See Also:
workerThreadCountMax(), workerThreadCountMin(), setWorkerThreadCountMax(java.lang.Number)

sharedEditingContext

public EOSharedEditingContext sharedEditingContext()
Deprecated. EOSharedEditingContext.defaultSharedEditingContext should be directly used instead.

This is a convenience method that returns the default shared editing context.
Returns:
the default EOSharedEditingContext for this application
See Also:
EOSharedEditingContext.defaultSharedEditingContext()

shouldRestoreSessionOnCleanEntry

public boolean shouldRestoreSessionOnCleanEntry(WORequest aRequest)
This is a delegate method for the developer to override for custom behavior. If an application receives a request with a "clean" URL (i.e. with nothing after the application name) and the sessionID is stored in a cookie, this method is invoked to determine if the session should be restored using the stored session ID. If Servlet integration is being used, this determines if an existing JSP/Servlet session should be invalidated when receiving a request with a "clean" URL. This method defaults to returning false, so that existing WOSessions will not be restored, and any JSP/Servlet sessions will be invalidated.
Parameters:
aRequest - the incoming request object.
Returns:
boolean return true to restore an existing session, false to ignore or invalidate existing sessions.

sleep

public 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. The default implementation does nothing.

socketCacheSize

public Number socketCacheSize()
Deprecated. socketCacheSize no longer supported

Deprecated, do not use.
Returns:
a Number

socketMonitorSleepTime

public Number socketMonitorSleepTime()
Deprecated. socketMonitorSleepTime no longer supported

Returns a Number indicating the length of time (in milliseconds) that the socket monitor will sleep in order to allow the worker threads to operate. The default is 50 milliseconds.
Returns:
a Number indicating the length of time the socket monitor will sleep
See Also:
setSocketMonitorSleepTime(java.lang.Number)

statistics

public NSDictionary statistics()
Returns a copy of the dictionary containing the application statistics maintained by WOStatisticsStore. This method is used by the Monitor application to retrieve application statistics. If you need to access the statistics internally, use the following instead:

WOApplication.application().statisticsStore().statistics()
 
Returns:
a dictionary containing application statistics

statisticsStore

public WOStatisticsStore statisticsStore()
Returns the WOStatisticsStore object, which records statistics while the application runs.
Returns:
the WOStatisticsStore object
See Also:
setStatisticsStore(com.webobjects.appserver.WOStatisticsStore)

streamActionRequestHandlerKey

public String streamActionRequestHandlerKey()
Returns the key which identifies URLs directed at Stream based requests. By default, this method returns the string "wis".
Returns:
the key which identifies URLs directed through the Stream request handler
See Also:
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)

takeValueForKey

public void takeValueForKey(Object value,
                            String key)
Conformance to NSKeyValueCoding. Sets the value of the property identified by key to value.
Specified by:
takeValueForKey in interface NSKeyValueCoding
Parameters:
key - String identifying the property to be set
value - the value to which the property specified by key should be set
See Also:
valueForKey(java.lang.String), handleTakeValueForUnboundKey(java.lang.Object, java.lang.String), NSKeyValueCoding

takeValueForKeyPath

public void takeValueForKeyPath(Object value,
                                String keyPath)
Conformance to NSKeyValueCodingAdditions. Sets the property identified by 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.
Specified by:
takeValueForKeyPath in interface NSKeyValueCodingAdditions
Parameters:
keyPath - identifies a derived property of the receiver
value - value to which the derived property identified by keyPath will be set
See Also:
takeValueForKey(java.lang.Object, java.lang.String), valueForKeyPath(java.lang.String), NSKeyValueCoding, NSKeyValueCodingAdditions

takeValuesFromRequest

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.
Parameters:
aRequest - the request to be handled
aContext - the context of the transaction
See Also:
appendToResponse(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)

terminate

public void terminate()
Terminates the application process. Termination does not take place until the handling of the current request has completed.
See Also:
isTerminating(), setTimeOut(double)

terminateAfterTimeInterval

public void terminateAfterTimeInterval(double aTimeInterval)
Deprecated. This method is deprecated, and currently just calls setTimeOut.

See Also:
setTimeOut(double)

timeOut

public double timeOut()
Returns the application's time-out interval: a period (in seconds) of inactivity after which the application will terminate execution. The default application time-out interval is a very large number.
Returns:
the application's time-out interval
See Also:
setTimeOut(double)

toString

public String toString()
Returns a String containing a string representation of the receiver.
Overrides:
toString in class Object
Returns:
a string representation of the receiver

unableToSetNullForKey

public void unableToSetNullForKey(String key)
Conformance to NSKeyValueCoding.ErrorHandling. This method is invoked from 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.
Specified by:
unableToSetNullForKey in interface NSKeyValueCoding.ErrorHandling
Parameters:
key - String identifying the property to be set
See Also:
takeValueForKey(java.lang.Object, java.lang.String), NSKeyValueCoding

unlock

public void unlock()
Deprecated. synchronized(WOApplication.application()) should be used instead.


validationFailedWithException

public void validationFailedWithException(Throwable t,
                                          Object value,
                                          String keyPath,
                                          WOComponent component,
                                          WOSession session)
Appends a validation failed message to NSLog.err. If debugging is enabled, also logs more detailed information on NSLog.debug.
Parameters:
t - the exception that was thrown
value - the value that was being set
keyPath - the derived path that was being accessed
component - the component that was being used
session - the session in which validation failed
See Also:
NSLog

valueForKey

public Object valueForKey(String key)
Conformance to NSKeyValueCoding. Returns the value of the property identified by key.
Specified by:
valueForKey in interface NSKeyValueCoding
Parameters:
key - String identifying the property to be retrieved
Returns:
the receiver's value for the property identified by key
See Also:
takeValueForKey(java.lang.Object, java.lang.String), handleQueryWithUnboundKey(java.lang.String), NSKeyValueCoding

valueForKeyPath

public Object valueForKeyPath(String keyPath)
Conformance to NSKeyValueCodingAdditions. Returns the receiver's value for the derived property identified by 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.
Specified by:
valueForKeyPath in interface NSKeyValueCodingAdditions
Parameters:
keyPath - String identifying the derived property to be retrieved
Returns:
receiver's value for the derived property identified by keyPath
See Also:
valueForKey(java.lang.String), takeValueForKeyPath(java.lang.Object, java.lang.String), NSKeyValueCoding, NSKeyValueCodingAdditions

wasMainInvoked

public boolean wasMainInvoked()
Used to determine if the WO application was started standalone or not. In particular, applications running in a Servlet Container will return false.
Returns:
boolean Whether WOApplication.main was invoked.

webServiceRequestHandlerKey

public String webServiceRequestHandlerKey()
Returns the key which identifies URLs directed at Web services. By default, this method returns the string "ws". This is a cover for the system property _WebServiceRequestHandlerKey.
Returns:
the key which identifies URLs directed through the Web Service request handler
See Also:
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)

webserverConnectURL

public String webserverConnectURL()
Returns the URL to connect to the application through the web server and WOAdaptors. It includes the path to the WebObjects CGI adaptor, the application name, and a negative port number. For example, 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.
Returns:
the URL for the web server
See Also:
cgiAdaptorURL(), directConnectURL(), servletConnectURL()

workerThreadCount

public Number workerThreadCount()
Deprecated. workerThreadCount no longer supported

This method no longer does anything.
Returns:
the number of worker threads which will be created by WODefaultAdaptor
See Also:
workerThreadCountMin(), setWorkerThreadCountMin(java.lang.Number), workerThreadCountMax(), setWorkerThreadCountMax(java.lang.Number)

workerThreadCountMax

public Number workerThreadCountMax()
Returns the number of worker threads the default adaptor will create startup. This method is a cover for the property 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.
Returns:
the maximum number of worker threads the default adaptor can create
See Also:
workerThreadCountMin(), setWorkerThreadCountMax(java.lang.Number), setWorkerThreadCountMin(java.lang.Number)

workerThreadCountMin

public Number workerThreadCountMin()
Returns the number of worker threads the default adaptor will create at startup. This method is a cover for the property 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.
Returns:
the number of worker threads to be created at startup
See Also:
workerThreadCountMax(), setWorkerThreadCountMax(java.lang.Number), setWorkerThreadCountMin(java.lang.Number)

Last updated Fri Feb 21 13:15:00 PST 2003.

Copyright © 2003 Apple Computer, Inc.