Each Relay cache uses a hashtable to maintain a replica of shared state. Cached objects must implement the Cacheable interface. The Relay cache uses this interface to assign system-wide unique names and to extract update information.
The Cacheable.setName(String name) method is used to stamp cached objects with a system-wide unique name. When a server's Listener thread receives an update for an unnamed object, it calls this method to name the object. Future updates for this object should use this name for system-wide referencing.
The Cacheable.getUpdate() method allows cached objects to define their own application specific updates. The Relay cache calls on this method to get an Update object whenever the Cacheable object is updated. At minimum, this method must assign a value to the obj field of the Update object it returns. If the Cacheable object has a name, it should be copied into the objname field of the returned Update object.
The definition of Cacheable.java can be found in Appendix A.