|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.revusky.niggle.data.AbstractDataSource | +--com.revusky.niggle.data.AbstractMutableDataSource
A convenient base class for MutableDataSource implementations. Implements some methods that are likely to be used by most.
Constructor Summary | |
AbstractMutableDataSource()
Our constructor must throw the exception since the superclass's constructor does. |
Method Summary | |
void |
addDataListener(DataListener dl)
Add a listener that gets notified if ever a record is inserted, updated or deleted. |
void |
close()
A method that should be called to free any resources associated with the data source. |
protected void |
fireDataEvent(DataEvent event)
Fire a data event to the listeners. |
protected void |
freeze(Record rec)
Called to mark the record as immutable. |
java.util.List |
getRecords(java.lang.Object key)
|
void |
init(java.util.Properties props)
TODO |
protected void |
markStale(Record rec)
Mark the record as "stale". |
protected static java.lang.String |
normalizeKey(java.lang.String type,
java.lang.Object key)
|
void |
removeDataListener(DataListener dl)
Remove a listener that gets notified if ever a record is inserted, updated or deleted. |
java.util.List |
select(RecordFilter filter)
This is equivalent to select(null, filter) |
void |
wipeCache()
If this data source is backed by some external mechanism, like an RDBMS, wipes the in-memory cache, if one is being maintained. |
Methods inherited from class com.revusky.niggle.data.AbstractDataSource |
get, getName, keys |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.revusky.niggle.data.MutableDataSource |
delete, insert, select, update |
Methods inherited from interface com.revusky.niggle.data.DataSource |
get, get, getName, keys, keys |
Constructor Detail |
public AbstractMutableDataSource() throws java.io.IOException
Method Detail |
public void addDataListener(DataListener dl) throws java.io.IOException
MutableDataSource
addDataListener
in interface MutableDataSource
com.revusky.niggle.data.MutableDataSource
dl
- the listenerpublic void removeDataListener(DataListener dl) throws java.io.IOException
MutableDataSource
removeDataListener
in interface MutableDataSource
com.revusky.niggle.data.MutableDataSource
dl
- the listenerprotected void fireDataEvent(DataEvent event)
protected void freeze(Record rec) throws java.io.IOException
protected void markStale(Record rec)
protected static java.lang.String normalizeKey(java.lang.String type, java.lang.Object key) throws java.io.IOException
public void init(java.util.Properties props) throws java.io.IOException
init
in interface DataSource
init
in class AbstractDataSource
public final java.util.List getRecords(java.lang.Object key) throws java.io.IOException
getRecords
in interface DataSource
com.revusky.niggle.data.DataSource
public final java.util.List select(RecordFilter filter) throws java.io.IOException
MutableDataSource
select
in interface MutableDataSource
public void wipeCache() throws java.io.IOException
MutableDataSource
wipeCache
in interface MutableDataSource
public void close() throws java.io.IOException
DataSource
close
in interface DataSource
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |