Package org.firebirdsql.gds.ng.listeners
Class StatementListenerDispatcher
- java.lang.Object
-
- org.firebirdsql.gds.ng.listeners.AbstractListenerDispatcher<StatementListener>
-
- org.firebirdsql.gds.ng.listeners.StatementListenerDispatcher
-
- All Implemented Interfaces:
java.lang.Iterable<StatementListener>,StatementListener
public final class StatementListenerDispatcher extends AbstractListenerDispatcher<StatementListener> implements StatementListener
Dispatcher to maintain and notify otherStatementListener.- Since:
- 3.0
- Author:
- Mark Rotteveel
-
-
Constructor Summary
Constructors Constructor Description StatementListenerDispatcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterLast(FbStatement sender)Method to be notified when the cursor of a statement is positioned after the last row.voidbeforeFirst(FbStatement sender)Method to be notified when the cursor of a statement is positioned before the first row.protected voidlogError(java.lang.String message, java.lang.Throwable throwable)voidreceivedRow(FbStatement sender, RowValue rowValue)Method to be notified of a new row of data.voidsqlCounts(FbStatement sender, SqlCountHolder sqlCounts)Called when the SQL counts of a statement have been retrieved.voidstatementExecuted(FbStatement sender, boolean hasResultSet, boolean hasSingletonResult)Method to be notified when a statement has been executed.voidstatementStateChanged(FbStatement sender, StatementState newState, StatementState previousState)Method to be notified when the state of a statement has changed.voidwarningReceived(FbStatement sender, java.sql.SQLWarning warning)Called when a warning was received for thesenderstatement.-
Methods inherited from class org.firebirdsql.gds.ng.listeners.AbstractListenerDispatcher
addListener, addWeakListener, isShutdown, iterator, notify, removeAllListeners, removeListener, shutdown
-
-
-
-
Method Detail
-
receivedRow
public void receivedRow(FbStatement sender, RowValue rowValue)
Description copied from interface:StatementListenerMethod to be notified of a new row of data.Listeners that process
StatementListener.beforeFirst(FbStatement)and/orStatementListener.afterLast(FbStatement)should consider calls to this method to clear the before-first or after-last state to an- in-cursor
state.- Specified by:
receivedRowin interfaceStatementListener- Parameters:
sender- TheFbStatementthat called this method.rowValue- The row values.
-
beforeFirst
public void beforeFirst(FbStatement sender)
Description copied from interface:StatementListenerMethod to be notified when the cursor of a statement is positioned before the first row.When server-side scrolling is used, this method can be called multiple times during the lifetime of a single open cursor. This method may be called even if the cursor is already before-first.
- Specified by:
beforeFirstin interfaceStatementListener- Parameters:
sender- TheFbStatementthat called this method.- See Also:
StatementListener.statementExecuted(FbStatement, boolean, boolean),StatementListener.receivedRow(FbStatement, RowValue),StatementListener.afterLast(FbStatement)
-
afterLast
public void afterLast(FbStatement sender)
Description copied from interface:StatementListenerMethod to be notified when the cursor of a statement is positioned after the last row.When server-side scrolling is used, this method might be called multiple times during the lifetime of a single open cursor. This method may be called even if the cursor is already after-last.
- Specified by:
afterLastin interfaceStatementListener- Parameters:
sender- TheFbStatementthat called this method.- See Also:
StatementListener.statementExecuted(FbStatement, boolean, boolean),StatementListener.receivedRow(FbStatement, RowValue),StatementListener.beforeFirst(FbStatement)
-
statementExecuted
public void statementExecuted(FbStatement sender, boolean hasResultSet, boolean hasSingletonResult)
Description copied from interface:StatementListenerMethod to be notified when a statement has been executed.This event with
hasResultSet=truecan be seen as a counterpart ofStatementListener.afterLast(FbStatement).- Specified by:
statementExecutedin interfaceStatementListener- Parameters:
sender- TheFbStatementthat called this method.hasResultSet-truethere is a result set,falsethere is no result sethasSingletonResult-truesingleton result,falsestatement will produce indeterminate number of rows; can be ignored whenhasResultSetisfalse.
-
statementStateChanged
public void statementStateChanged(FbStatement sender, StatementState newState, StatementState previousState)
Description copied from interface:StatementListenerMethod to be notified when the state of a statement has changed.- Specified by:
statementStateChangedin interfaceStatementListener- Parameters:
sender- TheFbStatementthat called this method.newState- The new state of the statementpreviousState- The old state of the statement
-
warningReceived
public void warningReceived(FbStatement sender, java.sql.SQLWarning warning)
Description copied from interface:StatementListenerCalled when a warning was received for thesenderstatement.- Specified by:
warningReceivedin interfaceStatementListener- Parameters:
sender- Statement receiving the warningwarning- Warning
-
sqlCounts
public void sqlCounts(FbStatement sender, SqlCountHolder sqlCounts)
Description copied from interface:StatementListenerCalled when the SQL counts of a statement have been retrieved.- Specified by:
sqlCountsin interfaceStatementListener- Parameters:
sender- Statement that called this methodsqlCounts- SQL counts
-
logError
protected void logError(java.lang.String message, java.lang.Throwable throwable)- Specified by:
logErrorin classAbstractListenerDispatcher<StatementListener>
-
-