getMethodInterceptors method

  1. @override
List<MethodInterceptor> getMethodInterceptors()
override

Retrieves the list of method interceptors to be applied by this dispatcher.

Concrete implementations must provide the list of interceptors that should be considered for method interception. The interceptors are evaluated in the order they are returned, and each interceptor's canIntercept method is called to determine if it should apply to the current method invocation.

Example Implementation

class MyDispatcher extends AbstractMethodDispatcher {
  final List<MethodInterceptor> _interceptors;

  MyDispatcher(this._interceptors);

  @override
  List<MethodInterceptor> getMethodInterceptors() {
    return _interceptors;
  }
}

@return The list of MethodInterceptor instances to apply.

Implementation

@override
List<MethodInterceptor> getMethodInterceptors() {
  // Use dependency graph sorting (topological)
  final sorted = _sortInterceptorsByRelations();
  return List.unmodifiable(sorted);
}