[isis] branch dev/2.0.0/ISIS-1740-where-am-i updated (2132cba -> 4f0a59b)

2017-11-09 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a change to branch dev/2.0.0/ISIS-1740-where-am-i
in repository https://gitbox.apache.org/repos/asf/isis.git.


 discard 2132cba  ISIS-1740 refactored method names, added javadoc
 discard 38a81da  ISIS-1740 initial commit of prototype
 add caa4fbb  ISIS-1762 fix inverted logic on null safe stream of arrays
 new 4481b04  ISIS-1740 initial commit of prototype
 new 4f0a59b  ISIS-1740 refactored method names, added javadoc

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   (2132cba)
\
 N -- N -- N   refs/heads/dev/2.0.0/ISIS-1740-where-am-i (4f0a59b)

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 2 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:
 .../src/main/java/org/apache/isis/core/commons/lang/NullSafe.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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


[isis] 01/02: ISIS-1740 initial commit of prototype

2017-11-09 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch dev/2.0.0/ISIS-1740-where-am-i
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 4481b04bdb527c28dfddf40c674d0e77833bec54
Author: Andi Huber 
AuthorDate: Fri Oct 27 15:34:55 2017 +0200

ISIS-1740 initial commit of prototype
---
 .../org/apache/isis/applib/annotation/Parent.java  |  34 ++
 .../metamodel/util/pchain/CachingParentChain.java  |  66 +++
 .../core/metamodel/util/pchain/ParentChain.java|  99 
 .../metamodel/util/pchain/SimpleParentChain.java   |  75 +
 .../isis/core/metamodel/util/pchain/SoftCache.java | 124 +
 .../model/models/whereami/WhereAmIModel.java   |  38 +++
 .../models/whereami/WhereAmIModelDefault.java  |  68 +++
 .../viewer/wicket/ui/pages/entity/EntityPage.css   |  29 +
 .../viewer/wicket/ui/pages/entity/EntityPage.html  |   7 +-
 .../viewer/wicket/ui/pages/entity/EntityPage.java  |  68 ---
 10 files changed, 594 insertions(+), 14 deletions(-)

diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/annotation/Parent.java 
b/core/applib/src/main/java/org/apache/isis/applib/annotation/Parent.java
new file mode 100644
index 000..6e4a7d8
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Parent.java
@@ -0,0 +1,34 @@
+/* 
+ * 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.applib.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Tells the framework which method or field to use in order to construct a 
navigable chain of
+ * parent domain object instances. This annotation can only be used once per 
class declaration. 
+ * 
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.FIELD, ElementType.METHOD})
+public @interface Parent {
+}
diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/util/pchain/CachingParentChain.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/util/pchain/CachingParentChain.java
new file mode 100644
index 000..630e928
--- /dev/null
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/util/pchain/CachingParentChain.java
@@ -0,0 +1,66 @@
+/*
+ * 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.metamodel.util.pchain;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.reflect.Method;
+
+class CachingParentChain extends SimpleParentChain {
+
+   private final SoftCache cache = new 
SoftCache<>();
+
+   @Override
+   public Object parentOf(Object node) {
+   if(node==null)
+   return null;
+   
+   final MethodHandle mh = cache.computeIfAbsent(node.getClass(), 
+   key->{
+   try {
+   return methodHandleOf(node);
+   } catch (IllegalAccessException e) {
+   e.printStackTrace();
+   return null;
+   }
+

[isis] 02/02: ISIS-1740 refactored method names, added javadoc

2017-11-09 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch dev/2.0.0/ISIS-1740-where-am-i
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 4f0a59b1b78f857056514b3f439e308ae8743441
Author: Andi Huber 
AuthorDate: Fri Oct 27 16:03:36 2017 +0200

ISIS-1740 refactored method names, added javadoc
---
 .../model/models/whereami/WhereAmIModel.java   | 28 ++
 .../models/whereami/WhereAmIModelDefault.java  | 24 +--
 .../viewer/wicket/ui/pages/entity/EntityPage.java  |  4 ++--
 3 files changed, 38 insertions(+), 18 deletions(-)

diff --git 
a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/whereami/WhereAmIModel.java
 
b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/whereami/WhereAmIModel.java
index 7ecfba0..fdc11f2 100644
--- 
a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/whereami/WhereAmIModel.java
+++ 
b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/whereami/WhereAmIModel.java
@@ -23,16 +23,36 @@ import java.util.stream.Stream;
 
 import org.apache.isis.viewer.wicket.model.models.EntityModel;
 
+/**
+ * Represents a navigable chain of parent nodes starting at the current node. 
+ * 
+ * @author a.hu...@corax.at
+ * 
+ * @since 2.0.0
+ *
+ */
 public interface WhereAmIModel {
 
-   public static WhereAmIModel of(EntityModel endOfChain) {
-   return new WhereAmIModelDefault(endOfChain);
+   public static WhereAmIModel of(EntityModel startOfChain) {
+   return new WhereAmIModelDefault(startOfChain);
}
 
+   /**
+* The navigable parent chain requires a minimum length of 2 in order 
to be shown.
+* @return whether the where-am-I hint should be shown or hidden
+*/
public boolean isShowWhereAmI();

-   public Stream streamParentChain();
+   /**
+* Streams the linked nodes of this model's navigable parent chain in 
reverse order.
+* @return reversed order stream of linked parent nodes, which does not 
include the start node
+*/
+   public Stream streamParentChainReversed();

-   public EntityModel getEndOfChain();
+   /**
+*  
+* @return the immutable start node of the navigable parent chain
+*/
+   public EntityModel getStartOfChain();

 }
diff --git 
a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/whereami/WhereAmIModelDefault.java
 
b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/whereami/WhereAmIModelDefault.java
index b3f6679..955c2db 100644
--- 
a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/whereami/WhereAmIModelDefault.java
+++ 
b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/whereami/WhereAmIModelDefault.java
@@ -28,32 +28,32 @@ import 
org.apache.isis.viewer.wicket.model.models.EntityModel;
 
 class WhereAmIModelDefault implements WhereAmIModel {
 
-   private final List chainOfParents = new ArrayList<>();
-   private final EntityModel endOfChain;
+   private final List reversedChainOfParents = new ArrayList<>();
+   private final EntityModel startOfChain;

-   public WhereAmIModelDefault(EntityModel endOfChain) {
-   this.endOfChain = endOfChain;
+   public WhereAmIModelDefault(EntityModel startOfChain) {
+   this.startOfChain = startOfChain;

-   final Object startPojo = endOfChain.getObject().getObject();
+   final Object startPojo = startOfChain.getObject().getObject();
 
ParentChain.caching()
.streamReversedParentChainOf(startPojo)
-   .forEach(chainOfParents::add);
+   .forEach(reversedChainOfParents::add);
}

@Override
-   public EntityModel getEndOfChain() {
-   return endOfChain;
+   public EntityModel getStartOfChain() {
+   return startOfChain;
}

@Override
public boolean isShowWhereAmI() {
-   return !chainOfParents.isEmpty();
+   return !reversedChainOfParents.isEmpty();
}
 
@Override
-   public Stream streamParentChain() {
-   return chainOfParents.stream()
+   public Stream streamParentChainReversed() {
+   return reversedChainOfParents.stream()
.map(this::toEntityModel);
}

@@ -61,7 +61,7 @@ class WhereAmIModelDefault implements WhereAmIModel {
 
private EntityModel toEntityModel(Object domainObject) {
return new EntityModel(
-   endOfChain.getPersistenceSession()
+   

[isis] 08/09: ISIS-1754 context aware class-loading for Isis

2017-11-09 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch dev/2.0.0/ISIS-1767-jee-7
in repository https://gitbox.apache.org/repos/asf/isis.git

commit ab2b0697c7b1104610cb25c22062ba8b6d8c29f2
Author: Andi Huber 
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 |  26 ++--
 3 files changed, 107 insertions(+), 72 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. 

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

2017-11-09 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch dev/2.0.0/ISIS-1767-jee-7
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 8b15e61a424930b40b96d393de4ae3d043d793c1
Author: Andi Huber 
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 000..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 https://docs.jboss.org/weld/reference/latest/en-US/html/extend.html;>weld,
+ * that lets CDI ignore certain Beans we declare tabu. 
+ * 
+ * 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.
+ * 
+ * 
+ * 
+ * Beans declared tabu are managed (meaning instantiation and dependency 
injection) 
+ * by Isis itself. All other Beans are allowed to be managed by CDI.
+ * 
+ * 
+ * @author ahu...@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 tabu = new HashSet<>();
+   {
+   tabu.add(MetricsService.class.getName());
+   }
+   
+   void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event) {
+   log.info("beginning the scanning process");
+   }
+
+void processAnnotatedType(@Observes ProcessAnnotatedType 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 000..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


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

2017-11-09 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch dev/2.0.0/ISIS-1767-jee-7
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 1cfbc6942e5710e14b2b344c6e071127a188e2cc
Author: Andi Huber 
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 31a70c3..47e117a 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -151,6 +151,8 @@
 
 4.1.0
 2.15
+
+7.0
 
 1.6.1
 2.0.2
@@ -1390,6 +1392,14 @@ ${license.additional-notes}
 picocontainer
 ${picocontainer.version}
 
+
+
+
+javax
+   javaee-api
+${javaee.version}
+provided
+
 
 
 
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 @@
 slf4j-log4j12
 
 
+   
+   javax
+   javaee-api
+   
+
 
 
 log4j

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


[isis] branch dev/2.0.0/ISIS-1767-jee-7 updated (1ea665d -> fee0943)

2017-11-09 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a change to branch dev/2.0.0/ISIS-1767-jee-7
in repository https://gitbox.apache.org/repos/asf/isis.git.


 discard 1ea665d  ISIS-1755 TomEE requires Service Providers to be public 
classes
 discard c6005f4  ISIS-1754 context aware class-loading for Isis
 discard 9ff06b1  ISIS-1756 utilize IsisWicketApplication's life-cycle instead 
of providing a life-cycle CDI Bean
 discard e51e2f4  ISIS-1756 prevent SQLException on schema creation if config 
is missing
 discard 644ec85  ISIS-1756 - fix typo
 discard b0c0048  ISIS-1755 JEE 7+ allow coexistence of CDI and Isis' 
ServiceInjector
 discard 15a4d3e  ISIS-1756 JEE 7+ Isis App life-cycling
 discard 07f2c95  ISIS-1767 JEE 7+ added dependency on javaee-api to 
core/runtime
 discard 05e7a96  ISIS-1756: IsisContext: add destroy(), deprecate testReset()
 add caa4fbb  ISIS-1762 fix inverted logic on null safe stream of arrays
 new bedbe39  ISIS-1756: IsisContext: add destroy(), deprecate testReset()
 new 1cfbc69  ISIS-1767 JEE 7+ added dependency on javaee-api to 
core/runtime
 new 39b618a  ISIS-1756 JEE 7+ Isis App life-cycling
 new 8b15e61  ISIS-1755 JEE 7+ allow coexistence of CDI and Isis' 
ServiceInjector
 new bd2acca  ISIS-1756 - fix typo
 new 09fdcc0  ISIS-1756 prevent SQLException on schema creation if config 
is missing
 new 4b60e49  ISIS-1756 utilize IsisWicketApplication's life-cycle instead 
of providing a life-cycle CDI Bean
 new ab2b069  ISIS-1754 context aware class-loading for Isis
 new fee0943  ISIS-1755 TomEE requires Service Providers to be public 
classes

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   (1ea665d)
\
 N -- N -- N   refs/heads/dev/2.0.0/ISIS-1767-jee-7 (fee0943)

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 9 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:
 .../src/main/java/org/apache/isis/core/commons/lang/NullSafe.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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


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

2017-11-09 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch dev/2.0.0/ISIS-1767-jee-7
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 4b60e4921241a1c7871284a04d31f9aebe91a252
Author: Andi Huber 
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..000
--- 
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. 
- * 
- * 
- * This CDI managed Bean ensures proper destruction of Isis's context.
- * 
- * 
- * @author ahu...@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" .


[isis] 03/09: ISIS-1756 JEE 7+ Isis App life-cycling

2017-11-09 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch dev/2.0.0/ISIS-1767-jee-7
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 39b618a606c769c3ae39282d5ef3bf0c2db211ff
Author: Andi Huber 
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 000..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. 
+ * 
+ * 
+ * This CDI managed Bean ensures proper destruction of Isis's context.
+ * 
+ * 
+ * @author ahu...@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 000..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.
+ * 
+ * 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:
+ * 
+ * {@code
+ * 
+ * 

[isis] 05/09: ISIS-1756 - fix typo

2017-11-09 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch dev/2.0.0/ISIS-1767-jee-7
in repository https://gitbox.apache.org/repos/asf/isis.git

commit bd2accab0eacd7a49578a6c9c32285367c035b28
Author: Andi Huber 
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" .


[isis] 01/09: ISIS-1756: IsisContext: add destroy(), deprecate testReset()

2017-11-09 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch dev/2.0.0/ISIS-1767-jee-7
in repository https://gitbox.apache.org/repos/asf/isis.git

commit bedbe39f3ad6128040d80e67008ab1eceef05853
Author: Andi Huber 
AuthorDate: Fri Oct 27 16:41:43 2017 +0200

ISIS-1756: IsisContext: add destroy(), deprecate testReset()
---
 .../isis/core/runtime/system/context/IsisContext.java | 15 +--
 1 file changed, 13 insertions(+), 2 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 495458b..dd63f0f 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
@@ -72,13 +72,24 @@ public final class IsisContext {
 }
 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

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


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

2017-11-09 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch dev/2.0.0/ISIS-1767-jee-7
in repository https://gitbox.apache.org/repos/asf/isis.git

commit fee094352e2f6e35a7f3f6f6f5838a3b839222ff
Author: Andi Huber 
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 ahu...@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" .


[isis] branch dev/2.0.0/ISIS-1762-j8-utils updated: ISIS-1762 fix inverted logic on null safe stream of arrays

2017-11-09 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch dev/2.0.0/ISIS-1762-j8-utils
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/dev/2.0.0/ISIS-1762-j8-utils 
by this push:
 new caa4fbb  ISIS-1762 fix inverted logic on null safe stream of arrays
caa4fbb is described below

commit caa4fbb91d78127451c45e01e4077a119433d26d
Author: Andi Huber 
AuthorDate: Thu Nov 9 17:57:53 2017 +0100

ISIS-1762 fix inverted logic on null safe stream of arrays
---
 .../src/main/java/org/apache/isis/core/commons/lang/NullSafe.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/commons/lang/NullSafe.java 
b/core/metamodel/src/main/java/org/apache/isis/core/commons/lang/NullSafe.java
index 985b498..c86063e 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/commons/lang/NullSafe.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/commons/lang/NullSafe.java
@@ -44,7 +44,7 @@ public class NullSafe {
 * the specified {@code array}, or the empty stream if array is {@code 
null}.
 */
public static  Stream stream(T[] array) {
-   return array!=null ? Stream.empty() : Stream.of(array);
+   return array!=null ? Stream.of(array) : Stream.empty();
}
 
/**

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