Class DefaultInterceptor

java.lang.Object
org.rapidcontext.core.proc.Interceptor
org.rapidcontext.core.proc.DefaultInterceptor

public class DefaultInterceptor extends Interceptor
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 Details

    • DefaultInterceptor

      public DefaultInterceptor()
      Creates a new default interceptor.
  • Method Details

    • reserve

      public void reserve(CallContext cx, Procedure proc) throws ProcedureException
      Reserves all adapter connections needed for executing the specified procedure. All connections needed by imported procedures will also be reserved recursively.
      Overrides:
      reserve in class Interceptor
      Parameters:
      cx - the procedure context
      proc - the procedure definition
      Throws:
      ProcedureException - if the connections couldn't be reserved
    • releaseAll

      public void releaseAll(CallContext cx, boolean commit)
      Releases all reserved adapter connections. The connections will either be committed or rolled back, depending on the commit flag.
      Overrides:
      releaseAll in class Interceptor
      Parameters:
      cx - the procedure context
      commit - the commit (or rollback) flag
    • call

      public Object call(CallContext cx, Procedure proc, Bindings bindings) throws ProcedureException
      Calls a procedure with the specified bindings.
      Overrides:
      call in class Interceptor
      Parameters:
      cx - the procedure context
      proc - the procedure definition
      bindings - 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