You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2020/01/10 14:50:15 UTC

[isis] branch master updated: ISIS-2158: adding comments

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new ba33cc2  ISIS-2158: adding comments
ba33cc2 is described below

commit ba33cc2d456255173c558df0ad9058f5e9522bfc
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Jan 10 15:50:08 2020 +0100

    ISIS-2158: adding comments
---
 .../jaxrsresteasy4/webmodule/WebModuleJaxrsResteasy4.java     | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/core/viewers/restfulobjects/jaxrs-resteasy-4/src/main/java/org/apache/isis/viewer/restfulobjects/jaxrsresteasy4/webmodule/WebModuleJaxrsResteasy4.java b/core/viewers/restfulobjects/jaxrs-resteasy-4/src/main/java/org/apache/isis/viewer/restfulobjects/jaxrsresteasy4/webmodule/WebModuleJaxrsResteasy4.java
index 0b15dcd..7e3c2b0 100644
--- a/core/viewers/restfulobjects/jaxrs-resteasy-4/src/main/java/org/apache/isis/viewer/restfulobjects/jaxrsresteasy4/webmodule/WebModuleJaxrsResteasy4.java
+++ b/core/viewers/restfulobjects/jaxrs-resteasy-4/src/main/java/org/apache/isis/viewer/restfulobjects/jaxrsresteasy4/webmodule/WebModuleJaxrsResteasy4.java
@@ -46,6 +46,13 @@ import lombok.Getter;
  * WebModule that provides the RestfulObjects Viewer.
  * 
  * @since 2.0
+ * 
+ * @implNote CDI feels responsible to resolve injection points for any Servlet or Filter 
+ * we register programmatically on the ServletContext. 
+ * As long as injection points are considered to be resolved by Spring, we can workaround this fact:
+ * By replacing annotations {@code @Inject} with {@code @Autowire} for any Servlet or Filter,
+ * that get contributed by a WebModule, these will be ignored by CDI.
+ * 
  */
 @Service
 @Named("isisRoViewer.WebModuleJaxrsRestEasy4")
@@ -77,6 +84,8 @@ public final class WebModuleJaxrsResteasy4 extends WebModuleAbstract {
     @Override
     public void prepare(WebModuleContext ctx) {
         
+        // forces RuntimeDelegate.getInstance() to be provided by RestEasy
+        // (and not by eg. the JEE container if any)
         ResteasyProviderFactory.setInstance(new ResteasyProviderFactoryImpl());
         
         super.prepare(ctx);
@@ -92,8 +101,6 @@ public final class WebModuleJaxrsResteasy4 extends WebModuleAbstract {
     @Override
     public Can<ServletContextListener> init(ServletContext ctx) throws ServletException {
 
-        ResteasyProviderFactory.setInstance(new ResteasyProviderFactoryImpl());
-        
         registerFilter(ctx, ISIS_SESSION_FILTER_FOR_RESTFUL_OBJECTS, IsisRestfulObjectsSessionFilter.class)
                 .ifPresent(filterReg -> {
                     // this is mapped to the entire application;