Squarespace/jersey2-guice — pull request #2 by rkapsi (2014-08-12 16:41:17+00:00)
Title: Support for AOP

This change addresses a few different things...

1) It adds the ability to map Guice bindings straight into HK2 and bypass HK2's resolve process if it needs to fall back to Just In Time type -> instance resolving.

2) The ability to do #1 adds also support for AOP. The basic idea (and requirement for Guice+AOP) is to let Guice construct the object for us. The general approach is not much different from how it used to work in Jersey 1.x.

```
// Jersey 1.x
@Override
protected void construct() {
bind(MyResource.class);
bindInterceptor(Matchers.any(), ...);
}
```

```
// Jersey 2.x
@Override
protected void construct() {
GuiceBinding.bind(binder(), MyResource.class);
bindInterceptor(Matchers.any(), ...);
}
```