Table of Contents
Previous Section
The following example, FaultTolerantApplication, shows one approach to implementing a custom storage solution. FaultTolerantApplication is a subclass of WOWebScriptApplication that archives state in the file system. Its name derives from the fact that because it archives state in the file system, no more than the last interaction in a session can ever be lost.
FaultTolerantApplication includes the following methods:
[super stateID], which stores the state in the application and returns a new stateID. The method then invokes the WOApplication method stateDataForID:, which takes the state in the application, archives it into an NSData object, and returns the NSData object. Finally, the method stores the NSData object in the file system and removes the state from the server.
[super restoreToStateWithID:aStateID data:stateData], which restores the session's state from the NSData object.