|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TransactionalDataProvider
Behavioral interface that is implemented by DataProvider
classes
that offer commit/revert support. In such environments, methods that modify
the data element values (such as setValue()
) must cause the new
values to be cached, and the underlying data elements are not actually
updated until commitChanges()
is called. An application may
also call revertChanges()
to throw away any cached updates. In
spite of this caching, however, valueChanged()
events must still
be sent to registered DataListener
s -- an instance of
TransactionalDataListener
will also be notified when the
actual commitChanges()
or revertChanges()
occurs.
During the time between when a modification method (such as
setValue()
is called, and a later call to
commitChanges()
, any calls to getType()
or
getValue()
will reflect the modified value from the cache, not
the original value from the underlying data structure.
Method Summary | |
---|---|
void |
addTransactionalDataListener(TransactionalDataListener listener)
Register a new TransactionalDataListener to this
TransactionalDataProvider instance. |
void |
commitChanges()
Cause any cached changes to values of data elements supported by this DataProvider to be passed through to the underlying data
structure. |
TransactionalDataListener[] |
getTransactionalDataListeners()
|
void |
removeTransactionalDataListener(TransactionalDataListener listener)
Deregister an existing TransactionalDataListener from
TransactionalDataProvider instance. |
void |
revertChanges()
Cause any cached changes to values of data elements supported by this DataProvider to be thrown away, so that the initial values are
again visible. |
Methods inherited from interface com.sun.data.provider.DataProvider |
---|
addDataListener, getDataListeners, getFieldKey, getFieldKeys, getType, getValue, isReadOnly, removeDataListener, setValue |
Method Detail |
---|
void commitChanges() throws DataProviderException
Cause any cached changes to values of data elements supported by this
DataProvider
to be passed through to the underlying data
structure.
DataProviderException
- Implementations may wish to surface
internal exceptions (nested in DataProviderException). Consult
the documentation of the specific DataProvider implementation for
details on what exceptions might be wrapped by a DPE.void revertChanges() throws DataProviderException
Cause any cached changes to values of data elements supported by this
DataProvider
to be thrown away, so that the initial values are
again visible.
DataProviderException
- Implementations may wish to surface
internal exceptions (nested in DataProviderException). Consult
the documentation of the specific DataProvider implementation for
details on what exceptions might be wrapped by a DPE.void addTransactionalDataListener(TransactionalDataListener listener)
Register a new TransactionalDataListener
to this
TransactionalDataProvider
instance.
listener
- New TransactionalDataListener
to registervoid removeTransactionalDataListener(TransactionalDataListener listener)
Deregister an existing TransactionalDataListener
from
TransactionalDataProvider
instance.
listener
- Old TransactionalDataListener
to removeTransactionalDataListener[] getTransactionalDataListeners()
TransactionalDataListener
s
currently registered on this TransactionalDataProvider
.
If there are no registered listeners, a zero-length array is
returned.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |