Documentation Archive Developer
Search
PATH  Documentation > WebObjects 4.5 > WebObjects Developer's Guide


Table of Contents Previous Section

Request Handling Initialization and Post-Processing

At the beginning of each cycle of the component action request-response loop, a method named awake is sent to the WOApplication, WOSession, and WOComponent objects. Like the init method or constructor, the awake method performs initialization tasks, but awake is invoked at a different time during an object's life than the init method or constructor is. The init message or constructor message is sent once, when the object is first created. In contrast, awake is sent at the beginning of each cycle of the request-response loop that the object is involved in. Thus, it may be sent several times during an object's life.

Complementing awake is the sleep method. The sleep method is invoked at the end of each cycle of the component action request-response loop (in contrast to the dealloc or finalize methods, which are invoked at the end of the object's life). The sleep method is rarely used, but you could use it to perform any clean-up task necessary before the next request begins.

Table of Contents Next Section