com.kedwards.swt.persist
Class TaggedPersistentData

java.lang.Object
  |
  +--com.kedwards.swt.persist.TaggedPersistentData
All Implemented Interfaces:
java.io.Serializable

public class TaggedPersistentData
extends java.lang.Object
implements java.io.Serializable

TaggedPersistentData.java

SWT services that need to checkpoint and restore data do so indirectly, though a Persistifier. These services pass and receive TaggedPersistentData objects to and from their Persistifier. They write data to be checkpointed to the data object, and--upon recovery--read data from it.

A single TaggedPersistentData object will collect checkpoint data for the service's wrapper and backend. Different sub-components in a service may need to add or take different data from it. Each component thus "tags" any data they add with their class name with the name of the data appended to it. This allows the Persistifier framework to determine if a service component has written data that it never reads, etc.

This is an implementation of the collector pattern.

See http://www.kedwards.com/jini

No warranty expressed or implied; use at your own risk; for educational purposes only.

Author:
Keith Edwards
See Also:
Serialized Form

Constructor Summary
TaggedPersistentData()
           
 
Method Summary
 java.lang.Object get(java.lang.String name)
          Retrieved the named data.
 java.util.Iterator keyIterator()
           
 void put(java.lang.String name, java.io.Serializable data)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaggedPersistentData

public TaggedPersistentData()
Method Detail

put

public void put(java.lang.String name,
                java.io.Serializable data)
         throws java.io.IOException

get

public java.lang.Object get(java.lang.String name)
                     throws java.io.IOException,
                            java.lang.ClassNotFoundException
Retrieved the named data. Once an object is retrieved, it is removed from the map.

size

public int size()

keyIterator

public java.util.Iterator keyIterator()