Package uk.gov.gchq.gaffer.graph.hook
Class Log4jLogger
- java.lang.Object
-
- uk.gov.gchq.gaffer.graph.hook.Log4jLogger
-
-
Constructor Summary
Constructors Constructor Description Log4jLogger()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
onFailure(T result, OperationChain<?> opChain, Context context, Exception e)
Called fromGraph
if an error occurs whilst executing theOperationChain
.<T> T
postExecute(T result, OperationChain<?> operationChain, Context context)
Called fromGraph
after anOperationChain
is executed.void
preExecute(OperationChain<?> opChain, Context context)
Logs the operation chain and the user id.
-
-
-
Method Detail
-
preExecute
public void preExecute(OperationChain<?> opChain, Context context)
Logs the operation chain and the user id.- Specified by:
preExecute
in interfaceGraphHook
- Parameters:
opChain
- the operation chain being executedcontext
- the Context executing the operation chain
-
postExecute
public <T> T postExecute(T result, OperationChain<?> operationChain, Context context)
Description copied from interface:GraphHook
Called fromGraph
after anOperationChain
is executed.- Specified by:
postExecute
in interfaceGraphHook
- Type Parameters:
T
- the result type- Parameters:
result
- the result from the operation chainoperationChain
- theOperationChain
that was executed. This can be modified/optimised in any GraphHook.context
- theContext
in which the operation chain was executed. The context also holds a reference to the original operation chain.- Returns:
- result object
-
onFailure
public <T> T onFailure(T result, OperationChain<?> opChain, Context context, Exception e)
Description copied from interface:GraphHook
Called fromGraph
if an error occurs whilst executing theOperationChain
.- Specified by:
onFailure
in interfaceGraphHook
- Type Parameters:
T
- the result type- Parameters:
result
- the result from the operation chain - likely to be null.opChain
- theOperationChain
that was executed. This can be modified/optimised in any GraphHook.context
- theContext
in which the operation chain was executed. The context also holds a reference to the original operation chain.e
- the exception- Returns:
- result object
-
-