org.granite.client.persistence.collection
Class AbstractPersistentCollection<C>

java.lang.Object
  extended by org.granite.client.persistence.collection.AbstractPersistentCollection<C>
All Implemented Interfaces:
Externalizable, Serializable, PersistentCollection
Direct Known Subclasses:
AbstractPersistentMapCollection, AbstractPersistentSimpleCollection

public abstract class AbstractPersistentCollection<C>
extends Object
implements PersistentCollection

Author:
Franck WOLFF
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.granite.client.persistence.collection.PersistentCollection
PersistentCollection.ChangeListener, PersistentCollection.InitializationCallback, PersistentCollection.InitializationListener
 
Constructor Summary
protected AbstractPersistentCollection()
           
 
Method Summary
 void addListener(PersistentCollection.ChangeListener listener)
           
 void addListener(PersistentCollection.InitializationListener listener)
           
protected  boolean checkInitializedRead()
           
protected  void checkInitializedWrite()
           
 void clearDirty()
           
 PersistentCollection clone(boolean uninitialize)
           
protected abstract  PersistentCollectionSnapshot createSnapshot(Object io, boolean forReading)
           
 void dirty()
           
protected abstract  void doInitialize()
           
protected  ClassLoader getClassLoader()
           
protected  C getCollection()
           
 String getDetachedState()
           
 Loader<PersistentCollection> getLoader()
           
protected  void init(C collection, String detachedState, boolean dirty)
           
 void initialize()
           
 void initializing()
           
 boolean isDirty()
           
 void readExternal(ObjectInput in)
           
 void removeListener(PersistentCollection.ChangeListener listener)
           
 void removeListener(PersistentCollection.InitializationListener listener)
           
 void setLoader(Loader<PersistentCollection> loader)
           
 String toString()
           
 void uninitialize()
           
protected abstract  void updateFromSnapshot(ObjectInput in, PersistentCollectionSnapshot snapshot)
           
 boolean wasInitialized()
           
 void withInitialized(PersistentCollection.InitializationCallback callback)
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractPersistentCollection

protected AbstractPersistentCollection()
Method Detail

init

protected void init(C collection,
                    String detachedState,
                    boolean dirty)

getLoader

public Loader<PersistentCollection> getLoader()
Specified by:
getLoader in interface PersistentCollection

setLoader

public void setLoader(Loader<PersistentCollection> loader)
Specified by:
setLoader in interface PersistentCollection

checkInitializedRead

protected boolean checkInitializedRead()

checkInitializedWrite

protected void checkInitializedWrite()

getCollection

protected C getCollection()

getDetachedState

public String getDetachedState()

getClassLoader

protected ClassLoader getClassLoader()

wasInitialized

public boolean wasInitialized()
Specified by:
wasInitialized in interface PersistentCollection

isDirty

public boolean isDirty()
Specified by:
isDirty in interface PersistentCollection

dirty

public void dirty()
Specified by:
dirty in interface PersistentCollection

clearDirty

public void clearDirty()
Specified by:
clearDirty in interface PersistentCollection

clone

public PersistentCollection clone(boolean uninitialize)
Specified by:
clone in interface PersistentCollection

createSnapshot

protected abstract PersistentCollectionSnapshot createSnapshot(Object io,
                                                               boolean forReading)

updateFromSnapshot

protected abstract void updateFromSnapshot(ObjectInput in,
                                           PersistentCollectionSnapshot snapshot)

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

toString

public String toString()
Overrides:
toString in class Object

addListener

public void addListener(PersistentCollection.ChangeListener listener)
Specified by:
addListener in interface PersistentCollection

removeListener

public void removeListener(PersistentCollection.ChangeListener listener)
Specified by:
removeListener in interface PersistentCollection

addListener

public void addListener(PersistentCollection.InitializationListener listener)
Specified by:
addListener in interface PersistentCollection

removeListener

public void removeListener(PersistentCollection.InitializationListener listener)
Specified by:
removeListener in interface PersistentCollection

initializing

public void initializing()
Specified by:
initializing in interface PersistentCollection

initialize

public void initialize()
Specified by:
initialize in interface PersistentCollection

doInitialize

protected abstract void doInitialize()

uninitialize

public void uninitialize()
Specified by:
uninitialize in interface PersistentCollection

withInitialized

public void withInitialized(PersistentCollection.InitializationCallback callback)
Specified by:
withInitialized in interface PersistentCollection