|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.access.util.DefaultOperationObserver
public class DefaultOperationObserver
Simple implementation of OperationObserver interface. Useful as a superclass of other implementations of OperationObserver. This implementation only tracks transaction events and exceptions.
This operation observer is unsafe to use in application, since it doesn't rethrow the exceptions immediately, and may cause the database to hang.
Field Summary | |
---|---|
protected List |
globalExceptions
|
protected Map |
queryExceptions
|
Constructor Summary | |
---|---|
DefaultOperationObserver()
|
Method Summary | |
---|---|
List |
getGlobalExceptions()
Returns a list of global exceptions that occured during data operation run. |
Map |
getQueryExceptions()
Returns a list of exceptions that occured during data operation run by query. |
boolean |
hasExceptions()
Returns true if at least one exception was registered during query
execution. |
boolean |
isIteratedResult()
Returns false . |
void |
nextBatchCount(Query query,
int[] resultCount)
Callback method invoked after a batch update is executed. |
void |
nextCount(Query query,
int resultCount)
Callback method invoked after an updating query is executed. |
void |
nextDataRows(Query query,
List dataRows)
Callback method invoked for each processed ResultSet. |
void |
nextDataRows(Query query,
ResultIterator it)
Closes ResultIterator without reading its data. |
void |
nextGeneratedDataRows(Query query,
ResultIterator keysIterator)
Closes ResultIterator without reading its data. |
void |
nextGlobalException(Exception ex)
Callback method invoked on exceptions that are not tied to a specific query execution, such as JDBC connection exceptions, etc. |
void |
nextQueryException(Query query,
Exception ex)
Callback method invoked on exceptions that happen during an execution of a specific query. |
void |
printExceptions(PrintWriter out)
Prints the information about query and global exceptions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected List globalExceptions
protected Map queryExceptions
Constructor Detail |
---|
public DefaultOperationObserver()
Method Detail |
---|
public void printExceptions(PrintWriter out)
public List getGlobalExceptions()
public Map getQueryExceptions()
public boolean hasExceptions()
true
if at least one exception was registered during query
execution.
public void nextCount(Query query, int resultCount)
OperationObserver
nextCount
in interface OperationObserver
public void nextBatchCount(Query query, int[] resultCount)
OperationObserver
nextBatchCount
in interface OperationObserver
public void nextDataRows(Query query, List dataRows)
OperationObserver
nextDataRows
in interface OperationObserver
public void nextDataRows(Query query, ResultIterator it)
nextDataRows
in interface OperationObserver
public void nextGeneratedDataRows(Query query, ResultIterator keysIterator)
nextGeneratedDataRows
in interface OperationObserver
public void nextQueryException(Query query, Exception ex)
OperationObserver
nextQueryException
in interface OperationObserver
public void nextGlobalException(Exception ex)
OperationObserver
nextGlobalException
in interface OperationObserver
public boolean isIteratedResult()
false
.
isIteratedResult
in interface OperationHints
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |