ca.sqlpower.wabit.rs
Class ResultSetProducerSupport

java.lang.Object
  extended by ca.sqlpower.wabit.rs.ResultSetProducerSupport

public class ResultSetProducerSupport
extends java.lang.Object

Convenient implementation support for the ResultSetProducer interface.


Constructor Summary
ResultSetProducerSupport(ResultSetProducer eventSource)
           
 
Method Summary
 void addResultSetListener(ResultSetListener listener)
           
 void fireResultSetEvent(ResultSetAndUpdateCountCollection results)
          Notifies all registered listeners of the new result set.
 long getEventsFired()
          Returns the count of how many times #fireResultSetEvent(ResultSet) has been called.
 void removeResultSetListener(ResultSetListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultSetProducerSupport

public ResultSetProducerSupport(@Nonnull
                                ResultSetProducer eventSource)
Method Detail

addResultSetListener

public void addResultSetListener(@Nonnull
                                 ResultSetListener listener)
See Also:
ResultSetProducer.addResultSetListener(ResultSetListener)

removeResultSetListener

public void removeResultSetListener(ResultSetListener listener)
See Also:
ResultSetProducer.removeResultSetListener(ResultSetListener)

fireResultSetEvent

public void fireResultSetEvent(@Nullable
                               ResultSetAndUpdateCountCollection results)
Notifies all registered listeners of the new result set. The event's source is the ResultSetProducer specified to this instance's constructor.

Calling this method has the side effect of incrementing the eventsFired property by exactly 1.

Parameters:
results - The new result sets. If it is already a CachedRowSet, it will be embedded in the event object as-is; otherwise, it will be copied into a new CachedRowSet. In the latter case, the row cursor of results will have been moved to the afterLast position as a side effect of populating the new CachedRowSet. Furthermore, for the CachedRowSet to populate properly, the row cursor of results should be at the beforeFirst position prior to calling this method.

getEventsFired

public long getEventsFired()
Returns the count of how many times #fireResultSetEvent(ResultSet) has been called.



Copyright © 2009. All Rights Reserved.