ca.odell.glazedlists.hibernate
Class CategoryEventListFactory

java.lang.Object
  extended by ca.odell.glazedlists.hibernate.CategoryEventListFactory
All Implemented Interfaces:
EventListFactory

public final class CategoryEventListFactory
extends Object
implements EventListFactory

An EventListFactory implementation that uses a list category as key to determine, which ListEventPublisher and ReadWriteLock should be used to create EventLists. All factory instances that use the same category produce EventLists wich share the same publisher and lock.

Author:
Holger Brands

Field Summary
 
Fields inherited from interface ca.odell.glazedlists.hibernate.EventListFactory
DEFAULT
 
Constructor Summary
CategoryEventListFactory(String category)
          Constructor with list category to use.
CategoryEventListFactory(String category, ReadWriteLock lock, ListEventPublisher publisher)
          Constructor with list category, lock and publisher to use.
 
Method Summary
static void clearCategoryMapping()
          Helper method to clear the mapping of categories to publisher/lock pairs.
 EventList createEventList()
          Creates a new EventList.
 EventList createEventList(int initalCapacity)
          Create a new EventList with an initial capacity.
 String getCategory()
          Gets the list category.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CategoryEventListFactory

public CategoryEventListFactory(String category)
Constructor with list category to use. If the category is not registered yet, it will be registered with a new ReadWriteLock and ListEventPublisher.


CategoryEventListFactory

public CategoryEventListFactory(String category,
                                ReadWriteLock lock,
                                ListEventPublisher publisher)
Constructor with list category, lock and publisher to use. If the category is not registered yet, it will be registered with the given ReadWriteLock and ListEventPublisher.

Throws:
IllegalStateException - if the same category is already registered with different values
Method Detail

getCategory

public String getCategory()
Gets the list category.


createEventList

public EventList createEventList()
Creates a new EventList.

Specified by:
createEventList in interface EventListFactory

createEventList

public EventList createEventList(int initalCapacity)
Create a new EventList with an initial capacity.

Specified by:
createEventList in interface EventListFactory

clearCategoryMapping

public static void clearCategoryMapping()
Helper method to clear the mapping of categories to publisher/lock pairs.



Glazed Lists, Copyright © 2003 publicobject.com, O'Dell Engineering.
Documentation build by mockbuild at 2013-02-07 9:25