Package org.rapidcontext.core.proc
Class DefaultInterceptor
java.lang.Object
org.rapidcontext.core.proc.Interceptor
org.rapidcontext.core.proc.DefaultInterceptor
The default procedure call interceptor. This interceptor provides
the standard implementation for all methods (necessary since it
is the last link in the interceptor chain). All actual procedure
calls will be delegated to the actual procedure implementation,
and resource reservation will be delegated to the call context.
- Version:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall
(CallContext cx, Procedure proc, Bindings bindings) Calls a procedure with the specified bindings.void
releaseAll
(CallContext cx, boolean commit) Releases all reserved adapter connections.void
reserve
(CallContext cx, Procedure proc) Reserves all adapter connections needed for executing the specified procedure.Methods inherited from class org.rapidcontext.core.proc.Interceptor
call, getParent, reserve
-
Constructor Details
-
DefaultInterceptor
public DefaultInterceptor()Creates a new default interceptor.
-
-
Method Details
-
reserve
Reserves all adapter connections needed for executing the specified procedure. All connections needed by imported procedures will also be reserved recursively.- Overrides:
reserve
in classInterceptor
- 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.- Overrides:
releaseAll
in classInterceptor
- Parameters:
cx
- the procedure contextcommit
- the commit (or rollback) flag
-
call
Calls a procedure with the specified bindings.- Overrides:
call
in classInterceptor
- 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
-