beautypg.com

Adaptor modes – Apple WebObjects 3.5: Serving User Manual

Page 5

background image

Serving WebObjects

6

in the private configuration file; if you manually start HelloWorld and it’s
already been started, the entry for HelloWorld in the file is overwritten.
(The old process will continue to run, but cannot be contacted.) The
adaptor also cannot contact a remote instance of an application using the
private configuration file.

The contents of the private configuration file are essentially the same as
those of the public configuration file, except that the contents are stored as
C structures and so cannot be directly modified. This file should only be
modified by the WebObjects adaptor itself.

Adaptor Modes

All WebObjects adaptors route incoming requests to WebObjects applications
in one of three modes:

1. Load-balancing between concurrent instances of the same application

specified in the public configuration file

2. Choosing an application from the private configuration file

3. Autostarting an application

The active adaptor tries to contact the requested application by going through
the modes in the preceding order.

Load Balancing

: When the client request tries to contact an application, the active

WebObjects adaptor first checks the public configuration file for an application
matching the specification in the URL. Load balancing typically occurs only for
the first request of a session if the application stores state in the server.
Afterwards, the application resolves the URL so that page navigation will always
occur in the context of the same application. But if the application stores state
on the page or in cookies, true load balancing will be performed for each request.

Private Configuration File

: If the adaptor cannot find a public configuration file, it

attempts to resolve the URL against entries in the private configuration file. If
the adaptor finds a matching entry but cannot contact it (for example, the
application has been stopped), the adaptor deletes the “dangling” entry from
the private configuration file and autostarts the application.

Autostarting

: If there is no public configuration file and the adaptor fails to find an

application matching the client’s request in the private configuration file, it tries
to start the application itself. The adaptor first searches in specific locations in
the document root of the HTTP server and then in NeXT_ROOT

/NextLibrary/WOApps

for a WebObjects application (one with a

.woa

extension) that matches the

specification in the request URL. If it finds one, it invokes the

WODefaultApp