|
Re: @InjectLink [message #1821061 is a reply to message #1820538] |
Tue, 04 February 2020 23:08  |
Eclipse User |
|
|
|
Hi Gennadii,
It appears to me that the example above is from here:
https://docs.huihoo.com/jersey/2.13/declarative-linking.html
In the docs above, there is this:
12.7. Configure and register
In order to add the Declarative Linking feature register DeclarativeLinkingFeature
Example 12.1. Creating JAX-RS application with Declarative Linking feature enabled.
// Create JAX-RS application.
final Application application = new ResourceConfig()
.packages("org.glassfish.jersey.examples.linking")
.register(DeclarativeLinkingFeature.class);
[Scott] From the above, it looks as if it's necessary to register the DeclarativeLinkingFeature to activate this function of Jersey.
With ECF remote services, much of this configuration of Jersey is done automatically within the remote services exporter (i.e. the Jersey server distribution provider).
The parent project for both the Jersey and CXF distribution providers are here:
https://github.com/ECF/JaxRSProviders
This is the project for the Jersey server distribution provider:
https://github.com/ECF/JaxRSProviders/tree/master/bundles/org.eclipse.ecf.provider.jersey.server
Essentially what's needed for the ECF jersey server distribution to support DeclarativeLinkingFeature is to register that feature at runtime
For example, in this file is a method: createConfigurable()
https://github.com/ECF/JaxRSProviders/blob/master/bundles/org.eclipse.ecf.provider.jersey.server/src/org/eclipse/ecf/provider/jersey/server/JerseyServerDistributionProvider.java#L71
protected Configurable createConfigurable() {
return new ResourceConfig();
}
This method could be enhanced to registre the DeclarativeLinkingFeature like this:
protected Configurable createConfigurable() {
return new ResourceConfig().register(DeclarativeLinkingFeature.class);
}
Currently, however, the distribution provider does not include the Jersey bundle that has the DeclarativeLinkingFeature classes.. That bundle is at maven central:
https://search.maven.org/artifact/org.glassfish.jersey.ext/jersey-declarative-linking/2.29.1/jar
But this jersey extension library/bundle is currently *not* included in the ECF jersey server distribution provider as of this released version:
https://github.com/ECF/JaxRSProviders/releases/tag/1.12.0
I would consider adding support for the DeclarativeLinkingFeature (and perhaps others if desired), but might not be able to happen immediately.
If you would like work on this yourself or request that I put support for DeclarativeLinkingFeature in the ECF jersey server distribution provider, please open an issue here:
https://github.com/ECF/JaxRSProviders/issues
or contact me directly at scottlsewis at gmail.com and reference this forum entry directly.
Thanks,
Scott
|
|
|
Powered by
FUDForum. Page generated in 0.03570 seconds