FasterXML / jackson-modules-base

Uber-project for foundational modules of Jackson that build directly on core components but nothing else; not including data format or datatype modules
Apache License 2.0
167 stars 77 forks source link

Guice Interceptors (AOP) are not activated when attached to ObjectMapper based instances #1

Open cowtowncoder opened 8 years ago

cowtowncoder commented 8 years ago

(note: moved from https://github.com/FasterXML/jackson-module-guice/issues/4)

In a Guice Injector, I tried to chain the Jackson Module Guice's ObjectMapperModule with a regular Guice Module having regular bindings (using: binder.bind()). Instance retrieval from the Guice Injector works very well, both directly from the Guice Injector and indirectly through Jackson Module Guice's ObjectMapper.

Additionally, I tried to add a new Guice Module to the chain of Guice Modules with inside a custom Guice Interceptor (using: binder.bindInterceptor).

Instances retrieved directly from the Guice Injector show that they are instantiated from classes like: $$EnhancerByGuice$$25c21b02. These instances work with the Guice Interceptor as expected; method calls get redirected the Interceptor when the annotated methods get invoked.

However, instances retrieved indirectly from the Guice Injector through the ObjectMapper first show that they are instantiated from the original class names like: (no enhancements). Additionally, no interception (redirection) is executed on these instances when annotated methods are invoked.

Am I missing something here?

johnoliver commented 8 years ago

I am also having this same issue, are interceptors possible with Jackson Module Guice?

cowtowncoder commented 8 years ago

I don't know enough to answer (I did not implement the module). Mailing list (jackson-users) might have devs who could help.

mkjois commented 7 years ago

@cowtowncoder Is this still an issue? Asking proactively before I use the module

cowtowncoder commented 7 years ago

@mkjois No updates here so I don't think anything has changed.