You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2018/01/05 17:48:22 UTC

[isis] branch ISIS-1779-jax-rs-2 updated (83cdd6f -> fd8670e)

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

danhaywood pushed a change to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git.


 discard 83cdd6f  ISIS-1779 Transition to JAX-RS 2.0 Client API removed dependency on deprecated resteasy client api
    omit a22f2dc  Merge branch 'ISIS-1744-update-to-dn-515' into dev/2.0.0-M2
    omit 446d219  ISIS-1744: removes work-around code for prior to DN 5.1.5
    omit 75a0edf  ISIS-1744: updates to DN 5.1.5
    omit f82a68a  ISIS-1767: fixes dependency convergence issue with com.sun.mail
    omit a142e53  Merge branch 'ISIS-1767-jee-7' into dev/2.0.0-M2
    omit 2627bbb  ISIS-1756 remove reflective access to DN's EnhancementHelper since we've got a dedicated method instead
    omit 363639c  ISIS-1756 on shutdown purge any state associated with the current web-app classloader
    omit 6316c7c  ISIS-1755 veto ExceptionRecognizer on CDI scan
    omit b5f2586  ISIS-1754 proper DN class-loading
    omit 223afd7  ISIS-1775 added license
    omit 576ed4a  ISIS-1775 Honor web-app's context path when configuring swagger.
    omit 18e2b24  ISIS-1755 TomEE requires Service Providers to be public classes
    omit 8f06ca4  ISIS-1754 context aware class-loading for Isis
    omit a049ac9  ISIS-1756 utilize IsisWicketApplication's life-cycle instead of providing a life-cycle CDI Bean
    omit 3ef7567  ISIS-1756 prevent SQLException on schema creation if config is missing
    omit 2ec0083  ISIS-1756 - fix typo
    omit 4608ed6  ISIS-1755 JEE 7+ allow coexistence of CDI and Isis' ServiceInjector
    omit 16da8ca  ISIS-1756 JEE 7+ Isis App life-cycling
    omit 53d3d60  ISIS-1767 JEE 7+ added dependency on javaee-api to core/runtime
    omit 060fa6e  Merge branch 'dev/2.0.0/ISIS-1276-dn-5-1' into dev/2.0.0-M2
    omit 92cdd2e  ISIS-1728: uses typesafe queries for helloworld
    omit 40410e7  ISIS-1726: generalizes the logic that searches for @PersistenceCapable entities, to also take into account meta-annotations.
    omit 0dd3173  ISIS-1727: uses lambda in IsisSessionFactoryBuilder
    omit c17a16d  ISIS-1725: requires that an AppManifest is supplied (used to obtain list of entities).
    omit 9c02fe5  ISIS-1724: removes the deprecated IsisJdoSupport in the jdo applib
    omit 4b2b08a  ISIS-1723: removes jdo applib's Auditable interface and @Auditable annotation
    omit 994d824  ISIS-1276: fixes algorithm for lookup of datastore id's, at least
    omit e1c9fa9  ISIS-1276: fixes compile issues in metamodel and runtime
    omit d0945e2  ISIS-1276: updates applib, replaces references of TypesafeQuery to be instead JDOQLTypedQuery
    omit a983f01  ISIS-1276: updates core to compile under JDK 1.8 only
    omit 12b2b35  ISIS-1276: updates references for datanucleus.
     add d727de1  ISIS-1809: adds new implementations of UrlEncodingService
     add e97fa3c  Merge branch 'ISIS-1809-url-encoding-service' into dev/2.0.0-M1
     new 126c8e8  ISIS-1276: updates references for datanucleus.
     new a0da312  ISIS-1276: updates core to compile under JDK 1.8 only
     new b1ff901  ISIS-1276: updates applib, replaces references of TypesafeQuery to be instead JDOQLTypedQuery
     new 14179e1  ISIS-1276: fixes compile issues in metamodel and runtime
     new ed5f61f  ISIS-1276: fixes algorithm for lookup of datastore id's, at least
     new c6be1eb  ISIS-1723: removes jdo applib's Auditable interface and @Auditable annotation
     new 223957e  ISIS-1724: removes the deprecated IsisJdoSupport in the jdo applib
     new 9fafe95  ISIS-1725: requires that an AppManifest is supplied (used to obtain list of entities).
     new 380398c  ISIS-1727: uses lambda in IsisSessionFactoryBuilder
     new 13c70c2  ISIS-1726: generalizes the logic that searches for @PersistenceCapable entities, to also take into account meta-annotations.
     new fbd8ee1  ISIS-1728: uses typesafe queries for helloworld
     new 0a15e71  Merge branch 'dev/2.0.0/ISIS-1276-dn-5-1' into dev/2.0.0-M2
     new 8674bdb  ISIS-1767 JEE 7+ added dependency on javaee-api to core/runtime
     new 21f780f  ISIS-1756 JEE 7+ Isis App life-cycling
     new 150f7c1  ISIS-1755 JEE 7+ allow coexistence of CDI and Isis' ServiceInjector
     new 4285449  ISIS-1756 - fix typo
     new 9661bc4  ISIS-1756 prevent SQLException on schema creation if config is missing
     new de01fbd  ISIS-1756 utilize IsisWicketApplication's life-cycle instead of providing a life-cycle CDI Bean
     new 2914ee2  ISIS-1754 context aware class-loading for Isis
     new 01f32e4  ISIS-1755 TomEE requires Service Providers to be public classes
     new 2bbcfbd  ISIS-1775 Honor web-app's context path when configuring swagger.
     new 80a977f  ISIS-1775 added license
     new 5ea0f0c  ISIS-1754 proper DN class-loading
     new 237ef69  ISIS-1755 veto ExceptionRecognizer on CDI scan
     new 549bb71  ISIS-1756 on shutdown purge any state associated with the current web-app classloader
     new 32df2f1  ISIS-1756 remove reflective access to DN's EnhancementHelper since we've got a dedicated method instead
     new 8cce64e  Merge branch 'ISIS-1767-jee-7' into dev/2.0.0-M2
     new efff23e  ISIS-1767: fixes dependency convergence issue with com.sun.mail
     new d8709d1  ISIS-1744: updates to DN 5.1.5
     new ad6426f  ISIS-1744: removes work-around code for prior to DN 5.1.5
     new b7497fe  Merge branch 'ISIS-1744-update-to-dn-515' into dev/2.0.0-M2
     new fd8670e  ISIS-1779 Transition to JAX-RS 2.0 Client API removed dependency on deprecated resteasy client api

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (83cdd6f)
            \
             N -- N -- N   refs/heads/ISIS-1779-jax-rs-2 (fd8670e)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 32 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../UrlEncodingServiceUsingBaseEncoding.java       | 10 +++-
 ...aseEncodingWithSupportForLargeUrlsAbstract.java | 69 ++++++++++++++++++++++
 .../UrlEncodingServiceWithCompressionAbstract.java | 66 +++++++++++++++++++++
 ...codingServiceWithCompression_Abstract_Test.java | 35 +++++++++++
 4 files changed, 179 insertions(+), 1 deletion(-)
 create mode 100644 core/applib/src/main/java/org/apache/isis/applib/services/urlencoding/UrlEncodingServiceUsingBaseEncodingWithSupportForLargeUrlsAbstract.java
 create mode 100644 core/applib/src/main/java/org/apache/isis/applib/services/urlencoding/UrlEncodingServiceWithCompressionAbstract.java
 create mode 100644 core/applib/src/test/java/org/apache/isis/applib/services/urlencoding/UrlEncodingServiceWithCompression_Abstract_Test.java

-- 
To stop receiving notification emails like this one, please contact
['"commits@isis.apache.org" <co...@isis.apache.org>'].

[isis] 06/32: ISIS-1723: removes jdo applib's Auditable interface and @Auditable annotation

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit c6be1eb9888c027179430b80ee4f27653d9ba715
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Sep 19 22:43:59 2017 +0100

    ISIS-1723: removes jdo applib's Auditable interface and @Auditable annotation
---
 .../system/persistence/PersistenceSessionFactoryMetamodelRefiner.java    | 1 -
 1 file changed, 1 deletion(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactoryMetamodelRefiner.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactoryMetamodelRefiner.java
index c294447..7534598 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactoryMetamodelRefiner.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactoryMetamodelRefiner.java
@@ -55,7 +55,6 @@ public class PersistenceSessionFactoryMetamodelRefiner implements MetaModelRefin
         // and also MandatoryFacetOnPropertyMandatoryAnnotationFactory
         // and also PropertyAnnotationFactory
         programmingModel.addFactory(new MandatoryFromJdoColumnAnnotationFacetFactory());
-
     }
 
     @Override

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 01/32: ISIS-1276: updates references for datanucleus.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 126c8e8a1b78058c180ef6c0daee107fccd3fe50
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Sep 18 22:13:20 2017 +0100

    ISIS-1276: updates references for datanucleus.
    
    Also updated org.incode:incode-build to 3-SNAPSHOT, and java-mavenmixin-datanucleus to 0.0.5-SNAPSHOT
---
 core/applib/pom.xml                    | 39 ++--------------------------------
 core/pom.xml                           | 19 ++++++++---------
 core/unittestsupport/pom.xml           |  5 ++---
 example/application/helloworld/pom.xml |  4 ++--
 example/application/simpleapp/pom.xml  |  2 +-
 5 files changed, 16 insertions(+), 53 deletions(-)

diff --git a/core/applib/pom.xml b/core/applib/pom.xml
index cea4c42..be3411c 100644
--- a/core/applib/pom.xml
+++ b/core/applib/pom.xml
@@ -51,41 +51,6 @@
                 </excludes>
             </resource>
         </resources>
-        <pluginManagement>
-            <plugins>
-                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
-                <plugin>
-                    <groupId>org.eclipse.m2e</groupId>
-                    <artifactId>lifecycle-mapping</artifactId>
-                    <version>1.0.0</version>
-                    <configuration>
-                        <lifecycleMappingMetadata>
-                            <pluginExecutions>
-                                <pluginExecution>
-                                    <pluginExecutionFilter>
-                                        <groupId>
-                                            org.datanucleus
-                                        </groupId>
-                                        <artifactId>
-                                            datanucleus-maven-plugin
-                                        </artifactId>
-                                        <versionRange>
-                                            [4.0.0-release,)
-                                        </versionRange>
-                                        <goals>
-                                            <goal>enhance</goal>
-                                        </goals>
-                                    </pluginExecutionFilter>
-                                    <action>
-                                        <ignore />
-                                    </action>
-                                </pluginExecution>
-                            </pluginExecutions>
-                        </lifecycleMappingMetadata>
-                    </configuration>
-                </plugin>
-            </plugins>
-        </pluginManagement>
     </build>
 
     <dependencies>
@@ -128,8 +93,8 @@
 
         <!-- DataNucleus' standard JDO support -->
         <dependency>
-            <groupId>javax.jdo</groupId>
-            <artifactId>jdo-api</artifactId>
+            <groupId>org.datanucleus</groupId>
+            <artifactId>javax.jdo</artifactId>
         </dependency>
 
         <!-- DataNucleus' (proprietary) type-safe query support-->
diff --git a/core/pom.xml b/core/pom.xml
index 18a1731a..bb311e5 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -84,14 +84,13 @@
 [6] https://github.com/moment/moment/blob/develop/LICENSE</license.additional-notes>
 
         <!-- Datanucleus Objectstore -->
-        <jdo-api.version>3.1</jdo-api.version>
+        <jdo-api.version>3.2.0-m7</jdo-api.version>
 
-        <datanucleus-core.version>4.1.7</datanucleus-core.version>
-        <datanucleus-api-jdo.version>4.1.1</datanucleus-api-jdo.version>
-        <datanucleus-jdo-query.version>4.0.5</datanucleus-jdo-query.version>
-        <datanucleus-rdbms.version>4.1.9</datanucleus-rdbms.version>
-
-        <datanucleus-jodatime.version>4.1.0-release</datanucleus-jodatime.version>
+        <datanucleus-core.version>5.1.2</datanucleus-core.version>
+        <datanucleus-api-jdo.version>5.1.2</datanucleus-api-jdo.version>
+        <datanucleus-jdo-query.version>5.0.2</datanucleus-jdo-query.version>
+        <datanucleus-rdbms.version>5.1.2</datanucleus-rdbms.version>
+        <datanucleus-jodatime.version>5.1.0-release</datanucleus-jodatime.version>
 	<!--
 	    ISIS-1288: seen integration tests to fail;
 	    domain object date holding 1-Aug-2015 after xactn retrieved as 31-Jul-2015
@@ -100,7 +99,7 @@
 
         <datanucleus-jodatime.version>4.1.1</datanucleus-jodatime.version>
 	-->
-        <datanucleus-maven-plugin.version>4.0.2</datanucleus-maven-plugin.version>
+        <datanucleus-maven-plugin.version>5.0.2</datanucleus-maven-plugin.version>
 
         <shiro.version>1.2.6</shiro.version>
 
@@ -1955,8 +1954,8 @@ ${license.additional-notes}
 
             <!-- DataNucleus -->
             <dependency>
-                <groupId>javax.jdo</groupId>
-                <artifactId>jdo-api</artifactId>
+                <groupId>org.datanucleus</groupId>
+                <artifactId>javax.jdo</artifactId>
                 <version>${jdo-api.version}</version>
             </dependency>
             <dependency>
diff --git a/core/unittestsupport/pom.xml b/core/unittestsupport/pom.xml
index 8d09993..02d8027 100644
--- a/core/unittestsupport/pom.xml
+++ b/core/unittestsupport/pom.xml
@@ -56,9 +56,8 @@
            </dependency>
 
             <dependency>
-                <groupId>javax.jdo</groupId>
-                <artifactId>jdo-api</artifactId>
-                <version>${jdo-api.version}</version>
+                <groupId>org.datanucleus</groupId>
+                <artifactId>javax.jdo</artifactId>
                 <optional>true</optional>
             </dependency>
 
diff --git a/example/application/helloworld/pom.xml b/example/application/helloworld/pom.xml
index e9fd6bb..aee7956 100644
--- a/example/application/helloworld/pom.xml
+++ b/example/application/helloworld/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.incode</groupId>
         <artifactId>incode-build</artifactId>
-        <version>2</version>
+        <version>3-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.isis.example.application</groupId>
@@ -40,7 +40,7 @@
 
         <compiler-plugin.source>1.8</compiler-plugin.source>
         <compiler-plugin.target>1.8</compiler-plugin.target>
-        <compiler-plugin.compilerArgument></compiler-plugin.compilerArgument>
+        <compiler-plugin.compilerArgument>-parameters</compiler-plugin.compilerArgument>
 
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
diff --git a/example/application/simpleapp/pom.xml b/example/application/simpleapp/pom.xml
index 4dd98c6..eb423d2 100644
--- a/example/application/simpleapp/pom.xml
+++ b/example/application/simpleapp/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.incode</groupId>
         <artifactId>incode-build</artifactId>
-        <version>2</version>
+        <version>3-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.isis.example.application</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 23/32: ISIS-1754 proper DN class-loading

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 5ea0f0cab14d74494af125ebfa86b29d2b512412
Author: Andi Huber <ah...@apache.org>
AuthorDate: Wed Nov 22 12:08:32 2017 +0100

    ISIS-1754 proper DN class-loading
---
 .../core/runtime/system/context/IsisContext.java   | 24 ++++++++++++++-----
 .../DataNucleusApplicationComponents.java          | 27 +++++++++++-----------
 .../wicket/viewer/IsisWicketApplication.java       |  2 ++
 3 files changed, 34 insertions(+), 19 deletions(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java
index f26b6d9..9aaf71b 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java
@@ -19,15 +19,14 @@
 
 package org.apache.isis.core.runtime.system.context;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.metamodel.specloader.validator.MetaModelInvalidException;
-import org.apache.isis.core.runtime.system.session.IsisSessionFactoryBuilder;
-import org.apache.log4j.BasicConfigurator;
 import org.apache.isis.core.runtime.system.session.IsisSession;
 import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
+import org.apache.isis.core.runtime.system.session.IsisSessionFactoryBuilder;
+import org.apache.log4j.BasicConfigurator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Simply a static field holding the {@link IsisSessionFactory} singleton, and convenience methods to obtain the
@@ -97,19 +96,31 @@ public final class IsisContext {
 	public static void destroy() {
 		sessionFactory = null;
 		metamodelInvalidException = null;
+		classLoader = null;
 		log.info("destroyed");
 		resetLogging();
 	}
 
 	// -- CLASS LOADING
 
+	private static ClassLoader classLoader;
+	
 	/**
 	 * 
 	 * @return the framework's default class-loader
 	 */
 	public static ClassLoader getClassLoader() {
+		if(classLoader==null) {
+			classLoader = Thread.currentThread().getContextClassLoader();
+		}
+		return classLoader;
 		//TODO requires skinny-war testing on glassfish, payara, wildfly, tomee, ...
-		return Thread.currentThread().getContextClassLoader();
+		//return ClassLoaderProvider.getManagedOrElseDefault();
+				//Thread.currentThread().getContextClassLoader();
+	}
+	
+	public static void setClassLoader(ClassLoader classLoader) {
+		IsisContext.classLoader = classLoader;
 	}
 
 	// -- HELPER
@@ -124,4 +135,5 @@ public final class IsisContext {
 	}
 
 
+
 }
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java
index a68ce06..8fafca8 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java
@@ -25,26 +25,26 @@ import java.util.Set;
 import javax.jdo.JDOHelper;
 import javax.jdo.PersistenceManagerFactory;
 
-import com.google.common.base.Joiner;
-import com.google.common.collect.Maps;
-
-import org.datanucleus.PersistenceNucleusContext;
-import org.datanucleus.PropertyNames;
-import org.datanucleus.api.jdo.JDOPersistenceManagerFactory;
-import org.datanucleus.metadata.MetaDataListener;
-import org.datanucleus.metadata.MetaDataManager;
-import org.datanucleus.store.StoreManager;
-import org.datanucleus.store.schema.SchemaAwareStoreManager;
-
 import org.apache.isis.core.commons.components.ApplicationScopedComponent;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.factory.InstanceUtil;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
+import org.apache.isis.core.runtime.system.context.IsisContext;
 import org.apache.isis.objectstore.jdo.datanucleus.CreateSchemaObjectFromClassMetadata;
 import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPropertiesAware;
 import org.apache.isis.objectstore.jdo.metamodel.facets.object.query.JdoNamedQuery;
 import org.apache.isis.objectstore.jdo.metamodel.facets.object.query.JdoQueryFacet;
+import org.datanucleus.PersistenceNucleusContext;
+import org.datanucleus.PropertyNames;
+import org.datanucleus.api.jdo.JDOPersistenceManagerFactory;
+import org.datanucleus.metadata.MetaDataListener;
+import org.datanucleus.metadata.MetaDataManager;
+import org.datanucleus.store.StoreManager;
+import org.datanucleus.store.schema.SchemaAwareStoreManager;
+
+import com.google.common.base.Joiner;
+import com.google.common.collect.Maps;
 
 public class DataNucleusApplicationComponents implements ApplicationScopedComponent {
 
@@ -148,8 +148,9 @@ public class DataNucleusApplicationComponents implements ApplicationScopedCompon
                 datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_TABLES, "true"); // but have DN do everything else...
                 datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_COLUMNS, "true");
                 datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_CONSTRAINTS, "true");
-
-                persistenceManagerFactory = JDOHelper.getPersistenceManagerFactory(datanucleusProps);
+                
+                persistenceManagerFactory = JDOHelper
+                		.getPersistenceManagerFactory(datanucleusProps,	IsisContext.getClassLoader() );
                 createSchema(persistenceManagerFactory, persistableClassNameSet, datanucleusProps);
 
             } else {
diff --git a/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java b/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
index d15ac12..e09bb6e 100644
--- a/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
+++ b/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
@@ -333,6 +333,8 @@ public class IsisWicketApplication
         List<Future<Object>> futures = null;
         try {
             super.init();
+            
+            IsisContext.setClassLoader(this.getClass().getClassLoader());
 
             futures = startBackgroundInitializationThreads();
 

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 14/32: ISIS-1756 JEE 7+ Isis App life-cycling

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 21f780f59dac8949e81807b5a145bec346ab8e45
Author: Andi Huber <ah...@apache.org>
AuthorDate: Sun Oct 29 09:29:38 2017 +0100

    ISIS-1756 JEE 7+ Isis App life-cycling
---
 .../webapp/jee/IsisDomainAppLifecycleBean.java     |  61 +++++++++++
 .../webapp/jee/PersistenceUnitNoopProvider.java    | 112 +++++++++++++++++++++
 .../src/main/resources/META-INF/persistence.xml    |   8 ++
 3 files changed, 181 insertions(+)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisDomainAppLifecycleBean.java b/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisDomainAppLifecycleBean.java
new file mode 100644
index 0000000..07881e3
--- /dev/null
+++ b/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisDomainAppLifecycleBean.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ **/
+package org.apache.isis.core.webapp.jee;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import javax.enterprise.context.ApplicationScoped;
+
+import org.apache.isis.core.runtime.system.context.IsisContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * 
+ * JEE singleton that hooks into an Isis-Application's life-cycle. 
+ * 
+ * <p>
+ * This CDI managed Bean ensures proper destruction of Isis's context.
+ * </p>
+ * 
+ * @author ahuber@apache.org
+ *
+ */
+@Singleton
+@Startup
+@ApplicationScoped
+public class IsisDomainAppLifecycleBean {
+
+	private static final Logger log = LoggerFactory.getLogger(IsisDomainAppLifecycleBean.class);
+	
+	@PostConstruct
+	public void init() {
+		log.info("initializing ...");
+	}
+	
+	@PreDestroy
+	public void destroy() {
+		IsisContext.destroy();
+		log.info("detroyed.");
+	}
+	
+}
diff --git a/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/PersistenceUnitNoopProvider.java b/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/PersistenceUnitNoopProvider.java
new file mode 100644
index 0000000..3a9bac1
--- /dev/null
+++ b/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/PersistenceUnitNoopProvider.java
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.core.webapp.jee;
+
+import java.util.Map;
+
+import javax.persistence.Cache;
+import javax.persistence.EntityGraph;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.PersistenceUnitUtil;
+import javax.persistence.Query;
+import javax.persistence.SynchronizationType;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.metamodel.Metamodel;
+import javax.persistence.spi.PersistenceUnitInfo;
+import javax.persistence.spi.ProviderUtil;
+import javax.resource.NotSupportedException;
+
+/**
+ * Implements a PersistenceProvider that does nothing.
+ * <p>
+ * Note: the axon framework on JEE requires at least a dummy persistence unit. 
+ * This requires that the {@code web.xml} includes a {@code persistence-context-ref} entry as follows:
+ * 
+ * <pre>{@code
+ * <persistence-context-ref>
+ *     <persistence-context-ref-name>org.axonframework.common.jpa.ContainerManagedEntityManagerProvider/entityManager</persistence-context-ref-name>
+ *     <persistence-unit-name>noop</persistence-unit-name>
+ * </persistence-context-ref>
+ * }
+ * </pre>
+ * </p>
+ * <p>
+ * A {@code META_INF/persistence.xml} that declares the 'noop' persistence-unit 
+ * is bundled with this module. 
+ * </p>
+ * 
+ * @author ahuber@apache.org
+ *
+ */
+@SuppressWarnings("rawtypes") 
+public class PersistenceUnitNoopProvider implements javax.persistence.spi.PersistenceProvider{
+
+	@Override
+	public EntityManagerFactory createEntityManagerFactory(String emName, Map map) {
+		return noopEntityManagerFactory();
+	}
+
+	@Override
+	public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map map) {
+		return noopEntityManagerFactory();
+	}
+
+	@Override
+	public void generateSchema(PersistenceUnitInfo info, Map map) {
+		throw notSupported();	
+	}
+
+	@Override
+	public boolean generateSchema(String persistenceUnitName, Map map) {
+		throw notSupported();
+	}
+
+	@Override
+	public ProviderUtil getProviderUtil() {
+		throw notSupported();
+	}
+
+	// -- HELPER
+
+	private static RuntimeException notSupported() {
+		return new RuntimeException(
+				new NotSupportedException("This PersistenceProvider is just a dummy."));
+	}
+	
+	private EntityManagerFactory noopEntityManagerFactory() {
+		return new EntityManagerFactory() {
+			@Override public EntityManager createEntityManager() {	return null; }
+			@Override public EntityManager createEntityManager(Map map) { return null; }
+			@Override public EntityManager createEntityManager(SynchronizationType synchronizationType) { return null;	}
+			@Override public EntityManager createEntityManager(SynchronizationType synchronizationType, Map map) { return null;	}
+			@Override public CriteriaBuilder getCriteriaBuilder() { return null; }
+			@Override public Metamodel getMetamodel() { return null; }
+			@Override public boolean isOpen() {	return false; }
+			@Override public void close() {	}
+			@Override public Map<String, Object> getProperties() { return null;	}
+			@Override public Cache getCache() { return null; }
+			@Override public PersistenceUnitUtil getPersistenceUnitUtil() {	return null; }
+			@Override public void addNamedQuery(String name, Query query) {	}
+			@Override public <T> T unwrap(Class<T> cls) { return null; }
+			@Override public <T> void addNamedEntityGraph(String graphName, EntityGraph<T> entityGraph) { }
+		};
+	}
+	
+}
diff --git a/core/runtime/src/main/resources/META-INF/persistence.xml b/core/runtime/src/main/resources/META-INF/persistence.xml
new file mode 100644
index 0000000..356a2aa
--- /dev/null
+++ b/core/runtime/src/main/resources/META-INF/persistence.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
+
+	<!-- declares a persistence unit that does nothing -->
+	<persistence-unit name="noop">
+		<provider>org.apache.isis.core.webapp.jee.PersistenceUnitNoopProvider</provider>
+	</persistence-unit>
+</persistence>

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 17/32: ISIS-1756 prevent SQLException on schema creation if config is missing

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 9661bc42ce2dc29cf3278da34d1351cf6e02554c
Author: Andi Huber <ah...@apache.org>
AuthorDate: Mon Oct 30 15:14:16 2017 +0100

    ISIS-1756 prevent SQLException on schema creation if config is missing
---
 .../jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java     | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java
index d2ee742..6ee60d1 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java
@@ -25,8 +25,6 @@ import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.Map;
 
-import com.google.common.base.Strings;
-
 import org.datanucleus.ClassLoaderResolver;
 import org.datanucleus.enhancer.EnhancementNucleusContextImpl;
 import org.datanucleus.metadata.AbstractClassMetaData;
@@ -35,6 +33,8 @@ import org.datanucleus.store.ConnectionEncryptionProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.base.Strings;
+
 
 /**
  * Implementation note: the methods in this class are <tt>protected</tt> to allow for easy subclassing.
@@ -68,6 +68,11 @@ public class CreateSchemaObjectFromClassMetadata implements MetaDataListener, Da
         final String url = properties.get("javax.jdo.option.ConnectionURL");
         final String userName = properties.get("javax.jdo.option.ConnectionUserName");
         final String password = getConnectionPassword();
+        
+        if(Strings.isNullOrEmpty(driverName) || Strings.isNullOrEmpty(url)) {
+        	LOG.warn("Unable to create schema due to missing configuration javax.jdo.option.Connection*");
+        	return;
+        }
 
         try {
 

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 32/32: ISIS-1779 Transition to JAX-RS 2.0 Client API removed dependency on deprecated resteasy client api

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit fd8670e8337f99832f767bf24c26dde33bf34cc5
Author: Andi Huber <ah...@apache.org>
AuthorDate: Sun Nov 19 15:20:44 2017 +0100

    ISIS-1779 Transition to JAX-RS 2.0 Client API
    removed dependency on deprecated resteasy client api
---
 core/applib/pom.xml                                |   9 +-
 core/pom.xml                                       |  18 ++-
 .../core/runtime/system/context/IsisContext.java   |  13 ++-
 .../persistence/PersistenceSessionFactory.java     |  40 +++----
 .../apache/isis/viewer/legacy/ClientExecutor.java  | 123 +++++++++++++++++++++
 .../ClientRequest.java}                            |  36 +++---
 .../ClientRequestFactory.java}                     |  45 ++++----
 .../apache/isis/viewer/legacy/RestEasyLegacy.java  |  89 +++++++++++++++
 .../restfulobjects/applib/LinkRepresentation.java  |   3 +-
 .../restfulobjects/applib/RestfulHttpMethod.java   |   2 +-
 .../applib/client/ClientRequestConfigurer.java     |  15 +--
 .../applib/client/RestfulClient.java               |  32 ++----
 .../applib/client/RestfulRequest.java              |  10 +-
 .../applib/client/RestfulResponse.java             |   2 +
 .../applib/domainobjects/DomainObjectResource.java |  30 +++--
 .../domainobjects/DomainServiceResource.java       |  14 +--
 .../applib/domaintypes/DomainTypeResource.java     |  19 ++--
 .../applib/homepage/HomePageResource.java          |  12 +-
 .../restfulobjects/applib/user/UserResource.java   |   6 +-
 .../restfulobjects/applib/util/JsonMapper.java     |   6 +-
 .../applib/version/VersionResource.java            |   3 +-
 .../viewer/restfulobjects/rendering/Responses.java |  22 +++-
 .../conneg/IsisPrettyPrintingProcessor.java        |   2 +-
 .../PreProcessInterceptorForIsisSession.java       |  12 +-
 24 files changed, 403 insertions(+), 160 deletions(-)

diff --git a/core/applib/pom.xml b/core/applib/pom.xml
index be3411c..ca7a836 100644
--- a/core/applib/pom.xml
+++ b/core/applib/pom.xml
@@ -74,10 +74,17 @@
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-jcdi_1.0_spec</artifactId>
         </dependency>
+        
+		<!-- replaced since Isis 2.0.0 by org.jboss.resteasy:jaxrs-api  
         <dependency>
             <groupId>org.jboss.spec.javax.ws.rs</groupId>
             <artifactId>jboss-jaxrs-api_2.0_spec</artifactId>
-        </dependency>
+        </dependency> -->
+        <dependency>
+		    <groupId>org.jboss.resteasy</groupId>
+		    <artifactId>jaxrs-api</artifactId>
+		</dependency>
+		        
 
         <dependency>
             <groupId>org.axonframework</groupId>
diff --git a/core/pom.xml b/core/pom.xml
index cda9a40..4f4d1f2 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -134,7 +134,12 @@
         <!-- using 2.3.3 throws SQL exception in simpleapp integtests -->
         <hsqldb.version>2.3.4</hsqldb.version>
         <log4jdbc-remix.version>0.2.7</log4jdbc-remix.version>
-        <resteasy-jaxrs.version>3.0.24.Final</resteasy-jaxrs.version>
+
+		<!-- for JEE 7 JAX-RS API 2.0 -->
+		<!-- <resteasy-jaxrs.version>3.1.4.Final</resteasy-jaxrs.version> -->
+		
+		<!-- for JEE 8 JAX-RS API 2.1 -->
+        <resteasy-jaxrs.version>4.0.0.Beta1</resteasy-jaxrs.version>
 
         <jetty.version>9.4.3.v20170317</jetty.version>
 
@@ -180,7 +185,11 @@
 
         <javax-mail.version>1.4.7</javax-mail.version>
 
+		<!-- replaced since Isis 2.0.0 by jboss-jaxrs-api 
         <jboss-jaxrs-api_2.0_spec.version>1.0.0.Final</jboss-jaxrs-api_2.0_spec.version>
+        -->
+        <jboss-jaxrs-api.version>3.0.12.Final</jboss-jaxrs-api.version>
+        
     </properties>
 
     <scm>
@@ -1947,11 +1956,18 @@ ${license.additional-notes}
                 <version>${geronimo-jcdi_1.0_spec.version}</version>
             </dependency>
 
+			<!-- replaced since Isis 2.0.0 by org.jboss.resteasy:jaxrs-api  
             <dependency>
                 <groupId>org.jboss.spec.javax.ws.rs</groupId>
                 <artifactId>jboss-jaxrs-api_2.0_spec</artifactId>
                 <version>${jboss-jaxrs-api_2.0_spec.version}</version>
             </dependency>
+            -->
+        	<dependency>
+		    	<groupId>org.jboss.resteasy</groupId>
+		    	<artifactId>jaxrs-api</artifactId>
+		    	<version>${jboss-jaxrs-api.version}</version>
+			</dependency>
 
 
             <!-- javax APIs -->
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java
index 059914b..17ebab6 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java
@@ -19,14 +19,15 @@
 
 package org.apache.isis.core.runtime.system.context;
 
+import org.apache.log4j.BasicConfigurator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.metamodel.specloader.validator.MetaModelInvalidException;
 import org.apache.isis.core.runtime.system.session.IsisSession;
 import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
 import org.apache.isis.core.runtime.system.session.IsisSessionFactoryBuilder;
-import org.apache.log4j.BasicConfigurator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * Simply a static field holding the {@link IsisSessionFactory} singleton, and convenience methods to obtain the
@@ -87,10 +88,10 @@ public final class IsisContext {
 	}
 
 	/**
-	 * life-cycle exit point
+	 * Marks the end of this IsisContext's life-cycle.
 	 * <p>
 	 * Destroys this context and clears any state associated with it. 
-	 * It marks the end of IsisContext's life-cycle. Subsequent calls have no effect.
+	 * Subsequent calls have no effect.
 	 * </p> 
 	 */
 	public static void destroy() {
@@ -127,7 +128,7 @@ public final class IsisContext {
 
 	/**
 	 * TODO [andi-huber] not sure if required, initial idea was to force log4j
-	 * re-configuration on a undeploy/deploy cycle
+	 * re-configuration on an undeploy/deploy cycle
 	 */
 	private static void resetLogging() {
 		org.apache.log4j.Logger.getRootLogger().removeAllAppenders();
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
index 989c989..67de81f 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
@@ -53,18 +53,12 @@ public class PersistenceSessionFactory implements ApplicationScopedComponent, Fi
 
     private static final Logger LOG = LoggerFactory.getLogger(PersistenceSessionFactory.class);
 
-    //region > constructor
-
     private final IsisConfigurationDefault configuration;
 
     public PersistenceSessionFactory(final IsisConfigurationDefault isisConfiguration) {
         this.configuration = isisConfiguration;
     }
 
-    //endregion
-
-    //region > init, createDataNucleusApplicationComponents
-
     public static final String JDO_OBJECTSTORE_CONFIG_PREFIX = "isis.persistor.datanucleus";  // specific to the JDO objectstore
     public static final String DATANUCLEUS_CONFIG_PREFIX = "isis.persistor.datanucleus.impl"; // reserved for datanucleus' own config props
 
@@ -159,23 +153,32 @@ public class PersistenceSessionFactory implements ApplicationScopedComponent, Fi
             props.put(key, value);
         }
     }
-    //endregion
 
-    //region > shutdown
+    /**
+     * Marks the end of this PersistenceSessionFactory's life-cycle.
+     * 
+     * <p>
+     * From <a href="http://www.datanucleus.org/products/datanucleus/jdo/persistence.html">JDO Persistence Guide</a> ...
+     * <br/>
+     * Since the PMF has significant resources associated with it, it should always be closed 
+     * when you no longer need to perform any more persistence operations. For most operations 
+     * this will be when closing your application.
+     * </p>
+     * 
+     */
     @Programmatic
     public final void shutdown() {
+        if(!isInitialized()) {
+            return;
+        }
+
     	//XXX ISIS-1756 purge any DataNucleus State
     	if(applicationComponents != null) {
     		applicationComponents.shutdown();
-    		applicationComponents = null;
+            applicationComponents = null;
     	}
     }
 
-    //endregion
-
-
-    //region > createPersistenceSession
-
     /**
      * Called by {@link org.apache.isis.core.runtime.system.session.IsisSessionFactory#openSession(AuthenticationSession)}.
      */
@@ -194,12 +197,6 @@ public class PersistenceSessionFactory implements ApplicationScopedComponent, Fi
                 fixturesInstalledFlag);
     }
 
-
-
-    //endregion
-
-    //region > FixturesInstalledFlag impl
-
     private Boolean fixturesInstalled;
 
     @Programmatic
@@ -214,7 +211,4 @@ public class PersistenceSessionFactory implements ApplicationScopedComponent, Fi
         this.fixturesInstalled = fixturesInstalled;
     }
 
-    //endregion
-
-
 }
diff --git a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/legacy/ClientExecutor.java b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/legacy/ClientExecutor.java
new file mode 100644
index 0000000..bbe683a
--- /dev/null
+++ b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/legacy/ClientExecutor.java
@@ -0,0 +1,123 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.viewer.legacy;
+
+import java.net.URI;
+import java.util.AbstractMap;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.client.Invocation;
+import javax.ws.rs.client.Invocation.Builder;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriBuilder;
+
+/**
+ * Compatibility layer, legacy of deprecated resteasy client API. 
+ * 
+ * @author ahuber@apache.org
+ *
+ */
+public interface ClientExecutor {
+
+	ClientRequest createRequest(UriBuilder uriBuilder);
+	WebTarget webTarget(URI baseUri);
+
+	static ClientExecutor of(final Client client) {
+		return new ClientExecutor() {
+
+			@Override
+			public ClientRequest createRequest(UriBuilder uriBuilder) {
+				
+				return new ClientRequest() {
+					
+					final WebTarget target = client.target(uriBuilder);
+										
+					final List<MediaType> accept = new ArrayList<>();
+					final List<Map.Entry<String, String>> header = new ArrayList<>();
+					
+					private Entity<String> payload;
+
+					// TODO [andi-huber] just a wild guess
+					private String method = "get";
+
+					@Override
+					public String getHttpMethod() {
+						return method;
+					}
+					
+					@Override
+					public void setHttpMethod(String method) {
+						this.method = method;
+					}
+					
+					@Override
+					public void accept(MediaType mediaType) {
+						accept.add(mediaType);
+					}
+					
+					@Override
+					public void header(String headerName, String value) {
+						header.add(new AbstractMap.SimpleEntry<String, String>(headerName, value));
+					}
+					
+					@Override
+					public void addQueryParameter(String param, String arg) {
+						target.queryParam(param, arg);
+					}
+					
+					@Override
+					public void jsonPayload(String jsonString) {
+						payload = Entity.json(jsonString);
+					}
+					
+					@Override
+					public Response execute() {
+						final Builder builder = target.request();
+						
+						accept.stream()
+							.forEach(builder::accept);
+						header.stream()
+							.forEach(e->builder.header(e.getKey(), e.getValue()));
+						
+						final Invocation invocation = payload==null 
+								? builder.build(method)
+								: builder.build(method, payload);  
+						
+						return invocation.invoke();
+					}
+
+				};
+			}
+
+			@Override
+			public WebTarget webTarget(URI baseUri) {
+				return client.target(baseUri);
+			}
+			
+		};
+	}
+	
+
+}
diff --git a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/version/VersionResource.java b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/legacy/ClientRequest.java
similarity index 59%
copy from core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/version/VersionResource.java
copy to core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/legacy/ClientRequest.java
index 535fc72..dd167fa 100644
--- a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/version/VersionResource.java
+++ b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/legacy/ClientRequest.java
@@ -16,30 +16,30 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.restfulobjects.applib.version;
+package org.apache.isis.viewer.legacy;
 
-import javax.ws.rs.*;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-import org.apache.isis.viewer.restfulobjects.applib.RestfulMediaType;
-import org.jboss.resteasy.annotations.ClientResponseType;
-
-@Path("/version")
-public interface VersionResource {
+/**
+ * Compatibility layer, legacy of deprecated resteasy client API. 
+ * 
+ * @author ahuber@apache.org
+ *
+ */
+public interface ClientRequest {
 
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_VERSION })
-    @ClientResponseType(entityType = String.class)
-    public Response version();
+	void accept(MediaType mediaType);
 
-    @DELETE
-    public Response deleteVersionNotAllowed();
+	void header(String headerName, String value);
 
-    @PUT
-    public Response putVersionNotAllowed();
+	void setHttpMethod(String httpMethod);
+	String getHttpMethod();
+	
+	void addQueryParameter(String param, String arg);
+	
+	void jsonPayload(String jsonString);
 
-    @POST
-    public Response postVersionNotAllowed();
+	Response execute();
 
-}
\ No newline at end of file
+}
diff --git a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/version/VersionResource.java b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/legacy/ClientRequestFactory.java
similarity index 55%
copy from core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/version/VersionResource.java
copy to core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/legacy/ClientRequestFactory.java
index 535fc72..1c9ae07 100644
--- a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/version/VersionResource.java
+++ b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/legacy/ClientRequestFactory.java
@@ -16,30 +16,37 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.restfulobjects.applib.version;
+package org.apache.isis.viewer.legacy;
 
-import javax.ws.rs.*;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
+import java.net.URI;
 
-import org.apache.isis.viewer.restfulobjects.applib.RestfulMediaType;
-import org.jboss.resteasy.annotations.ClientResponseType;
+/**
+ * Compatibility layer, legacy of deprecated resteasy client API. 
+ * 
+ * @author ahuber@apache.org
+ *
+ */
+public interface ClientRequestFactory {
 
-@Path("/version")
-public interface VersionResource {
+	<T> T createProxy(Class<T> clazz);
 
-    @GET
-    @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_VERSION })
-    @ClientResponseType(entityType = String.class)
-    public Response version();
+	URI getBase();
 
-    @DELETE
-    public Response deleteVersionNotAllowed();
+	static ClientRequestFactory of(final ClientExecutor clientExecutor, final URI baseUri) {
+		
+		return new ClientRequestFactory() {
 
-    @PUT
-    public Response putVersionNotAllowed();
+			@Override
+			public <T> T createProxy(Class<T> clazz) {
+				return RestEasyLegacy.proxy(clientExecutor.webTarget(baseUri), clazz);
+			}
 
-    @POST
-    public Response postVersionNotAllowed();
+			@Override
+			public URI getBase() {
+				return baseUri;
+			}
+			
+		};
+	}
 
-}
\ No newline at end of file
+}
diff --git a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/legacy/RestEasyLegacy.java b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/legacy/RestEasyLegacy.java
new file mode 100644
index 0000000..6e6bac9
--- /dev/null
+++ b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/legacy/RestEasyLegacy.java
@@ -0,0 +1,89 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.viewer.legacy;
+
+import java.lang.reflect.Method;
+
+import javax.ws.rs.NotSupportedException;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.Response;
+
+/**
+ * Compatibility layer, legacy of deprecated resteasy client API. 
+ * 
+ * @author ahuber@apache.org
+ *
+ */
+public class RestEasyLegacy {
+
+	public static String getEntityAsStringFrom(Response response) {
+		
+		final Object result = response.getEntity();
+		
+		if(result == null)
+			return null;
+		
+		if(result instanceof String) {
+			return (String) result;
+		}
+		
+		// TODO [andi-huber] just a wild guess
+		return response.readEntity(String.class);
+
+		// legacy code ...
+        // final ClientResponse<?> clientResponse = (ClientResponse<?>) response;
+        // return clientResponse.getEntity(String.class);
+	}
+
+	public static void setReturnTypeToString(Response response) {
+
+		// TODO [andi-huber] why is this needed at all?
+
+		// legacy code ...
+        // final BaseClientResponse<String> restEasyResponse = (BaseClientResponse<String>) response;
+        // restEasyResponse.setReturnType(String.class);
+		
+		System.err.println("WARN RestEasyLegacy - setReturnTypeToString(Response) not implemented!");
+		
+	}
+
+	@SuppressWarnings("unchecked")
+	public static <T> T proxy(WebTarget webTarget, Class<T> clazz) {
+		
+		// legacy of
+		// final org.jboss.resteasy.client.jaxrs.ResteasyWebTarget target = 
+		//		(org.jboss.resteasy.client.jaxrs.ResteasyWebTarget) webTarget;
+		// return target.proxy(clazz);
+		
+		try {
+			// [andi-huber]	resort to reflection, since we wan't to get rid of resteasy legacy
+			// first step is to remove compile time dependencies
+			
+			final Method proxyMethod = 
+					webTarget.getClass().getMethod("proxy", new Class<?>[]{Class.class});
+			return (T) proxyMethod.invoke(webTarget, clazz);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		throw new NotSupportedException("proxy not supported by this JAX-RS implementation");
+		
+	}
+
+}
diff --git a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/LinkRepresentation.java b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/LinkRepresentation.java
index a883fe6..3b4d691 100644
--- a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/LinkRepresentation.java
+++ b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/LinkRepresentation.java
@@ -23,10 +23,11 @@ import javax.ws.rs.core.MediaType;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+
+import org.apache.isis.viewer.legacy.ClientExecutor;
 import org.apache.isis.viewer.restfulobjects.applib.client.ClientRequestConfigurer;
 import org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest;
 import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse;
-import org.jboss.resteasy.client.ClientExecutor;
 
 public final class LinkRepresentation extends JsonRepresentation {
 
diff --git a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/RestfulHttpMethod.java b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/RestfulHttpMethod.java
index 6819e7b..b7055b2 100644
--- a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/RestfulHttpMethod.java
+++ b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/RestfulHttpMethod.java
@@ -18,8 +18,8 @@
  */
 package org.apache.isis.viewer.restfulobjects.applib;
 
+import org.apache.isis.viewer.legacy.ClientRequest;
 import org.apache.isis.viewer.restfulobjects.applib.client.ClientRequestConfigurer;
-import org.jboss.resteasy.client.ClientRequest;
 
 public enum RestfulHttpMethod {
     GET(javax.ws.rs.HttpMethod.GET, ArgStrategy.QUERY_STRING), 
diff --git a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/client/ClientRequestConfigurer.java b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/client/ClientRequestConfigurer.java
index 61b9240..b98f8f0 100644
--- a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/client/ClientRequestConfigurer.java
+++ b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/client/ClientRequestConfigurer.java
@@ -21,16 +21,15 @@ package org.apache.isis.viewer.restfulobjects.applib.client;
 import java.util.Map;
 
 import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.UriBuilder;
 
+import org.apache.isis.viewer.legacy.ClientExecutor;
+import org.apache.isis.viewer.legacy.ClientRequest;
 import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
 import org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation;
 import org.apache.isis.viewer.restfulobjects.applib.RestfulHttpMethod;
 import org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest.RequestParameter;
 import org.apache.isis.viewer.restfulobjects.applib.util.UrlEncodingUtils;
-import org.jboss.resteasy.client.ClientExecutor;
-import org.jboss.resteasy.client.ClientRequest;
 import org.jboss.resteasy.specimpl.ResteasyUriBuilder;
 
 /**
@@ -45,7 +44,10 @@ import org.jboss.resteasy.specimpl.ResteasyUriBuilder;
  */
 public class ClientRequestConfigurer {
 
-    public static ClientRequestConfigurer create(final ClientExecutor executor, final String uriTemplate) {
+    public static ClientRequestConfigurer create(
+    		final ClientExecutor executor, 
+    		final String uriTemplate) 
+    {
         final UriBuilder uriBuilder = new ResteasyUriBuilder().uriTemplate(uriTemplate);
         final ClientRequest clientRequest = executor.createRequest(uriBuilder);
         return new ClientRequestConfigurer(clientRequest, uriBuilder);
@@ -127,7 +129,7 @@ public class ClientRequestConfigurer {
      * {@link RestfulHttpMethod#setUpArgs(ClientRequestConfigurer, JsonRepresentation)}
      */
     public ClientRequestConfigurer body(final JsonRepresentation requestArgs) {
-        clientRequest.body(MediaType.APPLICATION_JSON_TYPE, requestArgs.toString());
+        clientRequest.jsonPayload(requestArgs.toString());
         return this;
     }
 
@@ -149,12 +151,11 @@ public class ClientRequestConfigurer {
      * {@link RestfulHttpMethod#setUpArgs(ClientRequestConfigurer, JsonRepresentation)}
      */
     public ClientRequestConfigurer queryArgs(final JsonRepresentation requestArgs) {
-        final MultivaluedMap<String, String> queryParameters = clientRequest.getQueryParameters();
         for (final Map.Entry<String, JsonRepresentation> entry : requestArgs.mapIterable()) {
             final String param = entry.getKey();
             final JsonRepresentation argRepr = entry.getValue();
             final String arg = UrlEncodingUtils.urlEncode(argRepr.asArg());
-            queryParameters.add(param, arg);
+            clientRequest.addQueryParameter(param, arg);
         }
         return this;
     }
diff --git a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/client/RestfulClient.java b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/client/RestfulClient.java
index 90b3a1f..ee5985f 100644
--- a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/client/RestfulClient.java
+++ b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/client/RestfulClient.java
@@ -20,17 +20,13 @@ package org.apache.isis.viewer.restfulobjects.applib.client;
 
 import java.net.URI;
 
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-import org.apache.http.client.HttpClient;
-import org.apache.http.conn.ClientConnectionManager;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
-import org.jboss.resteasy.client.ClientExecutor;
-import org.jboss.resteasy.client.ClientRequestFactory;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClient4Executor;
-
+import org.apache.isis.viewer.legacy.ClientExecutor;
+import org.apache.isis.viewer.legacy.ClientRequestFactory;
 import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
 import org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation;
 import org.apache.isis.viewer.restfulobjects.applib.RestfulHttpMethod;
@@ -55,25 +51,17 @@ public class RestfulClient {
 
     
     /**
-     * Using {@link ApacheHttpClient4Executor} and {@link DefaultHttpClient}.
+     * Using {@link javax.ws.rs.client.Client}.
      */
     public RestfulClient(final URI baseUri) {
-        this(baseUri, new ThreadSafeClientConnManager());
-    }
-
-    /**
-     * Using {@link ApacheHttpClient4Executor} and {@link DefaultHttpClient}.
-     */
-    public RestfulClient(final URI baseUri, ClientConnectionManager clientConnectionManager) {
-        this(baseUri, new DefaultHttpClient(clientConnectionManager));
+        this(baseUri, ClientBuilder.newClient());
     }
 
-
     /**
-     * Using {@link ApacheHttpClient4Executor} and specified {@link HttpClient}.
+     * Using {@link javax.ws.rs.client.Client}.
      */
-    public RestfulClient(final URI baseUri, HttpClient client) {
-        this(baseUri, new ApacheHttpClient4Executor(client));
+    public RestfulClient(final URI baseUri, Client client) {
+        this(baseUri, ClientExecutor.of(client));
     }
 
     /**
@@ -81,7 +69,7 @@ public class RestfulClient {
      */
     public RestfulClient(final URI baseUri, final ClientExecutor clientExecutor) {
         this.executor = clientExecutor;
-        this.clientRequestFactory = new ClientRequestFactory(clientExecutor, baseUri);
+        this.clientRequestFactory = ClientRequestFactory.of(clientExecutor, baseUri);
 
         this.homePageResource = clientRequestFactory.createProxy(HomePageResource.class);
         this.userResource = clientRequestFactory.createProxy(UserResource.class);
diff --git a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/client/RestfulRequest.java b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/client/RestfulRequest.java
index 77e0ac2..fbdbd5a 100644
--- a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/client/RestfulRequest.java
+++ b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/client/RestfulRequest.java
@@ -25,8 +25,9 @@ import java.util.Map;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import com.google.common.collect.Maps;
-import org.jboss.resteasy.client.ClientRequest;
-import org.jboss.resteasy.client.core.BaseClientResponse;
+
+import org.apache.isis.viewer.legacy.ClientRequest;
+import org.apache.isis.viewer.legacy.RestEasyLegacy;
 import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
 import org.apache.isis.viewer.restfulobjects.applib.util.Parser;
 
@@ -173,10 +174,7 @@ public final class RestfulRequest {
             final ClientRequest clientRequest = clientRequestConfigurer.getClientRequest();
             final Response response = clientRequest.execute();
 
-            // this is a bit hacky
-            @SuppressWarnings("unchecked")
-            final BaseClientResponse<String> restEasyResponse = (BaseClientResponse<String>) response;
-            restEasyResponse.setReturnType(String.class);
+            RestEasyLegacy.setReturnTypeToString(response);
 
             return RestfulResponse.ofT(response);
         } catch (final Exception ex) {
diff --git a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/client/RestfulResponse.java b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/client/RestfulResponse.java
index a900a8d..2431a9e 100644
--- a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/client/RestfulResponse.java
+++ b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/client/RestfulResponse.java
@@ -369,4 +369,6 @@ public class RestfulResponse<T> {
         return "RestfulResponse [httpStatusCode=" + httpStatusCode + "]";
     }
 
+
+
 }
diff --git a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/domainobjects/DomainObjectResource.java b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/domainobjects/DomainObjectResource.java
index aa29ef7..2095718 100644
--- a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/domainobjects/DomainObjectResource.java
+++ b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/domainobjects/DomainObjectResource.java
@@ -32,8 +32,6 @@ import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-import org.jboss.resteasy.annotations.ClientResponseType;
-
 import org.apache.isis.viewer.restfulobjects.applib.RestfulMediaType;
 
 @Path("/objects")
@@ -46,7 +44,7 @@ public interface DomainObjectResource {
             MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_OBJECT, RestfulMediaType.APPLICATION_JSON_ERROR,
             MediaType.APPLICATION_XML, RestfulMediaType.APPLICATION_XML_OBJECT, RestfulMediaType.APPLICATION_XML_ERROR
     })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response persist(@PathParam("domainType") String domainType, final InputStream object);
 
     // //////////////////////////////////////////////////////////
@@ -60,7 +58,7 @@ public interface DomainObjectResource {
             MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_OBJECT, RestfulMediaType.APPLICATION_JSON_ERROR,
             MediaType.APPLICATION_XML, RestfulMediaType.APPLICATION_XML_OBJECT, RestfulMediaType.APPLICATION_XML_ERROR
     })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response object(@PathParam("domainType") String domainType, @PathParam("instanceId") final String instanceId);
 
     @PUT
@@ -70,7 +68,7 @@ public interface DomainObjectResource {
             MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_OBJECT, RestfulMediaType.APPLICATION_JSON_ERROR,
             MediaType.APPLICATION_XML, RestfulMediaType.APPLICATION_XML_OBJECT, RestfulMediaType.APPLICATION_XML_ERROR
     })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response object(@PathParam("domainType") String domainType, @PathParam("instanceId") final String instanceId, final InputStream arguments);
 
     @DELETE
@@ -111,7 +109,7 @@ public interface DomainObjectResource {
             MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_OBJECT_PROPERTY, RestfulMediaType.APPLICATION_JSON_ERROR,
             MediaType.APPLICATION_XML, RestfulMediaType.APPLICATION_XML_OBJECT_PROPERTY, RestfulMediaType.APPLICATION_XML_ERROR
     })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response propertyDetails(@PathParam("domainType") String domainType, @PathParam("instanceId") final String instanceId, @PathParam("propertyId") final String propertyId);
 
     @PUT
@@ -121,7 +119,7 @@ public interface DomainObjectResource {
             MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_OBJECT_PROPERTY, RestfulMediaType.APPLICATION_JSON_ERROR,
             MediaType.APPLICATION_XML, RestfulMediaType.APPLICATION_XML_OBJECT_PROPERTY, RestfulMediaType.APPLICATION_XML_ERROR
     })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response modifyProperty(@PathParam("domainType") String domainType, @PathParam("instanceId") final String instanceId, @PathParam("propertyId") final String propertyId, final InputStream arguments);
 
     @DELETE
@@ -131,7 +129,7 @@ public interface DomainObjectResource {
             MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_OBJECT_PROPERTY, RestfulMediaType.APPLICATION_JSON_ERROR,
             MediaType.APPLICATION_XML, RestfulMediaType.APPLICATION_XML_OBJECT_PROPERTY, RestfulMediaType.APPLICATION_XML_ERROR
     })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response clearProperty(@PathParam("domainType") String domainType, @PathParam("instanceId") final String instanceId, @PathParam("propertyId") final String propertyId);
 
     @POST
@@ -150,7 +148,7 @@ public interface DomainObjectResource {
             MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_OBJECT_COLLECTION, RestfulMediaType.APPLICATION_JSON_ERROR,
             MediaType.APPLICATION_XML, RestfulMediaType.APPLICATION_XML_OBJECT_COLLECTION, RestfulMediaType.APPLICATION_XML_ERROR
     })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response accessCollection(@PathParam("domainType") String domainType, @PathParam("instanceId") final String instanceId, @PathParam("collectionId") final String collectionId);
 
     @PUT
@@ -160,7 +158,7 @@ public interface DomainObjectResource {
             MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_OBJECT_COLLECTION, RestfulMediaType.APPLICATION_JSON_ERROR,
             MediaType.APPLICATION_XML, RestfulMediaType.APPLICATION_XML_OBJECT_COLLECTION, RestfulMediaType.APPLICATION_XML_ERROR
     })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response addToSet(@PathParam("domainType") String domainType, @PathParam("instanceId") final String instanceId, @PathParam("collectionId") final String collectionId, final InputStream arguments);
 
     @POST
@@ -170,7 +168,7 @@ public interface DomainObjectResource {
             MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_OBJECT_COLLECTION, RestfulMediaType.APPLICATION_JSON_ERROR,
             MediaType.APPLICATION_XML, RestfulMediaType.APPLICATION_XML_OBJECT_COLLECTION, RestfulMediaType.APPLICATION_XML_ERROR
     })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response addToList(@PathParam("domainType") String domainType, @PathParam("instanceId") final String instanceId, @PathParam("collectionId") final String collectionId, final InputStream arguments);
 
     @DELETE
@@ -180,7 +178,7 @@ public interface DomainObjectResource {
             MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_OBJECT_COLLECTION, RestfulMediaType.APPLICATION_JSON_ERROR,
             MediaType.APPLICATION_XML, RestfulMediaType.APPLICATION_XML_OBJECT_COLLECTION, RestfulMediaType.APPLICATION_XML_ERROR
     })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response removeFromCollection(@PathParam("domainType") String domainType, @PathParam("instanceId") final String instanceId, @PathParam("collectionId") final String collectionId);
 
     // //////////////////////////////////////////////////////////
@@ -194,7 +192,7 @@ public interface DomainObjectResource {
             MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_OBJECT_ACTION, RestfulMediaType.APPLICATION_JSON_ERROR,
             MediaType.APPLICATION_XML, RestfulMediaType.APPLICATION_XML_OBJECT_ACTION, RestfulMediaType.APPLICATION_XML_ERROR
     })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response actionPrompt(@PathParam("domainType") String domainType, @PathParam("instanceId") final String instanceId, @PathParam("actionId") final String actionId);
 
     @DELETE
@@ -220,7 +218,7 @@ public interface DomainObjectResource {
             MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_ACTION_RESULT, RestfulMediaType.APPLICATION_JSON_ERROR,
             MediaType.APPLICATION_XML, RestfulMediaType.APPLICATION_XML_ACTION_RESULT, RestfulMediaType.APPLICATION_XML_ERROR
     })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response invokeActionQueryOnly(@PathParam("domainType") String domainType, @PathParam("instanceId") final String instanceId, @PathParam("actionId") final String actionId, @QueryParam("x-isis-querystring") final String xIsisQueryString);
 
     @PUT
@@ -230,7 +228,7 @@ public interface DomainObjectResource {
             MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_ACTION_RESULT, RestfulMediaType.APPLICATION_JSON_ERROR,
             MediaType.APPLICATION_XML, RestfulMediaType.APPLICATION_XML_ACTION_RESULT, RestfulMediaType.APPLICATION_XML_ERROR
     })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response invokeActionIdempotent(@PathParam("domainType") String domainType, @PathParam("instanceId") final String instanceId, @PathParam("actionId") final String actionId, final InputStream arguments);
 
     @POST
@@ -240,7 +238,7 @@ public interface DomainObjectResource {
             MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_ACTION_RESULT, RestfulMediaType.APPLICATION_JSON_ERROR,
             MediaType.APPLICATION_XML, RestfulMediaType.APPLICATION_XML_ACTION_RESULT, RestfulMediaType.APPLICATION_XML_ERROR
     })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response invokeAction(@PathParam("domainType") String domainType, @PathParam("instanceId") final String instanceId, @PathParam("actionId") final String actionId, final InputStream arguments);
 
     @DELETE
diff --git a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/domainobjects/DomainServiceResource.java b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/domainobjects/DomainServiceResource.java
index c11cdb7..d472e56 100644
--- a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/domainobjects/DomainServiceResource.java
+++ b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/domainobjects/DomainServiceResource.java
@@ -32,8 +32,6 @@ import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-import org.jboss.resteasy.annotations.ClientResponseType;
-
 import org.apache.isis.viewer.restfulobjects.applib.RestfulMediaType;
 
 @Path("/services")
@@ -42,7 +40,7 @@ public interface DomainServiceResource {
     @GET
     @Path("/")
     @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_LIST, RestfulMediaType.APPLICATION_JSON_ERROR })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response services();
 
     @DELETE
@@ -67,7 +65,7 @@ public interface DomainServiceResource {
             MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_OBJECT, RestfulMediaType.APPLICATION_JSON_ERROR,
             MediaType.APPLICATION_XML, RestfulMediaType.APPLICATION_XML_OBJECT, RestfulMediaType.APPLICATION_XML_ERROR
     })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response service(@PathParam("serviceId") final String serviceId);
 
     @DELETE
@@ -94,7 +92,7 @@ public interface DomainServiceResource {
             MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_OBJECT_ACTION, RestfulMediaType.APPLICATION_JSON_ERROR,
             MediaType.APPLICATION_XML, RestfulMediaType.APPLICATION_XML_OBJECT_ACTION, RestfulMediaType.APPLICATION_XML_ERROR
     })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response actionPrompt(@PathParam("serviceId") final String serviceId, @PathParam("actionId") final String actionId);
 
     @DELETE
@@ -127,7 +125,7 @@ public interface DomainServiceResource {
             MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_ACTION_RESULT, RestfulMediaType.APPLICATION_JSON_ERROR,
             MediaType.APPLICATION_XML, RestfulMediaType.APPLICATION_XML_ACTION_RESULT, RestfulMediaType.APPLICATION_XML_ERROR
     })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response invokeActionQueryOnly(@PathParam("serviceId") final String serviceId, @PathParam("actionId") final String actionId, @QueryParam("x-isis-querystring") final String xIsisQueryString);
 
     @PUT
@@ -137,7 +135,7 @@ public interface DomainServiceResource {
             MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_ACTION_RESULT, RestfulMediaType.APPLICATION_JSON_ERROR,
             MediaType.APPLICATION_XML, RestfulMediaType.APPLICATION_XML_ACTION_RESULT, RestfulMediaType.APPLICATION_XML_ERROR
     })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response invokeActionIdempotent(@PathParam("serviceId") final String serviceId, @PathParam("actionId") final String actionId, final InputStream arguments);
 
     @POST
@@ -147,7 +145,7 @@ public interface DomainServiceResource {
             MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_ACTION_RESULT, RestfulMediaType.APPLICATION_JSON_ERROR,
             MediaType.APPLICATION_XML, RestfulMediaType.APPLICATION_XML_ACTION_RESULT, RestfulMediaType.APPLICATION_XML_ERROR
     })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response invokeAction(@PathParam("serviceId") final String serviceId, @PathParam("actionId") final String actionId, final InputStream arguments);
 
     @DELETE
diff --git a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/domaintypes/DomainTypeResource.java b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/domaintypes/DomainTypeResource.java
index fde2a14..d19a300 100644
--- a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/domaintypes/DomainTypeResource.java
+++ b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/domaintypes/DomainTypeResource.java
@@ -26,8 +26,6 @@ import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-import org.jboss.resteasy.annotations.ClientResponseType;
-
 import org.apache.isis.viewer.restfulobjects.applib.RestfulMediaType;
 
 @Path("/domain-types")
@@ -40,7 +38,7 @@ public interface DomainTypeResource {
     @GET
     @Path("/")
     @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_TYPE_LIST })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public abstract Response domainTypes();
 
     // /////////////////////////////////////////////////////
@@ -50,7 +48,7 @@ public interface DomainTypeResource {
     @GET
     @Path("/{domainType}")
     @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_DOMAIN_TYPE })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public abstract Response domainType(@PathParam("domainType") final String domainType);
 
     @GET
@@ -59,30 +57,31 @@ public interface DomainTypeResource {
             MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_LAYOUT_BS3,
             MediaType.APPLICATION_XML, RestfulMediaType.APPLICATION_XML_LAYOUT_BS3
     })
+    //deprecated @ClientResponseType(entityType = String.class)
     public abstract Response layout(@PathParam("domainType") final String domainType);
 
     @GET
     @Path("/{domainType}/properties/{propertyId}")
     @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_PROPERTY_DESCRIPTION })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public abstract Response typeProperty(@PathParam("domainType") final String domainType, @PathParam("propertyId") final String propertyId);
 
     @GET
     @Path("/{domainType}/collections/{collectionId}")
     @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_COLLECTION_DESCRIPTION })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public abstract Response typeCollection(@PathParam("domainType") final String domainType, @PathParam("collectionId") final String collectionId);
 
     @GET
     @Path("/{domainType}/actions/{actionId}")
     @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_ACTION_DESCRIPTION })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public abstract Response typeAction(@PathParam("domainType") final String domainType, @PathParam("actionId") final String actionId);
 
     @GET
     @Path("/{domainType}/actions/{actionId}/params/{paramNum}")
     @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_ACTION_PARAMETER_DESCRIPTION })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public abstract Response typeActionParam(@PathParam("domainType") final String domainType, @PathParam("actionId") final String actionId, @PathParam("paramNum") final String paramName);
 
     // //////////////////////////////////////////////////////////
@@ -92,7 +91,7 @@ public interface DomainTypeResource {
     @GET
     @Path("/{domainType}/isSubtypeOf/invoke")
     @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_TYPE_ACTION_RESULT, RestfulMediaType.APPLICATION_JSON_ERROR })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public abstract Response domainTypeIsSubtypeOf(
             @PathParam("domainType") final String domainType, 
             @QueryParam("supertype") String superType, // simple style
@@ -102,7 +101,7 @@ public interface DomainTypeResource {
     @GET
     @Path("/{domainType}/isSupertypeOf/invoke")
     @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_TYPE_ACTION_RESULT, RestfulMediaType.APPLICATION_JSON_ERROR })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public abstract Response domainTypeIsSupertypeOf(
             @PathParam("domainType") final String domainType, 
             @QueryParam("supertype") String superType, // simple style
diff --git a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/homepage/HomePageResource.java b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/homepage/HomePageResource.java
index 497ef69..a502d34 100644
--- a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/homepage/HomePageResource.java
+++ b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/homepage/HomePageResource.java
@@ -18,19 +18,23 @@
  */
 package org.apache.isis.viewer.restfulobjects.applib.homepage;
 
-import javax.ws.rs.*;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
 import org.apache.isis.viewer.restfulobjects.applib.RestfulMediaType;
-import org.jboss.resteasy.annotations.ClientResponseType;
 
 @Path("/")
 public interface HomePageResource {
 
     @GET
     @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_HOME_PAGE })
-    @ClientResponseType(entityType = String.class)
+    //@ClientResponseType(entityType = String.class)
     public Response homePage();
 
     @DELETE
@@ -49,7 +53,7 @@ public interface HomePageResource {
     @GET
     @Path("/notAuthenticated")
     @Produces({ MediaType.APPLICATION_JSON })
-    @ClientResponseType(entityType = String.class)
+    //@ClientResponseType(entityType = String.class)
     public Response notAuthenticated();
 
 }
\ No newline at end of file
diff --git a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/user/UserResource.java b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/user/UserResource.java
index afcc179..9d02419 100644
--- a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/user/UserResource.java
+++ b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/user/UserResource.java
@@ -27,8 +27,6 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-import org.jboss.resteasy.annotations.ClientResponseType;
-
 import org.apache.isis.viewer.restfulobjects.applib.RestfulMediaType;
 
 @Path("/user")
@@ -36,7 +34,7 @@ public interface UserResource {
 
     @GET
     @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_USER })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response user();
 
     @DELETE
@@ -54,7 +52,7 @@ public interface UserResource {
     @GET
     @Path("/logout")
     @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_HOME_PAGE })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response logout();
 
 }
\ No newline at end of file
diff --git a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/util/JsonMapper.java b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/util/JsonMapper.java
index 8e7179f..bb53752 100644
--- a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/util/JsonMapper.java
+++ b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/util/JsonMapper.java
@@ -38,7 +38,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.SerializationFeature;
 import com.fasterxml.jackson.databind.SerializerProvider;
 import com.fasterxml.jackson.databind.module.SimpleModule;
-import org.jboss.resteasy.client.ClientResponse;
+
+import org.apache.isis.viewer.legacy.RestEasyLegacy;
 import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
 
 public final class JsonMapper {
@@ -115,8 +116,7 @@ public final class JsonMapper {
     }
 
     public <T> T read(final Response response, final Class<T> requiredType) throws JsonParseException, JsonMappingException, IOException {
-        final ClientResponse<?> clientResponse = (ClientResponse<?>) response; // a shame, but needed if calling resources directly.
-        final String entity = clientResponse.getEntity(String.class);
+    	final String entity = RestEasyLegacy.getEntityAsStringFrom(response);
         if (entity == null) {
             return null;
         }
diff --git a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/version/VersionResource.java b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/version/VersionResource.java
index 535fc72..6b596a7 100644
--- a/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/version/VersionResource.java
+++ b/core/viewer-restfulobjects-applib/src/main/java/org/apache/isis/viewer/restfulobjects/applib/version/VersionResource.java
@@ -23,14 +23,13 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
 import org.apache.isis.viewer.restfulobjects.applib.RestfulMediaType;
-import org.jboss.resteasy.annotations.ClientResponseType;
 
 @Path("/version")
 public interface VersionResource {
 
     @GET
     @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_VERSION })
-    @ClientResponseType(entityType = String.class)
+    //deprecated @ClientResponseType(entityType = String.class)
     public Response version();
 
     @DELETE
diff --git a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/Responses.java b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/Responses.java
index 4be7721..a88d640 100644
--- a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/Responses.java
+++ b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/Responses.java
@@ -16,16 +16,22 @@
  */
 package org.apache.isis.viewer.restfulobjects.rendering;
 
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.util.Date;
+
 import javax.ws.rs.core.EntityTag;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
-import org.joda.time.DateTime;
-import org.joda.time.format.ISODateTimeFormat;
+import javax.ws.rs.core.Response.ResponseBuilder;
+
+import org.apache.isis.core.commons.reflection.Reflect;
 import org.apache.isis.core.metamodel.adapter.version.Version;
 import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
 import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse;
 import org.apache.isis.viewer.restfulobjects.rendering.util.JsonWriterUtil;
+import org.joda.time.DateTime;
+import org.joda.time.format.ISODateTimeFormat;
 
 public final class Responses {
 
@@ -87,6 +93,18 @@ public final class Responses {
     }
 
     protected static Response.ResponseBuilder of(final RestfulResponse.HttpStatusCode httpStatusCode) {
+    	
+    	//XXX debug
+    	Response.ResponseBuilder x;
+		try {
+			Method m = ResponseBuilder.class.getDeclaredMethod("newInstance", Reflect.emptyClasses);
+			m.setAccessible(true);
+			x =	(ResponseBuilder) m.invoke(null, Reflect.emptyObjects);
+	    	System.out.println("!!! DEBUG: "+x.getClass().getName());
+		} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException
+				| SecurityException e) {
+			e.printStackTrace();
+		}
         return Response.status(httpStatusCode.getJaxrsStatusType()).type(MediaType.APPLICATION_JSON_TYPE);
     }
 
diff --git a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/conneg/IsisPrettyPrintingProcessor.java b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/conneg/IsisPrettyPrintingProcessor.java
index d26c2e3..94140d1 100644
--- a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/conneg/IsisPrettyPrintingProcessor.java
+++ b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/conneg/IsisPrettyPrintingProcessor.java
@@ -22,7 +22,7 @@ import javax.ws.rs.core.MediaType;
 import javax.xml.bind.Marshaller;
 
 import org.jboss.resteasy.annotations.DecorateTypes;
-import org.jboss.resteasy.spi.interception.DecoratorProcessor;
+import org.jboss.resteasy.spi.DecoratorProcessor;
 
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
diff --git a/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/webapp/PreProcessInterceptorForIsisSession.java b/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/webapp/PreProcessInterceptorForIsisSession.java
index 90b9ad6..d906cc4 100644
--- a/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/webapp/PreProcessInterceptorForIsisSession.java
+++ b/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/webapp/PreProcessInterceptorForIsisSession.java
@@ -21,19 +21,21 @@ package org.apache.isis.viewer.restfulobjects.server.webapp;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.ext.Provider;
 
-import org.jboss.resteasy.annotations.interception.ServerInterceptor;
+//deprectaed import org.jboss.resteasy.annotations.interception.ServerInterceptor;
 import org.jboss.resteasy.core.ResourceMethodInvoker;
 import org.jboss.resteasy.core.ServerResponse;
 import org.jboss.resteasy.spi.Failure;
 import org.jboss.resteasy.spi.HttpRequest;
-import org.jboss.resteasy.spi.interception.PreProcessInterceptor;
+//deprectaed import org.jboss.resteasy.spi.interception.PreProcessInterceptor;
 
 @Provider
-@ServerInterceptor
-public class PreProcessInterceptorForIsisSession implements PreProcessInterceptor {
+//deprectaed @ServerInterceptor
+public class PreProcessInterceptorForIsisSession //deprectaed implements PreProcessInterceptor 
+{
 
+	/* deprectaed
     @Override
     public ServerResponse preProcess(HttpRequest httpRequest, ResourceMethodInvoker resourceMethodInvoker) throws Failure, WebApplicationException {
         return null;
-    }
+    }*/
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 25/32: ISIS-1756 on shutdown purge any state associated with the current web-app classloader

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 549bb712733a840eb7a1c9e56b69e25f96121111
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Dec 8 04:23:58 2017 +0100

    ISIS-1756 on shutdown purge any state associated with the current
    web-app classloader
---
 core/pom.xml                                       |   6 +-
 .../core/runtime/system/context/IsisContext.java   |   3 +-
 .../DataNucleusApplicationComponents.java          |  22 ++++
 .../persistence/PersistenceSessionFactory.java     |   6 +-
 .../datanucleus/DataNucleusLifeCycleHelper.java    | 125 +++++++++++++++++++++
 5 files changed, 157 insertions(+), 5 deletions(-)

diff --git a/core/pom.xml b/core/pom.xml
index 87d447f..737f95c 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -86,10 +86,10 @@
         <!-- Datanucleus Objectstore -->
         <jdo-api.version>3.2.0-m7</jdo-api.version>
 
-        <datanucleus-core.version>5.1.2</datanucleus-core.version>
-        <datanucleus-api-jdo.version>5.1.2</datanucleus-api-jdo.version>
+        <datanucleus-core.version>5.1.5-SNAPSHOT</datanucleus-core.version>
+        <datanucleus-api-jdo.version>5.1.5-SNAPSHOT</datanucleus-api-jdo.version>
         <datanucleus-jdo-query.version>5.0.2</datanucleus-jdo-query.version>
-        <datanucleus-rdbms.version>5.1.2</datanucleus-rdbms.version>
+        <datanucleus-rdbms.version>5.1.5-SNAPSHOT</datanucleus-rdbms.version>
         <datanucleus-jodatime.version>5.1.0-release</datanucleus-jodatime.version>
 	<!--
 	    ISIS-1288: seen integration tests to fail;
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java
index 9aaf71b..059914b 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java
@@ -127,7 +127,7 @@ public final class IsisContext {
 
 	/**
 	 * TODO [andi-huber] not sure if required, initial idea was to force log4j
-	 * re-configuration on a undeply/deploy cycle
+	 * re-configuration on a undeploy/deploy cycle
 	 */
 	private static void resetLogging() {
 		org.apache.log4j.Logger.getRootLogger().removeAllAppenders();
@@ -136,4 +136,5 @@ public final class IsisContext {
 
 
 
+
 }
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java
index 8fafca8..986e649 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java
@@ -18,6 +18,9 @@
  */
 package org.apache.isis.core.runtime.system.persistence;
 
+import java.io.IOException;
+import java.net.URL;
+import java.util.Enumeration;
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
@@ -32,15 +35,19 @@ import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
 import org.apache.isis.core.runtime.system.context.IsisContext;
 import org.apache.isis.objectstore.jdo.datanucleus.CreateSchemaObjectFromClassMetadata;
+import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusLifeCycleHelper;
 import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPropertiesAware;
 import org.apache.isis.objectstore.jdo.metamodel.facets.object.query.JdoNamedQuery;
 import org.apache.isis.objectstore.jdo.metamodel.facets.object.query.JdoQueryFacet;
+import org.datanucleus.ClassLoaderResolver;
 import org.datanucleus.PersistenceNucleusContext;
 import org.datanucleus.PropertyNames;
 import org.datanucleus.api.jdo.JDOPersistenceManagerFactory;
 import org.datanucleus.metadata.MetaDataListener;
 import org.datanucleus.metadata.MetaDataManager;
+import org.datanucleus.store.AbstractStoreManager;
 import org.datanucleus.store.StoreManager;
+import org.datanucleus.store.autostart.AutoStartMechanism;
 import org.datanucleus.store.schema.SchemaAwareStoreManager;
 
 import com.google.common.base.Joiner;
@@ -109,6 +116,21 @@ public class DataNucleusApplicationComponents implements ApplicationScopedCompon
 
         namedQueryByName = catalogNamedQueries(persistableClassNameSet);
     }
+    
+    /** 
+     * Marks the end of DataNucleus' life-cycle. Purges any state associated with DN. 
+     * Subsequent calls have no effect.  
+     * 
+     * @author ahuber@apache.org
+     * @since 2.0.0
+     */
+    public void shutdown() {
+    	instance = null;
+    	if(persistenceManagerFactory != null) {
+    		DataNucleusLifeCycleHelper.cleanUp(persistenceManagerFactory);
+    		persistenceManagerFactory = null;
+    	}
+    }
 
     private static boolean isSchemaAwareStoreManager(Map<String,String> datanucleusProps) {
 
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
index 4be046c..989c989 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
@@ -164,7 +164,11 @@ public class PersistenceSessionFactory implements ApplicationScopedComponent, Fi
     //region > shutdown
     @Programmatic
     public final void shutdown() {
-        // no-op
+    	//XXX ISIS-1756 purge any DataNucleus State
+    	if(applicationComponents != null) {
+    		applicationComponents.shutdown();
+    		applicationComponents = null;
+    	}
     }
 
     //endregion
diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusLifeCycleHelper.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusLifeCycleHelper.java
new file mode 100644
index 0000000..93ba482
--- /dev/null
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusLifeCycleHelper.java
@@ -0,0 +1,125 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.objectstore.jdo.datanucleus;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.reflect.Field;
+import java.util.Map;
+import java.util.function.Consumer;
+
+import javax.jdo.PersistenceManagerFactory;
+
+import org.apache.isis.core.runtime.system.context.IsisContext;
+import org.datanucleus.ClassLoaderResolver;
+import org.datanucleus.PersistenceNucleusContext;
+import org.datanucleus.api.jdo.JDOPersistenceManagerFactory;
+import org.datanucleus.enhancer.EnhancementHelper;
+import org.datanucleus.store.AbstractStoreManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * 
+ * Purges any state associated with DataNucleus.
+ * 
+ * @author ahuber@apache.org
+ * @since 2.0.0
+ *
+ */
+public class DataNucleusLifeCycleHelper {
+	
+    private static final Logger LOG = LoggerFactory.getLogger(DataNucleusLifeCycleHelper.class);
+
+	public static void cleanUp(PersistenceManagerFactory persistenceManagerFactory) {
+		
+		try {
+			
+			final ClassLoader cl = IsisContext.getClassLoader();
+			
+			if(persistenceManagerFactory instanceof JDOPersistenceManagerFactory) {
+				
+				final JDOPersistenceManagerFactory jdoPMF = 
+						(JDOPersistenceManagerFactory) persistenceManagerFactory;
+				final PersistenceNucleusContext nucleusContext = jdoPMF.getNucleusContext();
+				final AbstractStoreManager storeManager = 
+						(AbstractStoreManager)nucleusContext.getStoreManager();
+				
+			
+				persistenceManagerFactory.getManagedClasses()
+				.forEach(clazz->{
+			        final ClassLoaderResolver clr = nucleusContext.getClassLoaderResolver(cl);
+	    		     	    		        
+			        // Un-manage from the store
+			        storeManager.unmanageClass(clr,	clazz.getName(), false);
+			        
+					 // Unload the meta-data for this class
+			        nucleusContext.getMetaDataManager().unloadMetaDataForClass(clazz.getName());
+				});
+			}
+			
+			persistenceManagerFactory.close();
+			dnUnregisterClassesManagedBy(cl);
+			
+			
+		} catch (Exception e) {
+			// ignore, since it only affects re-deploy-ability, which is nice to have but not critical
+		}
+
+	}
+    
+    // -- HELPER
+    
+    private static void dnUnregisterClassesManagedBy(ClassLoader cl) {
+    	if(cl==null)
+    		return;
+		visitDNRegisteredClasses(map->
+			map.entrySet()
+			.removeIf(entry->cl.equals(entry.getKey().getClassLoader()))
+		);
+	}
+    
+    // -- LOW LEVEL REFLECTION
+    
+	private final static MethodHandle getRegisteredClassesMH;
+	static {
+		MethodHandle mh;		
+		try {
+			Field registeredClasses = EnhancementHelper.class.getDeclaredField("registeredClasses");
+			registeredClasses.setAccessible(true);
+			mh = MethodHandles.lookup().unreflectGetter(registeredClasses);
+			registeredClasses.setAccessible(false);
+		} catch (Exception e) {
+			mh = null;
+			e.printStackTrace();
+		}
+		getRegisteredClassesMH = mh;
+	}
+	
+	private static void visitDNRegisteredClasses(Consumer<Map<Class<?>, ?>> visitor){
+		try {
+			visitor.accept( (Map<Class<?>, ?>) getRegisteredClassesMH.invoke() );
+		} catch (Throwable e) {
+			LOG.warn("Failed to access DataNucleus' EnhancementHelper via reflection.", e);
+		}
+	}
+
+
+
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 09/32: ISIS-1727: uses lambda in IsisSessionFactoryBuilder

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 380398caecbf84161854d678d1f2476504f1d9f9
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Sep 19 22:56:54 2017 +0100

    ISIS-1727: uses lambda in IsisSessionFactoryBuilder
---
 .../system/session/IsisSessionFactoryBuilder.java  | 25 ++++++++++------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java
index 1ddcaf7..b9d4e21 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryBuilder.java
@@ -209,22 +209,19 @@ public class IsisSessionFactoryBuilder {
 
 
             isisSessionFactory.doInSession(
-                    new Runnable() {
-                        @Override
-                        public void run() {
-                            try {
-                                specificationLoader.validateAndAssert();
-
-                            } catch (final MetaModelInvalidException ex) {
-                                // no need to use a higher level, such as error(...); the calling code will expose any metamodel
-                                // validation errors in their own particular way.
-                                if(LOG.isDebugEnabled()) {
-                                    LOG.debug("Meta model invalid", ex);
-                                }
-                                IsisContext.setMetaModelInvalidException(ex);
+                    () -> {
+                        try {
+                            specificationLoader.validateAndAssert();
+
+                        } catch (final MetaModelInvalidException ex) {
+                            // no need to use a higher level, such as error(...); the calling code will expose any metamodel
+                            // validation errors in their own particular way.
+                            if(LOG.isDebugEnabled()) {
+                                LOG.debug("Meta model invalid", ex);
                             }
-
+                            IsisContext.setMetaModelInvalidException(ex);
                         }
+
                     }
             );
 

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 19/32: ISIS-1754 context aware class-loading for Isis

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 2914ee29c76cfd5e0665855966f0ee03a0a86ec7
Author: Andi Huber <ah...@apache.org>
AuthorDate: Mon Oct 30 17:29:14 2017 +0100

    ISIS-1754 context aware class-loading for Isis
---
 .../core/runtime/services/ServiceInstantiator.java |   4 +-
 .../core/runtime/system/context/IsisContext.java   | 149 ++++++++++++---------
 .../IsisComponentProvider.java                     |   8 +-
 3 files changed, 98 insertions(+), 63 deletions(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServiceInstantiator.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServiceInstantiator.java
index 3303118..38ee52f 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServiceInstantiator.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServiceInstantiator.java
@@ -42,6 +42,7 @@ import org.apache.isis.core.commons.lang.ArrayExtensions;
 import org.apache.isis.core.commons.lang.MethodExtensions;
 import org.apache.isis.core.metamodel.services.ServicesInjector;
 import org.apache.isis.core.metamodel.specloader.classsubstitutor.JavassistEnhanced;
+import org.apache.isis.core.runtime.system.context.IsisContext;
 
 import javassist.util.proxy.MethodFilter;
 import javassist.util.proxy.MethodHandler;
@@ -110,8 +111,7 @@ public final class ServiceInstantiator {
     private Class<?> loadClass(final String className) {
         try {
             LOG.debug("loading class for service: " + className);
-            //return Thread.currentThread().getContextClassLoader().loadClass(className);
-            return Class.forName(className);
+            return IsisContext.getClassLoader().loadClass(className);
         } catch (final ClassNotFoundException ex) {
             throw new InitialisationException(String.format("Cannot find class '%s' for service", className));
         }
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java
index dd63f0f..f26b6d9 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java
@@ -25,74 +25,103 @@ import org.slf4j.LoggerFactory;
 import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.metamodel.specloader.validator.MetaModelInvalidException;
 import org.apache.isis.core.runtime.system.session.IsisSessionFactoryBuilder;
+import org.apache.log4j.BasicConfigurator;
 import org.apache.isis.core.runtime.system.session.IsisSession;
 import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
 
 /**
- * Simply a static field holding the {@link IsisSessionFactory} singleton, and conveneince methods to obtain the
+ * Simply a static field holding the {@link IsisSessionFactory} singleton, and convenience methods to obtain the
  * current {@link IsisSession}, along with application-scoped components and also any transaction-scoped components.
  */
 public final class IsisContext {
 
-    private static final Logger LOG = LoggerFactory.getLogger(IsisContext.class);
-
-    private IsisContext(){
-        throw new IllegalStateException("Never instantiated");
-    }
-
-    //region > metaModelInvalidExceptionIfAny (static)
-    /**
-     * Populated only if the metamodel was found to be invalid
-     */
-    private static MetaModelInvalidException metamodelInvalidException;
-
-    public static MetaModelInvalidException getMetaModelInvalidExceptionIfAny() {
-        return IsisContext.metamodelInvalidException;
-    }
-    public static void setMetaModelInvalidException(final MetaModelInvalidException metaModelInvalid) {
-        IsisContext.metamodelInvalidException = metaModelInvalid;
-    }
-    //endregion
-
-    //region > sessionFactory (static)
-
-    private static IsisSessionFactory sessionFactory;
-
-    public static IsisSessionFactory getSessionFactory() {
-        return sessionFactory;
-    }
-
-
-    /**
-     * Intended to be called only by {@link IsisSessionFactoryBuilder}.
-     */
-    public static void setSessionFactory(final IsisSessionFactory sessionFactory) {
-        if (IsisContext.sessionFactory != null) {
-            throw new IsisException("SessionFactory already set up");
-        }
-        IsisContext.sessionFactory = sessionFactory;
-    }
-    
-    /**
-     * Resets
-     * @deprecated replaced by {@link #destroy()}
-     * 
-     */
-    @Deprecated
-    public static void testReset() {
-    	destroy();
-    }
-    
-    /**
-     * Destroys this context and clears any state associated with it. 
-     * It marks the end of IsisContext's lifecycle. Subsequent calls have no effect. 
-     */
-    public static void destroy() {
-        sessionFactory = null;
-        metamodelInvalidException = null;
-    }
-
-    //endregion
+	private static final Logger log = LoggerFactory.getLogger(IsisContext.class);
+
+	// -- CONSTRUCTOR
+
+	private IsisContext(){
+		throw new IllegalStateException("Never instantiated");
+	}
+
+	// -- META MODEL VALIDATION
+
+	/**
+	 * Populated only if the metamodel was found to be invalid
+	 */
+	private static MetaModelInvalidException metamodelInvalidException;
+
+	public static MetaModelInvalidException getMetaModelInvalidExceptionIfAny() {
+		return IsisContext.metamodelInvalidException;
+	}
+	public static void setMetaModelInvalidException(final MetaModelInvalidException metaModelInvalid) {
+		IsisContext.metamodelInvalidException = metaModelInvalid;
+	}
+
+	// -- SESSION FACTORY
+
+	private static IsisSessionFactory sessionFactory;
+
+	public static IsisSessionFactory getSessionFactory() {
+		return sessionFactory;
+	}
+
+	/**
+	 * Intended to be called only by {@link IsisSessionFactoryBuilder}.
+	 */
+	public static void setSessionFactory(final IsisSessionFactory sessionFactory) {
+		if (IsisContext.sessionFactory != null) {
+			throw new IsisException("SessionFactory already set up");
+		}
+		IsisContext.sessionFactory = sessionFactory;
+	}
+
+	// -- LIFE CYCLING
+
+	/**
+	 * Resets
+	 * @deprecated replaced by {@link #destroy()}
+	 * 
+	 */
+	@Deprecated
+	public static void testReset() {
+		destroy();
+	}
+
+	/**
+	 * life-cycle exit point
+	 * <p>
+	 * Destroys this context and clears any state associated with it. 
+	 * It marks the end of IsisContext's life-cycle. Subsequent calls have no effect.
+	 * </p> 
+	 */
+	public static void destroy() {
+		sessionFactory = null;
+		metamodelInvalidException = null;
+		log.info("destroyed");
+		resetLogging();
+	}
+
+	// -- CLASS LOADING
+
+	/**
+	 * 
+	 * @return the framework's default class-loader
+	 */
+	public static ClassLoader getClassLoader() {
+		//TODO requires skinny-war testing on glassfish, payara, wildfly, tomee, ...
+		return Thread.currentThread().getContextClassLoader();
+	}
+
+	// -- HELPER
+
+	/**
+	 * TODO [andi-huber] not sure if required, initial idea was to force log4j
+	 * re-configuration on a undeply/deploy cycle
+	 */
+	private static void resetLogging() {
+		org.apache.log4j.Logger.getRootLogger().removeAllAppenders();
+		BasicConfigurator.resetConfiguration();
+	}
 
 
 }
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
index 7b05b88..9eb8dae 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
@@ -37,7 +37,9 @@ import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 
+import org.reflections.Configuration;
 import org.reflections.Reflections;
+import org.reflections.util.ConfigurationBuilder;
 import org.reflections.vfs.Vfs;
 
 import org.apache.isis.applib.AppManifest;
@@ -65,6 +67,7 @@ import org.apache.isis.core.runtime.services.ServicesInstallerFromConfiguration;
 import org.apache.isis.core.runtime.services.ServicesInstallerFromConfigurationAndAnnotation;
 import org.apache.isis.core.runtime.system.IsisSystemException;
 import org.apache.isis.core.runtime.system.SystemConstants;
+import org.apache.isis.core.runtime.system.context.IsisContext;
 import org.apache.isis.objectstore.jdo.service.RegisterEntities;
 import org.apache.isis.progmodels.dflt.JavaReflectorHelper;
 import org.apache.isis.progmodels.dflt.ProgrammingModelFacetsJava5;
@@ -141,7 +144,10 @@ public abstract class IsisComponentProvider {
 
         Vfs.setDefaultURLTypes(ClassDiscoveryServiceUsingReflections.getUrlTypes());
 
-        final Reflections reflections = new Reflections(moduleAndFrameworkPackages);
+        final Configuration reflectionsConfig = new ConfigurationBuilder()
+        		.addClassLoader(IsisContext.getClassLoader())
+        		.forPackages(moduleAndFrameworkPackages.toArray(new String[] {}));
+        final Reflections reflections = new Reflections(reflectionsConfig);
 
         final Set<Class<?>> domainServiceTypes = reflections.getTypesAnnotatedWith(DomainService.class);
         final Set<Class<?>> persistenceCapableTypes = findPersistenceCapableTypes(reflections);

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 04/32: ISIS-1276: fixes compile issues in metamodel and runtime

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 14179e1e523753291677eeccba2eceeed659598a
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Sep 18 22:29:13 2017 +0100

    ISIS-1276: fixes compile issues in metamodel and runtime
---
 .../value/vsp/ValueSemanticsProviderUtil.java      |  2 --
 ...ionParameterAbstractTest_getId_and_getName.java |  8 ++++---
 .../DataNucleusApplicationComponents.java          |  2 +-
 .../persistence/PersistenceSessionFactory.java     |  2 +-
 .../CreateSchemaObjectFromClassMetadata.java       |  3 ++-
 .../service/support/IsisJdoSupportImpl.java        | 27 +++++++++-------------
 6 files changed, 20 insertions(+), 24 deletions(-)

diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/value/vsp/ValueSemanticsProviderUtil.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/value/vsp/ValueSemanticsProviderUtil.java
index 03658a5..b34d5fe 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/value/vsp/ValueSemanticsProviderUtil.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/value/vsp/ValueSemanticsProviderUtil.java
@@ -24,7 +24,6 @@ import com.google.common.base.Strings;
 import org.apache.isis.applib.adapters.ValueSemanticsProvider;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.lang.ClassUtil;
-import org.apache.isis.core.commons.lang.StringExtensions;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 
 public final class ValueSemanticsProviderUtil {
@@ -46,7 +45,6 @@ public final class ValueSemanticsProviderUtil {
         @SuppressWarnings("rawtypes")
         final Class clazz = candidateClass != null ? ClassUtil.implementingClassOrNull(candidateClass.getName(), ValueSemanticsProvider.class, FacetHolder.class) : null;
         return clazz != null ? clazz : (Class)ClassUtil.implementingClassOrNull(classCandidateName, ValueSemanticsProvider.class, FacetHolder.class);
-
     }
 
 }
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstractTest_getId_and_getName.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstractTest_getId_and_getName.java
index 1f3fcc3..3e1eb76 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstractTest_getId_and_getName.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstractTest_getId_and_getName.java
@@ -19,6 +19,8 @@
 
 package org.apache.isis.core.metamodel.specloader.specimpl;
 
+import javax.ws.rs.HEAD;
+
 import com.google.common.base.Predicate;
 import com.google.common.collect.Lists;
 
@@ -164,7 +166,7 @@ public class ObjectActionParameterAbstractTest_getId_and_getName {
                 one(actionParamPeer).getFacet(NamedFacet.class);
                 will(returnValue(null));
 
-                one(parentAction).getParameters((Predicate<ObjectActionParameter>) with(Expectations.<Predicate>anything()));
+                one(parentAction).getParameters(with(Expectations.<Predicate<ObjectActionParameter>>anything()));
                 will(returnValue(Lists.newArrayList(objectActionParameter)));
             }
         });
@@ -183,7 +185,7 @@ public class ObjectActionParameterAbstractTest_getId_and_getName {
                 one(actionParamPeer).getFacet(NamedFacet.class);
                 will(returnValue(null));
 
-                one(parentAction).getParameters(with(Expectations.<Predicate>anything()));
+                one(parentAction).getParameters(with(Expectations.<Predicate<ObjectActionParameter>>anything()));
                 will(returnValue(Lists.newArrayList(stubObjectActionParameterString, objectActionParameter, stubObjectActionParameterString2)));
             }
         });
@@ -202,7 +204,7 @@ public class ObjectActionParameterAbstractTest_getId_and_getName {
                 one(actionParamPeer).getFacet(NamedFacet.class);
                 will(returnValue(null));
 
-                one(parentAction).getParameters(with(Expectations.<Predicate>anything()));
+                one(parentAction).getParameters(with(Expectations.<Predicate<ObjectActionParameter>>anything()));
                 will(returnValue(Lists.newArrayList(stubObjectActionParameterString, objectActionParameter, stubObjectActionParameterString2)));
             }
         });
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java
index 52ac35b..a68ce06 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java
@@ -144,7 +144,7 @@ public class DataNucleusApplicationComponents implements ApplicationScopedCompon
                 // (if the configured StoreMgr supports it, and if requested in isis.properties)
                 //
                 datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_ALL, "false"); // turn off, cos want to do the schema object ourselves...
-                datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_SCHEMA, "false");
+                datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_DATABASE, "false");
                 datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_TABLES, "true"); // but have DN do everything else...
                 datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_COLUMNS, "true");
                 datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_CONSTRAINTS, "true");
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
index 4504548..8a89c8a 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
@@ -112,7 +112,7 @@ public class PersistenceSessionFactory implements ApplicationScopedComponent, Fi
         putIfNotPresent(props, "javax.jdo.PersistenceManagerFactoryClass", JDOPersistenceManagerFactory.class.getName());
 
         // previously we defaulted this property to "true", but that could cause the target database to be modified
-        putIfNotPresent(props, PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_SCHEMA, Boolean.FALSE.toString());
+        putIfNotPresent(props, PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_DATABASE, Boolean.FALSE.toString());
 
         putIfNotPresent(props, PropertyNames.PROPERTY_SCHEMA_VALIDATE_ALL, Boolean.TRUE.toString());
         putIfNotPresent(props, PropertyNames.PROPERTY_CACHE_L2_TYPE, "none");
diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java
index 990e52d..d2ee742 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/CreateSchemaObjectFromClassMetadata.java
@@ -31,10 +31,11 @@ import org.datanucleus.ClassLoaderResolver;
 import org.datanucleus.enhancer.EnhancementNucleusContextImpl;
 import org.datanucleus.metadata.AbstractClassMetaData;
 import org.datanucleus.metadata.MetaDataListener;
-import org.datanucleus.store.encryption.ConnectionEncryptionProvider;
+import org.datanucleus.store.ConnectionEncryptionProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+
 /**
  * Implementation note: the methods in this class are <tt>protected</tt> to allow for easy subclassing.
  */
diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
index a9a2ac5..e5171c9 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
@@ -29,16 +29,14 @@ import java.util.Map;
 import java.util.concurrent.Callable;
 
 import javax.jdo.Extent;
+import javax.jdo.JDOQLTypedQuery;
 import javax.jdo.PersistenceManager;
 import javax.jdo.datastore.JDOConnection;
+import javax.jdo.query.BooleanExpression;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 
-import org.datanucleus.api.jdo.JDOPersistenceManager;
-import org.datanucleus.query.typesafe.BooleanExpression;
-import org.datanucleus.query.typesafe.TypesafeQuery;
-
 import org.apache.isis.applib.FatalException;
 import org.apache.isis.applib.annotation.DomainService;
 import org.apache.isis.applib.annotation.NatureOfService;
@@ -158,12 +156,9 @@ public class IsisJdoSupportImpl implements IsisJdoSupport {
             
             // temporarily disable concurrency checking while this method is performed
             try {
-                ConcurrencyChecking.executeWithConcurrencyCheckingDisabled(new Callable<Void>() {
-                    @Override
-                    public Void call() {
-                        getJdoPersistenceManager().deletePersistentAll(instances);
-                        return null;
-                    }
+                ConcurrencyChecking.executeWithConcurrencyCheckingDisabled((Callable<Void>) () -> {
+                    getJdoPersistenceManager().deletePersistentAll(instances);
+                    return null;
                 });
             } catch (final Exception ex) {
                 throw new FatalException(ex);
@@ -176,31 +171,31 @@ public class IsisJdoSupportImpl implements IsisJdoSupport {
     @Programmatic
     @Override
     public <T> List<T> executeQuery(final Class<T> cls, final BooleanExpression expression) {
-        final TypesafeQuery<T> query = newTypesafeQuery(cls).filter(expression);
+        final JDOQLTypedQuery<T> query = newTypesafeQuery(cls).filter(expression);
         return executeListAndClose(query);
     }
 
     @Programmatic
     @Override
     public <T> T executeQueryUnique(final Class<T> cls, final BooleanExpression expression) {
-        final TypesafeQuery<T> query = newTypesafeQuery(cls).filter(expression);
+        final JDOQLTypedQuery<T> query = newTypesafeQuery(cls).filter(expression);
         return executeUniqueAndClose(query);
     }
 
     @Programmatic
     @Override
-    public <T> TypesafeQuery<T> newTypesafeQuery(Class<T> cls) {
-        return ((JDOPersistenceManager)getJdoPersistenceManager()).newTypesafeQuery(cls);
+    public <T> JDOQLTypedQuery<T> newTypesafeQuery(Class<T> cls) {
+        return getJdoPersistenceManager().newJDOQLTypedQuery(cls);
     }
 
-    private static <T> List<T> executeListAndClose(final TypesafeQuery<T> query) {
+    private static <T> List<T> executeListAndClose(final JDOQLTypedQuery<T> query) {
         final List<T> elements = query.executeList();
         final List<T> list = Lists.newArrayList(elements);
         query.closeAll();
         return list;
     }
 
-    private static <T> T executeUniqueAndClose(final TypesafeQuery<T> query) {
+    private static <T> T executeUniqueAndClose(final JDOQLTypedQuery<T> query) {
         final T result = query.executeUnique();
         query.closeAll();
         return result;

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 15/32: ISIS-1755 JEE 7+ allow coexistence of CDI and Isis' ServiceInjector

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 150f7c16fe3867d2216f29c521ed0606b7813ca0
Author: Andi Huber <ah...@apache.org>
AuthorDate: Sun Oct 29 09:33:17 2017 +0100

    ISIS-1755 JEE 7+ allow coexistence of CDI and Isis' ServiceInjector
---
 .../webapp/jee/IsisCDIBeanScanInterceptor.java     | 97 ++++++++++++++++++++++
 .../services/javax.enterprise.inject.spi.Extension |  1 +
 2 files changed, 98 insertions(+)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisCDIBeanScanInterceptor.java b/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisCDIBeanScanInterceptor.java
new file mode 100644
index 0000000..6632a59
--- /dev/null
+++ b/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisCDIBeanScanInterceptor.java
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.core.webapp.jee;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
+import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.ProcessAnnotatedType;
+
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.services.metrics.MetricsService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * 
+ * A CDI inject extension @see <a href="https://docs.jboss.org/weld/reference/latest/en-US/html/extend.html">weld</a>,
+ * that lets CDI ignore certain Beans we declare tabu. 
+ * <p>
+ * This extension is registered as a service provider by creating a file named 
+ * {@code META-INF/services/javax.enterprise.inject.spi.Extension}, 
+ * which contains the name of this extension class.
+ * </p>
+ * 
+ * <p>
+ * Beans declared tabu are managed (meaning instantiation and dependency injection) 
+ * by Isis itself. All other Beans are allowed to be managed by CDI.
+ * </p>
+ * 
+ * @author ahuber@apache.org
+ *
+ */
+final class IsisCDIBeanScanInterceptor implements Extension {
+	
+	private static final Logger log = LoggerFactory.getLogger(IsisCDIBeanScanInterceptor.class);
+
+	/**
+	 * Declaration of Beans that are managed by Isis and should be ignored by CDI. 
+	 * (in addition to those that have the @DomainService annotation)
+	 */
+	private static final Set<String> tabu = new HashSet<>();
+	{
+		tabu.add(MetricsService.class.getName());
+	}
+	
+	void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event) {
+		log.info("beginning the scanning process");
+	}
+
+	<T> void processAnnotatedType(@Observes ProcessAnnotatedType<T> event) {
+
+		final String className = event.getAnnotatedType().getJavaClass().getName();
+		
+		if(isTabu(className, event)) {
+			log.debug("veto type: " + className);
+			event.veto();
+		} else {
+			log.debug("allowing type: " + className);
+		}
+	}
+
+	void afterBeanDiscovery(@Observes AfterBeanDiscovery event) {
+		log.info("finished the scanning process");
+	}
+	
+	// -- HELPER
+	
+	private boolean isTabu(String className, ProcessAnnotatedType<?> event) {
+		if(tabu.contains(className))
+			return true;
+		if(event.getAnnotatedType().isAnnotationPresent(DomainService.class))
+			return true;
+		
+		return false;
+	}
+
+}
diff --git a/core/runtime/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension b/core/runtime/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
new file mode 100644
index 0000000..1be69b2
--- /dev/null
+++ b/core/runtime/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
@@ -0,0 +1 @@
+org.apache.isis.core.webapp.jee.IsisCDIBeanScanInterceptor
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 10/32: ISIS-1726: generalizes the logic that searches for @PersistenceCapable entities, to also take into account meta-annotations.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 13c70c27f11dc30b82b322dcea56a5d8a180ce07
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Sep 19 22:59:43 2017 +0100

    ISIS-1726: generalizes the logic that searches for @PersistenceCapable entities, to also take into account meta-annotations.
---
 .../IsisComponentProvider.java                     | 35 ++++++++++++++++++----
 1 file changed, 30 insertions(+), 5 deletions(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
index 890e831..f7ba2b1 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
@@ -19,14 +19,17 @@
 
 package org.apache.isis.core.runtime.systemusinginstallers;
 
+import java.lang.annotation.Annotation;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 import javax.annotation.Nullable;
 import javax.jdo.annotations.PersistenceCapable;
+import javax.ws.rs.HEAD;
 
 import com.google.common.base.Function;
 import com.google.common.base.Joiner;
@@ -142,7 +145,7 @@ public abstract class IsisComponentProvider {
         final Reflections reflections = new Reflections(moduleAndFrameworkPackages);
 
         final Set<Class<?>> domainServiceTypes = reflections.getTypesAnnotatedWith(DomainService.class);
-        final Set<Class<?>> persistenceCapableTypes = reflections.getTypesAnnotatedWith(PersistenceCapable.class);
+        final Set<Class<?>> persistenceCapableTypes = findPersistenceCapableTypes(reflections);
         final Set<Class<? extends FixtureScript>> fixtureScriptTypes = reflections.getSubTypesOf(FixtureScript.class);
 
         final Set<Class<?>> mixinTypes = Sets.newHashSet();
@@ -150,9 +153,13 @@ public abstract class IsisComponentProvider {
 
         final Set<Class<?>> domainObjectTypes = reflections.getTypesAnnotatedWith(DomainObject.class);
         mixinTypes.addAll(
-                domainObjectTypes.stream()
-                        .filter(input -> input.getAnnotation(DomainObject.class).nature() == Nature.MIXIN)
-                        .collect(Collectors.toList())
+                domainObjectTypes.stream().filter(input -> {
+                    if (input == null) {
+                        return false;
+                    }
+                    final DomainObject annotation = input.getAnnotation(DomainObject.class);
+                    return annotation.nature() == Nature.MIXIN;
+                }).collect(Collectors.toList())
         );
 
         // add in any explicitly registered services...
@@ -192,12 +199,30 @@ public abstract class IsisComponentProvider {
     }
     static private boolean containedWithin(final List<String> packagesWithDotSuffix, final String className) {
         for (String packageWithDotSuffix : packagesWithDotSuffix) {
-            if(className.startsWith(packageWithDotSuffix)) {
+            if (className.startsWith(packageWithDotSuffix)) {
                 return true;
             }
         }
         return false;
     }
+    private Set<Class<?>> findPersistenceCapableTypes(final Reflections reflections) {
+
+        Set<Class<?>> pcSet = Sets.newLinkedHashSet();
+
+        Set<Class<?>> persistenceCapables = reflections.getTypesAnnotatedWith(PersistenceCapable.class);
+        persistenceCapables.stream()
+                .filter(x -> !x.isAnnotation())
+                .forEach(pcSet::add);
+
+        Stream<Class<? extends Annotation>> pcMetaAnnotStream =
+                (Stream)persistenceCapables.stream().filter(x -> x.isAnnotation());
+        pcMetaAnnotStream.map(metaAnnot -> reflections.getTypesAnnotatedWith(metaAnnot).stream())
+                .flatMap(x -> x)
+                .filter(x -> !x.isAnnotation())
+                .forEach(pcSet::add);
+
+        return pcSet;
+    }
 
     private void specifyServicesAndRegisteredEntitiesUsing(final AppManifest appManifest) {
         final Iterable<String> packageNames = modulePackageNamesFrom(appManifest);

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 29/32: ISIS-1744: updates to DN 5.1.5

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit d8709d1c788f801d11bdd88d6b199452e78a788a
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Jan 5 14:46:25 2018 +0000

    ISIS-1744: updates to DN 5.1.5
---
 core/pom.xml                           | 6 +++---
 example/application/helloworld/pom.xml | 2 +-
 example/application/simpleapp/pom.xml  | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/core/pom.xml b/core/pom.xml
index 737f95c..cda9a40 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -86,10 +86,10 @@
         <!-- Datanucleus Objectstore -->
         <jdo-api.version>3.2.0-m7</jdo-api.version>
 
-        <datanucleus-core.version>5.1.5-SNAPSHOT</datanucleus-core.version>
-        <datanucleus-api-jdo.version>5.1.5-SNAPSHOT</datanucleus-api-jdo.version>
+        <datanucleus-core.version>5.1.5</datanucleus-core.version>
+        <datanucleus-api-jdo.version>5.1.4</datanucleus-api-jdo.version>
         <datanucleus-jdo-query.version>5.0.2</datanucleus-jdo-query.version>
-        <datanucleus-rdbms.version>5.1.5-SNAPSHOT</datanucleus-rdbms.version>
+        <datanucleus-rdbms.version>5.1.5</datanucleus-rdbms.version>
         <datanucleus-jodatime.version>5.1.0-release</datanucleus-jodatime.version>
 	<!--
 	    ISIS-1288: seen integration tests to fail;
diff --git a/example/application/helloworld/pom.xml b/example/application/helloworld/pom.xml
index aee7956..dab1b17 100644
--- a/example/application/helloworld/pom.xml
+++ b/example/application/helloworld/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.incode</groupId>
         <artifactId>incode-build</artifactId>
-        <version>3-SNAPSHOT</version>
+        <version>4</version>
     </parent>
 
     <groupId>org.apache.isis.example.application</groupId>
diff --git a/example/application/simpleapp/pom.xml b/example/application/simpleapp/pom.xml
index eb423d2..54b7a1e 100644
--- a/example/application/simpleapp/pom.xml
+++ b/example/application/simpleapp/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.incode</groupId>
         <artifactId>incode-build</artifactId>
-        <version>3-SNAPSHOT</version>
+        <version>4</version>
     </parent>
 
     <groupId>org.apache.isis.example.application</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 22/32: ISIS-1775 added license

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 80a977ff24dff6693931aa086b8d2f3ad2406622
Author: Andi Huber <ah...@apache.org>
AuthorDate: Sun Nov 12 19:55:13 2017 +0100

    ISIS-1775 added license
---
 .../apache/isis/core/webapp/WebAppContextSupport.java | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/core/metamodel/src/main/java/org/apache/isis/core/webapp/WebAppContextSupport.java b/core/metamodel/src/main/java/org/apache/isis/core/webapp/WebAppContextSupport.java
index 044fe67..10aa314 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/webapp/WebAppContextSupport.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/webapp/WebAppContextSupport.java
@@ -1,3 +1,22 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
 package org.apache.isis.core.webapp;
 
 import javax.servlet.ServletContext;

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 12/32: Merge branch 'dev/2.0.0/ISIS-1276-dn-5-1' into dev/2.0.0-M2

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 0a15e71661e3689ff9561f2be922458dcf87faac
Merge: e97fa3c fbd8ee1
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Jan 5 10:24:12 2018 +0000

    Merge branch 'dev/2.0.0/ISIS-1276-dn-5-1' into dev/2.0.0-M2

 core/applib/pom.xml                                | 39 +--------
 .../applib/services/jdosupport/IsisJdoSupport.java |  7 +-
 .../value/vsp/ValueSemanticsProviderUtil.java      |  2 -
 ...ionParameterAbstractTest_getId_and_getName.java |  8 +-
 core/pom.xml                                       | 21 +++--
 .../DataNucleusApplicationComponents.java          |  2 +-
 .../persistence/PersistenceSessionFactory.java     |  4 +-
 .../PersistenceSessionFactoryMetamodelRefiner.java |  1 -
 .../system/session/IsisSessionFactoryBuilder.java  | 25 +++---
 .../IsisComponentProvider.java                     | 34 ++++++--
 .../CreateSchemaObjectFromClassMetadata.java       |  3 +-
 .../persistence/spi/JdoObjectIdSerializer.java     | 45 +++-------
 .../service/support/IsisJdoSupportImpl.java        | 29 +++----
 .../objectstore/jdo/service/RegisterEntities.java  | 96 ++--------------------
 core/unittestsupport/pom.xml                       |  5 +-
 example/application/helloworld/pom.xml             |  4 +-
 .../java/domainapp/dom/impl/HelloWorldObject.java  |  6 +-
 .../java/domainapp/dom/impl/HelloWorldObjects.java |  9 +-
 .../modules/simple/dom/impl/SimpleObjects.java     |  7 +-
 example/application/simpleapp/pom.xml              |  2 +-
 20 files changed, 114 insertions(+), 235 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 27/32: Merge branch 'ISIS-1767-jee-7' into dev/2.0.0-M2

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 8cce64e826866f524a15ece2149fff3b55ee98d0
Merge: 0a15e71 32df2f1
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Jan 5 10:44:48 2018 +0000

    Merge branch 'ISIS-1767-jee-7' into dev/2.0.0-M2

 .../services/swagger/SwaggerServiceDefault.java    |  15 +-
 .../isis/core/webapp/WebAppContextSupport.java     |  50 ++++++
 core/pom.xml                                       |  16 +-
 core/runtime/pom.xml                               |   5 +
 .../core/runtime/services/ServiceInstantiator.java |   4 +-
 .../core/runtime/system/context/IsisContext.java   | 170 +++++++++++++--------
 .../DataNucleusApplicationComponents.java          |  49 ++++--
 .../persistence/PersistenceSessionFactory.java     |   6 +-
 .../IsisComponentProvider.java                     |   8 +-
 .../webapp/jee/IsisCDIBeanScanInterceptor.java     | 102 +++++++++++++
 .../webapp/jee/PersistenceUnitNoopProvider.java    | 112 ++++++++++++++
 .../CreateSchemaObjectFromClassMetadata.java       |   9 +-
 .../datanucleus/DataNucleusLifeCycleHelper.java    | 136 +++++++++++++++++
 .../src/main/resources/META-INF/persistence.xml    |   8 +
 .../services/javax.enterprise.inject.spi.Extension |   1 +
 .../wicket/viewer/IsisWicketApplication.java       |  98 ++++++------
 16 files changed, 653 insertions(+), 136 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 03/32: ISIS-1276: updates applib, replaces references of TypesafeQuery to be instead JDOQLTypedQuery

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit b1ff901057ffa437060cbc73de9bfc74aec3daf6
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Sep 18 22:17:54 2017 +0100

    ISIS-1276: updates applib, replaces references of TypesafeQuery to be instead JDOQLTypedQuery
---
 .../org/apache/isis/applib/services/jdosupport/IsisJdoSupport.java | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/jdosupport/IsisJdoSupport.java b/core/applib/src/main/java/org/apache/isis/applib/services/jdosupport/IsisJdoSupport.java
index 4ca5c10..75a4e0f 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/jdosupport/IsisJdoSupport.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/jdosupport/IsisJdoSupport.java
@@ -23,10 +23,9 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 
+import javax.jdo.JDOQLTypedQuery;
 import javax.jdo.PersistenceManager;
-
-import org.datanucleus.query.typesafe.BooleanExpression;
-import org.datanucleus.query.typesafe.TypesafeQuery;
+import javax.jdo.query.BooleanExpression;
 
 import org.apache.isis.applib.annotation.Programmatic;
 
@@ -132,5 +131,5 @@ public interface IsisJdoSupport {
      * </p>
      */
     @Programmatic
-    <T> TypesafeQuery<T> newTypesafeQuery(Class<T> cls);
+    <T> JDOQLTypedQuery<T> newTypesafeQuery(Class<T> cls);
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 20/32: ISIS-1755 TomEE requires Service Providers to be public classes

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 01f32e4dbc60317afe13ce153a60eb80dc148a21
Author: Andi Huber <ah...@apache.org>
AuthorDate: Tue Oct 31 09:01:45 2017 +0100

    ISIS-1755 TomEE requires Service Providers to be public classes
---
 .../org/apache/isis/core/webapp/jee/IsisCDIBeanScanInterceptor.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisCDIBeanScanInterceptor.java b/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisCDIBeanScanInterceptor.java
index 6632a59..c75605c 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisCDIBeanScanInterceptor.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisCDIBeanScanInterceptor.java
@@ -50,7 +50,7 @@ import org.slf4j.LoggerFactory;
  * @author ahuber@apache.org
  *
  */
-final class IsisCDIBeanScanInterceptor implements Extension {
+public final class IsisCDIBeanScanInterceptor implements Extension {
 	
 	private static final Logger log = LoggerFactory.getLogger(IsisCDIBeanScanInterceptor.class);
 

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 08/32: ISIS-1725: requires that an AppManifest is supplied (used to obtain list of entities).

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 9fafe95ad2692fd0ee7daa235a9fff486df91b25
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Sep 19 22:55:48 2017 +0100

    ISIS-1725: requires that an AppManifest is supplied (used to obtain list of entities).
---
 .../persistence/PersistenceSessionFactory.java     |  2 +-
 .../objectstore/jdo/service/RegisterEntities.java  | 96 ++--------------------
 2 files changed, 9 insertions(+), 89 deletions(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
index 8a89c8a..4be046c 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
@@ -93,7 +93,7 @@ public class PersistenceSessionFactory implements ApplicationScopedComponent, Fi
             final Map<String, String> datanucleusProps = dataNucleusConfig.asMap();
             addDataNucleusPropertiesIfRequired(datanucleusProps);
 
-            final RegisterEntities registerEntities = new RegisterEntities(configuration.asMap(), specificationLoader);
+            final RegisterEntities registerEntities = new RegisterEntities(specificationLoader);
             final Set<String> classesToBePersisted = registerEntities.getEntityTypes();
 
             applicationComponents = new DataNucleusApplicationComponents(jdoObjectstoreConfig, specificationLoader,
diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/service/RegisterEntities.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/service/RegisterEntities.java
index 538b5b1..a83b115 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/service/RegisterEntities.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/service/RegisterEntities.java
@@ -18,23 +18,13 @@
  */
 package org.apache.isis.objectstore.jdo.service;
 
-import java.util.Collections;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 
-import javax.jdo.annotations.PersistenceCapable;
-
-import com.google.common.base.Function;
 import com.google.common.base.Joiner;
-import com.google.common.base.Predicate;
-import com.google.common.base.Splitter;
-import com.google.common.base.Strings;
-import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 
-import org.reflections.Reflections;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -45,7 +35,11 @@ public class RegisterEntities {
 
     @SuppressWarnings("unused")
     private final static Logger LOG = LoggerFactory.getLogger(RegisterEntities.class);
-    
+
+    /**
+     * @deprecated - no longer used; instead an AppManifest must be specified.
+     */
+    @Deprecated
     public final static String PACKAGE_PREFIX_KEY = "isis.persistor.datanucleus.RegisterEntities.packagePrefix";
 
     // //////////////////////////////////////
@@ -60,13 +54,13 @@ public class RegisterEntities {
     }
     //endregion
 
-    public RegisterEntities(final Map<String, String> configuration, final SpecificationLoader specificationLoader) {
+    public RegisterEntities(final SpecificationLoader specificationLoader) {
         this.specificationLoader = specificationLoader;
 
         Set<Class<?>> persistenceCapableTypes = AppManifest.Registry.instance().getPersistenceCapableTypes();
 
         if(persistenceCapableTypes == null) {
-            persistenceCapableTypes = searchForPersistenceCapables(configuration);
+            throw new IllegalStateException("AppManifest is required");
         }
 
         final List<String> classNamesNotEnhanced = Lists.newArrayList();
@@ -86,88 +80,14 @@ public class RegisterEntities {
         }
     }
 
-    /**
-     * only called if no appManifest
-     */
-    Set<Class<?>> searchForPersistenceCapables(final Map<String, String> configuration) {
-
-        final String packagePrefixes = lookupPackagePrefixes(configuration);
-
-        final Set<Class<?>> persistenceCapableTypes = Sets.newLinkedHashSet();
-        final List<String> domPackages = parseDomPackages(packagePrefixes);
-        for (final String packageName : domPackages) {
-            Reflections reflections = new Reflections(packageName);
-            final Set<Class<?>> entityTypesInPackage =
-                    reflections.getTypesAnnotatedWith(PersistenceCapable.class);
-
-            if(!entitiesIn(entityTypesInPackage)) {
-                throw new IllegalArgumentException(String.format(
-                        "Bad configuration.\n\nCould not locate any @PersistenceCapable entities in package '%s'\n" +
-                                "Check value of '%s' key in WEB-INF/*.properties\n",
-                        packageName,
-                        PACKAGE_PREFIX_KEY));
-            }
-            persistenceCapableTypes.addAll(entityTypesInPackage);
-        }
-        return persistenceCapableTypes;
-    }
-
-    private String lookupPackagePrefixes(final Map<String, String> configuration) {
-        final String packagePrefixes = configuration.get(PACKAGE_PREFIX_KEY);
-        if(Strings.isNullOrEmpty(packagePrefixes)) {
-            throw new IllegalArgumentException(String.format(
-                    "Could not locate '%s' key in property files - aborting",
-                    PACKAGE_PREFIX_KEY));
-        }
-        return packagePrefixes;
-    }
-
-    private static List<String> parseDomPackages(String packagePrefixes) {
-        return Collections.unmodifiableList(Lists.newArrayList(Iterables.transform(Splitter.on(",").split(packagePrefixes), trim())));
-    }
-
     private static boolean ignore(final Class<?> entityType) {
-        try {
-            if(entityType.isAnonymousClass() || entityType.isLocalClass() || entityType.isMemberClass()) {
-                return true;
-            }
-            final PersistenceCapable persistenceCapable = entityType.getAnnotation(PersistenceCapable.class);
-            return persistenceCapable == null; // ignore if doesn't have @PersistenceCapable
-        } catch (NoClassDefFoundError ex) {
-            return true;
-        }
-    }
-
-    private static Function<String,String> trim() {
-        return new Function<String,String>(){
-            @Override
-            public String apply(String input) {
-                return input.trim();
-            }
-        };
-    }
-
-    private static boolean entitiesIn(Set<Class<?>> entityTypes) {
-        return Iterables.filter(entityTypes, notNullClass()).iterator().hasNext();
+        return entityType.isAnonymousClass() || entityType.isLocalClass() || entityType.isMemberClass() || entityType.isAnnotation();
     }
 
-    /**
-     * {@link Reflections} seems to return a set with 1 null element if none can be found, so we ignore these.
-     */
-    private static <T> Predicate<T> notNullClass() {
-        return new Predicate<T>() {
-            @Override
-            public boolean apply(T input) {
-                return input != null;
-            }
-        };
-    }
 
-    // //////////////////////////////////////
 
     SpecificationLoader getSpecificationLoader() {
         return specificationLoader;
     }
 
-
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 13/32: ISIS-1767 JEE 7+ added dependency on javaee-api to core/runtime

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 8674bdb0ae400cdb760c28bded4671a482485bd9
Author: Andi Huber <ah...@apache.org>
AuthorDate: Sun Oct 29 09:24:11 2017 +0100

    ISIS-1767 JEE 7+ added dependency on javaee-api to core/runtime
---
 core/pom.xml         | 10 ++++++++++
 core/runtime/pom.xml |  5 +++++
 2 files changed, 15 insertions(+)

diff --git a/core/pom.xml b/core/pom.xml
index 9fe4391..87d447f 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -151,6 +151,8 @@
 
         <guice.version>4.1.0</guice.version>
         <picocontainer.version>2.15</picocontainer.version>
+        
+        <javaee.version>7.0</javaee.version>
 
         <dom4j.version>1.6.1</dom4j.version>
         <jdom.version>2.0.2</jdom.version>
@@ -1390,6 +1392,14 @@ ${license.additional-notes}
                 <artifactId>picocontainer</artifactId>
                 <version>${picocontainer.version}</version>
             </dependency>
+            
+            <!-- JEE API -->
+            <dependency>
+                <groupId>javax</groupId>
+    			<artifactId>javaee-api</artifactId>
+                <version>${javaee.version}</version>
+                <scope>provided</scope>
+            </dependency>
 
             <!--  Reflection/metadata -->
             <dependency>
diff --git a/core/runtime/pom.xml b/core/runtime/pom.xml
index efe21b2..9cff140 100644
--- a/core/runtime/pom.xml
+++ b/core/runtime/pom.xml
@@ -119,6 +119,11 @@
             <artifactId>slf4j-log4j12</artifactId>
         </dependency>
 
+		<dependency>
+			<groupId>javax</groupId>
+    		<artifactId>javaee-api</artifactId>
+		</dependency>
+
         <dependency>
             <!-- because DataNucleus uses log4j as its preferred logger -->
             <groupId>log4j</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 30/32: ISIS-1744: removes work-around code for prior to DN 5.1.5

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit ad6426f0b006fd6d87b55d732a5a5a2055b53c74
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Jan 5 14:51:35 2018 +0000

    ISIS-1744: removes work-around code for prior to DN 5.1.5
---
 .../datanucleus/DataNucleusLifeCycleHelper.java    | 26 ++++------------------
 1 file changed, 4 insertions(+), 22 deletions(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusLifeCycleHelper.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusLifeCycleHelper.java
index fc5669e..398c30f 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusLifeCycleHelper.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusLifeCycleHelper.java
@@ -26,15 +26,12 @@ import java.util.function.Consumer;
 
 import javax.jdo.PersistenceManagerFactory;
 
-import org.apache.isis.core.runtime.system.context.IsisContext;
-import org.datanucleus.ClassLoaderResolver;
-import org.datanucleus.PersistenceNucleusContext;
-import org.datanucleus.api.jdo.JDOPersistenceManagerFactory;
 import org.datanucleus.enhancer.EnhancementHelper;
-import org.datanucleus.store.AbstractStoreManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import org.apache.isis.core.runtime.system.context.IsisContext;
+
 /**
  * 
  * Purges any state associated with DataNucleus.
@@ -78,11 +75,7 @@ public class DataNucleusLifeCycleHelper {
 			
 			persistenceManagerFactory.close();
 			
-			// XXX uses reflection prior to DN v5.1.5
-			// remove once DN v5.1.5 is released
-			// dnUnregisterClassesManagedBy(cl);
-			
-			// XXX for info, why we do this see
+			// for info, on why we do this see
 			// https://github.com/datanucleus/datanucleus-core/issues/272
 			EnhancementHelper.getInstance().unregisterClasses(cl);
 			
@@ -92,18 +85,7 @@ public class DataNucleusLifeCycleHelper {
 
 	}
     
-    // -- HELPER
-    
-	// TODO remove once DN v5.1.5 is released
-	private static void dnUnregisterClassesManagedBy(ClassLoader cl) {
-    	if(cl==null)
-    		return;
-		visitDNRegisteredClasses(map->
-			map.entrySet()
-			.removeIf(entry->cl.equals(entry.getKey().getClassLoader()))
-		);
-	}
-    
+
     // -- LOW LEVEL REFLECTION
     
 	// TODO remove once DN v5.1.5 is released

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 18/32: ISIS-1756 utilize IsisWicketApplication's life-cycle instead of providing a life-cycle CDI Bean

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit de01fbd407239dd84114ef5cc53a76f3836daa82
Author: Andi Huber <ah...@apache.org>
AuthorDate: Mon Oct 30 17:21:46 2017 +0100

    ISIS-1756 utilize IsisWicketApplication's life-cycle instead of
    providing a life-cycle CDI Bean
---
 .../webapp/jee/IsisDomainAppLifecycleBean.java     | 61 ----------------------
 .../wicket/viewer/IsisWicketApplication.java       |  1 +
 2 files changed, 1 insertion(+), 61 deletions(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisDomainAppLifecycleBean.java b/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisDomainAppLifecycleBean.java
deleted file mode 100644
index 416b11f..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisDomainAppLifecycleBean.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- **/
-package org.apache.isis.core.webapp.jee;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.ejb.Singleton;
-import javax.ejb.Startup;
-import javax.enterprise.context.ApplicationScoped;
-
-import org.apache.isis.core.runtime.system.context.IsisContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * 
- * JEE singleton that hooks into an Isis-Application's life-cycle. 
- * 
- * <p>
- * This CDI managed Bean ensures proper destruction of Isis's context.
- * </p>
- * 
- * @author ahuber@apache.org
- *
- */
-@Singleton
-@Startup
-@ApplicationScoped
-public class IsisDomainAppLifecycleBean {
-
-	private static final Logger log = LoggerFactory.getLogger(IsisDomainAppLifecycleBean.class);
-	
-	@PostConstruct
-	public void init() {
-		log.info("initializing ...");
-	}
-	
-	@PreDestroy
-	public void destroy() {
-		IsisContext.destroy();
-		log.info("destroyed.");
-	}
-	
-}
diff --git a/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java b/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
index 6719fcd..612b346 100644
--- a/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
+++ b/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
@@ -859,6 +859,7 @@ public class IsisWicketApplication
             }
             getServletContext().setAttribute(WebAppConstants.ISIS_SESSION_FACTORY, null);
             super.onDestroy();
+            IsisContext.destroy();
         } catch(final RuntimeException ex) {
             // symmetry with #init()
             LOG.error("Failed to destroy", ex);

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 05/32: ISIS-1276: fixes algorithm for lookup of datastore id's, at least

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit ed5f61f24534f4d80003a13da5eca239fae86131
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Sep 18 22:55:49 2017 +0100

    ISIS-1276: fixes algorithm for lookup of datastore id's, at least
---
 .../persistence/spi/JdoObjectIdSerializer.java     | 45 +++++++---------------
 1 file changed, 13 insertions(+), 32 deletions(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/persistence/spi/JdoObjectIdSerializer.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/persistence/spi/JdoObjectIdSerializer.java
index 48d4da9..ebb4d40 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/persistence/spi/JdoObjectIdSerializer.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/persistence/spi/JdoObjectIdSerializer.java
@@ -90,37 +90,14 @@ public final class JdoObjectIdSerializer {
             final DatastoreId dnOid = (DatastoreId) jdoOid;
             final Object keyValue = dnOid.getKeyAsObject();
 
-            if(false) {
-
-                //
-                // 1.8.0 original handling, appending a prefix "L_" or whatever
-                //
-                // if required by user community, we could add a property in isis.properties to enable if requested.
-                //
-                if(keyValue instanceof String) {
-                    return "S" + SEPARATOR + keyValue;
-                }
-                if(keyValue instanceof Long) {
-                    return "L" + SEPARATOR + keyValue;
-                }
-
-                if(keyValue instanceof BigInteger) {
-                    return "B" + SEPARATOR + keyValue;
-                }
-                if(keyValue instanceof Integer) {
-                    return "I" + SEPARATOR + keyValue;
-                }
-
-            } else {
-                if( keyValue instanceof String ||
-                        keyValue instanceof Long ||
-                        keyValue instanceof BigDecimal || // 1.8.0 did not support BigDecimal
-                        keyValue instanceof BigInteger ||
-                        keyValue instanceof Integer) {
-
-                    // no separator
-                    return "" + keyValue;
-                }
+            if( keyValue instanceof String ||
+                    keyValue instanceof Long ||
+                    keyValue instanceof BigDecimal || // 1.8.0 did not support BigDecimal
+                    keyValue instanceof BigInteger ||
+                    keyValue instanceof Integer) {
+
+                // no separator
+                return "" + keyValue;
             }
         }
 
@@ -201,7 +178,11 @@ public final class JdoObjectIdSerializer {
             // @javax.jdo.annotations.PersistenceCapable(identityType = IdentityType.DATASTORE)
             // for one of the common types (prettier handling)
 
-            return idStr + "[OID]" + spec.getFullIdentifier();
+            // in DN 4.1, we did this...
+            // return idStr + "[OID]" + spec.getFullIdentifier();
+
+            // in DN 5.1, we simply do this...
+            return idStr;
 
         }
     }

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 02/32: ISIS-1276: updates core to compile under JDK 1.8 only

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit a0da312d490d3ed1100b2a7c520216ba075653be
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Sep 18 22:16:56 2017 +0100

    ISIS-1276: updates core to compile under JDK 1.8 only
---
 core/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/pom.xml b/core/pom.xml
index bb311e5..9fe4391 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -2086,7 +2086,7 @@ ${license.additional-notes}
                         <configuration>
                             <toolchains>
                                 <jdk>
-                                    <version>1.7</version>
+                                    <version>1.8</version>
                                     <vendor>oracle</vendor>
                                 </jdk>
                             </toolchains>

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 21/32: ISIS-1775 Honor web-app's context path when configuring swagger.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 2bbcfbd4ac1683d738e7404b9db54963290dc4f5
Author: Andi Huber <ah...@apache.org>
AuthorDate: Sun Nov 12 19:13:37 2017 +0100

    ISIS-1775 Honor web-app's context path when configuring swagger.
---
 .../services/swagger/SwaggerServiceDefault.java    | 15 +++-
 .../isis/core/webapp/WebAppContextSupport.java     | 31 +++++++
 .../wicket/viewer/IsisWicketApplication.java       | 95 +++++++++++-----------
 3 files changed, 91 insertions(+), 50 deletions(-)

diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/swagger/SwaggerServiceDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/swagger/SwaggerServiceDefault.java
index 968a93c..192b5f6 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/swagger/SwaggerServiceDefault.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/swagger/SwaggerServiceDefault.java
@@ -22,15 +22,15 @@ import java.util.Map;
 
 import javax.annotation.PostConstruct;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import org.apache.isis.applib.annotation.DomainService;
 import org.apache.isis.applib.annotation.NatureOfService;
 import org.apache.isis.applib.annotation.Programmatic;
 import org.apache.isis.applib.services.swagger.SwaggerService;
 import org.apache.isis.core.metamodel.services.swagger.internal.SwaggerSpecGenerator;
 import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
+import org.apache.isis.core.webapp.WebAppContextSupport;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @DomainService(
         nature = NatureOfService.DOMAIN,
@@ -48,7 +48,14 @@ public class SwaggerServiceDefault implements SwaggerService {
 
     @PostConstruct
     public void init(final Map<String,String> properties) {
-        this.basePath = getPropertyElse(properties, KEY_RESTFUL_BASE_PATH, KEY_RESTFUL_BASE_PATH_DEFAULT);
+    	
+    	final String webappContextPath = 
+    			getPropertyElse(properties, WebAppContextSupport.WEB_APP_CONTEXT_PATH, "/");
+    	
+    	final String basePath = 
+    			getPropertyElse(properties, KEY_RESTFUL_BASE_PATH, KEY_RESTFUL_BASE_PATH_DEFAULT);
+    	
+    	this.basePath = WebAppContextSupport.prependContextPathIfPresent(webappContextPath, basePath);
     }
 
     static String getPropertyElse(final Map<String, String> properties, final String key, final String dflt) {
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/webapp/WebAppContextSupport.java b/core/metamodel/src/main/java/org/apache/isis/core/webapp/WebAppContextSupport.java
new file mode 100644
index 0000000..044fe67
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/webapp/WebAppContextSupport.java
@@ -0,0 +1,31 @@
+package org.apache.isis.core.webapp;
+
+import javax.servlet.ServletContext;
+
+import com.google.common.base.Strings;
+
+public class WebAppContextSupport {
+
+    /**
+     * Property name given to the context path of the web application as returned by 
+     * {@link ServletContext#getContextPath()}.
+     */
+	public static final String WEB_APP_CONTEXT_PATH = "application.webapp.context-path";
+	
+	
+	public static String prependContextPathIfPresent(String contextPath, String path) {
+		if(Strings.isNullOrEmpty(contextPath) || contextPath.equals("/"))
+			return path;
+		
+		if(!contextPath.startsWith("/"))
+			throw new IllegalArgumentException(
+					"contextPath must start with a slash '/' character, got '"+contextPath+"'");
+
+		if(!path.startsWith("/"))
+			throw new IllegalArgumentException(
+					"path must start with a slash '/' character, got '"+path+"'");
+		
+		return contextPath + path;
+	}
+	
+}
diff --git a/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java b/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
index 612b346..d15ac12 100644
--- a/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
+++ b/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
@@ -30,52 +30,6 @@ import java.util.UUID;
 import java.util.concurrent.Callable;
 import java.util.concurrent.Future;
 
-import com.google.common.base.Function;
-import com.google.common.base.Joiner;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-import com.google.common.io.Resources;
-import com.google.inject.Guice;
-import com.google.inject.Injector;
-import com.google.inject.Module;
-
-import org.apache.wicket.Application;
-import org.apache.wicket.Component;
-import org.apache.wicket.ConverterLocator;
-import org.apache.wicket.IConverterLocator;
-import org.apache.wicket.Page;
-import org.apache.wicket.RuntimeConfigurationType;
-import org.apache.wicket.SharedResources;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.authentication.IAuthenticationStrategy;
-import org.apache.wicket.authentication.strategy.DefaultAuthenticationStrategy;
-import org.apache.wicket.authroles.authentication.AuthenticatedWebApplication;
-import org.apache.wicket.authroles.authentication.AuthenticatedWebSession;
-import org.apache.wicket.core.request.mapper.MountedMapper;
-import org.apache.wicket.devutils.debugbar.DebugBar;
-import org.apache.wicket.devutils.debugbar.InspectorDebugPanel;
-import org.apache.wicket.devutils.debugbar.PageSizeDebugPanel;
-import org.apache.wicket.devutils.debugbar.SessionSizeDebugPanel;
-import org.apache.wicket.devutils.debugbar.VersionDebugContributor;
-import org.apache.wicket.devutils.diskstore.DebugDiskDataStore;
-import org.apache.wicket.guice.GuiceComponentInjector;
-import org.apache.wicket.markup.head.IHeaderResponse;
-import org.apache.wicket.markup.head.filter.JavaScriptFilteredIntoFooterHeaderResponse;
-import org.apache.wicket.markup.html.IHeaderContributor;
-import org.apache.wicket.markup.html.IHeaderResponseDecorator;
-import org.apache.wicket.markup.html.WebPage;
-import org.apache.wicket.request.cycle.IRequestCycleListener;
-import org.apache.wicket.request.cycle.PageRequestHandlerTracker;
-import org.apache.wicket.request.cycle.RequestCycleListenerCollection;
-import org.apache.wicket.request.resource.CssResourceReference;
-import org.apache.wicket.settings.DebugSettings;
-import org.apache.wicket.settings.RequestCycleSettings;
-import org.apache.wicket.util.IContextProvider;
-import org.apache.wicket.util.time.Duration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.wicketstuff.select2.ApplicationSettings;
-
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.config.IsisConfigurationDefault;
@@ -91,6 +45,7 @@ import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
 import org.apache.isis.core.runtime.threadpool.ThreadPoolSupport;
 import org.apache.isis.core.webapp.IsisWebAppBootstrapper;
 import org.apache.isis.core.webapp.WebAppConstants;
+import org.apache.isis.core.webapp.WebAppContextSupport;
 import org.apache.isis.schema.utils.ChangesDtoUtils;
 import org.apache.isis.schema.utils.CommandDtoUtils;
 import org.apache.isis.schema.utils.InteractionDtoUtils;
@@ -119,6 +74,51 @@ import org.apache.isis.viewer.wicket.viewer.integration.wicket.ConverterForObjec
 import org.apache.isis.viewer.wicket.viewer.integration.wicket.ConverterForObjectAdapterMemento;
 import org.apache.isis.viewer.wicket.viewer.integration.wicket.WebRequestCycleForIsis;
 import org.apache.isis.viewer.wicket.viewer.settings.IsisResourceSettings;
+import org.apache.wicket.Application;
+import org.apache.wicket.Component;
+import org.apache.wicket.ConverterLocator;
+import org.apache.wicket.IConverterLocator;
+import org.apache.wicket.Page;
+import org.apache.wicket.RuntimeConfigurationType;
+import org.apache.wicket.SharedResources;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.authentication.IAuthenticationStrategy;
+import org.apache.wicket.authentication.strategy.DefaultAuthenticationStrategy;
+import org.apache.wicket.authroles.authentication.AuthenticatedWebApplication;
+import org.apache.wicket.authroles.authentication.AuthenticatedWebSession;
+import org.apache.wicket.core.request.mapper.MountedMapper;
+import org.apache.wicket.devutils.debugbar.DebugBar;
+import org.apache.wicket.devutils.debugbar.InspectorDebugPanel;
+import org.apache.wicket.devutils.debugbar.PageSizeDebugPanel;
+import org.apache.wicket.devutils.debugbar.SessionSizeDebugPanel;
+import org.apache.wicket.devutils.debugbar.VersionDebugContributor;
+import org.apache.wicket.devutils.diskstore.DebugDiskDataStore;
+import org.apache.wicket.guice.GuiceComponentInjector;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.filter.JavaScriptFilteredIntoFooterHeaderResponse;
+import org.apache.wicket.markup.html.IHeaderContributor;
+import org.apache.wicket.markup.html.IHeaderResponseDecorator;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.request.cycle.IRequestCycleListener;
+import org.apache.wicket.request.cycle.PageRequestHandlerTracker;
+import org.apache.wicket.request.cycle.RequestCycleListenerCollection;
+import org.apache.wicket.request.resource.CssResourceReference;
+import org.apache.wicket.settings.DebugSettings;
+import org.apache.wicket.settings.RequestCycleSettings;
+import org.apache.wicket.util.IContextProvider;
+import org.apache.wicket.util.time.Duration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.wicketstuff.select2.ApplicationSettings;
+
+import com.google.common.base.Function;
+import com.google.common.base.Joiner;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+import com.google.common.io.Resources;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.Module;
 
 import de.agilecoders.wicket.core.Bootstrap;
 import de.agilecoders.wicket.core.markup.html.bootstrap.behavior.BootstrapBaseBehavior;
@@ -346,6 +346,9 @@ public class IsisWicketApplication
 
             final IsisConfigurationBuilder isisConfigurationBuilder = obtainConfigBuilder();
             isisConfigurationBuilder.addDefaultConfigurationResourcesAndPrimers();
+            
+            final String webappContextPath = getServletContext().getContextPath();
+            isisConfigurationBuilder.add(WebAppContextSupport.WEB_APP_CONTEXT_PATH, webappContextPath);
 
             final IsisConfigurationDefault configuration = isisConfigurationBuilder.getConfiguration();
 

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 26/32: ISIS-1756 remove reflective access to DN's EnhancementHelper since we've got a dedicated method instead

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 32df2f1b02d8df27310c1c1635f996e781c64bdb
Author: Andi Huber <ah...@apache.org>
AuthorDate: Sat Dec 9 09:55:21 2017 +0100

    ISIS-1756 remove reflective access to DN's EnhancementHelper since we've
    got a dedicated method instead
---
 .../datanucleus/DataNucleusLifeCycleHelper.java    | 57 +++++++++++++---------
 1 file changed, 34 insertions(+), 23 deletions(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusLifeCycleHelper.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusLifeCycleHelper.java
index 93ba482..fc5669e 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusLifeCycleHelper.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusLifeCycleHelper.java
@@ -52,31 +52,39 @@ public class DataNucleusLifeCycleHelper {
 		try {
 			
 			final ClassLoader cl = IsisContext.getClassLoader();
-			
-			if(persistenceManagerFactory instanceof JDOPersistenceManagerFactory) {
-				
-				final JDOPersistenceManagerFactory jdoPMF = 
-						(JDOPersistenceManagerFactory) persistenceManagerFactory;
-				final PersistenceNucleusContext nucleusContext = jdoPMF.getNucleusContext();
-				final AbstractStoreManager storeManager = 
-						(AbstractStoreManager)nucleusContext.getStoreManager();
-				
-			
-				persistenceManagerFactory.getManagedClasses()
-				.forEach(clazz->{
-			        final ClassLoaderResolver clr = nucleusContext.getClassLoaderResolver(cl);
-	    		     	    		        
-			        // Un-manage from the store
-			        storeManager.unmanageClass(clr,	clazz.getName(), false);
-			        
-					 // Unload the meta-data for this class
-			        nucleusContext.getMetaDataManager().unloadMetaDataForClass(clazz.getName());
-				});
-			}
+
+//          XXX not needed according to https://github.com/datanucleus/datanucleus-core/issues/272 
+//			
+//			if(persistenceManagerFactory instanceof JDOPersistenceManagerFactory) {
+//				
+//				final JDOPersistenceManagerFactory jdoPMF = 
+//						(JDOPersistenceManagerFactory) persistenceManagerFactory;
+//				final PersistenceNucleusContext nucleusContext = jdoPMF.getNucleusContext();
+//				final AbstractStoreManager storeManager = 
+//						(AbstractStoreManager)nucleusContext.getStoreManager();
+//				
+//			
+//				persistenceManagerFactory.getManagedClasses()
+//				.forEach(clazz->{
+//			        final ClassLoaderResolver clr = nucleusContext.getClassLoaderResolver(cl);
+//	    		     	    		        
+//			        // Un-manage from the store
+//			        storeManager.unmanageClass(clr,	clazz.getName(), false);
+//			        
+//					 // Unload the meta-data for this class
+//			        nucleusContext.getMetaDataManager().unloadMetaDataForClass(clazz.getName());
+//				});
+//			}
 			
 			persistenceManagerFactory.close();
-			dnUnregisterClassesManagedBy(cl);
 			
+			// XXX uses reflection prior to DN v5.1.5
+			// remove once DN v5.1.5 is released
+			// dnUnregisterClassesManagedBy(cl);
+			
+			// XXX for info, why we do this see
+			// https://github.com/datanucleus/datanucleus-core/issues/272
+			EnhancementHelper.getInstance().unregisterClasses(cl);
 			
 		} catch (Exception e) {
 			// ignore, since it only affects re-deploy-ability, which is nice to have but not critical
@@ -86,7 +94,8 @@ public class DataNucleusLifeCycleHelper {
     
     // -- HELPER
     
-    private static void dnUnregisterClassesManagedBy(ClassLoader cl) {
+	// TODO remove once DN v5.1.5 is released
+	private static void dnUnregisterClassesManagedBy(ClassLoader cl) {
     	if(cl==null)
     		return;
 		visitDNRegisteredClasses(map->
@@ -97,6 +106,7 @@ public class DataNucleusLifeCycleHelper {
     
     // -- LOW LEVEL REFLECTION
     
+	// TODO remove once DN v5.1.5 is released
 	private final static MethodHandle getRegisteredClassesMH;
 	static {
 		MethodHandle mh;		
@@ -112,6 +122,7 @@ public class DataNucleusLifeCycleHelper {
 		getRegisteredClassesMH = mh;
 	}
 	
+	// TODO remove once DN v5.1.5 is released
 	private static void visitDNRegisteredClasses(Consumer<Map<Class<?>, ?>> visitor){
 		try {
 			visitor.accept( (Map<Class<?>, ?>) getRegisteredClassesMH.invoke() );

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 11/32: ISIS-1728: uses typesafe queries for helloworld

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit fbd8ee12ab234a2c6a8be935d945bb2b15bed62d
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Sep 19 23:02:07 2017 +0100

    ISIS-1728: uses typesafe queries for helloworld
---
 .../runtime/systemusinginstallers/IsisComponentProvider.java     | 1 -
 .../src/main/java/domainapp/dom/impl/HelloWorldObject.java       | 6 +++---
 .../src/main/java/domainapp/dom/impl/HelloWorldObjects.java      | 9 +++++----
 .../java/domainapp/modules/simple/dom/impl/SimpleObjects.java    | 7 +++----
 4 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
index f7ba2b1..7b05b88 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
@@ -29,7 +29,6 @@ import java.util.stream.Stream;
 
 import javax.annotation.Nullable;
 import javax.jdo.annotations.PersistenceCapable;
-import javax.ws.rs.HEAD;
 
 import com.google.common.base.Function;
 import com.google.common.base.Joiner;
diff --git a/example/application/helloworld/src/main/java/domainapp/dom/impl/HelloWorldObject.java b/example/application/helloworld/src/main/java/domainapp/dom/impl/HelloWorldObject.java
index 2fe8bb8..7c6b7eb 100644
--- a/example/application/helloworld/src/main/java/domainapp/dom/impl/HelloWorldObject.java
+++ b/example/application/helloworld/src/main/java/domainapp/dom/impl/HelloWorldObject.java
@@ -21,10 +21,8 @@ package domainapp.dom.impl;
 import javax.jdo.annotations.IdGeneratorStrategy;
 import javax.jdo.annotations.IdentityType;
 import javax.jdo.annotations.VersionStrategy;
-import javax.ws.rs.HEAD;
 
 import com.google.common.collect.ComparisonChain;
-import com.google.common.collect.Ordering;
 
 import org.apache.isis.applib.annotation.Action;
 import org.apache.isis.applib.annotation.Auditing;
@@ -45,7 +43,6 @@ import org.apache.isis.applib.services.title.TitleService;
 @javax.jdo.annotations.PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "helloworld" )
 @javax.jdo.annotations.DatastoreIdentity(strategy = IdGeneratorStrategy.IDENTITY, column = "id")
 @javax.jdo.annotations.Version(strategy= VersionStrategy.DATE_TIME, column ="version")
-@javax.jdo.annotations.Unique(name="HelloWorldObject_name_UNQ", members = {"name"})
 @DomainObject(auditing = Auditing.ENABLED)
 @DomainObjectLayout()  // causes UI events to be triggered
 public class HelloWorldObject implements Comparable<HelloWorldObject> {
@@ -54,6 +51,8 @@ public class HelloWorldObject implements Comparable<HelloWorldObject> {
         this.name = name;
     }
 
+
+    @javax.jdo.annotations.Unique
     @javax.jdo.annotations.Column(allowsNull = "false", length = 40)
     @Property(editing = Editing.DISABLED)
     @Title(prepend = "Object: ")
@@ -61,6 +60,7 @@ public class HelloWorldObject implements Comparable<HelloWorldObject> {
     public String getName() { return name; }
     public void setName(final String name) { this.name = name; }
 
+
     @javax.jdo.annotations.Column(allowsNull = "true", length = 4000)
     @Property(editing = Editing.ENABLED)
     private String notes;
diff --git a/example/application/helloworld/src/main/java/domainapp/dom/impl/HelloWorldObjects.java b/example/application/helloworld/src/main/java/domainapp/dom/impl/HelloWorldObjects.java
index 92bd565..2c776f5 100644
--- a/example/application/helloworld/src/main/java/domainapp/dom/impl/HelloWorldObjects.java
+++ b/example/application/helloworld/src/main/java/domainapp/dom/impl/HelloWorldObjects.java
@@ -20,7 +20,7 @@ package domainapp.dom.impl;
 
 import java.util.List;
 
-import org.datanucleus.query.typesafe.TypesafeQuery;
+import javax.jdo.JDOQLTypedQuery;
 
 import org.apache.isis.applib.annotation.Action;
 import org.apache.isis.applib.annotation.DomainService;
@@ -31,9 +31,9 @@ import org.apache.isis.applib.annotation.ParameterLayout;
 import org.apache.isis.applib.annotation.RestrictTo;
 import org.apache.isis.applib.annotation.SemanticsOf;
 import org.apache.isis.applib.services.jdosupport.IsisJdoSupport;
-import org.apache.isis.applib.services.registry.ServiceRegistry;
 import org.apache.isis.applib.services.repository.RepositoryService;
 
+
 @DomainService(
         nature = NatureOfService.VIEW_MENU_ONLY,
         objectType = "helloworld.HelloWorldObjects"
@@ -52,7 +52,7 @@ public class HelloWorldObjects {
     @Action(semantics = SemanticsOf.SAFE)
     @MemberOrder(sequence = "2")
     public List<HelloWorldObject> findByName(final String name) {
-        TypesafeQuery<HelloWorldObject> q = isisJdoSupport.newTypesafeQuery(HelloWorldObject.class);
+        JDOQLTypedQuery<HelloWorldObject> q = isisJdoSupport.newTypesafeQuery(HelloWorldObject.class);
         final QHelloWorldObject cand = QHelloWorldObject.candidate();
         q = q.filter(
                 cand.name.indexOf(q.stringParameter("name")).ne(-1)
@@ -64,7 +64,8 @@ public class HelloWorldObjects {
     @Action(semantics = SemanticsOf.SAFE, restrictTo = RestrictTo.PROTOTYPING)
     @MemberOrder(sequence = "3")
     public List<HelloWorldObject> listAll() {
-        return repositoryService.allInstances(HelloWorldObject.class);
+        return isisJdoSupport.newTypesafeQuery(HelloWorldObject.class)
+                .executeList();
     }
 
     @javax.inject.Inject
diff --git a/example/application/simpleapp/module-simple/src/main/java/domainapp/modules/simple/dom/impl/SimpleObjects.java b/example/application/simpleapp/module-simple/src/main/java/domainapp/modules/simple/dom/impl/SimpleObjects.java
index 335f9d0..d77fe47 100644
--- a/example/application/simpleapp/module-simple/src/main/java/domainapp/modules/simple/dom/impl/SimpleObjects.java
+++ b/example/application/simpleapp/module-simple/src/main/java/domainapp/modules/simple/dom/impl/SimpleObjects.java
@@ -20,7 +20,7 @@ package domainapp.modules.simple.dom.impl;
 
 import java.util.List;
 
-import org.datanucleus.query.typesafe.TypesafeQuery;
+import javax.jdo.JDOQLTypedQuery;
 
 import org.apache.isis.applib.annotation.Action;
 import org.apache.isis.applib.annotation.ActionLayout;
@@ -35,7 +35,6 @@ import org.apache.isis.applib.annotation.SemanticsOf;
 import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
 import org.apache.isis.applib.services.jdosupport.IsisJdoSupport;
 import org.apache.isis.applib.services.repository.RepositoryService;
-import org.apache.isis.applib.services.xactn.TransactionService;
 
 @DomainService(
         nature = NatureOfService.VIEW_MENU_ONLY,
@@ -63,7 +62,7 @@ public class SimpleObjects {
             @ParameterLayout(named="Name")
             final String name
     ) {
-        TypesafeQuery<SimpleObject> q = isisJdoSupport.newTypesafeQuery(SimpleObject.class);
+        JDOQLTypedQuery<SimpleObject> q = isisJdoSupport.newTypesafeQuery(SimpleObject.class);
         final QSimpleObject cand = QSimpleObject.candidate();
         q = q.filter(
                 cand.name.indexOf(q.stringParameter("name")).ne(-1)
@@ -74,7 +73,7 @@ public class SimpleObjects {
 
     @Programmatic
     public SimpleObject findByNameExact(final String name) {
-        TypesafeQuery<SimpleObject> q = isisJdoSupport.newTypesafeQuery(SimpleObject.class);
+        JDOQLTypedQuery<SimpleObject> q = isisJdoSupport.newTypesafeQuery(SimpleObject.class);
         final QSimpleObject cand = QSimpleObject.candidate();
         q = q.filter(
                 cand.name.eq(q.stringParameter("name"))

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 16/32: ISIS-1756 - fix typo

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 42854496a4cad4970e184619de203cef44e2f1e3
Author: Andi Huber <ah...@apache.org>
AuthorDate: Sun Oct 29 10:25:52 2017 +0100

    ISIS-1756 - fix typo
---
 .../org/apache/isis/core/webapp/jee/IsisDomainAppLifecycleBean.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisDomainAppLifecycleBean.java b/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisDomainAppLifecycleBean.java
index 07881e3..416b11f 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisDomainAppLifecycleBean.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisDomainAppLifecycleBean.java
@@ -55,7 +55,7 @@ public class IsisDomainAppLifecycleBean {
 	@PreDestroy
 	public void destroy() {
 		IsisContext.destroy();
-		log.info("detroyed.");
+		log.info("destroyed.");
 	}
 	
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 31/32: Merge branch 'ISIS-1744-update-to-dn-515' into dev/2.0.0-M2

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit b7497fe71520d5f560f7fd5b6700afc4b480e6f5
Merge: 8cce64e ad6426f
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Jan 5 14:53:05 2018 +0000

    Merge branch 'ISIS-1744-update-to-dn-515' into dev/2.0.0-M2

 core/pom.xml                                       |  6 ++---
 core/runtime/pom.xml                               |  6 +++++
 .../datanucleus/DataNucleusLifeCycleHelper.java    | 26 ++++------------------
 example/application/helloworld/pom.xml             |  2 +-
 example/application/simpleapp/pom.xml              |  2 +-
 5 files changed, 15 insertions(+), 27 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 07/32: ISIS-1724: removes the deprecated IsisJdoSupport in the jdo applib

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 223957eb6cd7ecacba5f2beb6ed2b9b5ea946eff
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Sep 19 22:50:00 2017 +0100

    ISIS-1724: removes the deprecated IsisJdoSupport in the jdo applib
---
 .../objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
index e5171c9..6e2ef41 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/service/support/IsisJdoSupportImpl.java
@@ -62,7 +62,7 @@ import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
         nature = NatureOfService.DOMAIN,
         menuOrder = "" + Integer.MAX_VALUE
 )
-public class IsisJdoSupportImpl implements IsisJdoSupport {
+public class IsisJdoSupportImpl implements org.apache.isis.applib.services.jdosupport.IsisJdoSupport {
     
     @Programmatic
     @Override

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 28/32: ISIS-1767: fixes dependency convergence issue with com.sun.mail

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit efff23eca90fd6295dbf594f043eb03ed5bf022e
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Jan 5 14:43:57 2018 +0000

    ISIS-1767: fixes dependency convergence issue with com.sun.mail
---
 core/runtime/pom.xml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/core/runtime/pom.xml b/core/runtime/pom.xml
index 9cff140..457e5a5 100644
--- a/core/runtime/pom.xml
+++ b/core/runtime/pom.xml
@@ -122,6 +122,12 @@
 		<dependency>
 			<groupId>javax</groupId>
     		<artifactId>javaee-api</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>com.sun.mail</groupId>
+                    <artifactId>javax.mail</artifactId>
+                </exclusion>
+            </exclusions>
 		</dependency>
 
         <dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 24/32: ISIS-1755 veto ExceptionRecognizer on CDI scan

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1779-jax-rs-2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 237ef69db8dad0f4dbb53afbb6aac94138ab396f
Author: Andi Huber <ah...@apache.org>
AuthorDate: Wed Nov 22 14:12:22 2017 +0100

    ISIS-1755 veto ExceptionRecognizer on CDI scan
---
 .../webapp/jee/IsisCDIBeanScanInterceptor.java     | 25 +++++++++++++---------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisCDIBeanScanInterceptor.java b/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisCDIBeanScanInterceptor.java
index c75605c..06fe4bf 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisCDIBeanScanInterceptor.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/webapp/jee/IsisCDIBeanScanInterceptor.java
@@ -18,8 +18,9 @@
  */
 package org.apache.isis.core.webapp.jee;
 
-import java.util.HashSet;
-import java.util.Set;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.function.Predicate;
 
 import javax.enterprise.event.Observes;
 import javax.enterprise.inject.spi.AfterBeanDiscovery;
@@ -28,6 +29,7 @@ import javax.enterprise.inject.spi.Extension;
 import javax.enterprise.inject.spi.ProcessAnnotatedType;
 
 import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.services.exceprecog.ExceptionRecognizer;
 import org.apache.isis.applib.services.metrics.MetricsService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -58,9 +60,10 @@ public final class IsisCDIBeanScanInterceptor implements Extension {
 	 * Declaration of Beans that are managed by Isis and should be ignored by CDI. 
 	 * (in addition to those that have the @DomainService annotation)
 	 */
-	private static final Set<String> tabu = new HashSet<>();
+	private static final List<Predicate<Class<?>>> tabu = new ArrayList<>();
 	{
-		tabu.add(MetricsService.class.getName());
+		tabu.add(MetricsService.class::equals);
+		tabu.add(ExceptionRecognizer.class::isAssignableFrom);
 	}
 	
 	void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event) {
@@ -69,9 +72,10 @@ public final class IsisCDIBeanScanInterceptor implements Extension {
 
 	<T> void processAnnotatedType(@Observes ProcessAnnotatedType<T> event) {
 
-		final String className = event.getAnnotatedType().getJavaClass().getName();
+		final Class<?> clazz = event.getAnnotatedType().getJavaClass();
+		final String className = clazz.getName();
 		
-		if(isTabu(className, event)) {
+		if(isTabu(clazz, event)) {
 			log.debug("veto type: " + className);
 			event.veto();
 		} else {
@@ -85,12 +89,13 @@ public final class IsisCDIBeanScanInterceptor implements Extension {
 	
 	// -- HELPER
 	
-	private boolean isTabu(String className, ProcessAnnotatedType<?> event) {
-		if(tabu.contains(className))
-			return true;
+	private boolean isTabu(Class<?> clazz, ProcessAnnotatedType<?> event) {
 		if(event.getAnnotatedType().isAnnotationPresent(DomainService.class))
 			return true;
-		
+		for(Predicate<Class<?>> isTabu : tabu) {
+			if(isTabu.test(clazz))
+				return true;
+		}
 		return false;
 	}
 

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.