mercredi 1 juillet 2015

Jackson serialiser & jee/jax-rs : add mixin on startup

For extensibility purposes i'm searching how to add mixin on startup of my application (jee).

I tried almost everything i could find : - @Startup from ejb and try to get from the CDI the Jax-rs Providers or JacksonJaxRsProvider : NPE - From a servlet context listener i don't know how to get the Jax-RS providers. - I tried to inherit the JacksonJaxbJsonProvider and put the same annotation, i just got ignored.

I'm on a JBOSS with 2 ear apps.

I have currently two app : one is same as the other with new feature in (extend one entity and extend one service) for a demo of the extensibility of my code.

The only things that is keep in the war (meaning the 2nd EAR that extend some functionnality of the 1st) is : - the @ApplicationContext which have to return all controller class handle by each of them (even if the 2nd app use the same as the 1st since it's based in). - that piece of code that i want to make work

It is very important that i can do that, my goal is not to build an app but a product which i can extend without having to edit core classes.

PS : one important point : even thought my 2 web application are not in the same EAR, i have to be able to apply MixIn for the 1st and MixIn for the 2nd

My 1st goal would be to be able to be sure how i can do it. After that when i'll have some time, instead of writing each time one startup class that do the mixin, i'd like generate the code using annotation on my entity and annotation processor.

Anyone have some hints ?

Aucun commentaire:

Enregistrer un commentaire