AOP report

Guice AOP report shows all registered aop handlers and how (what order) they apply to gucie beans.


Example output:

    2 AOP handlers declared
    ├── AopModule/Interceptor1                                                    at
    └── AopModule/Interceptor2                                                    at

    1 bindings affected by AOP
    └── Service    (r.v.d.g.d.r.g.s.AopModule)
        ├── something()                                                       Interceptor1
        └── somethingElse(List)                                               Interceptor1, Interceptor2

This report shows all affected beans with all methods. In real application it may lead to the giant report. In real life it would be more suitable to always fine-tune report as a tool.


If you're using kotlin, keep in mind that it makes methods final by default so guice will not be able to apply aop. The workaround is to put open keyword before method.



Report is intended to be used as a tool in order to reveal aop on exact bean or even method (or showing appliances of exact handler).

Partial aop map activation:

.printGuiceAopMap(new GuiceAopConfig()

Where usual guice matchers used for type and method matching.

For example, to see only bindings of exact bean:

.printGuiceAopMap(new GuiceAopConfig()

All methods returning List:

.printGuiceAopMap(new GuiceAopConfig()

All appliances of exact interceptor:

.printGuiceAopMap(new GuiceAopConfig()


In the last case still all handlers applied to filtered methods will be shown (to see overall picture).

Report customization

Report is implemented as guicey event listener so you can register it directly in your bundle if required (without main bundle shortcuts):

listen(new GuiceAopDiagnostic(new GuiceAopConfig()));

Report rendering logic may also be used directly as report provide separate renderer object implementing ReportRenderer. Renderer not bound to guice context and assume direct instantiation.

For examples of direct renderer usage see events implementation:

  • InjectorPhaseEvent.ReportRenderer