|
WebObjects 5.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.webobjects.appserver.WOAdaptor
The WOAdaptor class serves as the abstract superclass for all WebObjects application adaptors (e.g. the adaptor running on the application side). Note that the WOServletAdaptor is not included in this list.
The Default adaptor's primary task is to receive incoming HTTP requests and package these events into a WORequest object. Second, the WOApplication object's dispatchRequest
method is invoked with the WORequest object as a parameter. dispatchRequest returns a WOResponse object, which is then returned to the client as an HTTP response. The name of the default adaptor is WODefaultAdaptor.
During the WOApplication constructor, WOApplication.adaptorForName()
is invoked, which in turn invokes the WOAdaptor constructor. Once the WOApplication object begins its runloop (started by WOApplication's run()
method), registerForEvents
is called. Once the runloop is ready to exit (typically by calling WOApplication's terminate()
method), unregisterForEvents
is called. If there are multiple adaptors, these invocations are called on each of them.
Note that the runloop does not repeatedly invoke any methods on the WOAdaptor objects. Because of this, developers should spawn at least one thread in registerForEvents
to do useful work.
Custom adaptors can be be used by subclassing WOAdaptor. They can be substituted for the WODefaultAdaptor by using the WOAdaptor property, or they can be run in addition to the WODefaultAdaptor by using the WOAdditionalAdaptors property. To substitute a custom adaptor for the default adaptor:
-WOAdaptor com.mycompany.MyCustomAdaptor
To run additional adaptors:
-WOAdditionalAdaptors "({WOAdaptor=com.mycompany.MyCustomAdaptor1;}, {WOAdaptor=com.mycompany.MyCustomAdaptor2;})"
WOApplication.adaptorWithName(String aClassName, NSDictionary anArgsDictionary)
,
WOApplication.dispatchRequest(WORequest aRequest)
,
registerForEvents()
,
unregisterForEvents()
Field Summary | |
protected static int |
DefaultListenQueueSize
This class constant is an integer that specifies the default value for the WOListenQueueSize property, if not set elsewhere. |
Constructor Summary | |
WOAdaptor(String aName,
NSDictionary arguments)
Initializes a WOAdaptor with the name aName and arguments
arguments . |
Method Summary | |
boolean |
dispatchesRequestsConcurrently()
This should return true if the adaptor is capable of dispatching
requests to the application concurrently, false otherwise. |
boolean |
doesBusyRunOnce()
Deprecated. This method will never be called and should not be used or overridden. |
int |
port()
Returns the port number on which the adaptor listens. |
abstract void |
registerForEvents()
WOApplication will invoke this method to prepare the WOAdaptor to start receiving events. |
void |
runOnce()
Deprecated. This method will never be called and should not be used or overridden. |
String |
toString()
Returns a string representation of the receiver. |
abstract void |
unregisterForEvents()
WOApplication will invoke this method to cause the WOAdaptor to stop receiving events. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final int DefaultListenQueueSize
Constructor Detail |
public WOAdaptor(String aName, NSDictionary arguments)
Initializes a WOAdaptor with the name aName
and arguments
arguments
. aName
is the name of the WOAdaptor subclass.
arguments
are the default options specified for this adaptor
(such as port number and listen queue depth).
The WOApplication method adaptorWithName
invokes this method to create
new WOAdaptors. If no custom WOAdaptors are added, either through the WOAdaptor
or WOAdditionalAdaptors properties, a default adaptor (WODefaultAdaptor) will be
created.
Custom subclasses should override this method to initialize their objects.
aName
- name of the WOAdaptor subclassarguments
- the default options specified for this adaptorWOApplication.adaptorWithName(String aClassName, NSDictionary anArgsDictionary)
Method Detail |
public boolean dispatchesRequestsConcurrently()
true
if the adaptor is capable of dispatching
requests to the application concurrently, false
otherwise.
Returning true
does not necessarily mean that requests will
be dispatched concurrently -- the WOAllowsConcurrentRequestHandling property
must be set as well. WOApplication's isConcurrentRequestHandlingEnabled returns
the current status of concurrent request handling in the application.true
if the adaptor is capable of being multi-threaded,
false
otherwiseWOApplication.isConcurrentRequestHandlingEnabled()
public boolean doesBusyRunOnce()
true
public int port()
WOApplication.port()
public abstract void registerForEvents()
unregisterForEvents
.
This method should never be invoked directly.unregisterForEvents()
public void runOnce()
public String toString()
toString
in class Object
public abstract void unregisterForEvents()
registerForEvents
.
This method should never be invoked directly.registerForEvents()
|
Last updated Fri Feb 21 13:15:00 PST 2003. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |