Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jaxrs-dev] Clarification regarding Application subclass instantiation

On Sat, Feb 23, 2019 at 10:57 PM Markus KARG <markus@xxxxxxxxxxxxxxx> wrote:

No, "product" IS Jersey, CXF, RESTeasy. It is definitively NOT the same thing as "application author". That would really be extraordinarily strange.

>Yes, that would be strange.  OK, so we know what "product" is not. So you're absolutely sure that in the following paragraph: "In a product that supports CDI, implementations MUST support the use of CDI-style Beans as root resource classes, providers and Application subclasses." …"product" means Jersey (for example) and "implementation" means…what, exactly?

 

The specification uses the words "Implementations" and "Products" differently. "Implementations" of the API means "CXF, Jersey, RESTEasy, …" while "Products" mean "GlassFish, Payara, WebSphere, …".

 

>And in section 11.2.1 (I picked it kind of arbitrarily) which uses the same sort of language and says in part "in a product that also supports the Servlet specification, implementations MUST support JAX-RS applications that are packaged as a Web application", again, you see "product" as Jersey, and "implementations" as…what, exactly?

 

This line means the application deployer can rely on the fact that his WAR-packaged JAX-RS application will run on Jersey once Jersey is used as part of GlassFish, because GlassFish supports Servlets.

 

>For the record I see this as:

>"product" == Glassfish or some other application server or integration environment inside of which a JAX-RS implementation might find itself

>"implementation" == Jersey or another implementation of the JAX-RS specification

 

Correct.

 

>Then it becomes very clear, and could be rewritten equivalently like this:

>When integrated in Glassfish, or any other product that supports CDI, Jersey or any other JAX-RS implementation MUST support the use of CDI-style Beans as root resource classes, providers and Application subclasses.

 

We cannot rewrite it literally like that because the specification is product- and vendor-neutral. But yes, this is what it means. Note that it does not automatically imply anything to the application programmer (he still can decide to NOT use or support CDI), nor that Jersey must support CDI outside of GlassFish.

 

>I base my interpretation on the clear distinction throughout the rest of section 11 between "product" and "implementation". Note that 11.2 says, in part, "this section describes the additional requirements that apply to a JAX-RS implementation when combined in a product that supports the following specifications". How could "product" and "implementation" possibly be synonyms in this sentence? They cannot. Anyway, thanks for your help and alternative interpretation.  I think I've got the answer I needed!

 

As I said, they aren't exactly synonyms. They form the runtime environment. In my previous postings I just wanted to make sure that you see the difference between the restrictions for the runtime environment (Implementation integrated into Product) and the application (custom business code).

 

Best,

Laird


Back to the top