Package org.rapidcontext.core.proc
Class Interceptor
java.lang.Object
org.rapidcontext.core.proc.Interceptor
- Direct Known Subclasses:
DefaultInterceptor
,JsCompileInterceptor
A procedure call interceptor. This is an abstract class that
allows subclasses to override, monitor or extend any resource
reservation or procedure call in the library. Interceptors are
chained together, and by default each interceptor delegates calls
to its parent interceptor. A default interceptor is available
that provides a standard implementation for all methods
(necessary since it is the last link in the interceptor chain).
- Version:
- 1.0
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Interceptor
(Interceptor parent) Creates a new interceptor and links it to the specified parent interceptor. -
Method Summary
Modifier and TypeMethodDescriptioncall
(CallContext cx, Procedure proc, Bindings bindings) Deprecated, for removal: This API element is subject to removal in a future version.Replaced with org.rapidcontext.core.type.Procedure signature.call
(CallContext cx, Procedure proc, Bindings bindings) Calls a procedure with the specified bindings.final Interceptor
Returns the parent interceptor in the interceptor chain.void
releaseAll
(CallContext cx, boolean commit) Releases all reserved adapter connections.void
reserve
(CallContext cx, Procedure proc) Deprecated, for removal: This API element is subject to removal in a future version.Replaced with org.rapidcontext.core.type.Procedure signature.void
reserve
(CallContext cx, Procedure proc) Reserves all adapter connections needed for executing the specified procedure.
-
Constructor Details
-
Interceptor
Creates a new interceptor and links it to the specified parent interceptor.- Parameters:
parent
- the parent interceptor
-
-
Method Details
-
getParent
Returns the parent interceptor in the interceptor chain.- Returns:
- the parent interceptor, or null if no parent is available
-
reserve
@Deprecated(forRemoval=true) public void reserve(CallContext cx, Procedure proc) throws ProcedureException Deprecated, for removal: This API element is subject to removal in a future version.Replaced with org.rapidcontext.core.type.Procedure signature.Reserves all adapter connections needed for executing the specified procedure. All connections needed by imported procedures will also be reserved recursively.- Parameters:
cx
- the procedure contextproc
- the procedure definition- Throws:
ProcedureException
- if the connections couldn't be reserved
-
reserve
Reserves all adapter connections needed for executing the specified procedure. All connections needed by imported procedures will also be reserved recursively.- Parameters:
cx
- the procedure contextproc
- the procedure definition- Throws:
ProcedureException
- if the connections couldn't be reserved
-
releaseAll
Releases all reserved adapter connections. The connections will either be committed or rolled back, depending on the commit flag.- Parameters:
cx
- the procedure contextcommit
- the commit (or rollback) flag
-
call
@Deprecated(forRemoval=true) public Object call(CallContext cx, Procedure proc, Bindings bindings) throws ProcedureException Deprecated, for removal: This API element is subject to removal in a future version.Replaced with org.rapidcontext.core.type.Procedure signature.Calls a procedure with the specified bindings.- Parameters:
cx
- the procedure contextproc
- the procedure definitionbindings
- the procedure bindings- Returns:
- the result of the call, or null if the call produced no result
- Throws:
ProcedureException
- if the call execution caused an error
-
call
Calls a procedure with the specified bindings.- Parameters:
cx
- the procedure contextproc
- the procedure definitionbindings
- the procedure bindings- Returns:
- the result of the call, or null if the call produced no result
- Throws:
ProcedureException
- if the call execution caused an error
-