Figure 3: Cacher Processes at a node
The implementation framework can be explained by relating it to the cacher processes that are employed at a node to enable caching (see figure 3). In Section 3, we motivated node and process cachers. While we discussed one node cacher per node, we show three cachers at the node level in figure 3 - namely, the generic node cacher, the causal cacher and the SC cacher. We call the causal and the SC cachers as the consistency cachers. We chose to use separate cacher processes for different levels of consistency instead of having a single process (the node cacher) handle all the responsibilities of caching at the node level since this design allows new consistency levels to be added more easily. Though we describe a design that allows consistency level of objects to be decided statically, the goal of this prototype is to allow consistency levels of objects to be changed dynamically. This will be facilitated by the generic node cacher which is designed to implement the type-independent aspects of caching. Thus, the generic node cacher class implements functionality that is both type-independent and common to all the consistency cacher classes.
The process cacher class implements the code that is executed by process cachers. A process cacher handles the type-independent aspects of caching that include actions such as maintaining a table of objects that are cached and their corresponding locations in the cache, invalidating the object copy, and invoking methods on the object reference to extract and restore state. The type-specific aspects of object access are implemented partially in the consistency framework and by the specific class that the object is an instance of. For example, if an object fault is experienced while trying to access a causally consistent object, the fault handler that is run is part of the Causal class which comes from the consistency framework. Also, as mentioned in Section 4.1, the state of the object is extracted and restored using the default writeToString and the readFromString methods of the Cached class or the overridden definitions of these methods defined in a class outside the consistency framework.