Hi Alessio,

sorry for the delayed response. I agree that if some SPI would allow to modify the builders, it should be done before the resource is registered in the resource factory. Do you think such a SPI would be useful for others? I would be happy to contribute some code if it improves portability between RESTEasy and the MVC RI.

Thanks for pointing me to the resteasy-cdi integration. I'll have a deeper look at it in the next days.

Christian

2017-09-21 14:39 GMT+02:00 Alessio Soldano <asoldano@redhat.com>:
Hi Christian,
I could not find something like what you mentioned, in RESTEasy. AFAICS, the registry is meant for adding (registering) / removing resource factories and getting resource invokers. Btw, I suspect it won't be safe to alter a ResourceMethod metadata once it's been added to the registry. If that's really the case, you should probably kick in before a resource (factory) is actually added.
Have you looked at the resteasy-cdi integration btw? I'm wondering if your scenario could be covered by extending the resteasy-cdi integration, considering you said that MVC controllers are CDI-based JAX-RS resources.
Cheers
Alessio

On Wed, Sep 20, 2017 at 6:28 AM, Christian Kaltepoth <christian@kaltepoth.de> wrote:
Hi Alessio,

thanks a lot for your reply. Yes, I saw the ResourceBuilder class and it looks quite interesting. But is there some kind of SPI which allows me to alter the resource model that RESTEasy creates for the discovered resources? Something like:

    public interface ResourceModelPostProcessorPlugin {
        void process( ResourceClassBuilder builder );
    }

Best regards

Christian Kaltepoth


2017-09-19 0:30 GMT+02:00 Alessio Soldano <asoldano@redhat.com>:
Hi Christian,
sorry for the late reply, been on PTO for a couple of weeks.
Have you checked https://github.com/resteasy/Resteasy/blob/master/testsuite/unit-tests/src/test/java/org/jboss/resteasy/test/resource/ProgammaticTest.java#L59 ? (produces(..) method). Is that what you're looking for?
Cheers
Alessio

On Fri, Sep 8, 2017 at 5:47 PM, Christian Kaltepoth <christian@kaltepoth.de> wrote:
Hi,

My name is Christian Kaltepoth and I'm specification lead of JSR 371 (MVC 1.0). As you may know, JSR 371 is about creating an action-based web framework on top of JAX-RS. 

The reference implementation of JSR 371 was previously only targeted to support Jersey. But we want to change that. Therefore, we are currently looking for ways to integrate with other JAX-RS implementations. Unfortunately there are certain features which cannot be implemented using the plain JAX-RS API. That's why we are also looking into using JAX-RS implementation specific SPIs.

One thing we are currently working on is the following requirement: MVC controllers (which are just special CDI-based JAX-RS resources) should be treated as if they are annotated with @Produces("text/html) without the need to add the annotation manually. The current draft of the specification states:

The semantics of controller methods differ slightly from JAX-RS resource methods; [...] Moreover, the default media type for a response is assumed to be text/html , but otherwise can be declared using @Produces just like in JAX-RS.

Jersey provides a special SPI which allows us to hook into the metadata for JAX-RS resources:


Is there anything like that in RESTEasy? I looked into the code but unfortunately didn't find anything like that.


Christian


--

_______________________________________________
resteasy-dev mailing list
resteasy-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/resteasy-dev





--




--
Christian Kaltepoth
Blog: http://blog.kaltepoth.de/
Twitter: http://twitter.com/chkal
GitHub: https://github.com/chkal