[RESTEASY-1533] Public/private module separation#1697
[RESTEASY-1533] Public/private module separation#1697asoldano merged 6 commits intoresteasy:masterfrom
Conversation
|
Module naming is a little bit inconsistent: Jax-rs api doesn't have a suffix (-api), but client api has a suffix (-api). Jax-rs impl has a suffix (-impl), but client impl doesn't have a suffix (-impl). What about make some naming convention, like "resteasy-jaxrs, resteasy-jaxrs-impl, resteasy-client, resteasy-client-impl", or "resteasy-jaxrs-api, resteasy-jaxrs, resteasy-client-api, resteasy-client", or something similar? WDYT? |
|
What about to add more |
|
If you have a time ... you can also check checkstyle, current master should be aligned with this checkstyle.xml: https://issues.jboss.org/browse/RESTEASY-1974?focusedCommentId=13610933&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13610933 |
I've been thinking about this; resteasy-jaxrs is not really an api, though, while resteasy-jaxrs-client-api is.
Otherwise a better naming could be:
... dropping the jaxrs which is kind of assumed. WDYT? |
|
I like naming without jaxrs part a bit more |
|
This restructuring looks good to me. |
438dcc0 to
fa6b021
Compare
|
@marekkopecky I've re-written two commits fixing the resteasy-jaxrs and resteasy-jaxrs-client-api modules according to the checkstyle. |
|
There's a lot to absorb. Now THIS is "epic". ;-) One point, for now: Seeing org.jboss.resteasy.plugins.providers.validation in public was a little jarring, and I think it can be done away with. As for ConstraintTypeUtil and ConstraintTypeUtil11, once upon a time there were two versions of the Resteasy validation layer, resteasy-validator-provider-11 for Hibernate Validator 5 (Bean Validation 1.1) and another one for Hibernate Validator 4 (Bean Validation 1.0). That's why there were two versions of ConstraintTypeUtil. Now that the BV 1.0 module is gone, I think it would be safe to move ConstraintTypeUtil and ConstraintTypeUtil11 to the resteasy-validator-provider-11 module. Also, it looks like ViolationsContainer, which is used only by two org.jboss.resteasy.api.validation.ResteasyViolationException (resteasy-jaxrs) constructors, can be removed since those constructors are no longer called. Alessio, I can make these changes in a separate pull request, or you can just make them here. -Ron |
|
@ronsigal thanks Ron, I agree on your proposals. I'm basically off for today, so if you still have some time, feel free to create a commit on top of mine and I'll cherry-pick it here. Otherwise we can work on this next week. |
|
@asoldano, I've created #1698 with the validation changes. The reason there are validation classes in resteasy-jaxrs was, as I mentioned before, that there used to be two different implementations of validation. I was thinking of moving everything into resteasy-validator-provider-11, but I see that there is now CDI 2.0. I guess, in principle, that we could have a new validation module based on CDI 2.0, so maybe it makes sense to leave things spread out, with API and SPI classes in resteasy-jaxrs. -Ron |
|
Thanks @ronsigal , I've cherry-picked the last commit from your PR 👍 |
|
I check quickstarts and grep TS logs for "Deployment * is using a private module". I don't find anything relevant, just this one: But this message is printed in current master as well, so it is not relevant with current PR. |
|
I've added another commit that moves the contextual data management out of the ResteasyProviderFactory (almost all static methods except for the get/newInstance) to a dedicated ResteasyContext class, out of the SPI. That also allows removing the ThreadLocalStack class from the SPI too. Perhaps there's much that could now be turned into "private" in the ResteasyProviderFactory interface and move out of the SPI... |
|
@marekkopecky , do you know/have you checked if that warning is printed only when the module dependency is explicitly set by the user? (versus automatically added by wildfly jaxrs integration) |
|
Having heard no further opinions on the module naming topic, I've renamed resteasy-jaxrs -> resteasy-core-spi, resteasy-jaxrs-impl -> resteasy-core, resteasy-jaxrs-client-api -> resteasy-client-api. At this point, I'm planning to leave this PR here for review for a couple of days, so that it can be reviewed, please let me know. |
…on resteasy internals when not needed
…ernal classes to new resteasy-jaxrs-impl module; initial revisit of other module's visibility
… new resteasy-jaxrs-client-api module
Refactor validation, separating API, SPI, and implementation.
…derFactory to ResteasyContext; moved ThreadLocalStack back to impl
619dd2e to
5defafd
Compare
|
Rebased to fix conflicts.. |
…jaxrs-impl -> resteasy-core, resteasy-jaxrs-client-api -> resteasy-client-api
5defafd to
27dbfd6
Compare
|
@asoldano warning is printed only when some class from private module is used in deployment code ... |
This PR provides a proposal for defining a public spi for the current resteasy-jaxrs and resteasy-client modules. This is a requirement for clearly stating what we guarantee to be stable and only possibly changing in major releases, versus what might changes in minor and micros too. Proper user expectations, easier project evolution and maintenance.
resteasy-jaxrs
This is now split into resteasy-jaxrs and resteasy-jaxrs-impl. The former includes the following packages:
The latter includes:
resteasy-client
This is now split into resteasy-client and resteasy-jaxrs-client-api . The latter only includes the following classes that are used for configuring the RESTEasy client additions:
JBoss Modules
There's a new org.jboss.resteasy.resteasy-jaxrs-public module including resteasy-jaxrs and resteasy-jaxrs-client-api. The already existing org.jboss.resteasy.resteasy-jaxrs as well as all other org.jboss.resteasy.* modules should become private.
Non backward compatible changes
Clearly, the refactoring comes with some unavoidable class moves and changes that imply breaking backward comaptibility (this is the reason why this only fits master). I tried to avoid breaking anything as much as possible, but sometimes there's no way (we also have to avoid splitting packages because of JDK 9 changes).