Package org.rapidcontext.core.proc
Class Interceptor
java.lang.Object
org.rapidcontext.core.proc.Interceptor
- Direct Known Subclasses:
DefaultInterceptor
Deprecated, for removal: This API element is subject to removal in a future version.
Use ReserveInterceptor or CallInterceptor instead.
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).
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInterceptor(Interceptor parent) Deprecated, for removal: This API element is subject to removal in a future version.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.Inherit from CallInterceptor instead.final InterceptorDeprecated, for removal: This API element is subject to removal in a future version.Returns the parent interceptor in the interceptor chain.voidreleaseAll(CallContext cx, boolean commit) Deprecated, for removal: This API element is subject to removal in a future version.Inherit from ReserveInterceptor instead.voidreserve(CallContext cx, Procedure proc) Deprecated, for removal: This API element is subject to removal in a future version.Inherit from ReserveInterceptor instead.
-
Constructor Details
-
Interceptor
Deprecated, for removal: This API element is subject to removal in a future version.Creates a new interceptor and links it to the specified parent interceptor.- Parameters:
parent- the parent interceptor
-
-
Method Details
-
getParent
Deprecated, for removal: This API element is subject to removal in a future version.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.Inherit from ReserveInterceptor instead.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- See Also:
-
releaseAll
Deprecated, for removal: This API element is subject to removal in a future version.Inherit from ReserveInterceptor instead.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- See Also:
-
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.Inherit from CallInterceptor instead.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- See Also:
-