public class CompositeProxyExecutionListener extends Object implements ProxyExecutionListener
ProxyExecutionListeners.| Constructor and Description |
|---|
CompositeProxyExecutionListener(ProxyExecutionListener... listeners) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(ProxyExecutionListener listener)
Add a
ProxyExecutionListener. |
boolean |
addAll(Collection<ProxyExecutionListener> listeners)
Add a list of
ProxyExecutionListener. |
void |
afterMethod(MethodExecutionInfo executionInfo)
Called after every invocation of methods.
|
void |
afterQuery(QueryExecutionInfo execInfo)
Called after executing a query (
Batch.execute() or Statement.execute()). |
void |
beforeMethod(MethodExecutionInfo executionInfo)
Called before every invocation of methods.
|
void |
beforeQuery(QueryExecutionInfo execInfo)
Called before executing a query (
Batch.execute() or Statement.execute()). |
void |
eachQueryResult(QueryExecutionInfo execInfo)
Called on processing each query
Result. |
List<ProxyExecutionListener> |
getListeners()
Get registered listeners.
|
public CompositeProxyExecutionListener(ProxyExecutionListener... listeners)
public void beforeMethod(MethodExecutionInfo executionInfo)
ProxyExecutionListenerbeforeMethod in interface ProxyExecutionListenerexecutionInfo - method execution contextpublic void afterMethod(MethodExecutionInfo executionInfo)
ProxyExecutionListenerafterMethod in interface ProxyExecutionListenerexecutionInfo - method execution contextpublic void beforeQuery(QueryExecutionInfo execInfo)
ProxyExecutionListenerBatch.execute() or Statement.execute()).
Note: this callback is called when the publisher, result of the execute(), is being
subscribed. Not at the time of execute() is called,
beforeQuery in interface ProxyExecutionListenerexecInfo - query execution contextpublic void afterQuery(QueryExecutionInfo execInfo)
ProxyExecutionListenerBatch.execute() or Statement.execute()).
The callback order is:
ProxyExecutionListener.beforeQuery(QueryExecutionInfo)
ProxyExecutionListener.eachQueryResult(QueryExecutionInfo) for 1st result
ProxyExecutionListener.eachQueryResult(QueryExecutionInfo) for 2nd result
ProxyExecutionListener.eachQueryResult(QueryExecutionInfo) for Nth result
ProxyExecutionListener.afterQuery(QueryExecutionInfo)
QueryExecutionInfo.getExecuteDuration() is available in this callback and it holds
the duration since ProxyExecutionListener.beforeQuery(QueryExecutionInfo).
Note: this callback is called when the publisher, result of the execute(), is being
subscribed. Not at the time of execute() is called,
afterQuery in interface ProxyExecutionListenerexecInfo - query execution contextpublic void eachQueryResult(QueryExecutionInfo execInfo)
ProxyExecutionListenerResult.
While processing query results with Result.map(BiFunction), this callback
is called per result.
QueryExecutionInfo.getCurrentMappedResult() contains the mapped result.
eachQueryResult in interface ProxyExecutionListenerexecInfo - query execution contextpublic boolean add(ProxyExecutionListener listener)
ProxyExecutionListener.listener - a listenertrue as specified by List.add(Object)IllegalArgumentException - if listener is nullpublic boolean addAll(Collection<ProxyExecutionListener> listeners)
ProxyExecutionListener.listeners - collection of listenerstrue if this list changed as a result of the callIllegalArgumentException - if listeners is nullpublic List<ProxyExecutionListener> getListeners()
Copyright © 2020. All rights reserved.