ca.odell.glazedlists.hibernate
Class PersistentEventList

java.lang.Object
  extended by org.hibernate.collection.AbstractPersistentCollection
      extended by org.hibernate.collection.PersistentList
          extended by ca.odell.glazedlists.hibernate.PersistentEventList
All Implemented Interfaces:
ListEventListener, EventList, Serializable, Iterable, Collection, EventListener, List, PersistentCollection

public final class PersistentEventList
extends PersistentList
implements EventList, ListEventListener

A Hibernate persistent wrapper for an EventList. Underlying collection implementation is BasicEventList.

Author:
Bruce Alspaugh, Holger Brands, James Lemieux
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.hibernate.collection.AbstractPersistentCollection
AbstractPersistentCollection.DelayedOperation
 
Field Summary
protected  ListEventAssembler updates
          the change event and notification system
 
Fields inherited from class org.hibernate.collection.PersistentList
list
 
Fields inherited from class org.hibernate.collection.AbstractPersistentCollection
UNKNOWN
 
Constructor Summary
PersistentEventList(SessionImplementor session, EventList newList)
          Constructor with session and EventList.
PersistentEventList(SessionImplementor session, EventListFactory listFactory)
          Constructor with session.
 
Method Summary
 void addListEventListener(ListEventListener listChangeListener)
          Registers the specified listener to receive change updates for this list.
 void beforeInitialize(CollectionPersister persister)
          Kept for compatibility with older Hibernate versions.
 void beforeInitialize(CollectionPersister persister, int anticipatedSize)
          
 void dispose()
          Disposing an EventList will make it eligible for garbage collection.
 ListEventPublisher getPublisher()
          Get the publisher used to distribute ListEvents.
 ReadWriteLock getReadWriteLock()
          Gets the lock required to share this list between multiple threads.
 void listChanged(ListEvent listChanges)
          When the underlying list changes, this notification allows the object to repaint itself or update itself as necessary.
 void removeListEventListener(ListEventListener listChangeListener)
          Removes the specified listener from receiving change updates for this list.
 
Methods inherited from class org.hibernate.collection.PersistentList
add, add, addAll, addAll, clear, contains, containsAll, disassemble, empty, entries, entryExists, equals, equalsSnapshot, get, getDeletes, getElement, getIndex, getOrphans, getSnapshot, getSnapshotElement, hashCode, indexOf, initializeFromCache, isEmpty, isSnapshotEmpty, isWrapper, iterator, lastIndexOf, listIterator, listIterator, needsInserting, needsUpdating, readFrom, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray, toString
 
Methods inherited from class org.hibernate.collection.AbstractPersistentCollection
afterInitialize, afterRowInsert, beginRead, clearDirty, dirty, endRead, forceInitialization, getCachedSize, getIdentifier, getKey, getOrphans, getOwner, getQueuedOrphans, getRole, getSession, getSnapshot, getStoredSnapshot, getValue, hasQueuedOperations, initialize, isClearQueueEnabled, isDirectlyAccessible, isDirty, isOperationQueueEnabled, isPutQueueEnabled, isRowUpdatePossible, isUnreferenced, needsRecreate, performQueuedOperations, postAction, preInsert, queuedAdditionIterator, queueOperation, read, readElementByIndex, readElementExistence, readIndexExistence, readSize, setCurrentSession, setDirectlyAccessible, setInitialized, setOwner, setSnapshot, unsetSession, wasInitialized, write
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Field Detail

updates

protected transient ListEventAssembler updates
the change event and notification system

Constructor Detail

PersistentEventList

public PersistentEventList(SessionImplementor session,
                           EventListFactory listFactory)
Constructor with session.

Parameters:
session - the session
listFactory - factory for EventLists

PersistentEventList

public PersistentEventList(SessionImplementor session,
                           EventList newList)
Constructor with session and EventList.

Parameters:
session - the session
newList - the EventList
Method Detail

beforeInitialize

public void beforeInitialize(CollectionPersister persister)
Kept for compatibility with older Hibernate versions.


beforeInitialize

public void beforeInitialize(CollectionPersister persister,
                             int anticipatedSize)

Specified by:
beforeInitialize in interface PersistentCollection
Overrides:
beforeInitialize in class PersistentList

getPublisher

public ListEventPublisher getPublisher()
Get the publisher used to distribute ListEvents.

Specified by:
getPublisher in interface EventList

getReadWriteLock

public ReadWriteLock getReadWriteLock()
Gets the lock required to share this list between multiple threads.

Specified by:
getReadWriteLock in interface EventList
Returns:
a re-entrant ReadWriteLock that guarantees thread safe access to this list.

addListEventListener

public void addListEventListener(ListEventListener listChangeListener)
Registers the specified listener to receive change updates for this list.

Specified by:
addListEventListener in interface EventList

removeListEventListener

public void removeListEventListener(ListEventListener listChangeListener)
Removes the specified listener from receiving change updates for this list.

Specified by:
removeListEventListener in interface EventList

listChanged

public void listChanged(ListEvent listChanges)
When the underlying list changes, this notification allows the object to repaint itself or update itself as necessary.

It is mandatory that the calling thread has obtained the write lock on the source list. This is because the calling thread will have written to the source list to cause this event. This condition guarantees that no writes can occur while the listener is handling this event. It is an error to write to the source list while processing an event.

Specified by:
listChanged in interface ListEventListener

dispose

public void dispose()
Disposing an EventList will make it eligible for garbage collection. Some EventLists install themselves as listeners to related objects so disposing them is necessary.

Warning: It is an error to call any method on an EventList after it has been disposed.

Specified by:
dispose in interface EventList


Glazed Lists, Copyright © 2003 publicobject.com, O'Dell Engineering.
Documentation build by James Lemieux at 2009-01-25 18:40