com.ibm.pdq.runtime.statement
Interface Hook
-
public interface Hook
Provides the ability to provide pre-execution and post-execution methods bracketing the execution of any Data API or annotated method.
An instance of Hook is assigned to an instance of Data at the
creation of the Data instance. This is done by passing the Hook instance as an argument to the getData method of DataFactory that is being called to create the Data
instance.
- See Also:
Data, DataFactory
Method Summary
Method Summary | Return Data Type | Method Name and Description |
void |
post(String methodName, Data dataInstance, Object returnValue, SqlStatementType sqlStatementType, Object... parameters)
When an instance of Hook is assigned, the Hook.post method is called after execution. |
void |
pre(String methodName, Data dataInstance,
SqlStatementType sqlStatementType, Object... parameters)
When an instance of Hook is assigned, the Hook.pre method is called before execution. |
post
void post(String methodName,
Data dataInstance,
Object returnValue,
SqlStatementType sqlStatementType,
Object... parameters)
- When an instance of
Hook is assigned, the Hook.post method is called after execution.
-
- Parameters:
methodName - a String that contains the name of the method after which post is called. This is provided in case the implementation of
post has need of it.
dataInstance - an instance of Data on the same
Connection
returnValue - the value returned by the method after which post is called. This is provided in case the implementation of post has need of
it.
sqlStatementType - the SqlStatementType of the SQL statement to be executed by the method after which post is called. This is provided
in case the implementation of post has need of it.
parameters - the parameters to the method after which post is called. This is provided in case the implementation of post has need of
it.
pre
void pre(String methodName,
Data dataInstance,
SqlStatementType sqlStatementType,
Object... parameters)
- When an instance of
Hook is assigned, the Hook.pre method is called before execution.
-
- Parameters:
methodName - a String that contains the name of the method before which pre is called. This is provided in case the implementation of
pre has need of it.
dataInstance - an instance of Data on the same
Connection
sqlStatementType - the SqlStatementType of the SQL statement to be executed by the method before which pre is called. This is provided
in case the implementation of pre has need of it.
parameters - the parameters to the method before which pre is called. This is provided in case the implementation of pre has need of
it.