Package org.rapidcontext.core.proc
Class CallInterceptor
java.lang.Object
org.rapidcontext.core.storage.StorableObject
org.rapidcontext.core.type.Interceptor
org.rapidcontext.core.proc.CallInterceptor
A procedure call interceptor. Allows overriding, auditing or transforming
results either pre- or post-call.
This class implements a default action if it is the last interceptor in
the chain. Otherwise it forwards the call to the next one. Custom call
interceptors can be created by subclassing this class.
-
Field Summary
Fields inherited from class org.rapidcontext.core.type.Interceptor
KEY_DESCRIPTION, KEY_PRIO, PATHFields inherited from class org.rapidcontext.core.storage.StorableObject
dict, KEY_ACTIVATED_TIME, KEY_CLASSNAME, KEY_ID, KEY_TYPE, PREFIX_COMPUTED, PREFIX_HIDDEN -
Constructor Summary
ConstructorsConstructorDescriptionCallInterceptor(String id, String type, Dict dict) Creates a new call interceptor from a serialized representation. -
Method Summary
Modifier and TypeMethodDescriptioncall(CallContext cx, Procedure proc, Bindings bindings) Calls a procedure with the specified bindings.static CallInterceptorget()Returns the top-level call interceptor.Methods inherited from class org.rapidcontext.core.type.Interceptor
chain, description, get, init, next, next, prio, setNext
-
Constructor Details
-
CallInterceptor
Creates a new call interceptor from a serialized representation.- Parameters:
id- the object identifiertype- the object type namedict- the serialized representation
-
-
Method Details
-
get
Returns the top-level call interceptor.- Returns:
- the call interceptor
-
call
Calls a procedure with the specified bindings.- Parameters:
cx- the procedure contextproc- the procedure definitionbindings- the procedure call bindings- Returns:
- the result of the call, or null if the call produced no result
- Throws:
ProcedureException- if the call execution caused an error
-