Class ReserveInterceptor

Direct Known Subclasses:
JsCompileInterceptor

public class ReserveInterceptor extends Interceptor
A procedure reserve interceptor. Allows overriding, monitoring or extending resource reservation prior to executing procedure calls. This is used e.g. to reserve pooled database connections, check execution permissions or similar. 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 reserve interceptors can be created by subclassing this class.
  • Constructor Details

    • ReserveInterceptor

      public ReserveInterceptor(String id, String type, Dict dict)
      Creates a new reserve interceptor from a serialized representation.
      Parameters:
      id - the object identifier
      type - the object type name
      dict - the serialized representation
  • Method Details

    • get

      public static ReserveInterceptor get()
      Returns the top-level reserve interceptor.
      Returns:
      the call interceptor
    • reserve

      public void reserve(CallContext cx, Procedure proc) throws ProcedureException
      Reserves all resources needed for executing a procedure. All resources needed by sub-procedures will also be reserved.
      Parameters:
      cx - the procedure context
      proc - the procedure definition
      Throws:
      ProcedureException - if some resource 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.
      Parameters:
      cx - the procedure context
      commit - the commit (or rollback) flag