next up previous contents index
Next: 4 Style Guide Up: 3 The Slate World Previous: 3.15 Modules   Contents   Index

Subsections

3.16 Persistence

3.16.1 Slate Heap Images

Slate's environment is available for saving as a whole via the representative object Image. It offers the following methods:

save &name:
Writes out a file containing the contents of the heap, after running a simple cleaning sweep of memory contents. The filename defaults to 'slate.image' or to the name of the most recent filename parameter value given. Note that execution context state is not disturbed, so saves may occur in any context as a snapshot of system-wide state, including debuggers, inspectors, and other live running processes.
handleShutdown
Performs each action (a block) in the Image's shutdownActions attribute, a Dictionary mapping keys to those corresponding actions. The keys are not meaningful except for identification by the library which installs it, so generally Symbols are used or objects which can be identified and distinguished very easily. handleShutdown is actually called by the quit method. The purpose of shutdown actions is to clean up any state that may affect the surrounding environment if not handled properly.
handleStartup
Performs each action (a block) in the Image's startupActions attribute, a Dictionary mapping keys to those corresponding actions. The keys are not meaningful except for identification by the library which installs it, so generally Symbols are used or objects which can be identified and distinguished very easily. handleStartup is actually called by the save method when the image is re-started, because the execution context is preserved, and the VM sends a signal to indicate a fresh startup. The purpose of startup actions is to clean up any state that may be left over from a previous session with that Slate environment, and also to re-initialize state which must persist to avoid inconsistent execution of various services. ExternalResources (sub:External-Resources) whose connections must be persistent are primary users of these hooks.
handleSave
Performs each action (a block) in the Image's saveActions attribute, a Dictionary mapping keys to those corresponding actions. The keys are not meaningful except for identification by the library which installs it, so generally Symbols are used or objects which can be identified and distinguished very easily. handleSave is actually called by the quit method. The purpose of save actions is to clean up any state that should not be saved at all; for example, passwords stored for secure access to external resources should be purged. In general, startup actions should be used for any other save-related activities.

3.16.2 Heap Image Segments

We are developing methods for extracting ``slices'' of images and saving them on disk along with explicit linking information so that groups of arbitrary objects may be transported reliably.


next up previous contents index
Next: 4 Style Guide Up: 3 The Slate World Previous: 3.15 Modules   Contents   Index
Brian Rice 2005-11-21