com.sun.data.provider.impl
Class CachedRowSetDataProvider

java.lang.Object
  extended by com.sun.data.provider.impl.AbstractDataProvider
      extended by com.sun.data.provider.impl.AbstractTableDataProvider
          extended by com.sun.data.provider.impl.CachedRowSetDataProvider
All Implemented Interfaces:
DataProvider, RefreshableDataProvider, TableDataProvider, TransactionalDataProvider, java.io.Serializable

public class CachedRowSetDataProvider
extends AbstractTableDataProvider
implements TableDataProvider, TransactionalDataProvider, RefreshableDataProvider

TableDataProvider implementation that wraps a CachedRowSet.

Note: valueChanged events will only fire for column changes made via the CachedRowSetDataProvider

Note: The lifetime of the RowKeys handed out CachedRowSetDataProvider is until the underlying CachedRowSet is closed or reexecuted.

See Also:
Serialized Form

Field Summary
protected  RowKey cursorRow
          storage for the current cursor row
 
Fields inherited from class com.sun.data.provider.impl.AbstractTableDataProvider
rowKeyList, rowKeyMap, tcListeners
 
Fields inherited from class com.sun.data.provider.impl.AbstractDataProvider
dpListeners
 
Constructor Summary
CachedRowSetDataProvider()
          Construct an unconfigured CachedRowSetDataProvider.
CachedRowSetDataProvider(javax.sql.rowset.CachedRowSet cachedRowSet)
          Construct a CachedRowSetDataProvider that wraps the specified CachedRowSet.
 
Method Summary
 void addRefreshableDataListener(RefreshableDataListener listener)
          

Register a new RefreshableDataListener to this RefreshableDataProvider instance.

 void addTransactionalDataListener(TransactionalDataListener listener)
          

Register a new TransactionalDataListener to this TransactionalDataProvider instance.

 RowKey appendRow()
          

Appends a new row at the end of the list and returns the row key for the newly appended row.

NOTE: The method should only be called after testing the canAppendRow() method to see if this TableDataProvider supports the append operation.

 boolean canAppendRow()
          

This method is called to test if this TableDataProvider supports the append operation. If rows can be appended to the list, this method should return true. If the data provider is not resizable, or cannot support an append operation, this method should return false.

 boolean canInsertRow(RowKey beforeRow)
          

This method is called to test if this TableDataProvider supports resizability. If objects can be inserted and removed from the list, this method should return true. If the data provider is not resizable, this method should return false.

The following methods will only be called if this method returns true:

  • insertRow(RowKey beforeRow)
  • appendRow()
  • removeRow(RowKey rowKey)
 boolean canRemoveRow(RowKey row)
          

This method is called to test if this TableDataProvider supports the removeRow operation. If rows can be removed from the table, this method should return true. If the data provider is does not support removing rows, this method should return false.

protected  void checkExecute()
          Check if rowset, if so, execute if necessary.
 void close()
          free resources used by this instance Close is guaranteed not to throw an exception.
 void commitChanges()
          

Cause any cached changes to values of data elements supported by this DataProvider to be passed through to the underlying data structure.

 boolean cursorFirst()
          

Move the cursor to the first row in this TableDataProvider.

 boolean cursorLast()
          

Move the cursor to the last row in this TableDataProvider.

 boolean cursorNext()
          

Move the cursor to the row after the current cursor row, unless the cursor is currently at the last row TableDataProvider.

 boolean cursorPrevious()
          

Move the cursor to the row before the current cursor row, unless the cursor is currently at the first row.

protected  void fireChangesCommitted()
          Fires a changesCommtted event to each registered TransactionalDataListener.
protected  void fireChangesReverted()
          Fires a changesReverted event to each registered TransactionalDataListener.
 RowKey[] getAllRows()
          Returns all the RowKeys, which may force the underlying dataprovider to go and perform an expensive operation to fetch them.
 javax.sql.rowset.CachedRowSet getCachedRowSet()
          Return the CachedRowSet that we are wrapping.
protected  int getCursorIndex()
           
 RowKey getCursorRow()
          
 FieldKey getFieldKey(java.lang.String fieldId)
          

Returns the FieldKey associated with the specified data element canonical id, if any; otherwise, return null.

 FieldKey[] getFieldKeys()
          
 RefreshableDataListener[] getRefreshableDataListeners()
          
 int getRowCount()
          
 RowKey getRowKey(java.lang.String rowId)
          Returns a RowKey for the specified rowId.
 RowKey[] getRowKeys(int count, RowKey afterRow)
          Returns an array of RowKey objects representing the requested batch of RowKeys. If null is passed as the afterRow parameter, the returned batch of RowKeys will start with the first one.
 TransactionalDataListener[] getTransactionalDataListeners()
          
 java.lang.Class getType(FieldKey fieldKey)
          

Returns the data type of the data element referenced by the specified data key.

 java.lang.Object getValue(FieldKey fieldKey, RowKey row)
          

Return value of the data element referenced by the specified FieldKey and RowKey.

 RowKey insertRow(RowKey beforeRow)
          

Inserts a new row at the specified row.

NOTE: The method should only be called after testing the canInsertRow(RowKey beforeRow) to see if this TableDataProvider supports resizing.

 boolean isReadOnly(FieldKey fieldKey)
          

Return a flag indicating whether the value of the data element represented by the specified FieldKey can be modified via the setValue() method.

 boolean isRowAvailable(RowKey row)
          Returns true if the specified RowKey represents data elements that are supported by this TableDataProvider; otherwise, return false
 void refresh()
          

Cause a re-fetch of whatever data this DataProvider is representing from the underlying source.

 void removeRefreshableDataListener(RefreshableDataListener listener)
          

Deregister an existing RefreshableDataListener from RefreshableDataProvider instance.

 void removeRow(RowKey row)
          

Removes the specified row.

NOTE: The method should only be called after testing the canRemoveRow(RowKey) method to see if this TableDataProvider supports removing rows.

 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.

 void setCachedRowSet(javax.sql.rowset.CachedRowSet cachedRowSet)
          Set the CachedRowSet that we are wrapping.
protected  boolean setCursorIndex(int index)
           
 void setCursorRow(RowKey row)
          

Sets the cursor to the row represented by the passed RowKey.

 void setValue(FieldKey fieldKey, RowKey row, java.lang.Object value)
          

Sets the value of the data element represented by the specified FieldKey and RowKey to the specified new value.

 
Methods inherited from class com.sun.data.provider.impl.AbstractTableDataProvider
addTableCursorListener, addTableDataListener, findAll, findAll, findAll, findAll, findFirst, findFirst, findFirst, findFirst, fireCursorChanged, fireCursorChanging, fireRowAdded, fireRowRemoved, fireValueChanged, getTableCursorListeners, getTableDataListeners, getValue, getValue, removeTableCursorListener, removeTableDataListener, setValue, setValue
 
Methods inherited from class com.sun.data.provider.impl.AbstractDataProvider
addDataListener, addFieldKey, addFieldKeys, clearFieldKeys, fireProviderChanged, fireValueChanged, getDataListeners, getFakeData, getFakeData, getType, getValue, isReadOnly, removeDataListener, removeFieldKey, removeFieldKeys, setValue, sortFieldKeys
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.data.provider.TableDataProvider
addTableCursorListener, addTableDataListener, getTableCursorListeners, getTableDataListeners, removeTableCursorListener, removeTableDataListener
 
Methods inherited from interface com.sun.data.provider.DataProvider
addDataListener, getDataListeners, getValue, removeDataListener, setValue
 
Methods inherited from interface com.sun.data.provider.DataProvider
addDataListener, getDataListeners, getValue, removeDataListener, setValue
 
Methods inherited from interface com.sun.data.provider.DataProvider
addDataListener, getDataListeners, getValue, removeDataListener, setValue
 

Field Detail

cursorRow

protected RowKey cursorRow
storage for the current cursor row

Constructor Detail

CachedRowSetDataProvider

public CachedRowSetDataProvider()

Construct an unconfigured CachedRowSetDataProvider.


CachedRowSetDataProvider

public CachedRowSetDataProvider(javax.sql.rowset.CachedRowSet cachedRowSet)

Construct a CachedRowSetDataProvider that wraps the specified CachedRowSet.

Parameters:
cachedRowSet - The CachedRowSet to be wrapped
Method Detail

getCachedRowSet

public javax.sql.rowset.CachedRowSet getCachedRowSet()

Return the CachedRowSet that we are wrapping.


setCachedRowSet

public void setCachedRowSet(javax.sql.rowset.CachedRowSet cachedRowSet)

Set the CachedRowSet that we are wrapping. In addition, ensure that the CachedRowSet has been executed so that subseuqent calls accessing it will work.

Parameters:
cachedRowSet - The new CachedRowSet

close

public void close()
free resources used by this instance Close is guaranteed not to throw an exception.


getRowKeys

public RowKey[] getRowKeys(int count,
                           RowKey afterRow)
                    throws DataProviderException
Returns an array of RowKey objects representing the requested batch of RowKeys. If null is passed as the afterRow parameter, the returned batch of RowKeys will start with the first one.

Specified by:
getRowKeys in interface TableDataProvider
Overrides:
getRowKeys in class AbstractTableDataProvider
Parameters:
count - The desired count of RowKeys to fetch. If this number exceeds the total number of rows available, the return array will contain the available number, and no exception will be thrown. Consider this an optimistic request of the TableDataProvider.
afterRow - The RowKey that represents the last row before the set of desired RowKeys to be returned. Typically, this is the last RowKey from the previously fetched set of RowKeys. If null is passed, the returned set will begin with the first row.
Returns:
An array of RowKey objects representing the requested batch of rows.
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning null or an empty array. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

getAllRows

public RowKey[] getAllRows()
                    throws DataProviderException
Returns all the RowKeys, which may force the underlying dataprovider to go and perform an expensive operation to fetch them.

Overrides:
getAllRows in class AbstractTableDataProvider
Returns:
RowKey[] All of the row keys in this TableDataProvider
Throws:
DataProviderException

getRowKey

public RowKey getRowKey(java.lang.String rowId)
                 throws DataProviderException
Description copied from interface: TableDataProvider
Returns a RowKey for the specified rowId. This allows a RowKey to be stored off as a simple string, which can be resolved into an instance of a RowKey at a later date.

Specified by:
getRowKey in interface TableDataProvider
Overrides:
getRowKey in class AbstractTableDataProvider
Parameters:
rowId - The cannoncial string ID of the desired RowKey
Returns:
A RowKey object representing the desired row, or null if the specified rowId does not correspond to a row in this TableDataProvider
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning null. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

getCursorIndex

protected int getCursorIndex()
Overrides:
getCursorIndex in class AbstractTableDataProvider

setCursorIndex

protected boolean setCursorIndex(int index)
Overrides:
setCursorIndex in class AbstractTableDataProvider

getCursorRow

public RowKey getCursorRow()
                    throws DataProviderException

Specified by:
getCursorRow in interface TableDataProvider
Overrides:
getCursorRow in class AbstractTableDataProvider
Returns:
the RowKey of the current cursor row position
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException). Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

setCursorRow

public void setCursorRow(RowKey row)
                  throws TableCursorVetoException

Sets the cursor to the row represented by the passed RowKey.

Specified by:
setCursorRow in interface TableDataProvider
Overrides:
setCursorRow in class AbstractTableDataProvider
Parameters:
row - New RowKey to move the cursor to.
Throws:
TableCursorVetoException - if a TableCursorListener decides to veto the cursor navigation

cursorFirst

public boolean cursorFirst()
                    throws DataProviderException

Move the cursor to the first row in this TableDataProvider.

Specified by:
cursorFirst in interface TableDataProvider
Overrides:
cursorFirst in class AbstractTableDataProvider
Returns:
true if the cursor row was successfully changed; else false
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning false. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

cursorNext

public boolean cursorNext()
                   throws DataProviderException

Move the cursor to the row after the current cursor row, unless the cursor is currently at the last row TableDataProvider.

Specified by:
cursorNext in interface TableDataProvider
Overrides:
cursorNext in class AbstractTableDataProvider
Returns:
true if the cursor row was successfully changed; else false
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning false. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

cursorPrevious

public boolean cursorPrevious()
                       throws DataProviderException

Move the cursor to the row before the current cursor row, unless the cursor is currently at the first row.

Specified by:
cursorPrevious in interface TableDataProvider
Overrides:
cursorPrevious in class AbstractTableDataProvider
Returns:
true if the cursor row was successfully changed; else false
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning false. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

cursorLast

public boolean cursorLast()
                   throws DataProviderException

Move the cursor to the last row in this TableDataProvider.

Specified by:
cursorLast in interface TableDataProvider
Overrides:
cursorLast in class AbstractTableDataProvider
Returns:
true if the cursor row was successfully changed; else false
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning false. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

getFieldKey

public FieldKey getFieldKey(java.lang.String fieldId)
                     throws DataProviderException

Returns the FieldKey associated with the specified data element canonical id, if any; otherwise, return null.

Specified by:
getFieldKey in interface DataProvider
Overrides:
getFieldKey in class AbstractDataProvider
Parameters:
fieldId - Canonical id of the requested FieldKey
Returns:
the FieldKey associated with the specified data element canonical id, if any; otherwise, return null
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning null. A DPE may also indicate that the passed fieldId is not valid. Consult the documentation of the specific DataProvider implementation for details on what exceptions might be wrapped by a DPE.

getFieldKeys

public FieldKey[] getFieldKeys()
                        throws DataProviderException

Specified by:
getFieldKeys in interface DataProvider
Overrides:
getFieldKeys in class AbstractDataProvider
Returns:
An array of all FieldKeys supported by this DataProvider. If the set of valid FieldKeys cannot be determined, return null instead.
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning null or an empty array. Consult the documentation of the specific DataProvider implementation for details on what exceptions might be wrapped by a DPE.

getType

public java.lang.Class getType(FieldKey fieldKey)
                        throws DataProviderException

Returns the data type of the data element referenced by the specified data key.

Specified by:
getType in interface DataProvider
Specified by:
getType in class AbstractTableDataProvider
Parameters:
fieldKey - FieldKey identifying the data element whose type is to be returned
Returns:
the data type of the data element referenced by the specified data key
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning null. A DPE may also indicate that the passed fieldKey is not valid. Consult the documentation of the specific DataProvider implementation for details on what exceptions might be wrapped by a DPE.

appendRow

public RowKey appendRow()
                 throws DataProviderException

Appends a new row at the end of the list and returns the row key for the newly appended row.

NOTE: The method should only be called after testing the canAppendRow() method to see if this TableDataProvider supports the append operation.

Specified by:
appendRow in interface TableDataProvider
Specified by:
appendRow in class AbstractTableDataProvider
Returns:
The row key for the newly appended row
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException). Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.
See Also:
TableDataProvider.canAppendRow()

canInsertRow

public boolean canInsertRow(RowKey beforeRow)
                     throws DataProviderException

This method is called to test if this TableDataProvider supports resizability. If objects can be inserted and removed from the list, this method should return true. If the data provider is not resizable, this method should return false.

The following methods will only be called if this method returns true:

Specified by:
canInsertRow in interface TableDataProvider
Specified by:
canInsertRow in class AbstractTableDataProvider
Parameters:
beforeRow - The desired location to insert the new row in front of
Returns:
true if the data provider is resizable, or false if not.
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning false. A DPE may also indicate that this RowKey does not represent a row provided by this TableDataProvider. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.
See Also:
TableDataProvider.insertRow(RowKey)

canAppendRow

public boolean canAppendRow()
                     throws DataProviderException

This method is called to test if this TableDataProvider supports the append operation. If rows can be appended to the list, this method should return true. If the data provider is not resizable, or cannot support an append operation, this method should return false.

Specified by:
canAppendRow in interface TableDataProvider
Specified by:
canAppendRow in class AbstractTableDataProvider
Returns:
true if the data provider supports the append operation, or false if not.
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException). A DPE may also indicate that this RowKey does not represent a row provided by this TableDataProvider. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.
See Also:
TableDataProvider.appendRow()

canRemoveRow

public boolean canRemoveRow(RowKey row)
                     throws DataProviderException

This method is called to test if this TableDataProvider supports the removeRow operation. If rows can be removed from the table, this method should return true. If the data provider is does not support removing rows, this method should return false.

Specified by:
canRemoveRow in interface TableDataProvider
Specified by:
canRemoveRow in class AbstractTableDataProvider
Parameters:
row - The desired row to remove
Returns:
true if the data provider supports removing rows, or false if not.
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException). A DPE may also indicate that this RowKey does not represent a row provided by this TableDataProvider. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.
See Also:
TableDataProvider.removeRow(RowKey)

getRowCount

public int getRowCount()
                throws DataProviderException

Specified by:
getRowCount in interface TableDataProvider
Specified by:
getRowCount in class AbstractTableDataProvider
Returns:
the number of rows represented by this TableDataProvider if this information is available; otherwise, return -1 (indicating unknown row count)
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning -1. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

getValue

public java.lang.Object getValue(FieldKey fieldKey,
                                 RowKey row)
                          throws DataProviderException

Return value of the data element referenced by the specified FieldKey and RowKey.

Specified by:
getValue in interface TableDataProvider
Specified by:
getValue in class AbstractTableDataProvider
Parameters:
fieldKey - FieldKey identifying the data element whose value is to be returned
row - RowKey identifying the data row whose value is to be returned
Returns:
value of the data element referenced by the specified FieldKey and RowKey
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning null. A DPE may also indicate that this FieldKey or RowKey does not represent a data element provided by this TableDataProvider. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

insertRow

public RowKey insertRow(RowKey beforeRow)
                 throws DataProviderException

Inserts a new row at the specified row.

NOTE: The method should only be called after testing the canInsertRow(RowKey beforeRow) to see if this TableDataProvider supports resizing.

Specified by:
insertRow in interface TableDataProvider
Specified by:
insertRow in class AbstractTableDataProvider
Parameters:
beforeRow - The desired location to insert the new row in front of
Returns:
A RowKey representing the address of the newly inserted row
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException). A DPE may also indicate that this RowKey does not represent a row provided by this TableDataProvider. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.
See Also:
TableDataProvider.canInsertRow(RowKey)

isReadOnly

public boolean isReadOnly(FieldKey fieldKey)
                   throws DataProviderException

Return a flag indicating whether the value of the data element represented by the specified FieldKey can be modified via the setValue() method.

Specified by:
isReadOnly in interface DataProvider
Specified by:
isReadOnly in class AbstractTableDataProvider
Parameters:
fieldKey - FieldKey identifying the data element whose settable status is to be returned
Returns:
a flag indicating whether the value of the data element represented by the specified FieldKey can be modified via the setValue() method
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning true. A DPE may also indicate that the passed fieldKey is not valid. Consult the documentation of the specific DataProvider implementation for details on what exceptions might be wrapped by a DPE.

isRowAvailable

public boolean isRowAvailable(RowKey row)
                       throws DataProviderException
Returns true if the specified RowKey represents data elements that are supported by this TableDataProvider; otherwise, return false

Specified by:
isRowAvailable in interface TableDataProvider
Overrides:
isRowAvailable in class AbstractTableDataProvider
Parameters:
row - RowKey specifying row to be tested
Returns:
true if the row is available, false if not
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException) rather than simply returning false. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

removeRow

public void removeRow(RowKey row)
               throws DataProviderException

Removes the specified row.

NOTE: The method should only be called after testing the canRemoveRow(RowKey) method to see if this TableDataProvider supports removing rows.

Specified by:
removeRow in interface TableDataProvider
Specified by:
removeRow in class AbstractTableDataProvider
Parameters:
row - The desired row key to remove
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException). A DPE may also indicate that this RowKey does not represent a row provided by this TableDataProvider. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.
See Also:
TableDataProvider.canRemoveRow(RowKey)

setValue

public void setValue(FieldKey fieldKey,
                     RowKey row,
                     java.lang.Object value)
              throws DataProviderException

Sets the value of the data element represented by the specified FieldKey and RowKey to the specified new value.

Specified by:
setValue in interface TableDataProvider
Specified by:
setValue in class AbstractTableDataProvider
Parameters:
fieldKey - FieldKey identifying the data element whose value is to be modified
row - RowKey indentifying the data row whose value is to be modified
value - New value for this data element
Throws:
DataProviderException - Implementations may wish to surface internal exceptions (nested in DataProviderException). A DPE may also indicate that this FieldKey or RowKey does not represent a data element provided by this TableDataProvider. Consult the documentation of the specific TableDataProvider implementation for details on what exceptions might be wrapped by a DPE.

addRefreshableDataListener

public void addRefreshableDataListener(RefreshableDataListener listener)

Register a new RefreshableDataListener to this RefreshableDataProvider instance.

Specified by:
addRefreshableDataListener in interface RefreshableDataProvider
Parameters:
listener - New RefreshableDataListener to register

removeRefreshableDataListener

public void removeRefreshableDataListener(RefreshableDataListener listener)

Deregister an existing RefreshableDataListener from RefreshableDataProvider instance.

Specified by:
removeRefreshableDataListener in interface RefreshableDataProvider
Parameters:
listener - Old RefreshableDataListener to remove

getRefreshableDataListeners

public RefreshableDataListener[] getRefreshableDataListeners()

Specified by:
getRefreshableDataListeners in interface RefreshableDataProvider
Returns:
An array of the RefreshableDataListeners currently registered on this RefreshableDataProvider. If there are no registered listeners, a zero-length array is returned.

refresh

public void refresh()
             throws DataProviderException

Cause a re-fetch of whatever data this DataProvider is representing from the underlying source. This may result in a JDBC call, or an EJB or web service method invocation, etc. Any cached changes in the DataProvider will be lost.

Specified by:
refresh in interface RefreshableDataProvider
Throws:
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.

commitChanges

public 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.

Specified by:
commitChanges in interface TransactionalDataProvider
Throws:
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.

revertChanges

public 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.

Specified by:
revertChanges in interface TransactionalDataProvider
Throws:
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.

addTransactionalDataListener

public void addTransactionalDataListener(TransactionalDataListener listener)

Register a new TransactionalDataListener to this TransactionalDataProvider instance.

Specified by:
addTransactionalDataListener in interface TransactionalDataProvider
Parameters:
listener - New TransactionalDataListener to register

removeTransactionalDataListener

public void removeTransactionalDataListener(TransactionalDataListener listener)

Deregister an existing TransactionalDataListener from TransactionalDataProvider instance.

Specified by:
removeTransactionalDataListener in interface TransactionalDataProvider
Parameters:
listener - Old TransactionalDataListener to remove

getTransactionalDataListeners

public TransactionalDataListener[] getTransactionalDataListeners()

Specified by:
getTransactionalDataListeners in interface TransactionalDataProvider
Returns:
An array of the TransactionalDataListeners currently registered on this TransactionalDataProvider. If there are no registered listeners, a zero-length array is returned.

checkExecute

protected void checkExecute()
                     throws java.sql.SQLException

Check if rowset, if so, execute if necessary.

Throws:
java.sql.SQLException

fireChangesCommitted

protected void fireChangesCommitted()

Fires a changesCommtted event to each registered TransactionalDataListener.


fireChangesReverted

protected void fireChangesReverted()

Fires a changesReverted event to each registered TransactionalDataListener.