boot_aop 0.2.0+1 copy "boot_aop: ^0.2.0+1" to clipboard
boot_aop: ^0.2.0+1 copied to clipboard

AOP (Aspect-Oriented Programming) support for Boot.

boot_aop #

AOP (Aspect-Oriented Programming) support for the Boot Framework.

Features #

  • @Around — marks an annotation as AOP advice
  • @InterceptorBean — links interceptor to annotation
  • InterceptorChain — chains multiple interceptors
  • InvocationContext — method name, args, target, proceed()

Usage #

@Around()
class Timed { const Timed(); }

@InterceptorBean(Timed)
class TimedInterceptor implements MethodInterceptor {
  dynamic intercept(InvocationContext ctx) {
    final sw = Stopwatch()..start();
    final result = ctx.proceed();
    sw.stop();
    print('${ctx.methodName} took ${sw.elapsedMilliseconds}ms');
    return result;
  }
}
0
likes
150
points
5
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

AOP (Aspect-Oriented Programming) support for Boot.

Repository (GitHub)
View/report issues

Topics

#boot #aop #interceptor #proxy

License

MIT (license)

Dependencies

boot_core

More

Packages that depend on boot_aop