[isis] branch master updated: FIX ISIS-1738 (#97)

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 742eacc  FIX ISIS-1738 (#97)
742eacc is described below

commit 742eacc6587c8e09632c438ec8c88cc7c8593bc0
Author: Andi Huber <hob...@gmx.at>
AuthorDate: Fri Oct 6 23:02:05 2017 +0200

FIX ISIS-1738 (#97)
---
 .../core/metamodel/spec/feature/ObjectMember.java  | 30 +-
 1 file changed, 12 insertions(+), 18 deletions(-)

diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectMember.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectMember.java
index 39b2177..c7721e5 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectMember.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectMember.java
@@ -25,10 +25,6 @@ import java.util.List;
 
 import javax.annotation.Nullable;
 
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Maps;
-
 import org.apache.isis.applib.annotation.When;
 import org.apache.isis.applib.annotation.Where;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -36,7 +32,10 @@ import org.apache.isis.core.metamodel.consent.Consent;
 import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
 import org.apache.isis.core.metamodel.facets.all.hide.HiddenFacet;
 import org.apache.isis.core.metamodel.facets.members.order.MemberOrderFacet;
-import org.apache.isis.core.metamodel.util.DeweyOrderComparator;
+import 
org.apache.isis.core.metamodel.layout.memberorderfacet.MemberOrderFacetComparator;
+
+import com.google.common.base.Function;
+import com.google.common.collect.Maps;
 
 /**
  * Provides reflective access to an action or a field on a domain object.
@@ -205,19 +204,14 @@ public interface ObjectMember extends ObjectFeature {
 public static class Comparators {
 public static Comparator byMemberOrderSequence() {
 return new Comparator() {
-private final DeweyOrderComparator deweyOrderComparator = new 
DeweyOrderComparator();
-@Override
-public int compare(final ObjectMember o1, final ObjectMember 
o2) {
-final MemberOrderFacet o1Facet = 
o1.getFacet(MemberOrderFacet.class);
-final MemberOrderFacet o2Facet = 
o2.getFacet(MemberOrderFacet.class);
-String memberId1 = o1.getId();
-String memberId2 = o2.getId();
-String o1Sequence = o1Facet != null ? o1Facet.sequence() : 
"0";
-String o2Sequence = o2Facet != null ? o2Facet.sequence() : 
"0";
-return o1Facet == null? +1:
-o2Facet == null? -1:
-deweyOrderComparator.compare(o1Sequence, 
o2Sequence);
-}
+private final MemberOrderFacetComparator 
memberOrderFacetComparator = 
+   new MemberOrderFacetComparator(false);
+ @Override
+ public int compare(final ObjectMember o1, final ObjectMember 
o2) {
+   return memberOrderFacetComparator.compare(
+   o1.getFacet(MemberOrderFacet.class),
+   o2.getFacet(MemberOrderFacet.class));
+ }
 };
 }
 

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


[isis] branch master updated: orthography (#100)

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 4feb5e9  orthography (#100)
4feb5e9 is described below

commit 4feb5e9d6bd43ae1866b94de7dec93906abcf92d
Author: ppirus <ppi...@users.noreply.github.com>
AuthorDate: Sat Oct 14 09:06:51 2017 +0200

orthography (#100)

* orthography

* Update _ugtst_overview.adoc
---
 .../documentation/src/main/asciidoc/guides/ugtst/_ugtst_overview.adoc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/adocs/documentation/src/main/asciidoc/guides/ugtst/_ugtst_overview.adoc 
b/adocs/documentation/src/main/asciidoc/guides/ugtst/_ugtst_overview.adoc
index 804bf85..1cff8a0 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ugtst/_ugtst_overview.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ugtst/_ugtst_overview.adoc
@@ -40,7 +40,7 @@ Even if a domain expert understands the intent of these 
tests, the actual implem
 +
 The natural language specification then maps down onto some glue code that is 
used to drive the application.  But the benefits of taking a BDD approach 
include the fact that your domain expert will be able to read the 
tests/specifications, and that when you run the specs, you also get 
documentation of the application's behaviour ("living documentation").
 
-It's up to you whether you use BDD specs for your apps; it will depend on your 
development process and company culture.  But you if don't then you certainly 
should write integration tests: acceptance criteria for user stories should be 
automated!
+It's up to you whether you use BDD specs for your apps; it will depend on your 
development process and company culture.  But if you don't then you certainly 
should write integration tests: acceptance criteria for user stories should be 
automated!
 
 
 
@@ -50,7 +50,7 @@ It's up to you whether you use BDD specs for your apps; it 
will depend on your d
 
 When we talk about integration tests/specs here, we mean tests that exercise 
the domain object logic, through to the actual database.  But we also want the 
tests to exercise the app from the users's perspective, which means including 
the user interface.
 
-For most other frameworks that would require having to test the application in 
a very heavy weight/fragile fashion using a tool such as 
link:http://docs.seleniumhq.org/[Selenium], driving a web browser to navigate . 
 In this regard though, Apache Isis has a significant trick up its sleeve.  
Because Apache Isis implements the naked objects pattern, it means that the UI 
is generated automatically from the UI.  This therefore allows for other 
implementations of the UI.
+For most other frameworks that would require having to test the application in 
a very heavy weight/fragile fashion using a tool such as 
link:http://docs.seleniumhq.org/[Selenium], driving a web browser to navigate . 
 In this regard though, Apache Isis has a significant trick up its sleeve.  
Because Apache Isis implements the naked objects pattern, it means that the UI 
is generated automatically from declared domain-objects, -views and -services. 
This therefore allows for other implementa [...]
 
 The 
xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-api_WrapperFactory[`WrapperFactory`]
 domain service allows a test to wrap domain objects and thus to interact with 
said objects "as if" through the UI:
 

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


[isis] branch master updated: Update _ugfun_core-concepts_philosophy_aop.adoc (#101)

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

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


The following commit(s) were added to refs/heads/master by this push:
 new df86e03  Update _ugfun_core-concepts_philosophy_aop.adoc (#101)
df86e03 is described below

commit df86e03bbba6e14e8dae7608cac89f286c033e11
Author: ppirus <ppi...@users.noreply.github.com>
AuthorDate: Sat Oct 14 09:07:55 2017 +0200

Update _ugfun_core-concepts_philosophy_aop.adoc (#101)
---
 .../asciidoc/guides/ugfun/_ugfun_core-concepts_philosophy_aop.adoc| 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_core-concepts_philosophy_aop.adoc
 
b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_core-concepts_philosophy_aop.adoc
index 1be9ed3..0ff5279 100644
--- 
a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_core-concepts_philosophy_aop.adoc
+++ 
b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_core-concepts_philosophy_aop.adoc
@@ -61,5 +61,5 @@ The 
link:http://en.wikipedia.org/wiki/Single_responsibility_principle[single res
 Apache Isis' support for contributions (not only contributed actions, but also 
contributed properties and contributed collections) enables this.
 And again, to loop back to the topic of this section, it's an AOP concept that 
being implemented by the framework.
 
-The nice thing about aspect orientation is that for the most part you can 
ignore these cross-cutting concerns and - at least initially at least - just 
focus on implementing your domain object.
-Later when your app starts to grow and you start to break it out into smaller 
modules, you can leverage Apache Isis' AOP support for 
(xref:../ugfun/ugfun.adoc#_ugfun_building-blocks_types-of-domain-objects_mixins[mixins]),
 
(xref:../ugfun/ugfun.adoc#_ugfun_programming-model_domain-services_contributions[contributed
 services]) and interceptors (the 
xref:../ugfun/ugfun.adoc#_ugfun_building-blocks_events_domain-events[event 
bus]) to ensure that your codebase remains maintainable.
\ No newline at end of file
+The nice thing about aspect orientation is that for the most part you can 
ignore these cross-cutting concerns and - at least initially - just focus on 
implementing your domain object.
+Later when your app starts to grow and you start to break it out into smaller 
modules, you can leverage Apache Isis' AOP support for 
(xref:../ugfun/ugfun.adoc#_ugfun_building-blocks_types-of-domain-objects_mixins[mixins]),
 
(xref:../ugfun/ugfun.adoc#_ugfun_programming-model_domain-services_contributions[contributed
 services]) and interceptors (the 
xref:../ugfun/ugfun.adoc#_ugfun_building-blocks_events_domain-events[event 
bus]) to ensure that your codebase remains maintainable.

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


[isis] branch master updated: Update _ugfun_core-concepts_principles.adoc (#102)

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

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


The following commit(s) were added to refs/heads/master by this push:
 new f261140  Update _ugfun_core-concepts_principles.adoc (#102)
f261140 is described below

commit f261140ae92a490c82c79bfee144756282b7f08c
Author: ppirus <ppi...@users.noreply.github.com>
AuthorDate: Sat Oct 14 09:08:10 2017 +0200

Update _ugfun_core-concepts_principles.adoc (#102)
---
 .../src/main/asciidoc/guides/ugfun/_ugfun_core-concepts_principles.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_core-concepts_principles.adoc
 
b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_core-concepts_principles.adoc
index 12e3768..f0b9fb1 100644
--- 
a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_core-concepts_principles.adoc
+++ 
b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_core-concepts_principles.adoc
@@ -7,7 +7,7 @@
 
 
 Apache Isis is primarily aimed at custom-built "enterprise" applications.
-The UI provided by the xref:../ugvw/ugvw.adoc#[Wicket viewer] is intended to 
be usable by domain experts, typically end-users within the organization.pdf
+The UI provided by the xref:../ugvw/ugvw.adoc#[Wicket viewer] is intended to 
be usable by domain experts, typically end-users within the organization.
 The REST API exposed by the xref:../ugvro/ugvro.adoc#[RestfulObjects viewer] 
allows custom apps to be developed -- eg using Angular or similar -- for use by 
those requiring more guidance; typically end-users outside of the organization.
 This section describes some of the core principles and values that the 
framework aims to honour and support.
 

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


[isis] branch dev/2.0.0/ISIS-1767-jee-7 updated: ISIS-1754 proper DN class-loading

2017-11-22 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


The following commit(s) were added to refs/heads/dev/2.0.0/ISIS-1767-jee-7 by 
this push:
 new 662414b  ISIS-1754 proper DN class-loading
662414b is described below

commit 662414bba2e34bd7ba2f4e8ab42f6a3ad20f30e4
Author: Andi Huber <ahu...@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.DataNucleu

[isis] branch dev/2.0.0/ISIS-1767-jee-7 updated: ISIS-1755 veto ExceptionRecognizer on CDI scan

2017-11-22 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


The following commit(s) were added to refs/heads/dev/2.0.0/ISIS-1767-jee-7 by 
this push:
 new f42ac8b  ISIS-1755 veto ExceptionRecognizer on CDI scan
f42ac8b is described below

commit f42ac8b9889ab72599ed8bfe81110d48e1f81c2b
Author: Andi Huber <ahu...@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 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 {
 
 void processAnnotatedType(@Observes ProcessAnnotatedType 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" <commits@isis.apache.org>'].


[isis] branch master updated: ISIS-1781 fix wrong type: expected long, but is int

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 99a1f55  ISIS-1781 fix wrong type: expected long, but is int
99a1f55 is described below

commit 99a1f558a6c36d527c1aa457f7af72768a29528a
Author: Andi Huber <hob...@gmx.at>
AuthorDate: Tue Nov 21 19:49:12 2017 +0100

ISIS-1781 fix wrong type: expected long, but is int
---
 .../viewer/restfulobjects/rendering/domainobjects/JsonValueEncoder.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/domainobjects/JsonValueEncoder.java
 
b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/domainobjects/JsonValueEncoder.java
index 33d6d46..34e7b13 100644
--- 
a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/domainobjects/JsonValueEncoder.java
+++ 
b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/domainobjects/JsonValueEncoder.java
@@ -248,7 +248,7 @@ public final class JsonValueEncoder {
 return adapterFor(repr.asLong());
 }
 if (repr.isInt()) {
-return adapterFor(repr.asInt());
+return adapterFor(repr.asLong());
 }
 if (repr.isBigInteger()) {
 return adapterFor(repr.asBigInteger().longValue());

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


[isis] branch dev/2.0.0/ISIS-1767-jee-7 updated: ISIS-1775 Honor web-app's context path when configuring swagger.

2017-11-12 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


The following commit(s) were added to refs/heads/dev/2.0.0/ISIS-1767-jee-7 by 
this push:
 new aec3f28  ISIS-1775 Honor web-app's context path when configuring 
swagger.
aec3f28 is described below

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

[isis] branch dev/2.0.0/ISIS-1767-jee-7 updated (aec3f28 -> e4e5203)

2017-11-12 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.


from aec3f28  ISIS-1775 Honor web-app's context path when configuring 
swagger.
 new 3f98234  ISIS-1775 added License
 new 50ac764  ISIS-1775 added license
 new e4e5203  Merge branch 'dev/2.0.0/ISIS-1767-jee-7' of 
https://github.com/apache/isis into dev/2.0.0/ISIS-1767-jee-7

The 3 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:
 .../apache/isis/core/webapp/WebAppContextSupport.java | 19 +++
 1 file changed, 19 insertions(+)

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


[isis] 03/03: Merge branch 'dev/2.0.0/ISIS-1767-jee-7' of https://github.com/apache/isis into dev/2.0.0/ISIS-1767-jee-7

2017-11-12 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 e4e5203dcffe0517169150525f9d884d9399a770
Merge: 50ac764 aec3f28
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sun Nov 12 20:04:53 2017 +0100

Merge branch 'dev/2.0.0/ISIS-1767-jee-7' of
https://github.com/apache/isis into dev/2.0.0/ISIS-1767-jee-7

Conflicts:

core/metamodel/src/main/java/org/apache/isis/core/webapp/WebAppContextSupport.java


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


[isis] 02/03: ISIS-1775 added license

2017-11-12 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 50ac7648bcf61d3873bdef9b2b35e8f408bec41c
Author: Andi Huber <ahu...@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" <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 <ahu...@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 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 

[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 <ahu...@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" <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 <ahu...@apache.org>
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" <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 <ahu...@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..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" <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 <ahu...@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 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" <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 <ahu...@apache.org>
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" <commits@isis.apache.org>'].


[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 <ahu...@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 |  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. 

[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 <ahu...@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 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] 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 <ahu...@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 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" <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" <commits@isis.apache.org>'].


[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 <ahu...@apache.org>
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.get

[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" <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 <ahu...@apache.org>
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<Class, MethodHandle> 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()

[isis] branch dev/2.0.0/ISIS-1767-jee-7 updated: ISIS-1756 on shutdown purge any state associated with the current web-app classloader

2017-12-07 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


The following commit(s) were added to refs/heads/dev/2.0.0/ISIS-1767-jee-7 by 
this push:
 new 4805392  ISIS-1756 on shutdown purge any state associated with the 
current web-app classloader
4805392 is described below

commit 48053925364871ce30cf832360ee9b6855f1ee95
Author: Andi Huber <ahu...@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 47e117a..becc447 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -86,10 +86,10 @@
 
 3.2.0-m7
 
-5.1.2
-5.1.2
+5.1.5-SNAPSHOT
+
5.1.5-SNAPSHOT
 5.0.2
-5.1.2
+5.1.5-SNAPSHOT
 
5.1.0-release

[isis] branch dev/2.0.0/ISIS-1767-jee-7 updated: ISIS-1756 - fix typo

2017-10-29 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


The following commit(s) were added to refs/heads/dev/2.0.0/ISIS-1767-jee-7 by 
this push:
 new 644ec85  ISIS-1756 - fix typo
644ec85 is described below

commit 644ec85b67710011522aa58ef0d730b136da2d40
Author: Andi Huber <ahu...@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" <commits@isis.apache.org>'].


[isis] branch dev/2.0.0/ISIS-1767-jee-7 created (now 07f2c95)

2017-10-29 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.


  at 07f2c95  ISIS-1767 JEE 7+ added dependency on javaee-api to 
core/runtime

This branch includes the following new commits:

 new 05e7a96  ISIS-1756: IsisContext: add destroy(), deprecate testReset()
 new 07f2c95  ISIS-1767 JEE 7+ added dependency on javaee-api to 
core/runtime

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.


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


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

2017-10-29 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 07f2c9579af472ad06c70469b48fad09362fd445
Author: Andi Huber <ahu...@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 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" <commits@isis.apache.org>.


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

2017-10-29 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 05e7a96175169e1c3650800119b9d1a7c848bc2d
Author: Andi Huber <ahu...@apache.org>
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" <commits@isis.apache.org>.


[isis] branch dev/2.0.0/ISIS-1767-jee-7 updated: ISIS-1756 JEE 7+ Isis App life-cycling

2017-10-29 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


The following commit(s) were added to refs/heads/dev/2.0.0/ISIS-1767-jee-7 by 
this push:
 new 15a4d3e  ISIS-1756 JEE 7+ Isis App life-cycling
15a4d3e is described below

commit 15a4d3ee471c3707fac82639243e35a19a88aa3a
Author: Andi Huber <ahu...@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 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: th

[isis] branch dev/2.0.0/ISIS-1767-jee-7 updated: ISIS-1755 JEE 7+ allow coexistence of CDI and Isis' ServiceInjector

2017-10-29 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


The following commit(s) were added to refs/heads/dev/2.0.0/ISIS-1767-jee-7 by 
this push:
 new b0c0048  ISIS-1755 JEE 7+ allow coexistence of CDI and Isis' 
ServiceInjector
b0c0048 is described below

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

[isis] branch dev/2.0.0/ISIS-1767-jee-7 updated: ISIS-1756 prevent SQLException on schema creation if config is missing

2017-10-30 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


The following commit(s) were added to refs/heads/dev/2.0.0/ISIS-1767-jee-7 by 
this push:
 new e51e2f4  ISIS-1756 prevent SQLException on schema creation if config 
is missing
e51e2f4 is described below

commit e51e2f40ed5480f59b67bf5e106eaf67e4418a8e
Author: Andi Huber <ahu...@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 protected 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" <commits@isis.apache.org>'].


[isis] branch dev/2.0.0/ISIS-1767-jee-7 updated: ISIS-1756 utilize IsisWicketApplication's life-cycle instead of providing a life-cycle CDI Bean

2017-10-30 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


The following commit(s) were added to refs/heads/dev/2.0.0/ISIS-1767-jee-7 by 
this push:
 new 9ff06b1  ISIS-1756 utilize IsisWicketApplication's life-cycle instead 
of providing a life-cycle CDI Bean
9ff06b1 is described below

commit 9ff06b1d7d35dc88253754a53fd0f480c4cfdd71
Author: Andi Huber <ahu...@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..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" <commits@isis.apache.org>'].


[isis] branch dev/2.0.0/ISIS-1767-jee-7 updated: ISIS-1754 context aware class-loading for Isis

2017-10-30 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


The following commit(s) were added to refs/heads/dev/2.0.0/ISIS-1767-jee-7 by 
this push:
 new c6005f4  ISIS-1754 context aware class-loading for Isis
c6005f4 is described below

commit c6005f457be1391e1c95ae966ad74643b294a0af
Author: Andi Huber <ahu...@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 |  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()}
- 

[isis] branch dev/2.0.0/ISIS-1742-remove-deprecations updated: Proper lifecycling in preparation of ISIS-1756

2017-10-26 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-1742-remove-deprecations
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to 
refs/heads/dev/2.0.0/ISIS-1742-remove-deprecations by this push:
 new d96dc04  Proper lifecycling in preparation of ISIS-1756
d96dc04 is described below

commit d96dc04587a80db6b87f5f6f67ba11fe477ca983
Author: Andi Huber <hob...@gmx.at>
AuthorDate: Thu Oct 26 11:48:47 2017 +0200

Proper lifecycling in preparation of ISIS-1756
---
 .../isis/core/runtime/system/context/IsisContext.java  | 18 ++
 1 file changed, 18 insertions(+)

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..ba61579 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
@@ -78,7 +78,25 @@ public final class IsisContext {
  * Resets
  */
 public static void testReset() {
+destroy();
+}
+
+/**
+ * Resets
+ * @deprecated replaced by {@link #destroy()}
+ * 
+ */
+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" <commits@isis.apache.org>'].


[isis] branch dev/2.0.0/ISIS-1742-remove-deprecations updated: Update IsisContext.java

2017-10-26 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-1742-remove-deprecations
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to 
refs/heads/dev/2.0.0/ISIS-1742-remove-deprecations by this push:
 new aba7a26  Update IsisContext.java
aba7a26 is described below

commit aba7a2652675f37d8415cf2201bd2422509dc6bd
Author: Andi Huber <hob...@gmx.at>
AuthorDate: Thu Oct 26 12:09:57 2017 +0200

Update IsisContext.java
---
 .../org/apache/isis/core/runtime/system/context/IsisContext.java  | 8 
 1 file changed, 8 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 ba61579..55cc5bd 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,14 +72,6 @@ public final class IsisContext {
 }
 IsisContext.sessionFactory = sessionFactory;
 }
-
-
-/**
- * Resets
- */
-public static void testReset() {
-destroy();
-}
 
 /**
  * Resets

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


[isis] branch dev/2.0.0/ISIS-1767-jee-7 updated: ISIS-1755 TomEE requires Service Providers to be public classes

2017-10-31 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


The following commit(s) were added to refs/heads/dev/2.0.0/ISIS-1767-jee-7 by 
this push:
 new 1ea665d  ISIS-1755 TomEE requires Service Providers to be public 
classes
1ea665d is described below

commit 1ea665d47059c46fd4d1b8a34047240c12de4ba8
Author: Andi Huber <ahu...@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 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" <commits@isis.apache.org>'].


[isis] 03/03: ISIS-1943: Internal API: introduces _Functions

2018-05-04 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit a8646c4e18a5e01e96934be96f802bda0168c6cd
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Fri May 4 17:19:16 2018 +0200

ISIS-1943: Internal API: introduces _Functions

Task-Url: https://issues.apache.org/jira/browse/ISIS-1943
---
 .../isis/applib/internal/functions/_Functions.java | 53 ++
 .../_Functions_IndexAwareFunctionAdapter.java  | 44 ++
 .../applib/internal/functions/package-info.java| 28 
 .../components/tree/IsisToWicketTreeAdapter.java   | 15 +++---
 4 files changed, 134 insertions(+), 6 deletions(-)

diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/internal/functions/_Functions.java
 
b/core/applib/src/main/java/org/apache/isis/applib/internal/functions/_Functions.java
new file mode 100644
index 000..9a33621
--- /dev/null
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/internal/functions/_Functions.java
@@ -0,0 +1,53 @@
+/*
+ *  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.internal.functions;
+
+import java.util.function.Function;
+
+/**
+ * - internal use only -
+ * 
+ * Common Function idioms.
+ * 
+ * 
+ * WARNING: Do NOT use any of the classes provided by this 
package!  
+ * These may be changed or removed without notice!
+ * 
+ * 
+ * @since 2.0.0
+ */
+public class _Functions {
+
+   @FunctionalInterface
+   public interface IndexAwareFunction<T, R> {
+   public R apply(int index, T t);
+   }
+   
+   /**
+* Converts an IndexAwareFunction into a Function, having its index 
start at 0,
+* and incremented after each function call.
+* @param indexAwareFunction
+* @return 
+*/
+   public static <T, R> Function<T, R> 
indexAwareFunctionToFunction(IndexAwareFunction<T, R> indexAwareFunction){
+   return new _Functions_IndexAwareFunctionAdapter<T, 
R>(indexAwareFunction);
+   }
+   
+   
+}
diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/internal/functions/_Functions_IndexAwareFunctionAdapter.java
 
b/core/applib/src/main/java/org/apache/isis/applib/internal/functions/_Functions_IndexAwareFunctionAdapter.java
new file mode 100644
index 000..883abe0
--- /dev/null
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/internal/functions/_Functions_IndexAwareFunctionAdapter.java
@@ -0,0 +1,44 @@
+/*
+ *  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.internal.functions;
+
+import java.util.function.Function;
+
+import org.apache.isis.applib.internal.functions._Functions.IndexAwareFunction;
+
+/**
+ * Package private mixin for _Functions. 
+ * Extending a Function to keep track of an index, incremented with each 
function call.
+ */
+class _Functions_IndexAwareFunctionAdapter<T, R> implements Function<T, R> {
+
+
+   private int index=0;
+   private final IndexAwareFunction<T, R> indexAwareFunction;
+
+   _Functions_IndexAwareFunctionAdapter(IndexAwareFunction<T, R> 
indexAwareFunction) {
+   this.indexAwareFunction = indexAwareFunction;
+   }
+
+   @Override
+   pu

[isis] 01/03: ISIS-1943: extending the tree API: introduces TreePath

2018-05-04 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit f485b1b06f0b99405b3712ea8bd5463d071e1e9f
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Fri May 4 15:43:23 2018 +0200

ISIS-1943: extending the tree API: introduces TreePath

Task-Url: https://issues.apache.org/jira/browse/ISIS-1943
---
 .../org/apache/isis/applib/tree/LazyTreeNode.java  | 35 +++
 .../java/org/apache/isis/applib/tree/TreeNode.java |  4 ++
 .../java/org/apache/isis/applib/tree/TreePath.java | 50 ++
 .../apache/isis/applib/tree/TreePath_Default.java  | 47 
 .../components/tree/IsisToWicketTreeAdapter.java   |  3 +-
 5 files changed, 138 insertions(+), 1 deletion(-)

diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/tree/LazyTreeNode.java 
b/core/applib/src/main/java/org/apache/isis/applib/tree/LazyTreeNode.java
index 1d75d33..98ce49f 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/tree/LazyTreeNode.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/tree/LazyTreeNode.java
@@ -19,10 +19,12 @@
 package org.apache.isis.applib.tree;
 
 import java.util.Objects;
+import java.util.concurrent.atomic.LongAdder;
 import java.util.stream.Stream;
 
 import org.apache.isis.applib.annotation.Value;
 import org.apache.isis.applib.internal.base._Lazy;
+import org.apache.isis.applib.internal.exceptions._Exceptions;
 
 
@Value(semanticsProviderName="org.apache.isis.core.metamodel.facets.value.treenode.TreeNodeValueSemanticsProvider")
 public class LazyTreeNode implements TreeNode {
@@ -30,6 +32,7 @@ public class LazyTreeNode implements TreeNode {
private final T value;
private final Class> treeAdapterClass;
private final _Lazy<TreeAdapter> treeAdapter = 
_Lazy.of(this::newTreeAdapter);
+   private final _Lazy treePath = 
_Lazy.of(this::resolveTreePath);

public static  TreeNode of(T value, Class> treeAdapterClass) {
return new LazyTreeNode(value, treeAdapterClass);
@@ -73,6 +76,11 @@ public class LazyTreeNode implements TreeNode {
return treeAdapterClass;
}

+   @Override
+   public TreePath getPositionAsPath() {
+   return treePath.get();
+   }
+   
// -- HELPER

private TreeAdapter newTreeAdapter() {
@@ -92,5 +100,32 @@ public class LazyTreeNode implements TreeNode {
return of(value, getTreeAdapterClass());
}
 
+   private TreePath resolveTreePath() {
+   final TreeNode parent = getParentIfAny();
+   if(parent==null) {
+   return TreePath.root();
+   }
+   return 
parent.getPositionAsPath().append(indexWithinSiblings(parent));
+   }
+   
+   /*
+* @return zero based index
+*/
+   private int indexWithinSiblings(TreeNode parent) {
+   final LongAdder indexOneBased = new LongAdder();
+   
+   boolean found = parent.streamChildren()
+   .peek(__->indexOneBased.increment())
+   .anyMatch(sibling->this.equals(sibling))
+   ;
+   
+   if(!found) {
+   throw _Exceptions.unexpectedCodeReach();
+   }
+   
+   return indexOneBased.intValue()-1;
+   }
+
+

 }
diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/tree/TreeNode.java 
b/core/applib/src/main/java/org/apache/isis/applib/tree/TreeNode.java
index e387c0c..7ebb3ee 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/tree/TreeNode.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/tree/TreeNode.java
@@ -51,6 +51,10 @@ public interface TreeNode {
public default boolean isLeaf() {
return getChildCount() == 0;
}
+   
+   // -- PATH INFO
+   
+   public TreePath getPositionAsPath();
 
// -- CONSTRUCTION
 
diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/tree/TreePath.java 
b/core/applib/src/main/java/org/apache/isis/applib/tree/TreePath.java
new file mode 100644
index 000..0e8c349
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/tree/TreePath.java
@@ -0,0 +1,50 @@
+/*
+ *  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 applicabl

[isis] 02/03: ISIS-1943: introduces TreeModel that extends EntityModel

2018-05-04 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit 9aa747ead77790658bcd591b697cc20fb170ad8d
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Fri May 4 16:38:24 2018 +0200

ISIS-1943: introduces TreeModel that extends EntityModel


Task-Url: https://issues.apache.org/jira/browse/ISIS-1943
---
 .../java/org/apache/isis/applib/tree/TreePath.java |  10 ++
 .../apache/isis/applib/tree/TreePath_Default.java  |  32 +-
 .../components/tree/IsisToWicketTreeAdapter.java   | 125 +
 3 files changed, 119 insertions(+), 48 deletions(-)

diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/tree/TreePath.java 
b/core/applib/src/main/java/org/apache/isis/applib/tree/TreePath.java
index 0e8c349..0ecda6c 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/tree/TreePath.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/tree/TreePath.java
@@ -20,6 +20,8 @@ package org.apache.isis.applib.tree;
 
 import java.io.Serializable;
 
+import javax.annotation.Nullable;
+
 /**
  * Provides an unambiguous way to address nodes by position within a 
tree-structure. Examples:
  * 
@@ -37,6 +39,14 @@ public interface TreePath extends Serializable {
 */
public TreePath append(int indexWithinSiblings);

+   /**
+* 
+* @return a new TreePath instance that represents the parent path of 
this
+*/
+   public @Nullable TreePath getParentIfAny();
+   
+   public boolean isRoot();
+   
// -- CONSTRUCTION

public static TreePath of(final int ... canonicalPath) {
diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/tree/TreePath_Default.java 
b/core/applib/src/main/java/org/apache/isis/applib/tree/TreePath_Default.java
index ce30341..4851572 100644
--- 
a/core/applib/src/main/java/org/apache/isis/applib/tree/TreePath_Default.java
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/tree/TreePath_Default.java
@@ -18,6 +18,7 @@
  */
 package org.apache.isis.applib.tree;
 
+import java.util.Arrays;
 import java.util.Objects;
 
 /**
@@ -38,10 +39,39 @@ class TreePath_Default implements TreePath {
 
@Override
public TreePath append(int indexWithinSiblings) {
-   int[] newCanonicalPath = new int[canonicalPath.length+1];
+   final int[] newCanonicalPath = new int[canonicalPath.length+1];
System.arraycopy(canonicalPath, 0, newCanonicalPath, 0, 
canonicalPath.length);
newCanonicalPath[canonicalPath.length] = indexWithinSiblings;
return new TreePath_Default(newCanonicalPath);
}

+   @Override
+   public boolean equals(Object obj) {
+   if(obj instanceof TreePath_Default) {
+   final TreePath_Default other = (TreePath_Default) obj;
+   return Arrays.equals(canonicalPath, 
other.canonicalPath);
+   }
+   return false;
+   }
+   
+   @Override
+   public int hashCode() {
+   return canonicalPath.hashCode();
+   }
+
+   @Override
+   public TreePath getParentIfAny() {
+   if(isRoot()) {
+   return null;
+   }
+   final int[] newCanonicalPath = new int[canonicalPath.length-1];
+   System.arraycopy(canonicalPath, 0, newCanonicalPath, 0, 
canonicalPath.length-1);
+   return new TreePath_Default(newCanonicalPath);
+   }
+
+   @Override
+   public boolean isRoot() {
+   return canonicalPath.length==1;
+   }
+   
 }
diff --git 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
index 102a12a..164481d 100644
--- 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
+++ 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
@@ -5,6 +5,7 @@ import java.util.Iterator;
 import java.util.NoSuchElementException;
 import java.util.Objects;
 import java.util.Optional;
+import java.util.concurrent.atomic.LongAdder;
 import java.util.stream.Stream;
 
 import javax.resource.spi.IllegalStateException;
@@ -12,6 +13,7 @@ import javax.resource.spi.IllegalStateException;
 import org.apache.isis.applib.internal.collections._Lists;
 import org.apache.isis.applib.tree.TreeAdapter;
 import org.apache.isis.applib.tree.TreeNode;
+import org.apache.isis.applib.tree.TreePath;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.oid.RootOid;
 import org.apache.isis.core.runtime.system.context.IsisC

[isis] branch master updated (f4c9cdd -> a8646c4)

2018-05-04 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


from f4c9cdd  ISIS-898: cleanup debug code, also suppress 
unchecked+rawtypes warnings
 new f485b1b  ISIS-1943: extending the tree API: introduces TreePath
 new 9aa747e  ISIS-1943: introduces TreeModel that extends EntityModel
 new a8646c4  ISIS-1943: Internal API: introduces _Functions

The 3 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:
 .../{_Constants.java => functions/_Functions.java} |  36 +++---
 .../_Functions_IndexAwareFunctionAdapter.java} |  34 +++---
 .../internal/{base => functions}/package-info.java |   2 +-
 .../org/apache/isis/applib/tree/LazyTreeNode.java  |  35 ++
 .../java/org/apache/isis/applib/tree/TreeNode.java |   4 +
 .../_Comparators.java => tree/TreePath.java}   |  49 
 .../apache/isis/applib/tree/TreePath_Default.java  |  77 
 .../components/tree/IsisToWicketTreeAdapter.java   | 131 +
 8 files changed, 260 insertions(+), 108 deletions(-)
 copy 
core/applib/src/main/java/org/apache/isis/applib/internal/{_Constants.java => 
functions/_Functions.java} (64%)
 copy 
core/{applib-legacy/src/main/java/org/apache/isis/applib/layout/component/FieldSet_legacy.java
 => 
applib/src/main/java/org/apache/isis/applib/internal/functions/_Functions_IndexAwareFunctionAdapter.java}
 (57%)
 copy core/applib/src/main/java/org/apache/isis/applib/internal/{base => 
functions}/package-info.java (95%)
 copy 
core/applib/src/main/java/org/apache/isis/applib/{internal/compare/_Comparators.java
 => tree/TreePath.java} (50%)
 create mode 100644 
core/applib/src/main/java/org/apache/isis/applib/tree/TreePath_Default.java

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


[isis] branch master updated: ISIS-1946 minor cleanup, adding java-doc to clarify path-resource usage

2018-05-14 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 64ce6ad  ISIS-1946 minor cleanup, adding java-doc to clarify 
path-resource usage
64ce6ad is described below

commit 64ce6adfc7dc957b9af951f72809f2bca11cc610
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Mon May 14 20:01:06 2018 +0200

ISIS-1946 minor cleanup, adding java-doc to clarify path-resource usage
---
 .../isis/applib/internal/resources/_Resource.java  | 29 +++
 .../applib/internal/resources/_Resource_Path.java  | 42 --
 .../wicket/viewer/IsisWicketApplication.java   |  2 +-
 3 files changed, 39 insertions(+), 34 deletions(-)

diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/internal/resources/_Resource.java
 
b/core/applib/src/main/java/org/apache/isis/applib/internal/resources/_Resource.java
index 74ab7bb..193f78d 100644
--- 
a/core/applib/src/main/java/org/apache/isis/applib/internal/resources/_Resource.java
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/internal/resources/_Resource.java
@@ -57,21 +57,29 @@ public final class _Resource {
public static String loadAsString(Class contextClass, String 
resourceName, Charset charset) throws IOException {
final InputStream is = load(contextClass, resourceName);
return _Strings.ofBytes(_Bytes.of(is), charset);
-   
-   // legacy of guava
-// final URL url = Resources.getResource(contextClass, 
resourceName);
-//  return Resources.toString(url, charset);
}

// -- CONTEXT PATH RESOURCE

+   /**
+* @return context-path resource (if any) as stored previously by 
{@link #putContextPathIfPresent(String)}  
+*/
public final static String getContextPathIfAny() {
final _Resource_ContextPath resource = 
_Context.getIfAny(_Resource_ContextPath.class);
return resource!=null ? resource.getContextPath() : null;
}
 
-   public final static void putContextPath(String contextPath) {
-   _Context.put(_Resource_ContextPath.class, new 
_Resource_ContextPath(contextPath), false);
+   /**
+* Stores the {@code contextPath} as an application scoped 
resource-object.
+* If {@code contextPath} is null or an empty String, no path-resource 
object is stored. 
+* @param contextPath
+* @throws IllegalArgumentException if an non-empty contextPath 
evaluates to being 
+* equivalent to the root-path '/'
+*/
+   public final static void putContextPathIfPresent(String contextPath) {
+   if(!_Strings.isEmpty(contextPath)) {
+   _Context.put(_Resource_ContextPath.class, new 
_Resource_ContextPath(contextPath), false);   
+   } 
}

public final static String prependContextPathIfPresent(String path) {
@@ -95,11 +103,19 @@ public final class _Resource {
 
// -- RESTFUL PATH RESOURCE
 
+   /**
+* @return restful-path resource (if any) as stored previously by 
{@link #putRestfulPath(String)}  
+*/
public final static String getRestfulPathIfAny() {
final _Resource_RestfulPath resource = 
_Context.getIfAny(_Resource_RestfulPath.class);
return resource!=null ? resource.getRestfulPath() : null;
}
 
+   /**
+* Stores the {@code restfulPath} as an application scoped 
resource-object. 
+* @param restfulPath
+* @throws IllegalArgumentException if the restfulPath is empty or is 
the root-path.
+*/
public final static void putRestfulPath(String restfulPath) {
_Context.put(_Resource_RestfulPath.class, new 
_Resource_RestfulPath(restfulPath), false);
}
@@ -131,4 +147,5 @@ public final class _Resource {
 return name;
 }
 
+
 }
diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/internal/resources/_Resource_Path.java
 
b/core/applib/src/main/java/org/apache/isis/applib/internal/resources/_Resource_Path.java
index fd047d6..3b2a183 100644
--- 
a/core/applib/src/main/java/org/apache/isis/applib/internal/resources/_Resource_Path.java
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/internal/resources/_Resource_Path.java
@@ -25,6 +25,11 @@ import org.apache.isis.applib.internal.base._Strings;
 /**
  * 
  * package private abstract helper class to store application scoped path 
objects
+ * 
+ * 
+ * Implementation Note: Empty paths are represented by absence of this 
resource, 
+ * hence empty paths are not allowed (will throw an IllegalArgumentException 
on 
+ * attempted construction)   
  *
  */
 abstract class _Resource_Path {
@@ -34,21 +39,15 @@ abstract class _Resource_Path {
protected ab

[isis] 02/04: ISIS-1940 uses the invocation-preprocessor for support method validation

2018-04-27 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit 3bc8e4fcbc706f6fe65dc87bdb7f2ee754d1e1f2
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Fri Apr 27 14:48:16 2018 +0200

ISIS-1940 uses the invocation-preprocessor for support method validation
---
 .../apache/isis/core/commons/lang/MethodExtensions.java  |  2 +-
 .../lang/MethodInvocationPreprocessor.java}  | 16 +++-
 .../ActionInvocationFacetForDomainEventAbstract.java |  5 +++--
 .../specloader/specimpl/ObjectActionDefault.java |  1 +
 4 files changed, 16 insertions(+), 8 deletions(-)

diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/commons/lang/MethodExtensions.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/commons/lang/MethodExtensions.java
index 7215a47..6341054 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/commons/lang/MethodExtensions.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/commons/lang/MethodExtensions.java
@@ -41,7 +41,7 @@ public class MethodExtensions {
 public static Object invoke(final Method method, final Object object, 
final Object[] arguments) {
 try {
 Object[] defaultAnyPrimitive = 
defaultAnyPrimitive(method.getParameterTypes(), arguments);
-return method.invoke(object, defaultAnyPrimitive);
+return MethodInvocationPreprocessor.invoke(method, object, 
defaultAnyPrimitive);
 } catch (Exception e) {
return ThrowableExtensions.handleInvocationException(e, 
method.getName());
} 
diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/RelaxedMethodInvoker.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/commons/lang/MethodInvocationPreprocessor.java
similarity index 85%
rename from 
core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/RelaxedMethodInvoker.java
rename to 
core/metamodel/src/main/java/org/apache/isis/core/commons/lang/MethodInvocationPreprocessor.java
index 52dc432..aba3707 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/RelaxedMethodInvoker.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/commons/lang/MethodInvocationPreprocessor.java
@@ -17,7 +17,7 @@
  *  under the License.
  */
 
-package org.apache.isis.core.metamodel.facets.actions.action.invocation;
+package org.apache.isis.core.commons.lang;
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
@@ -32,12 +32,18 @@ import org.apache.isis.applib.internal.collections._Arrays;
 import org.apache.isis.applib.internal.collections._Collections;
 
 /**
- * Package private utility for method invocation pre-processing. 
- * Adapts supported collection parameter types List, Set, SortedSet, 
Collection and Arrays.
+ * Utility for method invocation pre-processing.
+ * 
+ * For a given array of parameters, we intercept and adapt those, 
+ * that are not compatible with the expected target parameter type.
+ * 
+ * 
+ * By now we do this for collection parameter types List, Set, SortedSet, 
Collection and Arrays.
+ * 
  */
-class RelaxedMethodInvoker {
+public class MethodInvocationPreprocessor {
 
-   static Object invoke(Method method, Object targetPojo, Object[] 
executionParameters) 
+   public static Object invoke(Method method, Object targetPojo, Object[] 
executionParameters) 
throws IllegalAccessException, 
InvocationTargetException {
 
if (_NullSafe.isEmpty(executionParameters)) {
diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventAbstract.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventAbstract.java
index 5f987d1..a071efe 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventAbstract.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventAbstract.java
@@ -51,6 +51,7 @@ import 
org.apache.isis.core.commons.authentication.AuthenticationSessionProvider
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.commons.lang.ArrayExtensions;
+import org.apache.isis.core.commons.lang.MethodInvocationPreprocessor;
 import org.apache.isis.core.commons.lang.ThrowableExtensions;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
@@ -389,11 +390,11 @@ public abstract

[isis] 01/04: ISIS-1939: overrides ObjectInputStream's class-loading to use Isis' default class-loader

2018-04-27 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit ce91cd599a2f427a35698829c8b36e236fd1d82d
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Fri Apr 27 13:18:51 2018 +0200

ISIS-1939: overrides ObjectInputStream's class-loading to use Isis'
default class-loader
---
 .../applib/internal/memento/_Mementos_MementoDefault.java   | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/internal/memento/_Mementos_MementoDefault.java
 
b/core/applib/src/main/java/org/apache/isis/applib/internal/memento/_Mementos_MementoDefault.java
index 9b58f00..deb3af0 100644
--- 
a/core/applib/src/main/java/org/apache/isis/applib/internal/memento/_Mementos_MementoDefault.java
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/internal/memento/_Mementos_MementoDefault.java
@@ -21,8 +21,10 @@ package org.apache.isis.applib.internal.memento;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
+import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
+import java.io.ObjectStreamClass;
 import java.io.Serializable;
 import java.util.Map;
 import java.util.Objects;
@@ -34,6 +36,7 @@ import org.apache.isis.applib.internal.base._Casts;
 import org.apache.isis.applib.internal.base._NullSafe;
 import org.apache.isis.applib.internal.collections._Maps;
 import org.apache.isis.applib.internal.collections._Sets;
+import org.apache.isis.applib.internal.context._Context;
 import org.apache.isis.applib.internal.memento._Mementos.Memento;
 import org.apache.isis.applib.internal.memento._Mementos.SerializingAdapter;
 import org.apache.isis.applib.services.urlencoding.UrlEncodingService;
@@ -108,7 +111,15 @@ class _Mementos_MementoDefault implements 
_Mementos.Memento {
if(_NullSafe.isEmpty(str)) {
return null;
}
-   try(ObjectInputStream ois = new ObjectInputStream(new 
ByteArrayInputStream(codec.decode(str {
+   try(ObjectInputStream ois = new ObjectInputStream(new 
ByteArrayInputStream(codec.decode(str))) {
+   //override ObjectInputStream's classloading
+   protected Class resolveClass(ObjectStreamClass desc)
+   throws IOException, ClassNotFoundException
+   {
+   String name = desc.getName();
+   return Class.forName(name, false, 
_Context.getDefaultClassLoader());
+   }
+   }) {
// read in the entire map
final Map<String, Serializable> valuesByKey = 
_Casts.uncheckedCast(ois.readObject());
return new _Mementos_MementoDefault(codec, serializer, 
valuesByKey);

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


[isis] branch master updated (9340178 -> 9a51b98)

2018-04-27 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


from 9340178  ISIS-898 remove temporary class
 new ce91cd5  ISIS-1939: overrides ObjectInputStream's class-loading to use 
Isis' default class-loader
 new 3bc8e4f  ISIS-1940 uses the invocation-preprocessor for support method 
validation
 new e7224f4  ISIS-1942 New Facet: XmlAccessorTypeFacet
 new 9a51b98  ISIS-1940 let the SortedSet-of-list adapter return a 
comparator=null

The 4 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:
 .../collections/_Collections_SortedSetOfList.java  |  5 +-
 .../internal/memento/_Mementos_MementoDefault.java | 13 -
 .../isis/core/commons/lang/MethodExtensions.java   |  2 +-
 .../lang/MethodInvocationPreprocessor.java}| 16 +--
 .../isis/core/metamodel/facets/Annotations.java|  2 +
 ...ctionInvocationFacetForDomainEventAbstract.java |  5 +-
 ...pterFacetFactory.java => JaxbFacetFactory.java} | 55 ++
 .../XmlAccessorTypeFacet.java} |  8 ++--
 ...ault.java => XmlAccessorTypeFacetAbstract.java} | 19 +---
 ...fault.java => XmlAccessorTypeFacetDefault.java} | 11 +++--
 .../specloader/specimpl/ObjectActionDefault.java   |  1 +
 .../dflt/ProgrammingModelFacetsJava5.java  |  4 +-
 12 files changed, 107 insertions(+), 34 deletions(-)
 rename 
core/metamodel/src/main/java/org/apache/isis/core/{metamodel/facets/actions/action/invocation/RelaxedMethodInvoker.java
 => commons/lang/MethodInvocationPreprocessor.java} (85%)
 rename 
core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/jaxb/{XmlJavaTypeAdapterFacetFactory.java
 => JaxbFacetFactory.java} (90%)
 copy 
core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/{collparam/semantics/CollectionSemanticsFacet.java
 => jaxb/XmlAccessorTypeFacet.java} (78%)
 copy 
core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/jaxb/{XmlJavaTypeAdapterFacetDefault.java
 => XmlAccessorTypeFacetAbstract.java} (66%)
 copy 
core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/jaxb/{XmlTransientFacetDefault.java
 => XmlAccessorTypeFacetDefault.java} (76%)

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


[isis] 04/04: ISIS-1940 let the SortedSet-of-list adapter return a comparator=null

2018-04-27 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit 9a51b98515fa864d175297e3eae2937a59732b2b
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Fri Apr 27 20:43:40 2018 +0200

ISIS-1940 let the SortedSet-of-list adapter return a comparator=null

otherwise streaming the elements will throw an exception
---
 .../applib/internal/collections/_Collections_SortedSetOfList.java| 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/internal/collections/_Collections_SortedSetOfList.java
 
b/core/applib/src/main/java/org/apache/isis/applib/internal/collections/_Collections_SortedSetOfList.java
index add7d8a..d78558c 100644
--- 
a/core/applib/src/main/java/org/apache/isis/applib/internal/collections/_Collections_SortedSetOfList.java
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/internal/collections/_Collections_SortedSetOfList.java
@@ -113,7 +113,10 @@ class _Collections_SortedSetOfList implements 
SortedSet {
 
@Override
public Comparator comparator() {
-   throw new UnsupportedOperationException(JUST_AN_ADAPTER);
+   return null; 
+   // this set was created from a list, we have no 
+   // info about the intended comparator, 
+   // but a least let stream traverse the elements
}
 
@Override

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


[isis] 03/04: ISIS-1942 New Facet: XmlAccessorTypeFacet

2018-04-27 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit e7224f42c7740de987be726f9deed03914b2a1da
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Fri Apr 27 20:41:08 2018 +0200

ISIS-1942 New Facet: XmlAccessorTypeFacet

also adds XmlTransient to the list the 'Annotations' scanner searches
fields for
---
 .../isis/core/metamodel/facets/Annotations.java|  2 +
 ...pterFacetFactory.java => JaxbFacetFactory.java} | 55 ++
 .../facets/jaxb/XmlAccessorTypeFacet.java  | 31 
 .../facets/jaxb/XmlAccessorTypeFacetAbstract.java  | 40 
 .../facets/jaxb/XmlAccessorTypeFacetDefault.java   | 33 +
 .../dflt/ProgrammingModelFacetsJava5.java  |  4 +-
 6 files changed, 154 insertions(+), 11 deletions(-)

diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/Annotations.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/Annotations.java
index 972f06e..1b92a47 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/Annotations.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/Annotations.java
@@ -33,6 +33,7 @@ import java.util.function.Predicate;
 import java.util.stream.Collectors;
 
 import javax.validation.constraints.Pattern;
+import javax.xml.bind.annotation.XmlTransient;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
 import org.apache.isis.applib.annotation.Collection;
@@ -583,6 +584,7 @@ public final class Annotations  {
 javax.annotation.Nullable.class,
 Title.class,
 XmlJavaTypeAdapter.class,
+XmlTransient.class,
 javax.jdo.annotations.Column.class
 )
 );
diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/jaxb/XmlJavaTypeAdapterFacetFactory.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/jaxb/JaxbFacetFactory.java
similarity index 90%
rename from 
core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/jaxb/XmlJavaTypeAdapterFacetFactory.java
rename to 
core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/jaxb/JaxbFacetFactory.java
index 1477cb8..b3fe9f0 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/jaxb/XmlJavaTypeAdapterFacetFactory.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/jaxb/JaxbFacetFactory.java
@@ -23,7 +23,10 @@ import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.util.List;
+import java.util.Optional;
 
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlTransient;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
@@ -51,7 +54,7 @@ import com.google.common.collect.Lists;
 /**
  * just adds a validator
  */
-public class XmlJavaTypeAdapterFacetFactory extends FacetFactoryAbstract
+public class JaxbFacetFactory extends FacetFactoryAbstract
 implements MetaModelValidatorRefiner {
 
 public static final String 
ISIS_REFLECTOR_VALIDATOR_JAXB_VIEW_MODEL_NOT_ABSTRACT =
@@ -74,42 +77,74 @@ public class XmlJavaTypeAdapterFacetFactory extends 
FacetFactoryAbstract
 "isis.reflector.validator.jaxbViewModelDateTimeTypeAdapter";
 public static final boolean 
ISIS_REFLECTOR_VALIDATOR_JAXB_VIEW_MODEL_DATE_TIME_TYPE_ADAPTER_DEFAULT = true;
 
-public XmlJavaTypeAdapterFacetFactory() {
+public JaxbFacetFactory() {
 super(FeatureType.OBJECTS_AND_PROPERTIES);
 }
+
+// -- CLASS CONTEXT
 
 @Override
 public void process(final ProcessClassContext processClassContext) {
+   processXmlJavaTypeAdapter(processClassContext);
+   processXmlAccessorTypeFacet(processClassContext);
+}
+
+private void processXmlJavaTypeAdapter(final ProcessClassContext 
processClassContext) {
 final Class cls = processClassContext.getCls();
 
 final XmlJavaTypeAdapter annotation = Annotations.getAnnotation(cls, 
XmlJavaTypeAdapter.class);
 if(annotation == null) {
 return;
 }
-
+
 final FacetHolder holder = processClassContext.getFacetHolder();
 final XmlJavaTypeAdapterFacetDefault facet = new 
XmlJavaTypeAdapterFacetDefault(holder,
 annotation.value(), getSpecificationLoader());
 
 FacetUtil.addFacet(facet);
 }
+
+private void processXmlAccessorTypeFacet(final ProcessClassContext 
processClassContext) {
+final Class cls = processClassContext.getCls();
+
+final XmlAccessorType annotation = Annotations.getAnnotation(cls, 
XmlAccessorType.class);
+if

[isis] branch master updated: ISIS-1944: Tree View: adds a model for the collapse/expand state

2018-05-08 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new d0c124a  ISIS-1944: Tree View: adds a model for the collapse/expand 
state
d0c124a is described below

commit d0c124aca88840935f1391313aa41102078f7cbe
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Tue May 8 13:32:36 2018 +0200

ISIS-1944: Tree View: adds a model for the collapse/expand state

Task-Url: https://issues.apache.org/jira/browse/ISIS-1944
---
 .../org/apache/isis/applib/tree/LazyTreeNode.java  | 36 +++---
 .../java/org/apache/isis/applib/tree/TreeNode.java | 11 ++-
 .../apache/isis/applib/tree/TreePath_Default.java  | 41 +++
 .../org/apache/isis/applib/tree/TreeState.java | 32 +
 .../apache/isis/applib/tree/TreeState_Default.java | 34 +
 .../org/apache/isis/applib/tree/TreePathTest.java  | 47 
 .../components/tree/IsisToWicketTreeAdapter.java   | 84 --
 7 files changed, 254 insertions(+), 31 deletions(-)

diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/tree/LazyTreeNode.java 
b/core/applib/src/main/java/org/apache/isis/applib/tree/LazyTreeNode.java
index 98ce49f..2446c21 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/tree/LazyTreeNode.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/tree/LazyTreeNode.java
@@ -29,18 +29,20 @@ import 
org.apache.isis.applib.internal.exceptions._Exceptions;
 
@Value(semanticsProviderName="org.apache.isis.core.metamodel.facets.value.treenode.TreeNodeValueSemanticsProvider")
 public class LazyTreeNode implements TreeNode {

+   private final TreeState sharedState;
private final T value;
private final Class> treeAdapterClass;
private final _Lazy<TreeAdapter> treeAdapter = 
_Lazy.of(this::newTreeAdapter);
private final _Lazy treePath = 
_Lazy.of(this::resolveTreePath);

-   public static  TreeNode of(T value, Class> treeAdapterClass) {
-   return new LazyTreeNode(value, treeAdapterClass);
+   public static  TreeNode of(T value, Class> treeAdapterClass, TreeState sharedState) {
+   return new LazyTreeNode(value, treeAdapterClass, 
sharedState);
}

-   protected LazyTreeNode(T value, Class> 
treeAdapterClass) {
+   protected LazyTreeNode(T value, Class> 
treeAdapterClass, TreeState sharedState) {
this.value = Objects.requireNonNull(value);
this.treeAdapterClass = 
Objects.requireNonNull(treeAdapterClass);
+   this.sharedState = sharedState;
}
 
@Override
@@ -52,8 +54,7 @@ public class LazyTreeNode implements TreeNode {
public TreeNode getParentIfAny() {
return treeAdapter().parentOf(getValue())
.map(this::toTreeNode)
-   .orElse(null)
-   ;
+   .orElse(null);
}
 
@Override
@@ -67,8 +68,7 @@ public class LazyTreeNode implements TreeNode {
return Stream.empty();
}
return treeAdapter().childrenOf(value)
-   .map(this::toTreeNode)
-   ;
+   .map(this::toTreeNode);
}
 
@Override
@@ -81,6 +81,23 @@ public class LazyTreeNode implements TreeNode {
return treePath.get();
}

+   @Override
+   public TreeState getTreeState() {
+   return sharedState;
+   }
+
+// @Override
+// public boolean isExpanded() {
+// // TODO Auto-generated method stub
+// return false;
+// }
+// 
+// @Override
+// public void setExpanded(boolean expanded) {
+// // TODO Auto-generated method stub
+// 
+// }
+   
// -- HELPER

private TreeAdapter newTreeAdapter() {
@@ -97,7 +114,7 @@ public class LazyTreeNode implements TreeNode {
}

private TreeNode toTreeNode(T value){
-   return of(value, getTreeAdapterClass());
+   return of(value, getTreeAdapterClass(), sharedState);
}
 
private TreePath resolveTreePath() {
@@ -116,8 +133,7 @@ public class LazyTreeNode implements TreeNode {

boolean found = parent.streamChildren()
.peek(__->indexOneBased.increment())
-   .anyMatch(sibling->this.equals(sibling))
-   ;
+   .anyMatch(sibling->this.equals(sibling));

if(!found) {
throw _Exceptions.unexpectedCodeReach();
diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/t

[isis] branch master updated: ISIS-1944: Tree View: adds convenient API for expand/collapse

2018-05-08 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new ceed81b  ISIS-1944: Tree View: adds convenient API for expand/collapse
ceed81b is described below

commit ceed81bea6502cf4a61ccfb68a5ff504f7d7056a
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Tue May 8 13:53:01 2018 +0200

ISIS-1944: Tree View: adds convenient API for expand/collapse

Task-Url: https://issues.apache.org/jira/browse/ISIS-1944
---
 .../java/org/apache/isis/applib/tree/TreeNode.java | 34 --
 1 file changed, 31 insertions(+), 3 deletions(-)

diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/tree/TreeNode.java 
b/core/applib/src/main/java/org/apache/isis/applib/tree/TreeNode.java
index 54f11d1..06413c3 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/tree/TreeNode.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/tree/TreeNode.java
@@ -19,6 +19,7 @@
 package org.apache.isis.applib.tree;
 
 import java.util.Iterator;
+import java.util.Set;
 import java.util.Spliterator;
 import java.util.Spliterators;
 import java.util.stream.Stream;
@@ -26,6 +27,9 @@ import java.util.stream.StreamSupport;
 
 import javax.annotation.Nullable;
 
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.internal.base._NullSafe;
+
 public interface TreeNode {
 
// -- VALUE
@@ -58,11 +62,35 @@ public interface TreeNode {
 
// -- COLLAPSE/EXPAND

+   /**
+* @return this tree's shared state object, holding e.g. the 
collapse/expand state
+*/
public TreeState getTreeState();

-// public boolean isExpanded();
-// 
-// public void setExpanded(boolean expanded);
+   public default boolean isExpanded(TreePath treePath) {
+   final Set expandedPaths = 
getTreeState().getExpandedNodePaths();
+   return expandedPaths.contains(treePath);
+   }
+   
+   /**
+* Adds {@code treePaths} to the set of expanded nodes, as held by this 
tree's shared state object. 
+* @param treePaths
+*/
+   @Programmatic
+   public default void expand(TreePath ... treePaths) {
+   final Set expandedPaths = 
getTreeState().getExpandedNodePaths();
+   _NullSafe.stream(treePaths).forEach(expandedPaths::add);
+   }
+   
+   /**
+* Removes {@code treePaths} from the set of expanded nodes, as held by 
this tree's shared state object.
+* @param treePaths
+*/
+   @Programmatic
+   public default void collapse(TreePath ... treePaths) {
+   final Set expandedPaths = 
getTreeState().getExpandedNodePaths();
+   _NullSafe.stream(treePaths).forEach(expandedPaths::remove);
+   }

// -- CONSTRUCTION
 

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


[isis] 01/02: ISIS-1944: Tree View: minor code improvements

2018-05-08 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit b6eac4ddb96ae6cbf4618a05d7c9908fde3051d1
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Tue May 8 14:24:25 2018 +0200

ISIS-1944: Tree View: minor code improvements

Task-Url: https://issues.apache.org/jira/browse/ISIS-1944
---
 .../components/tree/IsisToWicketTreeAdapter.java   | 124 +++--
 1 file changed, 68 insertions(+), 56 deletions(-)

diff --git 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
index a5ab062..90e7776 100644
--- 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
+++ 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
@@ -137,7 +137,7 @@ class IsisToWicketTreeAdapter {

}

-   // -- HELPER
+   // -- ISIS' TREE-MODEL

/**
 * Extending the EntityModel to also provide a TreePath.
@@ -157,6 +157,11 @@ class IsisToWicketTreeAdapter {
}
}

+   // -- ISIS' TREE ADAPTER (FOR TREES OF TREE-MODEL NODES) 
+   
+   /**
+*  TreeAdapter for TreeModel nodes. 
+*/
@SuppressWarnings({"rawtypes", "unchecked"})
private static class TreeModelTreeAdapter implements 
TreeAdapter, Serializable {
private static final long serialVersionUID = 1L;
@@ -225,6 +230,8 @@ class IsisToWicketTreeAdapter {
}

}
+   
+   // -- WICKET'S TREE PROVIDER (FOR TREES OF TREE-MODEL NODES)
 
/**
 * Wicket's ITreeProvider implemented for Isis
@@ -265,7 +272,7 @@ class IsisToWicketTreeAdapter {
 
@Override
public IModel model(final TreeModel treeModel) {
-   return new LoadableDetachableEntityModel(treeModel);
+   return new LoadableDetachableTreeModel(treeModel);
}

}
@@ -286,67 +293,19 @@ class IsisToWicketTreeAdapter {
wrappingTreeAdapter);   
}

-   /**
-* 
-* @param model
-* @return Wicket's model for collapse/expand state
-*/
-   @SuppressWarnings({ "rawtypes" })
-   private static TreeExpansionModel 
toIModelRepresentingCollapseExpandState(ModelAbstract model) {
-   
-   final TreeNode treeNode = (TreeNode) 
model.getObject().getObject();
-   final TreeState treeState = treeNode.getTreeState();
-   return TreeExpansionModel.of(treeState.getExpandedNodePaths());
-   }
+   // -- WICKET'S LOADABLE/DETACHABLE MODEL FOR TREE-MODEL NODES 

/**
-* Wicket's model for collapse/expand state
+* Wicket's loadable/detachable model for TreeModel nodes. 
 */
-   private static class TreeExpansionModel extends 
AbstractReadOnlyModel<Set> {
-   private static final long serialVersionUID = 
648152234030889164L;
-
-   public static TreeExpansionModel of(Set 
expandedTreePaths) {
-   return new TreeExpansionModel(expandedTreePaths);
-   }
-
-   public boolean contains(TreePath treePath) {
-   return expandedTreePaths.contains(treePath);
-   }
-
-   private final Set expandedTreePaths;
-   private final Set expandedNodes; //TODO [ahuber] 
possibly not used within this readonly model 
-   
-   private TreeExpansionModel(Set expandedTreePaths) {
-   this.expandedTreePaths = expandedTreePaths;
-   this.expandedNodes = expandedTreePaths.stream()
-   .map(tPath->new TreeModel(null, tPath))
-   .collect(Collectors.toSet());
-   }
-
-   @Override
-   public Set getObject() {
-   return expandedNodes;
-   }
-   
-   @Override
-   public String toString() {
-   return "{" + expandedNodes.stream()
-   .map(TreeModel::getTreePath)
-   .map(TreePath::toString)
-   .collect(Collectors.joining(", ")) + 
"}";
-   }
-
-
-   }
-   
-   private static class LoadableDetachableEntityModel extends 
LoadableDetachableModel {
+   private static class LoadableDetachableTreeMo

[isis] branch master updated (ceed81b -> fca655b)

2018-05-08 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


from ceed81b  ISIS-1944: Tree View: adds convenient API for expand/collapse
 new b6eac4d  ISIS-1944: Tree View: minor code improvements
 new fca655b  ISIS-1944: Tree View: propagate expand/collapse events to 
tree's state

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:
 .../components/tree/IsisToWicketTreeAdapter.java   | 166 ++---
 1 file changed, 108 insertions(+), 58 deletions(-)

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


[isis] 02/02: ISIS-1944: Tree View: propagate expand/collapse events to tree's state

2018-05-08 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit fca655be46c02207087f1b38f8e996ae010f2e9a
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Tue May 8 14:39:49 2018 +0200

ISIS-1944: Tree View: propagate expand/collapse events to tree's state

Task-Url: https://issues.apache.org/jira/browse/ISIS-1944
---
 .../components/tree/IsisToWicketTreeAdapter.java   | 44 --
 1 file changed, 41 insertions(+), 3 deletions(-)

diff --git 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
index 90e7776..dc504df 100644
--- 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
+++ 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
@@ -126,8 +126,8 @@ class IsisToWicketTreeAdapter {
}

/**
-* To utilize the custom TreeExpansionModel for deciding a 
node's collapse/expand state we 
-* override this method.
+* To utilize the custom TreeExpansionModel for deciding a 
node's collapse/expand state,
+* we override this method.
 */
@Override
public State getState(TreeModel t) {
@@ -135,6 +135,28 @@ class IsisToWicketTreeAdapter {
return treeExpansionModel.contains(t.getTreePath()) ? 
State.EXPANDED : State.COLLAPSED;
}

+   /**
+* To utilize the custom TreeExpansionModel for hooking into a 
node's expand event,
+* we override this method.
+*/
+   @Override
+   public void expand(TreeModel t) {
+   final TreeExpansionModel treeExpansionModel = 
(TreeExpansionModel) getModel();
+   treeExpansionModel.onExpand(t);
+   super.expand(t);
+   }
+   
+   /**
+* To utilize the custom TreeExpansionModel for hooking into a 
node's collapse event,
+* we override this method.
+*/
+   @Override
+   public void collapse(TreeModel t) {
+   final TreeExpansionModel treeExpansionModel = 
(TreeExpansionModel) getModel();
+   treeExpansionModel.onCollapse(t);
+   super.collapse(t);
+   }
+   
}

// -- ISIS' TREE-MODEL
@@ -386,12 +408,28 @@ class IsisToWicketTreeAdapter {
return new TreeExpansionModel(expandedTreePaths);
}
 
+   /**
+* Happens on user interaction via UI.
+* @param t
+*/
+   public void onExpand(TreeModel t) {
+   expandedTreePaths.add(t.getTreePath());
+   }
+   
+   /**
+* Happens on user interaction via UI.
+* @param t
+*/
+   public void onCollapse(TreeModel t) {
+   expandedTreePaths.remove(t.getTreePath());
+   }
+
public boolean contains(TreePath treePath) {
return expandedTreePaths.contains(treePath);
}
 
private final Set expandedTreePaths;
-   private final Set expandedNodes; //TODO [ahuber] 
possibly not used within this readonly model 
+   private final Set expandedNodes; 

private TreeExpansionModel(Set expandedTreePaths) {
this.expandedTreePaths = expandedTreePaths;

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


[isis] 01/03: ISIS-898: hardcode AjaxFallbackLink to be enabled in hierarchy

2018-05-04 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit dfe84e10c740cfadb19fe6bb68f6b15248227d43
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Fri May 4 11:56:18 2018 +0200

ISIS-898: hardcode AjaxFallbackLink to be enabled in hierarchy

Task-Url: https://issues.apache.org/jira/browse/ISIS-898
---
 .../components/tree/IsisToWicketTreeAdapter.java   | 70 --
 1 file changed, 66 insertions(+), 4 deletions(-)

diff --git 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
index 021d447..020d4ef 100644
--- 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
+++ 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
@@ -7,6 +7,7 @@ import java.util.Optional;
 import java.util.stream.Stream;
 
 import org.apache.isis.applib.internal.collections._Lists;
+import org.apache.isis.applib.internal.exceptions._Exceptions;
 import org.apache.isis.applib.tree.TreeAdapter;
 import org.apache.isis.applib.tree.TreeNode;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -19,8 +20,12 @@ import 
org.apache.isis.viewer.wicket.model.models.ScalarModel;
 import org.apache.isis.viewer.wicket.model.models.ValueModel;
 import 
org.apache.isis.viewer.wicket.ui.components.entity.icontitle.EntityIconAndTitlePanel;
 import org.apache.wicket.Component;
+import org.apache.wicket.MarkupContainer;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
 import org.apache.wicket.extensions.markup.html.repeater.tree.ITreeProvider;
 import org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree;
+import org.apache.wicket.extensions.markup.html.repeater.tree.Node;
 import 
org.apache.wicket.extensions.markup.html.repeater.tree.theme.WindowsTheme;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.LoadableDetachableModel;
@@ -37,6 +42,9 @@ class IsisToWicketTreeAdapter {

// -- RENDERING

+   /**
+* Wicket's Tree Component implemented for Isis
+*/
private static class EntityTree extends NestedTree {
 
private static final long serialVersionUID = 1L;
@@ -44,6 +52,9 @@ class IsisToWicketTreeAdapter {
public EntityTree(String id, ITreeProvider 
provider) {
super(id, provider);
add(new WindowsTheme()); // TODO not required if Isis 
provides it's own css styles for tree-nodes
+   
+   super.setEnabled(true);
+   super.setVisible(true);
}

/**
@@ -52,7 +63,50 @@ class IsisToWicketTreeAdapter {
@Override
protected Component newContentComponent(String id, 
IModel node) {
final EntityModel entityModel = node.getObject();
-   return new EntityIconAndTitlePanel(id, entityModel);
+   final Component entityIconAndTitle = new 
EntityIconAndTitlePanel(id, entityModel);
+   return entityIconAndTitle;
+   }
+   
+   /**
+* To hardcode Node's 
AjaxFallbackLink.isEnabledInHierarchy()->true we override this 
method.
+*/
+   @Override
+   public Component newNodeComponent(String id, 
IModel model) {
+   return new Node(id, this, model)
+   {
+   private static final long serialVersionUID = 1L;
+
+   @Override
+   protected Component createContent(String id, 
IModel model) {
+   return 
EntityTree.this.newContentComponent(id, model);
+   }
+   
+   @Override
+   protected MarkupContainer 
createJunctionComponent(String id) {
+   
+   final Node self = this;
+   
+   return new AjaxFallbackLink(id) {
+   private static final long 
serialVersionUID = 1L;
+   
+   @Override
+   public void 
onClick(AjaxRequestTarget target) {
+

[isis] 02/03: ISIS-1841: IsisContext: adds shortcuts for convenience

2018-05-04 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit 5b92468d60dbdfe6c9c3a837b10f50484642d75f
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Fri May 4 12:34:51 2018 +0200

ISIS-1841: IsisContext: adds shortcuts for convenience

also removes deprecated testReset()
---
 .../core/integtestsupport/IsisSystemForTest.java   |  2 +-
 .../runtime/headless/IsisSystemBootstrapper.java   |  2 +-
 .../core/runtime/system/context/IsisContext.java   | 45 ++
 3 files changed, 40 insertions(+), 9 deletions(-)

diff --git 
a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
 
b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
index 1149542..c2fef4d 100644
--- 
a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
+++ 
b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
@@ -327,7 +327,7 @@ public class IsisSystemForTest implements 
org.junit.rules.TestRule, DomainServic
 
 // for subsequent tests; the attempt to bootstrap the 
framework will leave
 // the IsisContext singleton as set.
-IsisContext.testReset();
+IsisContext.clear();
 
 final Set validationErrors = ex.getValidationErrors();
 final StringBuilder buf = new StringBuilder();
diff --git 
a/core/runtime/src/main/java/org/apache/isis/core/runtime/headless/IsisSystemBootstrapper.java
 
b/core/runtime/src/main/java/org/apache/isis/core/runtime/headless/IsisSystemBootstrapper.java
index b167b51..e587ec5 100644
--- 
a/core/runtime/src/main/java/org/apache/isis/core/runtime/headless/IsisSystemBootstrapper.java
+++ 
b/core/runtime/src/main/java/org/apache/isis/core/runtime/headless/IsisSystemBootstrapper.java
@@ -187,7 +187,7 @@ public class IsisSystemBootstrapper {
 isisSessionFactory.destroyServicesAndShutdown();
 pmf.close();
 
-IsisContext.testReset();
+IsisContext.clear();
 }
 
 public void tearDownAllModules() {
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 9763ff5..3e4bf99 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,8 +19,15 @@
 
 package org.apache.isis.core.runtime.system.context;
 
+import java.util.Optional;
+
 import org.apache.isis.applib.internal.context._Context;
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.metamodel.services.ServicesInjector;
+import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
 import 
org.apache.isis.core.metamodel.specloader.validator.MetaModelInvalidException;
+import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
+import org.apache.isis.core.runtime.system.session.IsisSession;
 import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
 
 /**
@@ -40,6 +47,7 @@ public interface IsisContext {
/**
 * 
 * @return Isis's session factory
+* @throws IllegalStateException if IsisSessionFactory not initialized
 */
// Implementation Note: Populated only by {@link 
IsisSessionFactoryBuilder}.
public static IsisSessionFactory getSessionFactory() {
@@ -68,16 +76,39 @@ public interface IsisContext {
resetLogging();
 }
 
-// -- DEPRECATIONS
+// -- CONVENIENT SHORTCUTS
 
 /**
- * Resets
- * @deprecated replaced by {@link #clear()}
- * 
+ * @return framework's current PersistenceSession (if any)
+ * @throws IllegalStateException if IsisSessionFactory not initialized
+ */
+public static Optional getPersistenceSession() {
+return Optional.ofNullable(getSessionFactory().getCurrentSession())
+   .map(IsisSession::getPersistenceSession);
+}
+
+/**
+ * @return framework's IsisConfiguration
+ * @throws IllegalStateException if IsisSessionFactory not initialized
+ */
+public static IsisConfiguration getConfiguration() {
+return getSessionFactory().getConfiguration();
+}
+
+/**
+ * @return framework's SpecificationLoader
+ * @throws IllegalStateException if IsisSessionFactory not initialized
+ */
+public static SpecificationLoader getSpecificationLoader() {
+return getSessionFactory().getSpecificationLoader();
+}
+
+/**
+ * @return framework's ServicesInjector
+ * @throws IllegalStateException if IsisSessionFactory not initialized
  */
-@Depr

[isis] branch master updated (9a51b98 -> 318c156)

2018-05-04 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


from 9a51b98  ISIS-1940 let the SortedSet-of-list adapter return a 
comparator=null
 new dfe84e1  ISIS-898: hardcode AjaxFallbackLink to be enabled in hierarchy
 new 5b92468  ISIS-1841: IsisContext: adds shortcuts for convenience
 new 318c156  ISIS-898: completes proof of concept

The 3 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:
 .../core/integtestsupport/IsisSystemForTest.java   |   2 +-
 .../runtime/headless/IsisSystemBootstrapper.java   |   2 +-
 .../core/runtime/system/context/IsisContext.java   |  45 ++--
 .../components/tree/IsisToWicketTreeAdapter.java   | 123 ++---
 4 files changed, 146 insertions(+), 26 deletions(-)

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


[isis] branch master updated: ISIS-898: cleanup debug code, also suppress unchecked+rawtypes warnings

2018-05-04 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new f4c9cdd  ISIS-898: cleanup debug code, also suppress 
unchecked+rawtypes warnings
f4c9cdd is described below

commit f4c9cdd5cec5705631fe7cc74ada8acf9916b99b
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Fri May 4 14:29:16 2018 +0200

ISIS-898: cleanup debug code, also suppress unchecked+rawtypes warnings

Task-Url: https://issues.apache.org/jira/browse/ISIS-898
---
 .../viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
index 222623e..766fd68 100644
--- 
a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
+++ 
b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
@@ -91,9 +91,7 @@ class IsisToWicketTreeAdapter {

@Override
public void 
onClick(AjaxRequestTarget target) {
-   System.out.println("!!! 
before toggle");

toggleExpandCollapse.run();
-   System.out.println("!!! 
after toggle");
}
 
@Override
@@ -120,7 +118,8 @@ class IsisToWicketTreeAdapter {
}

// -- HELPER
-   
+
+   @SuppressWarnings({"rawtypes", "unchecked"})
private static class EntityModelTreeAdapter implements 
TreeAdapter, Serializable {
private static final long serialVersionUID = 1L;

@@ -229,6 +228,7 @@ class IsisToWicketTreeAdapter {
 * @param model
 * @return Wicket's ITreeProvider
 */
+   @SuppressWarnings({ "rawtypes", "unchecked" })
private static ITreeProvider 
toITreeProvider(ModelAbstract model) {

final TreeNode tree = (TreeNode) model.getObject().getObject();

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


[isis] branch master updated: ISIS-1903 bump HelloWorld's parent pom to version 6

2018-05-18 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 69b64ab  ISIS-1903 bump HelloWorld's parent pom to version 6
69b64ab is described below

commit 69b64ab4f2c93ef1238e0edcf5536769dc294409
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Fri May 18 10:46:41 2018 +0200

ISIS-1903 bump HelloWorld's parent pom to version 6

fixes build under eclipse
---
 example/application/helloworld/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/example/application/helloworld/pom.xml 
b/example/application/helloworld/pom.xml
index 5a2cfad..be4aaae 100644
--- a/example/application/helloworld/pom.xml
+++ b/example/application/helloworld/pom.xml
@@ -24,7 +24,7 @@
 
 org.incode
 incode-build
-4
+6
 
 
 org.apache.isis.example.application

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


[isis] 07/13: ISIS-1948: reverts introduction of _Proxies

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit c85a1c5f329854be3c16ebd3970037d595de13ad
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 19 09:06:48 2018 +0200

ISIS-1948: reverts introduction of _Proxies

instead introduces plugin API (runtime): ProxyFactoryPlugin

Task-Url: https://issues.apache.org/jira/browse/ISIS-1948
---
 .../isis/applib/internal/context/_Plugin.java  |  26 -
 .../isis/applib/internal/discover/_Discover.java   |   8 +-
 .../internal/proxy/ProxyFactory_Default.java   | 110 -
 .../isis/applib/internal/proxy/package-info.java   |  28 --
 .../services/eventbus/EventBusImplementation.java  |   4 +-
 .../core/metamodel/IsisJdoMetamodelPlugin.java |   4 +-
 .../isis/core/metamodel/IsisJdoRuntimePlugin.java  |   4 +-
 .../core/runtime/plugins/codegen/ProxyFactory.java |  65 
 .../plugins/codegen/ProxyFactoryPlugin.java}   |  49 -
 .../core/runtime/services/ServiceInstantiator.java |   8 +-
 .../background/BackgroundServiceDefault.java   |  14 ++-
 .../applib/client/UriBuilderPlugin.java|   4 +-
 .../server/IsisJaxrsServerPlugin.java  |   4 +-
 .../isis/core/wrapper/proxy/ProxyCreator.java  |   8 +-
 14 files changed, 146 insertions(+), 190 deletions(-)

diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/internal/context/_Plugin.java
 
b/core/applib/src/main/java/org/apache/isis/applib/internal/context/_Plugin.java
index 65c149a..e0ba274 100644
--- 
a/core/applib/src/main/java/org/apache/isis/applib/internal/context/_Plugin.java
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/internal/context/_Plugin.java
@@ -29,6 +29,8 @@ import java.util.stream.Collectors;
 import org.apache.isis.applib.NonRecoverableException;
 import org.apache.isis.applib.internal.base._NullSafe;
 import org.apache.isis.applib.internal.collections._Sets;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * - internal use only -
@@ -99,17 +101,33 @@ public final class _Plugin {

}

+   // -- CONVENIENT PICK ANY
+   
+   public static  T pickAnyAndWarn(Class pluginInterfaceClass, 
Set ambiguousPlugins) {
+   final Logger log = 
LoggerFactory.getLogger(pluginInterfaceClass);
+   final T any = ambiguousPlugins.iterator().next();
+   
+   log.warn(String.format("You have more than one plugin 
implementing '%s' on your class-path [%s], "
+   + "just picking one: '%s'", 
+   pluginInterfaceClass.getName(),
+   
ambiguousPlugins.stream().map(p->p.getClass().getName()).collect(Collectors.joining(",
 ")),
+   any.getClass().getName()
+   ));
+   
+   return any;
+   }
+   
// -- CONVENIENT EXCEPTION FACTORIES
 
public static  NonRecoverableException ambiguityNonRecoverable(
Class pluginInterfaceClass, 
-   Set ambigousPlugins) {
+   Set ambiguousPlugins) {

return new NonRecoverableException(
-   String.format("Ambigous plugins implementing %s 
found on class path.\n{%s}", 
+   String.format("Ambiguous plugins implementing 
%s found on class path.\n{%s}", 
pluginInterfaceClass.getName(),

-   
_NullSafe.stream(ambigousPlugins)
+   
_NullSafe.stream(ambiguousPlugins)
.map(Object::getClass)
.map(Class::getName)
.collect(Collectors.joining(", 
"))
@@ -123,5 +141,7 @@ public final class _Plugin {
String.format("No plugin implementing %s found 
on class path.", 
pluginInterfaceClass.getName() 
));
}
+
+   

 }
diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/internal/discover/_Discover.java
 
b/core/applib/src/main/java/org/apache/isis/applib/internal/discover/_Discover.java
index 48109b3..d9b0c32 100644
--- 
a/core/applib/src/main/java/org/apache/isis/applib/internal/discover/_Discover.java
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/internal/discover/_Discover.java
@@ -62,11 +62,9 @@ public final class _Discover {
// -- HELPER

private static ClassDiscoveryPlugin ge

[isis] 11/13: ISIS-1949: Javassist plugin implemented

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit 45c98c070ef4d5a428c29961643b83e0beced496
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 19 10:51:57 2018 +0200

ISIS-1949: Javassist plugin implemented

Task-Url: https://issues.apache.org/jira/browse/ISIS-1949
---
 .../codegen/ProxyFactoryPluginUsingJavassist.java  | 55 ++
 .../proxy/ProxyCreatorTestUsingJavassist.java  |  3 +-
 .../core/runtime/plugins/codegen/ProxyFactory.java |  9 +++-
 3 files changed, 55 insertions(+), 12 deletions(-)

diff --git 
a/core/plugins/codegen-javassist/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingJavassist.java
 
b/core/plugins/codegen-javassist/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingJavassist.java
index 711c1e1..1f156c0 100644
--- 
a/core/plugins/codegen-javassist/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingJavassist.java
+++ 
b/core/plugins/codegen-javassist/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingJavassist.java
@@ -1,21 +1,60 @@
 package org.apache.isis.core.runtime.plugins.codegen;
 
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.function.Predicate;
 
-import org.apache.isis.applib.internal.exceptions._Exceptions;
+import org.apache.isis.applib.internal.base._Casts;
+import org.apache.isis.applib.internal.base._NullSafe;
+import org.apache.isis.core.commons.exceptions.IsisException;
 
 public class ProxyFactoryPluginUsingJavassist implements ProxyFactoryPlugin {
 
@Override
public  ProxyFactory factory(
-   Class base, 
-   Class[] interfaces, 
-   Predicate methodFilter,
-   Class[] constructorArgTypes) {
-   // TODO Auto-generated method stub
-   _Exceptions.throwNotImplemented();
-   return null;
+   final Class base, 
+   final Class[] interfaces, 
+   final Predicate methodFilter,
+   final Class[] constructorArgTypes) {
+   
+final javassist.util.proxy.ProxyFactory pfDelegate = new 
javassist.util.proxy.ProxyFactory();
+
+pfDelegate.setSuperclass(base);
+pfDelegate.setInterfaces(interfaces);
+
+if(methodFilter!=null) {
+   pfDelegate.setFilter(methodFilter::test);   
+}
+   
+final int constructorArgCount = _NullSafe.size(constructorArgTypes);
+
+   return new ProxyFactory() {
+
+   @Override
+   public T createInstance(final InvocationHandler 
handler, final Object[] constructorArgs) {
+   
+   final int constructorArgCountActual = 
_NullSafe.size(constructorArgTypes);
+   
+   if(constructorArgCount != 
constructorArgCountActual) {
+   throw new 
IllegalArgumentException(String.format("Contructor args expected %d, got %d.", 
+   constructorArgCount, 
constructorArgCountActual));
+   }
+   
+   try {
+   return _Casts.uncheckedCast( 
pfDelegate.create(
+   constructorArgTypes, 
+   constructorArgs, 
+   (Object self, Method 
thisMethod, Method proceed, Object[] args)->{
+   return 
handler.invoke(self, thisMethod, args);
+   }));
+   } catch (NoSuchMethodException | 
IllegalArgumentException | InstantiationException | 
+   IllegalAccessException | 
InvocationTargetException e) {
+   throw new IsisException(e);
+   }
+   }
+   
+   };
}
 
 }
diff --git 
a/core/plugins/codegen-javassist/src/test/java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTestUsingJavassist.java
 
b/core/plugins/codegen-javassist/src/test/java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTestUsingJavassist.java
index fabe6d8..d5fdba4 100644
--- 
a/core/plugins/codegen-javassist/src/test/java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTestUsingJavassist.java

[isis] 09/13: ISIS-1949: Align discovery plugin naming with codegen plugins

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit fecc1902421d41c8500aee7c8b5342ab7dc43a48
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 19 09:54:19 2018 +0200

ISIS-1949: Align discovery plugin naming with codegen plugins

Task-Url: https://issues.apache.org/jira/browse/ISIS-1949
---
 ...ReflectionsPlugin.java => ClassDiscoveryPluginUsingReflections.java} | 2 +-
 .../org.apache.isis.applib.plugins.classdiscovery.ClassDiscoveryPlugin  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/core/plugins/discovery-reflections/src/main/java/org/apache/isis/applib/plugins/classdiscovery/reflections/ClassDiscoveryUsingReflectionsPlugin.java
 
b/core/plugins/discovery-reflections/src/main/java/org/apache/isis/applib/plugins/classdiscovery/reflections/ClassDiscoveryPluginUsingReflections.java
similarity index 95%
rename from 
core/plugins/discovery-reflections/src/main/java/org/apache/isis/applib/plugins/classdiscovery/reflections/ClassDiscoveryUsingReflectionsPlugin.java
rename to 
core/plugins/discovery-reflections/src/main/java/org/apache/isis/applib/plugins/classdiscovery/reflections/ClassDiscoveryPluginUsingReflections.java
index 54bd85c..6cb60e1 100644
--- 
a/core/plugins/discovery-reflections/src/main/java/org/apache/isis/applib/plugins/classdiscovery/reflections/ClassDiscoveryUsingReflectionsPlugin.java
+++ 
b/core/plugins/discovery-reflections/src/main/java/org/apache/isis/applib/plugins/classdiscovery/reflections/ClassDiscoveryPluginUsingReflections.java
@@ -8,7 +8,7 @@ import 
org.apache.isis.applib.plugins.classdiscovery.ClassDiscoveryPlugin;
 import org.reflections.scanners.SubTypesScanner;
 import org.reflections.util.ClasspathHelper;
 
-public class ClassDiscoveryUsingReflectionsPlugin implements 
ClassDiscoveryPlugin {
+public class ClassDiscoveryPluginUsingReflections implements 
ClassDiscoveryPlugin {
 
@Override
public ClassDiscovery discover(String packageNamePrefix) {
diff --git 
a/core/plugins/discovery-reflections/src/main/resources/META-INF/services/org.apache.isis.applib.plugins.classdiscovery.ClassDiscoveryPlugin
 
b/core/plugins/discovery-reflections/src/main/resources/META-INF/services/org.apache.isis.applib.plugins.classdiscovery.ClassDiscoveryPlugin
index 9369ec4..a3e4d44 100644
--- 
a/core/plugins/discovery-reflections/src/main/resources/META-INF/services/org.apache.isis.applib.plugins.classdiscovery.ClassDiscoveryPlugin
+++ 
b/core/plugins/discovery-reflections/src/main/resources/META-INF/services/org.apache.isis.applib.plugins.classdiscovery.ClassDiscoveryPlugin
@@ -1 +1 @@
-org.apache.isis.applib.plugins.classdiscovery.reflections.ClassDiscoveryUsingReflectionsPlugin
\ No newline at end of file
+org.apache.isis.applib.plugins.classdiscovery.reflections.ClassDiscoveryPluginUsingReflections
\ No newline at end of file

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


[isis] 06/13: ISIS-1948: Internal API: adding 'combine' to _Arrays

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit 1ec1a40c6a6104feeac290ec516a620ac55d5078
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Fri May 18 21:52:46 2018 +0200

ISIS-1948: Internal API: adding 'combine' to _Arrays

Task-Url: https://issues.apache.org/jira/browse/ISIS-1948
---
 .../isis/applib/internal/collections/_Arrays.java  | 43 ++
 1 file changed, 43 insertions(+)

diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/internal/collections/_Arrays.java
 
b/core/applib/src/main/java/org/apache/isis/applib/internal/collections/_Arrays.java
index 76f409f..e4ef798 100644
--- 
a/core/applib/src/main/java/org/apache/isis/applib/internal/collections/_Arrays.java
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/internal/collections/_Arrays.java
@@ -19,12 +19,15 @@
 
 package org.apache.isis.applib.internal.collections;
 
+import java.lang.reflect.Array;
 import java.util.Collection;
 import java.util.Objects;
 import java.util.stream.Collector;
 
 import javax.annotation.Nullable;
 
+import org.apache.isis.applib.internal._Constants;
+import org.apache.isis.applib.internal.base._Casts;
 import org.apache.isis.applib.internal.base._NullSafe;
 
 /**
@@ -85,6 +88,46 @@ public final class _Arrays {
Objects.requireNonNull(componentType);
return new _Arrays_CollectorUnknownSize(componentType);
}
+
+// -- CONCATENATION
+
+/**
+ * Returns a new array containing all components {first, *rest} 
+ * @param first (non-null)
+ * @param rest (nullable)
+ * @return (non-null)
+ */
+@SafeVarargs
+   public static  T[] combine(T first, @Nullable  T... rest) {
+   Objects.requireNonNull(first);
+   final int restLength = _NullSafe.size(rest);
+   final T[] all = 
_Casts.uncheckedCast(Array.newInstance(first.getClass(), restLength+1));
+all[0] = first;
+if(restLength>0) {
+   System.arraycopy(rest, 0, all, 1, restLength);
+}
+return all;
+}
+
+/**
+ * Returns a new array containing all components {*first, *rest} 
+ * @param first (nullable)
+ * @param rest (nullable)
+ * @return (non-null)
+ */
+@SafeVarargs
+   public static  T[] combine(T[] first, T... rest) {
+   final int firstLength = _NullSafe.size(first);
+   final int restLength = _NullSafe.size(rest);
+   if(firstLength + restLength == 0) {
+   return _Casts.uncheckedCast(_Constants.emptyObjects);
+   }
+   final Class componentType = firstLength>0 ? first[0].getClass() : 
rest[0].getClass();
+   final T[] all = _Casts.uncheckedCast(Array.newInstance(componentType, 
firstLength + restLength));
+   System.arraycopy(first, 0, all, 0, firstLength);
+System.arraycopy(rest, 0, all, firstLength, restLength);
+return all;
+}
 
 // -- CONSTRUCTION
 

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


[isis] branch master updated (69b64ab -> 7243551)

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


from 69b64ab  ISIS-1903 bump HelloWorld's parent pom to version 6
 new b21d28a  ISIS-1948: Internal API: introduces _Proxies (stubs only)
 new 7ce9005  ISIS-1948: Adds unit test for ProxyCreator
 new a58f796  ISIS-1948: changes to a generic name for the proxy marker
 new da9a05d  ISIS-1948: fixes proxy test
 new 9545b50  ISIS-1948: switch to internal API (only stubs yet)
 new 1ec1a40  ISIS-1948: Internal API: adding 'combine' to _Arrays
 new c85a1c5  ISIS-1948: reverts introduction of _Proxies
 new 5eb8890  ISIS-1949: Adds new core plugin stubs
 new fecc190  ISIS-1949: Align discovery plugin naming with codegen plugins
 new 6a29e8b  ISIS-1949: cleanup plugin dependencies
 new 45c98c0  ISIS-1949: Javassist plugin implemented
 new 8179d7c  ISIS-1949: let helloworld/simpleapp use the new codegen plugin
 new 7243551  ISIS-1949: Move tests that depend on codegen plugins to 
plugins

The 13 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:
 .../isis/applib/internal/collections/_Arrays.java  |  43 +++
 .../isis/applib/internal/context/_Plugin.java  |  26 +++-
 .../isis/applib/internal/discover/_Discover.java   |   8 +-
 .../services/eventbus/EventBusImplementation.java  |   4 +-
 .../core/metamodel/IsisJdoMetamodelPlugin.java |   4 +-
 .../classsubstitutor/ClassSubstitutor.java |   2 +-
 .../{JavassistEnhanced.java => ProxyEnhanced.java} |   4 +-
 .../codegen-bytebuddy}/.gitignore  |   0
 .../{eventbus-guava => codegen-bytebuddy}/pom.xml  |  33 ++---
 .../codegen/ProxyFactoryPluginUsingByteBuddy.java  |  22 
 ...core.runtime.plugins.codegen.ProxyFactoryPlugin |   1 +
 .../codegen-javassist}/.gitignore  |   0
 .../{eventbus-guava => codegen-javassist}/pom.xml  |  27 +++--
 .../codegen/ProxyFactoryPluginUsingJavassist.java  |  60 +
 ...core.runtime.plugins.codegen.ProxyFactoryPlugin |   1 +
 .../ServiceInstantiatorTestUsingJavassist.java}|   5 +-
 .../proxy/ProxyCreatorTestUsingJavassist.java  |  97 +++
 ...a => ClassDiscoveryPluginUsingReflections.java} |   2 +-
 ...lib.plugins.classdiscovery.ClassDiscoveryPlugin |   2 +-
 core/pom.xml   |  18 ++-
 core/runtime/pom.xml   |   6 -
 .../isis/core/metamodel/IsisJdoRuntimePlugin.java  |   4 +-
 .../core/runtime/plugins/codegen/ProxyFactory.java |  70 +++
 .../plugins/codegen/ProxyFactoryPlugin.java}   |  48 
 .../core/runtime/services/ServiceInstantiator.java | 134 ++---
 .../background/BackgroundServiceDefault.java   |  91 +-
 .../runtime/services/ServiceInstantiatorTest.java  |   9 +-
 core/unittestsupport/pom.xml   |   4 -
 .../applib/client/UriBuilderPlugin.java|   4 +-
 .../server/IsisJaxrsServerPlugin.java  |   4 +-
 core/wrapper/pom.xml   | 104 
 .../isis/core/wrapper/proxy/ProxyCreator.java  |  66 +++---
 example/application/helloworld/pom.xml |   6 +
 .../application/simpleapp/module-simple/pom.xml|   6 +
 34 files changed, 582 insertions(+), 333 deletions(-)
 rename 
core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/classsubstitutor/{JavassistEnhanced.java
 => ProxyEnhanced.java} (93%)
 copy core/{viewer-wicket-ui-legacy => plugins/codegen-bytebuddy}/.gitignore 
(100%)
 copy core/plugins/{eventbus-guava => codegen-bytebuddy}/pom.xml (67%)
 create mode 100644 
core/plugins/codegen-bytebuddy/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingByteBuddy.java
 create mode 100644 
core/plugins/codegen-bytebuddy/src/main/resources/META-INF/services/org.apache.isis.core.runtime.plugins.codegen.ProxyFactoryPlugin
 copy core/{viewer-wicket-ui-legacy => plugins/codegen-javassist}/.gitignore 
(100%)
 copy core/plugins/{eventbus-guava => codegen-javassist}/pom.xml (76%)
 create mode 100644 
core/plugins/codegen-javassist/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingJavassist.java
 create mode 100644 
core/plugins/codegen-javassist/src/main/resources/META-INF/services/org.apache.isis.core.runtime.plugins.codegen.ProxyFactoryPlugin
 copy 
core/{runtime/src/test/java/org/apache/isis/core/runtime/services/ServiceInstantiatorTest.java
 => 
plugins/codegen-javassist/src/test/java/org/apache/isis/core/runtime/services/ServiceInstantiatorTestUsingJavassist.java}
 (99%)
 create mode 100644 
core/plugins/codegen-javassis

[isis] 05/13: ISIS-1948: switch to internal API (only stubs yet)

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit 9545b50a7033cb0eda557a345b02d1e79a3644d0
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Fri May 18 21:16:43 2018 +0200

ISIS-1948: switch to internal API (only stubs yet)

Task-Url: https://issues.apache.org/jira/browse/ISIS-1948
---
 .../classsubstitutor/ClassSubstitutor.java |   2 +-
 .../classsubstitutor/JavassistEnhanced.java|  28 -
 core/runtime/pom.xml   |   8 +-
 .../core/runtime/services/ServiceInstantiator.java | 132 ++---
 .../background/BackgroundServiceDefault.java   |  85 -
 core/unittestsupport/pom.xml   |   4 -
 core/wrapper/pom.xml   |   4 -
 .../isis/core/wrapper/proxy/ProxyCreator.java  |  64 +++---
 8 files changed, 105 insertions(+), 222 deletions(-)

diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/classsubstitutor/ClassSubstitutor.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/classsubstitutor/ClassSubstitutor.java
index d0b6ae7..ffafc48 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/classsubstitutor/ClassSubstitutor.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/classsubstitutor/ClassSubstitutor.java
@@ -76,7 +76,7 @@ public class ClassSubstitutor {
 if(superclass != null && superclass.isEnum()) {
 return superclass;
 }
-if (ClassUtil.directlyImplements(cls, JavassistEnhanced.class)) {
+if (ClassUtil.directlyImplements(cls, ProxyEnhanced.class)) {
 return getClass(cls.getSuperclass());
 }
 return cls;
diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/classsubstitutor/JavassistEnhanced.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/classsubstitutor/JavassistEnhanced.java
deleted file mode 100644
index 1dcb573..000
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/classsubstitutor/JavassistEnhanced.java
+++ /dev/null
@@ -1,28 +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.metamodel.specloader.classsubstitutor;
-
-/**
- * Marker interface for entities/services that have been enhanced with
- * javassist.
- */
-public interface JavassistEnhanced {
-
-}
diff --git a/core/runtime/pom.xml b/core/runtime/pom.xml
index d54a0f6..9a489dc 100644
--- a/core/runtime/pom.xml
+++ b/core/runtime/pom.xml
@@ -122,10 +122,10 @@

 

-   
-   org.javassist
-   javassist
-   
+
+
+
+
 

 
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 199e3b3..1ae7bb5 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
@@ -19,6 +19,7 @@
 
 package org.apache.isis.core.runtime.services;
 
+import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.Map;
@@ -29,24 +30,25 @@ import javax.annotation.PreDestroy;
 import javax.enterprise.context.RequestScoped;
 
 import org.apache.isis.applib.internal.context._Context;
+import org.apache.isis.applib.internal.proxy._Proxies;
+import org.apache.isis.applib.internal.proxy._Proxies.ProxyFactory;
 import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.commons.factory.InstanceCreationClassException;
 import org.apache.isis.core.commons.factory.InstanceCreationException;
 import org.apache.isis.core.com

[isis] 02/13: ISIS-1948: Adds unit test for ProxyCreator

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit 7ce900505885a41062d2054a64fe613dadc43dbd
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Fri May 18 21:01:07 2018 +0200

ISIS-1948: Adds unit test for ProxyCreator

Task-Url: https://issues.apache.org/jira/browse/ISIS-1948
---
 .../isis/core/wrapper/proxy/ProxyCreatorTest.java  | 87 ++
 1 file changed, 87 insertions(+)

diff --git 
a/core/wrapper/src/test/java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTest.java
 
b/core/wrapper/src/test/java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTest.java
new file mode 100644
index 000..eb65180
--- /dev/null
+++ 
b/core/wrapper/src/test/java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTest.java
@@ -0,0 +1,87 @@
+/*
+ *  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.wrapper.proxy;
+
+import java.lang.reflect.Method;
+import java.util.HashSet;
+import java.util.Set;
+
+import 
org.apache.isis.core.metamodel.specloader.classsubstitutor.ProxyEnhanced;
+import org.apache.isis.core.wrapper.handlers.DelegatingInvocationHandler;
+import org.apache.isis.progmodel.wrapper.dom.employees.Employee;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ProxyCreatorTest {
+   
+   private ProxyCreator proxyCreator;
+
+@Before
+public void setUp() throws Exception {
+   proxyCreator = new ProxyCreator();
+}
+
+private static class DelegatingInvocationHandlerForTest implements 
DelegatingInvocationHandler {
+   private final Employee delegate = new Employee();
+   private final Set invoked = new HashSet<>();
+   
+   @Override
+   public Object invoke(Object proxy, Method method, Object[] 
args) throws Throwable {
+   invoked.add(method.getName());
+   return "hi";
+   }
+
+   @Override
+   public Employee getDelegate() {
+   return delegate;
+   }
+
+   @Override
+   public boolean isResolveObjectChangedEnabled() {
+   return false;
+   }
+
+   @Override
+   public void setResolveObjectChangedEnabled(boolean 
resolveObjectChangedEnabled) {
+   }
+   
+   public boolean wasInvoked(String methodName) {
+   return invoked.contains(methodName);
+   }
+}
+
+   @Test
+   public void proxyShouldDlegateCalls() {
+   
+   final DelegatingInvocationHandlerForTest handler = new 
DelegatingInvocationHandlerForTest();
+   final Employee proxyOfEmployee = 
proxyCreator.instantiateProxy(handler);
+   
+   Assert.assertNotNull(proxyOfEmployee);
+   Assert.assertTrue(proxyOfEmployee instanceof ProxyEnhanced);
+   
+   Assert.assertFalse(handler.wasInvoked("getName"));
+   
+   Assert.assertEquals("hi", proxyOfEmployee.getName());
+   
+   Assert.assertTrue(handler.wasInvoked("getName"));
+   
+   }
+
+}

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


[isis] 04/13: ISIS-1948: fixes proxy test

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit da9a05d234a2a4080d36f5cea753a70759505ff1
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Fri May 18 21:11:40 2018 +0200

ISIS-1948: fixes proxy test

Task-Url: https://issues.apache.org/jira/browse/ISIS-1948
---
 .../java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTest.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/core/wrapper/src/test/java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTest.java
 
b/core/wrapper/src/test/java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTest.java
index eb65180..bbdd9a1 100644
--- 
a/core/wrapper/src/test/java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTest.java
+++ 
b/core/wrapper/src/test/java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTest.java
@@ -22,7 +22,6 @@ import java.lang.reflect.Method;
 import java.util.HashSet;
 import java.util.Set;
 
-import 
org.apache.isis.core.metamodel.specloader.classsubstitutor.ProxyEnhanced;
 import org.apache.isis.core.wrapper.handlers.DelegatingInvocationHandler;
 import org.apache.isis.progmodel.wrapper.dom.employees.Employee;
 import org.junit.Assert;
@@ -74,7 +73,8 @@ public class ProxyCreatorTest {
final Employee proxyOfEmployee = 
proxyCreator.instantiateProxy(handler);

Assert.assertNotNull(proxyOfEmployee);
-   Assert.assertTrue(proxyOfEmployee instanceof ProxyEnhanced);
+   
+   Assert.assertNotEquals(Employee.class.getName(), 
proxyOfEmployee.getClass().getName());

Assert.assertFalse(handler.wasInvoked("getName"));


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


[isis] 13/13: ISIS-1949: Move tests that depend on codegen plugins to plugins

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit 7243551954e919f681fee530ac59e658a9e6ab71
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 19 11:31:08 2018 +0200

ISIS-1949: Move tests that depend on codegen plugins to plugins

Task-Url: https://issues.apache.org/jira/browse/ISIS-1949
---
 core/plugins/codegen-javassist/pom.xml   | 6 ++
 .../runtime/services/ServiceInstantiatorTestUsingJavassist.java} | 5 +++--
 .../isis/core/runtime/services/ServiceInstantiatorTest.java  | 9 +
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/core/plugins/codegen-javassist/pom.xml 
b/core/plugins/codegen-javassist/pom.xml
index 69a5977..190059b 100644
--- a/core/plugins/codegen-javassist/pom.xml
+++ b/core/plugins/codegen-javassist/pom.xml
@@ -74,6 +74,12 @@
test

 
+   
+   org.apache.isis.core
+   isis-core-unittestsupport
+   test
+   
+

 
 
diff --git 
a/core/runtime/src/test/java/org/apache/isis/core/runtime/services/ServiceInstantiatorTest.java
 
b/core/plugins/codegen-javassist/src/test/java/org/apache/isis/core/runtime/services/ServiceInstantiatorTestUsingJavassist.java
similarity index 99%
copy from 
core/runtime/src/test/java/org/apache/isis/core/runtime/services/ServiceInstantiatorTest.java
copy to 
core/plugins/codegen-javassist/src/test/java/org/apache/isis/core/runtime/services/ServiceInstantiatorTestUsingJavassist.java
index 7dcb1b5..0b6a6f3 100644
--- 
a/core/runtime/src/test/java/org/apache/isis/core/runtime/services/ServiceInstantiatorTest.java
+++ 
b/core/plugins/codegen-javassist/src/test/java/org/apache/isis/core/runtime/services/ServiceInstantiatorTestUsingJavassist.java
@@ -1,3 +1,4 @@
+package org.apache.isis.core.runtime.services;
 /**
  *  Licensed to the Apache Software Foundation (ASF) under one or more
  *  contributor license agreements.  See the NOTICE file distributed with
@@ -14,7 +15,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.isis.core.runtime.services;
+
 
 import java.util.Collections;
 import java.util.List;
@@ -43,7 +44,7 @@ import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertThat;
 
-public class ServiceInstantiatorTest {
+public class ServiceInstantiatorTestUsingJavassist {
 
@Rule
public JUnitRuleMockery2 context = 
JUnitRuleMockery2.createFor(JUnitRuleMockery2.Mode.INTERFACES_AND_CLASSES);
diff --git 
a/core/runtime/src/test/java/org/apache/isis/core/runtime/services/ServiceInstantiatorTest.java
 
b/core/runtime/src/test/java/org/apache/isis/core/runtime/services/ServiceInstantiatorTest.java
index 7dcb1b5..791a3f4 100644
--- 
a/core/runtime/src/test/java/org/apache/isis/core/runtime/services/ServiceInstantiatorTest.java
+++ 
b/core/runtime/src/test/java/org/apache/isis/core/runtime/services/ServiceInstantiatorTest.java
@@ -32,6 +32,7 @@ import com.google.common.collect.Lists;
 
 import org.jmock.auto.Mock;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 
@@ -67,13 +68,13 @@ public class ServiceInstantiatorTest {
assertThat(calculator.add(3,4), is(7));
}
 
-   @Test
+   @Test @Ignore("test is in core plugins codegen-*")
public void requestScoped_instantiate() {
AccumulatingCalculator calculator = 
serviceInstantiator.createInstance(AccumulatingCalculator.class);
assertThat(calculator instanceof RequestScopedService, 
is(true));
}
 
-   @Test
+   @Test @Ignore("test is in core plugins codegen-*")
public void requestScoped_justOneThread() {
AccumulatingCalculator calculator = 
serviceInstantiator.createInstance(AccumulatingCalculator.class);
try {
@@ -86,7 +87,7 @@ public class ServiceInstantiatorTest {
}
}
 
-   @Test
+   @Test @Ignore("test is in core plugins codegen-*")
public void requestScoped_multipleThreads() throws 
InterruptedException, BrokenBarrierException {
 
final AccumulatingCalculator calculator = 
serviceInstantiator.createInstance(AccumulatingCalculator.class);
@@ -140,7 +141,7 @@ public class ServiceInstantiatorTest {
assertThat(totals[2], is(30));
}
 
-   @Test
+   @Test @Ignore("test is in core plugins codegen-*")
public void requestScoped_childThreads() throws InterruptedException  {
 
final Consumer consumer = 
serviceInstantiator.createInstance(Consumer.class);

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


[isis] 01/13: ISIS-1948: Internal API: introduces _Proxies (stubs only)

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit b21d28a7015692cda8ab58f02d13eec75fdcc434
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Fri May 18 21:00:12 2018 +0200

ISIS-1948: Internal API: introduces _Proxies (stubs only)

Task-Url: https://issues.apache.org/jira/browse/ISIS-1948
---
 .../internal/proxy/ProxyFactory_Default.java   | 110 +
 .../isis/applib/internal/proxy/_Proxies.java   |  47 +
 .../isis/applib/internal/proxy/package-info.java   |  28 ++
 3 files changed, 185 insertions(+)

diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/internal/proxy/ProxyFactory_Default.java
 
b/core/applib/src/main/java/org/apache/isis/applib/internal/proxy/ProxyFactory_Default.java
new file mode 100644
index 000..37709c7
--- /dev/null
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/internal/proxy/ProxyFactory_Default.java
@@ -0,0 +1,110 @@
+/*
+ *  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.internal.proxy;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationHandler;
+
+import org.apache.isis.applib.internal.exceptions._Exceptions;
+import org.apache.isis.applib.internal.proxy._Proxies.ProxyFactory;
+
+/**
+ * 
+ * package private mixin for utility class {@link _Proxies}
+ * 
+ * ProxyFactory default implementation.
+ *
+ */
+class ProxyFactory_Default implements ProxyFactory {
+
+   private final Class extending;
+   private final Class[] implementing;
+   
+   ProxyFactory_Default(Class extending, Class[] implementing) {
+   this.extending = extending;
+   this.implementing = implementing;
+   
+   // TODO ignore  return !m.getName().equals("finalize") || 
m.isBridge();
+   
+// this is the default, I believe
+// calling it here only because I know that it will throw an exception 
if the code were
+// in the future changed such that caching is invalid
+// (ie fail fast if future change could introduce a bug)
+//TODO proxyFactory.setUseCache(true);
+   
+   }
+
+   @Override
+   public T createInstance(InvocationHandler handler) {
+   
+//  final Class enhancedClass = proxyFactory.createClass();
+//  final Proxy proxy = (Proxy) Util.createInstance(enhancedClass);
+//
+//  proxy.setHandler(new MethodHandler() {
+//  @Override
+//  public Object invoke(Object self, Method thisMethod, Method 
proceed, Object[] args) throws Throwable {
+//  return handler.invoke(self, thisMethod, args);
+//  }
+//  });
+//
+//  return (T) proxy;
+   
+   //TODO 
+// } catch (final InstantiationException |
+//IllegalAccessException |
+//InvocationTargetException e) {
+// throw new IsisException(e);
+//}
+   
+   // TODO Auto-generated method stub
+   _Exceptions.throwNotImplemented();
+   return null;
+   }
+
+   
+//  final Class proxySubclass = proxyFactory.createClass();
+// 
+// final T newInstance;
+// if(mixedInIfAny == null) {
+// newInstance = proxySubclass.newInstance();
+// } else {
+// Constructor constructor = findConstructor(proxySubclass, 
mixedInIfAny);
+// newInstance = (T) constructor.newInstance(mixedInIfAny);
+// }
+// final ProxyObject proxyObject = (ProxyObject) newInstance;
+// proxyObject.setHandler(methodHandler);
+//
+// return newInstance;
+   
+private  Constructor findConstructor(final Class proxySubclass, 
final Object mixedInIfAny) {
+final Constructor[] constructors = proxySubclass.getConstructors();
+for (Constructor constructor : constructors) {
+final Class[] parameterTypes = constructor.getParameterTypes();
+if(parameterTypes.length == 1 && 
parameterTypes[0].isAssignableFrom(mixedInIfAny.getCla

[isis] branch master updated: ISIS-1949: unittesetsupport: add dependency on objenesis

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new edce32b  ISIS-1949: unittesetsupport: add dependency on objenesis
edce32b is described below

commit edce32ba3abf657fc09ba39c795f596231b46849
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 19 16:37:34 2018 +0200

ISIS-1949: unittesetsupport: add dependency on objenesis

Task-Url: https://issues.apache.org/jira/browse/ISIS-1949
---
 core/unittestsupport/pom.xml | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/core/unittestsupport/pom.xml b/core/unittestsupport/pom.xml
index a8d62d6..f32abf5 100644
--- a/core/unittestsupport/pom.xml
+++ b/core/unittestsupport/pom.xml
@@ -54,6 +54,12 @@
jmock-junit4

 
+
+org.objenesis
+objenesis
+true
+
+


javax.jdo

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


[isis] 03/03: ISIS-1949: comment: code does not ignore bridges

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit 49d3089e5fb7b1a0bacbb2e0f74123117d74
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 19 16:26:16 2018 +0200

ISIS-1949: comment: code does not ignore bridges

Task-Url: https://issues.apache.org/jira/browse/ISIS-1949
---
 .../isis/core/unittestsupport/jmocking/JavassistImposteriser.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/core/unittestsupport/src/main/java/org/apache/isis/core/unittestsupport/jmocking/JavassistImposteriser.java
 
b/core/unittestsupport/src/main/java/org/apache/isis/core/unittestsupport/jmocking/JavassistImposteriser.java
index 75567c8..5f3efdc 100644
--- 
a/core/unittestsupport/src/main/java/org/apache/isis/core/unittestsupport/jmocking/JavassistImposteriser.java
+++ 
b/core/unittestsupport/src/main/java/org/apache/isis/core/unittestsupport/jmocking/JavassistImposteriser.java
@@ -101,8 +101,8 @@ public class JavassistImposteriser implements Imposteriser {
 proxyFactory.setFilter(new MethodFilter() {
 @Override
 public boolean isHandled(final Method m) {
-// ignore finalize() and als bridge methods
-return !m.getName().equals("finalize") || m.isBridge();
+// ignore finalize() and also bridge methods
+return !m.getName().equals("finalize") || m.isBridge(); 
//[ahuber] this code does not ignore bridges!
 }
 });
 

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


[isis] 02/03: ISIS-1949: reinstate original behavior to not call noarg-constructor

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit c9f71c788107dffeee357d43a20968ebfd3b9b8e
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 19 16:20:42 2018 +0200

ISIS-1949: reinstate original behavior to not call noarg-constructor

Task-Url: https://issues.apache.org/jira/browse/ISIS-1949
---
 .../codegen/ProxyFactoryPluginUsingJavassist.java  | 66 --
 1 file changed, 49 insertions(+), 17 deletions(-)

diff --git 
a/core/plugins/codegen-javassist/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingJavassist.java
 
b/core/plugins/codegen-javassist/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingJavassist.java
index 1f156c0..f9d43e6 100644
--- 
a/core/plugins/codegen-javassist/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingJavassist.java
+++ 
b/core/plugins/codegen-javassist/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingJavassist.java
@@ -8,9 +8,13 @@ import java.util.function.Predicate;
 import org.apache.isis.applib.internal.base._Casts;
 import org.apache.isis.applib.internal.base._NullSafe;
 import org.apache.isis.core.commons.exceptions.IsisException;
+import org.objenesis.Objenesis;
+import org.objenesis.ObjenesisStd;
 
-public class ProxyFactoryPluginUsingJavassist implements ProxyFactoryPlugin {
+import javassist.util.proxy.ProxyObject;
 
+public class ProxyFactoryPluginUsingJavassist implements ProxyFactoryPlugin {
+   
@Override
public  ProxyFactory factory(
final Class base, 
@@ -19,6 +23,7 @@ public class ProxyFactoryPluginUsingJavassist implements 
ProxyFactoryPlugin {
final Class[] constructorArgTypes) {

 final javassist.util.proxy.ProxyFactory pfDelegate = new 
javassist.util.proxy.ProxyFactory();
+final Objenesis objenesis = new ObjenesisStd();
 
 pfDelegate.setSuperclass(base);
 pfDelegate.setInterfaces(interfaces);
@@ -26,35 +31,62 @@ public class ProxyFactoryPluginUsingJavassist implements 
ProxyFactoryPlugin {
 if(methodFilter!=null) {
pfDelegate.setFilter(methodFilter::test);   
 }
-   
-final int constructorArgCount = _NullSafe.size(constructorArgTypes);
 
return new ProxyFactory() {
 
@Override
-   public T createInstance(final InvocationHandler 
handler, final Object[] constructorArgs) {
-   
-   final int constructorArgCountActual = 
_NullSafe.size(constructorArgTypes);
-   
-   if(constructorArgCount != 
constructorArgCountActual) {
-   throw new 
IllegalArgumentException(String.format("Contructor args expected %d, got %d.", 
-   constructorArgCount, 
constructorArgCountActual));
-   }
+   public T createInstance(InvocationHandler handler, 
Object[] constructorArgs) {

+   ensureSameSize(constructorArgTypes, 
constructorArgs);
+
try {
-   return _Casts.uncheckedCast( 
pfDelegate.create(
-   constructorArgTypes, 
-   constructorArgs, 
-   (Object self, Method 
thisMethod, Method proceed, Object[] args)->{
-   return 
handler.invoke(self, thisMethod, args);
-   }));
+   
+   
if(_NullSafe.isEmpty(constructorArgTypes)) {
+   return _Casts.uncheckedCast( 
createNotUsingConstructor(handler) );  
+   } else {
+   return _Casts.uncheckedCast( 
createUsingConstructor(handler, constructorArgs) );
+   }
+   
} catch (NoSuchMethodException | 
IllegalArgumentException | InstantiationException | 
IllegalAccessException | 
InvocationTargetException e) {
throw new IsisException(e);
}
}
+
+   private Object 
createNotUsingConstructor(Invoca

[isis] 08/13: ISIS-1949: Adds new core plugin stubs

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit 5eb88908219d2886133941ce86f511ca6d95ea37
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 19 09:51:56 2018 +0200

ISIS-1949: Adds new core plugin stubs

Task-Url: https://issues.apache.org/jira/browse/ISIS-1949
---
 core/plugins/codegen-bytebuddy/.gitignore  |  1 +
 core/plugins/codegen-bytebuddy/pom.xml | 74 ++
 .../codegen/ProxyFactoryPluginUsingByteBuddy.java  | 22 +++
 ...core.runtime.plugins.codegen.ProxyFactoryPlugin |  1 +
 core/plugins/codegen-javassist/.gitignore  |  1 +
 core/plugins/codegen-javassist/pom.xml | 70 
 .../codegen/ProxyFactoryPluginUsingJavassist.java  | 21 ++
 ...core.runtime.plugins.codegen.ProxyFactoryPlugin |  1 +
 core/runtime/pom.xml   |  6 --
 9 files changed, 191 insertions(+), 6 deletions(-)

diff --git a/core/plugins/codegen-bytebuddy/.gitignore 
b/core/plugins/codegen-bytebuddy/.gitignore
new file mode 100644
index 000..a48e45b
--- /dev/null
+++ b/core/plugins/codegen-bytebuddy/.gitignore
@@ -0,0 +1 @@
+/target-ide
diff --git a/core/plugins/codegen-bytebuddy/pom.xml 
b/core/plugins/codegen-bytebuddy/pom.xml
new file mode 100644
index 000..0732c78
--- /dev/null
+++ b/core/plugins/codegen-bytebuddy/pom.xml
@@ -0,0 +1,74 @@
+
+
+http://maven.apache.org/POM/4.0.0;
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;>
+   4.0.0
+
+   
+   org.apache.isis.core
+   isis
+   ${revision}
+   ../../pom.xml
+   
+
+   isis-core-plugins-codegen-bytebuddy
+
+   Apache Isis Plugin for Code Generation (ByteBuddy)
+   
+Code generation plugin using ByteBuddy.
+
+
+   
+   1.8.0
+   
+   
org.apache.isis.plugins.codegen-bytebuddy
+   
org/apache/isis/plugins/codegen-bytebuddy
+   
+
+   
+   
+   
+   false
+   src/main/resources
+   
+   
+   false
+   src/main/java
+   
+   **
+   
+   
+   **/*.java
+   
+   
+   
+   
+
+   
+   
+   
+   net.bytebuddy
+   byte-buddy
+   ${bytebuddy.version}
+   
+
+   
+   org.apache.isis.core
+   isis-core-runtime
+   compile
+   
+
+   
+
+
+
\ No newline at end of file
diff --git 
a/core/plugins/codegen-bytebuddy/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingByteBuddy.java
 
b/core/plugins/codegen-bytebuddy/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingByteBuddy.java
new file mode 100644
index 000..0154f46
--- /dev/null
+++ 
b/core/plugins/codegen-bytebuddy/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingByteBuddy.java
@@ -0,0 +1,22 @@
+package org.apache.isis.core.runtime.plugins.codegen;
+
+import java.lang.reflect.Method;
+import java.util.function.Predicate;
+
+import org.apache.isis.applib.internal.exceptions._Exceptions;
+
+public class ProxyFactoryPluginUsingByteBuddy implements ProxyFactoryPlugin {
+
+   @Override
+   public  ProxyFactory factory(
+   Class base, 
+   Class[] interfaces, 
+   Predicate methodFilter,
+   Class[] constructorArgTypes) {
+   
+   _Exceptions.throwNotImplemented();
+   // TODO Auto-generated method stub
+   return null;
+   }
+
+}
diff --git 
a/core/plugins/codegen-bytebuddy/src/main/resources/META-INF/services/org.apache.isis.core.runtime.plugins.codegen.ProxyFactoryPlugin
 
b/core/plugins/codegen-bytebuddy/src/main/resources/META-INF/services/org.apache.isis.core.runtime.plugins.codegen.ProxyFactoryPlugin
new file mode 100644
index 000..f1dc631
--- /dev/null
+++ 
b/core/plugins/codegen-bytebuddy/src/main/resources/META-INF/services/org.apache.isis.core.runtime.plugins.codegen.ProxyFactoryPlugin
@@ -0,0 +1 @@
+org.apache.isis.core.runtime.plugins.codegen.ProxyFactoryPluginUsingByteBuddy
\ No newline at end of file
diff --git a/core/plugins/codegen-javassist/.gitignore 
b/core/plugins/codegen-javas

[isis] 10/13: ISIS-1949: cleanup plugin dependencies

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit 6a29e8b3a66124f4aea7747599c8aae007ed1207
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 19 10:20:35 2018 +0200

ISIS-1949: cleanup plugin dependencies

Task-Url: https://issues.apache.org/jira/browse/ISIS-1949
---
 core/plugins/codegen-javassist/pom.xml |  10 +++
 .../proxy/ProxyCreatorTestUsingJavassist.java} |  17 +++-
 core/pom.xml   |  18 +++-
 core/wrapper/pom.xml   | 100 ++---
 4 files changed, 89 insertions(+), 56 deletions(-)

diff --git a/core/plugins/codegen-javassist/pom.xml 
b/core/plugins/codegen-javassist/pom.xml
index d7f4b7b..69a5977 100644
--- a/core/plugins/codegen-javassist/pom.xml
+++ b/core/plugins/codegen-javassist/pom.xml
@@ -52,7 +52,9 @@

 

+   

+   

org.javassist
javassist
@@ -63,6 +65,14 @@
isis-core-runtime
compile

+   
+   
+   
+   
+   org.apache.isis.core
+   isis-core-wrapper
+   test
+   
 

 
diff --git 
a/core/wrapper/src/test/java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTest.java
 
b/core/plugins/codegen-javassist/src/test/java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTestUsingJavassist.java
similarity index 87%
rename from 
core/wrapper/src/test/java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTest.java
rename to 
core/plugins/codegen-javassist/src/test/java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTestUsingJavassist.java
index bbdd9a1..fabe6d8 100644
--- 
a/core/wrapper/src/test/java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTest.java
+++ 
b/core/plugins/codegen-javassist/src/test/java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTestUsingJavassist.java
@@ -23,12 +23,12 @@ import java.util.HashSet;
 import java.util.Set;
 
 import org.apache.isis.core.wrapper.handlers.DelegatingInvocationHandler;
-import org.apache.isis.progmodel.wrapper.dom.employees.Employee;
+
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class ProxyCreatorTest {
+public class ProxyCreatorTestUsingJavassist {

private ProxyCreator proxyCreator;
 
@@ -37,6 +37,17 @@ public class ProxyCreatorTest {
proxyCreator = new ProxyCreator();
 }
 
+@SuppressWarnings("unused")
+private static class Employee {
+private String name;
+public String getName() {
+return name;
+}
+   public void setName(final String name) {
+this.name = name;
+}
+}
+
 private static class DelegatingInvocationHandlerForTest implements 
DelegatingInvocationHandler {
private final Employee delegate = new Employee();
private final Set invoked = new HashSet<>();
@@ -67,7 +78,7 @@ public class ProxyCreatorTest {
 }
 
@Test
-   public void proxyShouldDlegateCalls() {
+   public void proxyShouldDelegateCalls() {

final DelegatingInvocationHandlerForTest handler = new 
DelegatingInvocationHandlerForTest();
final Employee proxyOfEmployee = 
proxyCreator.instantiateProxy(handler);
diff --git a/core/pom.xml b/core/pom.xml
index 57fa935..cdafd95 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -1440,8 +1440,20 @@ ${license.additional-notes}
 ${revision}
 
 
-
-
+
+
+
+org.apache.isis.core
+isis-core-plugins-codegen-bytebuddy
+${revision}
+
+
+
+org.apache.isis.core
+isis-core-plugins-codegen-javassist
+${revision}
+
+
 
 org.apache.isis.core
 
isis-core-plugins-discovery-reflections
@@ -2396,6 +2408,8 @@ ${license.additional-notes}
 mavendeps/webapp
 mavendeps/testing
 
+plugins/codegen-bytebuddy
+plugins/codegen-javassist
 plugins/discovery-reflections
 plugins/eventbus-axon
 plugins/eventbus-guava
diff --git a/core/wrapper/pom.xml b/core/wrapper/pom.xml
index c8e5b09..193cc5d 100644
--- a/core/wrapper/pom.xml
+++ b/core/wrapper/pom.xml
@@ -1,69 +1,67 @@
 
-
-http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;>
+
+http://maven.apache.org/POM/4.0.0;
+ 

[isis] 12/13: ISIS-1949: let helloworld/simpleapp use the new codegen plugin

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit 8179d7cb7ecc06111c03e2bd0ff0b78fdc89b4e1
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 19 11:13:58 2018 +0200

ISIS-1949: let helloworld/simpleapp use the new codegen plugin

Task-Url: https://issues.apache.org/jira/browse/ISIS-1949
---
 example/application/helloworld/pom.xml  | 6 ++
 example/application/simpleapp/module-simple/pom.xml | 6 ++
 2 files changed, 12 insertions(+)

diff --git a/example/application/helloworld/pom.xml 
b/example/application/helloworld/pom.xml
index be4aaae..461154c 100644
--- a/example/application/helloworld/pom.xml
+++ b/example/application/helloworld/pom.xml
@@ -167,6 +167,12 @@
 
 
 
+
+
+   org.apache.isis.core
+   
isis-core-plugins-codegen-javassist
+   
+
 
 org.apache.isis.core
 isis-core-plugins-discovery-reflections
diff --git a/example/application/simpleapp/module-simple/pom.xml 
b/example/application/simpleapp/module-simple/pom.xml
index dc4c7f7..29f5121 100644
--- a/example/application/simpleapp/module-simple/pom.xml
+++ b/example/application/simpleapp/module-simple/pom.xml
@@ -150,6 +150,12 @@
 
 
 
+   org.apache.isis.core
+   
isis-core-plugins-codegen-javassist
+   ${isis.version}
+   
+
+
 org.apache.isis.core
 isis-core-plugins-discovery-reflections
 ${isis.version}

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


[isis] 03/13: ISIS-1948: changes to a generic name for the proxy marker

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit a58f7961c57813f68b08fd801af2947e78398d92
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Fri May 18 21:07:26 2018 +0200

ISIS-1948: changes to a generic name for the proxy marker

Task-Url: https://issues.apache.org/jira/browse/ISIS-1948
---
 .../specloader/classsubstitutor/ProxyEnhanced.java | 28 ++
 1 file changed, 28 insertions(+)

diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/classsubstitutor/ProxyEnhanced.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/classsubstitutor/ProxyEnhanced.java
new file mode 100644
index 000..e0c1d1f
--- /dev/null
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/classsubstitutor/ProxyEnhanced.java
@@ -0,0 +1,28 @@
+/*
+ *  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.specloader.classsubstitutor;
+
+/**
+ * Marker interface for entities/services that have been enhanced with
+ * the framework's proxy factory.
+ */
+public interface ProxyEnhanced {
+
+}

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


[isis] branch master updated: ISIS-1949: Also aligning event-bus plugins.

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new bb42507  ISIS-1949: Also aligning event-bus plugins.
bb42507 is described below

commit bb42507b53e1faa6d4a72554221cd0e1c60990ef
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 19 19:33:22 2018 +0200

ISIS-1949: Also aligning event-bus plugins.

Task-Url: https://issues.apache.org/jira/browse/ISIS-1949
---
 .../isis/applib/services/eventbus/EventBusService.java   | 13 +++--
 .../isis/core/plugins/eventbus/EventBusPlugin.java}  | 12 ++--
 .../eventbus/EventBusPluginForAxon.java} | 12 ++--
 isis.applib.services.eventbus.EventBusImplementation |  1 -
 .../org.apache.isis.core.plugins.eventbus.EventBusPlugin |  1 +
 .../QueryResultsCacheUsingAxonTest.java  |  6 +++---
 .../eventbus/EventBusPluginForGuava.java}|  8 
 isis.applib.services.eventbus.EventBusImplementation |  1 -
 .../org.apache.isis.core.plugins.eventbus.EventBusPlugin |  1 +
 .../QueryResultsCacheUsingGuavaTest.java |  6 +++---
 .../eventbus/EventBusImplementationAbstract.java |  4 ++--
 .../services/eventbus/EventBusServiceDefault.java| 16 
 12 files changed, 41 insertions(+), 40 deletions(-)

diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/EventBusService.java
 
b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/EventBusService.java
index b1ebe6d..a0eeade 100644
--- 
a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/EventBusService.java
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/EventBusService.java
@@ -26,8 +26,9 @@ import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
 
 import org.apache.isis.applib.annotation.Programmatic;
-import 
org.apache.isis.applib.services.eventbus.EventBusImplementation.EventListener;
 import org.apache.isis.commons.internal.collections._Sets;
+import org.apache.isis.core.plugins.eventbus.EventBusPlugin;
+import org.apache.isis.core.plugins.eventbus.EventBusPlugin.EventListener;
 
 /**
  * A service implementing an Event Bus, allowing arbitrary events to be posted 
and
@@ -59,11 +60,11 @@ public abstract class EventBusService {
 @Override
 public void post(Object event) {}
 @Override
-public EventBusImplementation getEventBusImplementation() {
+public EventBusPlugin getEventBusImplementation() {
 return null;
 }
 @Override
-protected EventBusImplementation newEventBus() { return null; }
+protected EventBusPlugin newEventBus() { return null; }
 }
 
 public static final EventBusService NOOP = new Noop();
@@ -223,7 +224,7 @@ public abstract class EventBusService {
 /**
  * Lazily populated in {@link #getEventBusImplementation()} as result of 
the first {@link #post(Object)}.
  */
-protected EventBusImplementation eventBusImplementation;
+protected EventBusPlugin eventBusImplementation;
 
 public  EventListener addEventListener(final Class targetType, 
Consumer onEvent) {
return Optional.ofNullable(getEventBusImplementation())
@@ -242,7 +243,7 @@ public abstract class EventBusService {
  * Lazily populates the event bus for the current {@link #getSubscribers() 
subscribers}.
  */
 @Programmatic
-protected EventBusImplementation getEventBusImplementation() {
+protected EventBusPlugin getEventBusImplementation() {
 setupEventBus();
 return eventBusImplementation;
 }
@@ -302,7 +303,7 @@ public abstract class EventBusService {
 /**
  * Mandatory hook method for subclass to instantiate an appropriately 
configured Guava event bus.
  */
-protected abstract EventBusImplementation newEventBus();
+protected abstract EventBusPlugin newEventBus();
 
 
 /**
diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/EventBusImplementation.java
 
b/core/commons/src/main/java/org/apache/isis/core/plugins/eventbus/EventBusPlugin.java
similarity index 87%
rename from 
core/applib/src/main/java/org/apache/isis/applib/services/eventbus/EventBusImplementation.java
rename to 
core/commons/src/main/java/org/apache/isis/core/plugins/eventbus/EventBusPlugin.java
index 625355e..615da10 100644
--- 
a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/EventBusImplementation.java
+++ 
b/core/commons/src/main/java/org/apache/isis/core/plugins/eventbus/EventBusPlugin.java
@@ -14,7 +14,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.isis.applib.services.eventbus;
+package org.apache.isis.core.plugins.ev

[isis] branch master updated: ISIS-1949: refining ProxyFactory API, also adding java-doc

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 21c34ae  ISIS-1949: refining ProxyFactory API, also adding java-doc
21c34ae is described below

commit 21c34aeda54b951e30b2498991359684a6037952
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 19 17:28:33 2018 +0200

ISIS-1949: refining ProxyFactory API, also adding java-doc

Task-Url: https://issues.apache.org/jira/browse/ISIS-1949
---
 .../codegen/ProxyFactoryPluginUsingJavassist.java  | 50 +-
 .../core/runtime/plugins/codegen/ProxyFactory.java | 31 +++---
 .../core/runtime/services/ServiceInstantiator.java |  2 +-
 .../background/BackgroundServiceDefault.java   | 12 --
 .../isis/core/wrapper/proxy/ProxyCreator.java  |  2 +-
 5 files changed, 75 insertions(+), 22 deletions(-)

diff --git 
a/core/plugins/codegen-javassist/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingJavassist.java
 
b/core/plugins/codegen-javassist/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingJavassist.java
index f9d43e6..2bb6a8f 100644
--- 
a/core/plugins/codegen-javassist/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingJavassist.java
+++ 
b/core/plugins/codegen-javassist/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingJavassist.java
@@ -5,6 +5,9 @@ import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.function.Predicate;
 
+import javax.annotation.Nullable;
+
+import org.apache.isis.applib.internal._Constants;
 import org.apache.isis.applib.internal.base._Casts;
 import org.apache.isis.applib.internal.base._NullSafe;
 import org.apache.isis.core.commons.exceptions.IsisException;
@@ -33,26 +36,42 @@ public class ProxyFactoryPluginUsingJavassist implements 
ProxyFactoryPlugin {
 }
 
return new ProxyFactory() {
-
+   
@Override
-   public T createInstance(InvocationHandler handler, 
Object[] constructorArgs) {
-   
-   ensureSameSize(constructorArgTypes, 
constructorArgs);
+   public T createInstance(InvocationHandler handler, 
boolean initialize) {
 
try {

-   
if(_NullSafe.isEmpty(constructorArgTypes)) {
-   return _Casts.uncheckedCast( 
createNotUsingConstructor(handler) );  
+   if(initialize) {
+   
ensureSameSize(constructorArgTypes, null);
+   return _Casts.uncheckedCast( 
createUsingConstructor(handler, null) );
} else {
-   return _Casts.uncheckedCast( 
createUsingConstructor(handler, constructorArgs) );
+   return _Casts.uncheckedCast( 
createNotUsingConstructor(handler) );
}

} catch (NoSuchMethodException | 
IllegalArgumentException | InstantiationException | 
IllegalAccessException | 
InvocationTargetException e) {
throw new IsisException(e);
}
+   
+   }
+
+   @Override
+   public T createInstance(InvocationHandler handler, 
Object[] constructorArgs) {
+   
+   ensureSameSize(constructorArgTypes, 
constructorArgs);
+   ensureNonEmtpy(constructorArgs);
+
+   try {
+   return _Casts.uncheckedCast( 
createUsingConstructor(handler, constructorArgs) );
+   } catch (NoSuchMethodException | 
IllegalArgumentException | InstantiationException | 
+   IllegalAccessException | 
InvocationTargetException e) {
+   throw new IsisException(e);
+   }
}
 
+   // -- HELPER (create w/o initialize)
+   
private Object 
createNotUsingConstructor(InvocationHandler handler) {
final Class proxyClass = 
pfDelegate.createClass();

@@ -65,13 

[isis] 04/05: ISIS-1949: deprecating JavassistImposteriser ...

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit 4d2a40483d6893df17fe2826fba332b8648fd1f9
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 19 19:08:38 2018 +0200

ISIS-1949: deprecating JavassistImposteriser ...

... use ImposteriserUsingCodegenPlugin instead

Task-Url: https://issues.apache.org/jira/browse/ISIS-1949
---
 ...er.java => ImposteriserUsingCodegenPlugin.java} | 75 +-
 .../jmocking/JavassistImposteriser.java|  5 ++
 2 files changed, 20 insertions(+), 60 deletions(-)

diff --git 
a/core/unittestsupport/src/main/java/org/apache/isis/core/unittestsupport/jmocking/JavassistImposteriser.java
 
b/core/unittestsupport/src/main/java/org/apache/isis/core/unittestsupport/jmocking/ImposteriserUsingCodegenPlugin.java
similarity index 53%
copy from 
core/unittestsupport/src/main/java/org/apache/isis/core/unittestsupport/jmocking/JavassistImposteriser.java
copy to 
core/unittestsupport/src/main/java/org/apache/isis/core/unittestsupport/jmocking/ImposteriserUsingCodegenPlugin.java
index 5f3efdc..17b901f 100644
--- 
a/core/unittestsupport/src/main/java/org/apache/isis/core/unittestsupport/jmocking/JavassistImposteriser.java
+++ 
b/core/unittestsupport/src/main/java/org/apache/isis/core/unittestsupport/jmocking/ImposteriserUsingCodegenPlugin.java
@@ -16,29 +16,22 @@
  */
 package org.apache.isis.core.unittestsupport.jmocking;
 
-import javassist.util.proxy.MethodFilter;
-import javassist.util.proxy.MethodHandler;
-import javassist.util.proxy.ProxyFactory;
-import javassist.util.proxy.ProxyObject;
-
-import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
+
+import org.apache.isis.core.plugins.codegen.ProxyFactory;
 import org.jmock.api.Imposteriser;
 import org.jmock.api.Invocation;
 import org.jmock.api.Invokable;
 import org.jmock.lib.JavaReflectionImposteriser;
-import org.objenesis.Objenesis;
-import org.objenesis.ObjenesisStd;
 
-public class JavassistImposteriser implements Imposteriser {
+public class ImposteriserUsingCodegenPlugin implements Imposteriser {
 
-public static final Imposteriser INSTANCE = new JavassistImposteriser();
+public static final Imposteriser INSTANCE = new 
ImposteriserUsingCodegenPlugin();
 
 private final Imposteriser reflectionImposteriser = new 
JavaReflectionImposteriser();
-private final Objenesis objenesis = new ObjenesisStd();
 
-private JavassistImposteriser() {
+private ImposteriserUsingCodegenPlugin() {
 }
 
 
@@ -62,15 +55,16 @@ public class JavassistImposteriser implements Imposteriser {
 return reflectionImposteriser.imposterise(mockObject, mockedType, 
ancilliaryTypes);
 }
 
-try {
-setConstructorsAccessible(mockedType, true);
-
-final Class proxyClass = proxyClass(mockedType, 
ancilliaryTypes);
-final Object proxy = proxy(proxyClass, mockObject);
-return mockedType.cast(proxy);
-} finally {
-setConstructorsAccessible(mockedType, false);
-}
+
+final ProxyFactory factory = ProxyFactory.builder(mockedType)
+   .interfaces(ancilliaryTypes)
+   .build();
+
+final boolean initialize = false;
+
+return factory.createInstance(
+   (obj, method, args)->mockObject.invoke(new 
Invocation(obj, method, args)), 
+   initialize);
 }
 
 // //
@@ -88,44 +82,5 @@ public class JavassistImposteriser implements Imposteriser {
 throw new Error("no public toString method found", e);
 }
 }
-
-private static void setConstructorsAccessible(Class mockedType, boolean 
accessible) {
-for (Constructor constructor : 
mockedType.getDeclaredConstructors()) {
-constructor.setAccessible(accessible);
-}
-}
-
-private Class proxyClass(Class mockedType, Class... 
ancilliaryTypes) {
-
-final ProxyFactory proxyFactory = new ProxyFactory();
-proxyFactory.setFilter(new MethodFilter() {
-@Override
-public boolean isHandled(final Method m) {
-// ignore finalize() and also bridge methods
-return !m.getName().equals("finalize") || m.isBridge(); 
//[ahuber] this code does not ignore bridges!
-}
-});
-
-proxyFactory.setSuperclass(mockedType);
-proxyFactory.setInterfaces(ancilliaryTypes);
-
-return proxyFactory.createClass();
-}
-
-
-private Object proxy(Class proxyClass, final Invokable mockObject) {
-
-final ProxyObject proxyObject = (ProxyObject) 
objenesis.newInstance(proxyClass);
-proxyObject.setHandler(new MethodHandler() {
-@Override
-public O

[isis] branch master updated (43a2034 -> 963c08c)

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


from 43a2034  ISIS-1949: java-doc fix
 new c856eb0  ISIS-1949: Introduces new core project: commons
 new ecc37e5  ISIS-1949: moving Internal API to commons
 new 1fbad8a  ISIS-1949: project agnostic naming for plugin java packages 
...
 new 4d2a404  ISIS-1949: deprecating JavassistImposteriser ...
 new 963c08c  ISIS-1949: Aligning Internal API package names with new home 
'commons'

The 5 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:
 .../java/org/apache/isis/applib/util/Clause.java   |  2 +-
 .../isis/applib/util/ObjectContractsLegacy.java|  8 +--
 ...ectContractsLegacyTest_equals_and_hashCode.java |  2 +-
 core/applib/pom.xml|  5 ++
 .../apache/isis/applib/AppManifestAbstract.java|  4 +-
 .../java/org/apache/isis/applib/Identifier.java|  4 +-
 .../main/java/org/apache/isis/applib/Module.java   |  6 +-
 .../org/apache/isis/applib/ModuleAbstract.java |  4 +-
 .../isis/applib/ModuleOrBuilderAbstract.java   |  6 +-
 .../isis/applib/NonRecoverableException.java   |  2 +-
 .../apache/isis/applib/RecoverableException.java   |  4 +-
 .../isis/applib/annotation/MemberGroupLayout.java  |  2 +-
 .../isis/applib/domain/DomainObjectList.java   |  2 +-
 .../applib/events/domain/AbstractDomainEvent.java  |  4 +-
 .../isis/applib/events/ui/AbstractUiEvent.java |  2 +-
 .../apache/isis/applib/fixtures/LogonFixture.java  |  2 +-
 .../fixturescripts/BuilderScriptAbstract.java  |  2 +-
 .../applib/fixturescripts/ExecutionParameters.java |  6 +-
 .../applib/fixturescripts/FixtureResultList.java   |  6 +-
 .../isis/applib/fixturescripts/FixtureScript.java  | 10 +--
 .../isis/applib/fixturescripts/FixtureScripts.java |  6 +-
 .../setup/PersonaEnumPersistAll.java   |  2 +-
 .../teardown/TeardownFixtureAbstract.java  |  2 +-
 .../teardown/TeardownFixtureAbstract2.java |  2 +-
 .../applib/internal/exceptions/package-info.java   | 28 
 .../applib/internal/functions/package-info.java| 28 
 .../isis/applib/internal/memento/package-info.java | 28 
 .../applib/internal/resources/package-info.java| 28 
 .../layout/component/CollectionLayoutData.java |  2 +-
 .../isis/applib/layout/component/FieldSet.java |  2 +-
 .../layout/component/PropertyLayoutData.java   |  2 +-
 .../isis/applib/layout/grid/GridAbstract.java  |  4 +-
 .../isis/applib/layout/grid/bootstrap3/BS3Col.java |  2 +-
 .../applib/layout/grid/bootstrap3/BS3Grid.java |  4 +-
 .../isis/applib/layout/grid/bootstrap3/BS3Row.java |  2 +-
 .../isis/applib/layout/grid/bootstrap3/BS3Tab.java |  2 +-
 .../applib/layout/grid/bootstrap3/BS3TabGroup.java |  2 +-
 .../applib/layout/menubars/MenuBarsAbstract.java   |  2 +-
 .../applib/layout/menubars/bootstrap3/BS3Menu.java |  2 +-
 .../layout/menubars/bootstrap3/BS3MenuBar.java |  2 +-
 .../layout/menubars/bootstrap3/BS3MenuBars.java|  2 +-
 .../layout/menubars/bootstrap3/BS3MenuSection.java |  2 +-
 .../isis/applib/mixins/dto/DtoMappingHelper.java   |  2 +-
 .../mixins/layout/Object_downloadLayoutXml.java|  2 +-
 .../applib/mixins/layout/Object_openRestApi.java   |  2 +-
 .../apache/isis/applib/query/QueryAbstract.java|  2 +-
 .../services/appfeat/ApplicationMemberType.java|  2 +-
 .../isis/applib/services/bookmark/Bookmark.java|  4 +-
 .../applib/services/bookmark/BookmarkService.java  |  2 +-
 .../ClassDiscoveryServiceDefault.java  |  4 +-
 .../applib/services/command/CommandDefault.java|  4 +-
 .../services/config/ConfigurationProperty.java |  6 +-
 .../services/conmap/ContentMappingService.java |  2 +-
 .../services/eventbus/EventBusImplementation.java  |  2 +-
 .../applib/services/eventbus/EventBusService.java  |  2 +-
 .../exceprecog/ExceptionRecognizerAbstract.java|  2 +-
 .../exceprecog/ExceptionRecognizerComposite.java   |  2 +-
 .../exceprecog/ExceptionRecognizerForType.java |  2 +-
 ...eptionRecognizerCompositeForJdoObjectStore.java |  2 +-
 .../applib/services/hsqldb/HsqlDbManagerMenu.java  |  4 +-
 .../applib/services/i18n/TranslatableString.java   |  2 +-
 .../isis/applib/services/iactn/Interaction.java|  4 +-
 .../jaxb/CatalogingSchemaOutputResolver.java   |  4 +-
 .../isis/applib/services/jaxb/JaxbService.java |  6 +-
 .../applib/services/layout/LayoutServiceMenu.java  |  2 +-
 .../services/metamodel/MetaModelServicesMenu.java  |  2 +-
 .../QueryResultsCacheInternal.java |  4 +-
 .../applib/services/scratchpad/Scratchpad.java |  2 +-
 .../services/swagger/SwaggerService

[isis] branch master updated: ISIS-1949: java-doc fix

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 43a2034  ISIS-1949: java-doc fix
43a2034 is described below

commit 43a20344d9c275c933ef7e847b2c33d1edb7ab31
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 19 17:35:06 2018 +0200

ISIS-1949: java-doc fix

Task-Url: https://issues.apache.org/jira/browse/ISIS-1949
---
 .../runtime/plugins/codegen/ProxyFactoryPluginUsingJavassist.java  | 2 +-
 .../org/apache/isis/core/runtime/plugins/codegen/ProxyFactory.java | 7 ++-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git 
a/core/plugins/codegen-javassist/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingJavassist.java
 
b/core/plugins/codegen-javassist/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingJavassist.java
index 2bb6a8f..5c92541 100644
--- 
a/core/plugins/codegen-javassist/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingJavassist.java
+++ 
b/core/plugins/codegen-javassist/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactoryPluginUsingJavassist.java
@@ -59,8 +59,8 @@ public class ProxyFactoryPluginUsingJavassist implements 
ProxyFactoryPlugin {
@Override
public T createInstance(InvocationHandler handler, 
Object[] constructorArgs) {

-   ensureSameSize(constructorArgTypes, 
constructorArgs);
ensureNonEmtpy(constructorArgs);
+   ensureSameSize(constructorArgTypes, 
constructorArgs);
 
try {
return _Casts.uncheckedCast( 
createUsingConstructor(handler, constructorArgs) );
diff --git 
a/core/runtime/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactory.java
 
b/core/runtime/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactory.java
index b7c0ed2..b44936b 100644
--- 
a/core/runtime/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactory.java
+++ 
b/core/runtime/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactory.java
@@ -33,21 +33,18 @@ public interface ProxyFactory {
// -- INTERFACE

/**
-* 
 * @param handler
 * @param initialize whether to call a constructor on object 
instantiation 
-* @return
+* @return new proxy instance of type T
 * @throws IllegalArgumentException when using initialize=true and the 
number of 
 * constructorArgTypes specified while building this factory is greater 
than 0.
 */
public T createInstance(InvocationHandler handler, boolean initialize);

/**
-* 
 * @param handler
 * @param constructorArgs passed to the constructor with matching 
signature on object instantiation
-* @param initialize whether to call a constructor on object 
instantiation
-* @return
+* @return new proxy instance of type T (always uses a constructor)
 * @throws IllegalArgumentException if constructorArgs is null or empty 
or does not 
 * conform to the number of constructorArgTypes specified while 
building this factory.
 */

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


[isis] branch master updated: ISIS-1949: Adds 'commons' as a module to the core pom

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 88afeba  ISIS-1949: Adds 'commons' as a module to the core pom
88afeba is described below

commit 88afebaa01ea9d1104914705ec1fb23b268a0b78
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 19 19:19:49 2018 +0200

ISIS-1949: Adds 'commons' as a module to the core pom

Task-Url: https://issues.apache.org/jira/browse/ISIS-1949
---
 core/pom.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/core/pom.xml b/core/pom.xml
index 5321152..e432086 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -2386,6 +2386,7 @@ ${license.additional-notes}
 
 
 schema
+commons
 applib
 log4j
 metamodel

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


[isis] branch master updated: ISIS-1903: add to gitignore /.factorypath

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new df03029  ISIS-1903: add to gitignore /.factorypath
df03029 is described below

commit df030295967e9d8b4236f32a48ad23eceb6c11d3
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 19 19:59:59 2018 +0200

ISIS-1903: add to gitignore /.factorypath

originating from eclipse projects utilizing annotation processing

Task-Url: https://issues.apache.org/jira/browse/ISIS-1903
---
 example/application/helloworld/.gitignore  | 1 +
 example/application/simpleapp/module-simple/.gitignore | 1 +
 2 files changed, 2 insertions(+)

diff --git a/example/application/helloworld/.gitignore 
b/example/application/helloworld/.gitignore
index e859485..83e3db4 100644
--- a/example/application/helloworld/.gitignore
+++ b/example/application/helloworld/.gitignore
@@ -39,3 +39,4 @@ pom.xml.versionsBackup
 
 rebel.xml
 translations.pot
+/.factorypath
diff --git a/example/application/simpleapp/module-simple/.gitignore 
b/example/application/simpleapp/module-simple/.gitignore
index 72b06ac..726d3a0 100644
--- a/example/application/simpleapp/module-simple/.gitignore
+++ b/example/application/simpleapp/module-simple/.gitignore
@@ -4,3 +4,4 @@ translations.pot
 gradle/wrapper
 !gradle-wrapper.jar
 /.apt_generated/
+/.factorypath

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


[isis] 03/05: ISIS-1949: project agnostic naming for plugin java packages ...

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit 1fbad8ae6529fd8d1670700569da1878f0b4fa12
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 19 18:54:38 2018 +0200

ISIS-1949: project agnostic naming for plugin java packages ...

... org.apache.isis.core.plugins.*

Task-Url: https://issues.apache.org/jira/browse/ISIS-1949
---
 .../main/java/org/apache/isis/applib/internal/context/_Plugin.java  | 2 +-
 .../java/org/apache/isis/applib/internal/discover/_Discover.java| 4 ++--
 .../isis/{commons => core}/plugins/PluginResolveException.java  | 2 +-
 .../{applib => core}/plugins/classdiscovery/ClassDiscovery.java | 2 +-
 .../plugins/classdiscovery/ClassDiscoveryPlugin.java| 2 +-
 .../isis/core/{runtime => }/plugins/codegen/ProxyFactory.java   | 2 +-
 .../isis/core/{runtime => }/plugins/codegen/ProxyFactoryPlugin.java | 2 +-
 .../plugins/codegen/ProxyFactoryPluginUsingByteBuddy.java   | 4 +++-
 .../org.apache.isis.core.plugins.codegen.ProxyFactoryPlugin | 1 +
 .../org.apache.isis.core.runtime.plugins.codegen.ProxyFactoryPlugin | 1 -
 .../plugins/codegen/ProxyFactoryPluginUsingJavassist.java   | 4 +++-
 ...ugin => org.apache.isis.core.plugins.codegen.ProxyFactoryPlugin} | 0
 .../reflections/ClassDiscoveryPluginUsingReflections.java   | 6 +++---
 .../plugins/classdiscovery/reflections/ReflectDiscovery.java| 4 ++--
 .../plugins/classdiscovery/reflections/ReflectManifest.java | 2 +-
 ...g.apache.isis.applib.plugins.classdiscovery.ClassDiscoveryPlugin | 1 -
 ...org.apache.isis.core.plugins.classdiscovery.ClassDiscoveryPlugin | 1 +
 .../org/apache/isis/core/runtime/services/ServiceInstantiator.java  | 2 +-
 .../isis/core/runtime/services/ServicesInstallerFromAnnotation.java | 2 +-
 .../core/runtime/services/background/BackgroundServiceDefault.java  | 2 +-
 .../core/runtime/systemusinginstallers/IsisComponentProvider.java   | 2 +-
 .../runtime/systemusinginstallers/PersistenceCapableTypeFinder.java | 2 +-
 .../main/java/org/apache/isis/core/wrapper/proxy/ProxyCreator.java  | 2 +-
 23 files changed, 28 insertions(+), 24 deletions(-)

diff --git 
a/core/commons/src/main/java/org/apache/isis/applib/internal/context/_Plugin.java
 
b/core/commons/src/main/java/org/apache/isis/applib/internal/context/_Plugin.java
index 89da112..b328945 100644
--- 
a/core/commons/src/main/java/org/apache/isis/applib/internal/context/_Plugin.java
+++ 
b/core/commons/src/main/java/org/apache/isis/applib/internal/context/_Plugin.java
@@ -28,7 +28,7 @@ import java.util.stream.Collectors;
 
 import org.apache.isis.applib.internal.base._NullSafe;
 import org.apache.isis.applib.internal.collections._Sets;
-import org.apache.isis.commons.plugins.PluginResolveException;
+import org.apache.isis.core.plugins.PluginResolveException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git 
a/core/commons/src/main/java/org/apache/isis/applib/internal/discover/_Discover.java
 
b/core/commons/src/main/java/org/apache/isis/applib/internal/discover/_Discover.java
index d9b0c32..7593f27 100644
--- 
a/core/commons/src/main/java/org/apache/isis/applib/internal/discover/_Discover.java
+++ 
b/core/commons/src/main/java/org/apache/isis/applib/internal/discover/_Discover.java
@@ -22,8 +22,8 @@ package org.apache.isis.applib.internal.discover;
 import java.util.List;
 
 import org.apache.isis.applib.internal.context._Plugin;
-import org.apache.isis.applib.plugins.classdiscovery.ClassDiscovery;
-import org.apache.isis.applib.plugins.classdiscovery.ClassDiscoveryPlugin;
+import org.apache.isis.core.plugins.classdiscovery.ClassDiscovery;
+import org.apache.isis.core.plugins.classdiscovery.ClassDiscoveryPlugin;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git 
a/core/commons/src/main/java/org/apache/isis/commons/plugins/PluginResolveException.java
 
b/core/commons/src/main/java/org/apache/isis/core/plugins/PluginResolveException.java
similarity index 90%
rename from 
core/commons/src/main/java/org/apache/isis/commons/plugins/PluginResolveException.java
rename to 
core/commons/src/main/java/org/apache/isis/core/plugins/PluginResolveException.java
index 3f39581..5f37b8b 100644
--- 
a/core/commons/src/main/java/org/apache/isis/commons/plugins/PluginResolveException.java
+++ 
b/core/commons/src/main/java/org/apache/isis/core/plugins/PluginResolveException.java
@@ -1,4 +1,4 @@
-package org.apache.isis.commons.plugins;
+package org.apache.isis.core.plugins;
 
 public class PluginResolveException extends RuntimeException {
 
diff --git 
a/core/commons/src/main/java/org/apache/isis/applib/plugins/classdiscovery/ClassDiscovery.java
 
b/core/commons/src/main/java/org/apache/isis/core/plugins/classdiscovery/ClassDiscovery.java
similarity index 96%
rename from 
core/commons/src/main/java/o

[isis] 02/05: ISIS-1949: moving Internal API to commons

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit ecc37e51c73cb6a5bd3bf993acf6280f78a04be1
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 19 18:44:50 2018 +0200

ISIS-1949: moving Internal API to commons

Task-Url: https://issues.apache.org/jira/browse/ISIS-1949
---
 .../services/urlencoding/UrlEncodingService.java  |  9 ++---
 .../org/apache/isis/applib/internal/_Constants.java   |  0
 .../org/apache/isis/applib/internal/base/_Bytes.java  |  0
 .../applib/internal/base/_Bytes_GZipCompressor.java   |  0
 .../internal/base/_Bytes_GZipCompressorSmart.java |  0
 .../org/apache/isis/applib/internal/base/_Casts.java  |  0
 .../org/apache/isis/applib/internal/base/_Lazy.java   |  0
 .../apache/isis/applib/internal/base/_NullSafe.java   |  0
 .../apache/isis/applib/internal/base/_Reduction.java  |  0
 .../apache/isis/applib/internal/base/_Strings.java|  0
 .../applib/internal/base/_Strings_NaturalNames.java   |  0
 .../applib/internal/base/_Strings_SplitIterator.java  |  0
 .../isis/applib/internal/base/package-info.java   |  0
 .../isis/applib/internal/collections/_Arrays.java |  0
 .../internal/collections/_Arrays_Collector.java   |  0
 .../collections/_Arrays_CollectorUnknownSize.java |  0
 .../applib/internal/collections/_Collections.java |  0
 .../internal/collections/_Collections_Collector.java  |  0
 .../collections/_Collections_SortedSetOfList.java |  0
 .../isis/applib/internal/collections/_Lists.java  |  0
 .../isis/applib/internal/collections/_Maps.java   |  0
 .../isis/applib/internal/collections/_Multimaps.java  |  0
 .../isis/applib/internal/collections/_Sets.java   |  0
 .../applib/internal/collections/package-info.java |  0
 .../isis/applib/internal/compare/_Comparators.java|  0
 .../compare/_Comparators_SequenceCompare.java |  0
 .../isis/applib/internal/compare/package-info.java|  0
 .../apache/isis/applib/internal/context/_Context.java |  6 ++
 .../apache/isis/applib/internal/context/_Plugin.java  | 10 +-
 .../isis/applib/internal/context/package-info.java|  0
 .../isis/applib/internal/discover/_Discover.java  |  0
 .../isis/applib/internal/discover/package-info.java   |  0
 .../isis/applib/internal/exceptions/_Exceptions.java  |  0
 .../isis/applib/internal/exceptions/package-info.java |  0
 .../isis/applib/internal/functions/_Functions.java|  0
 .../_Functions_IndexAwareFunctionAdapter.java |  0
 .../isis/applib/internal/functions/package-info.java  |  0
 .../isis/applib/internal/memento/_Mementos.java   | 15 +++
 .../internal/memento/_Mementos_MementoDefault.java| 10 +-
 .../isis/applib/internal/memento/package-info.java|  0
 .../org/apache/isis/applib/internal/package-info.java |  0
 .../isis/applib/internal/resources/_Resource.java |  0
 .../internal/resources/_Resource_ContextPath.java |  0
 .../applib/internal/resources/_Resource_Path.java |  0
 .../internal/resources/_Resource_RestfulPath.java |  0
 .../isis/applib/internal/resources/package-info.java  |  0
 .../applib/plugins/classdiscovery/ClassDiscovery.java |  0
 .../plugins/classdiscovery/ClassDiscoveryPlugin.java  |  0
 .../isis/commons/plugins/PluginResolveException.java  | 19 +++
 .../core/runtime/plugins/codegen/ProxyFactory.java|  0
 .../runtime/plugins/codegen/ProxyFactoryPlugin.java   |  0
 51 files changed, 44 insertions(+), 25 deletions(-)

diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/services/urlencoding/UrlEncodingService.java
 
b/core/applib/src/main/java/org/apache/isis/applib/services/urlencoding/UrlEncodingService.java
index 6754532..4e3d978 100644
--- 
a/core/applib/src/main/java/org/apache/isis/applib/services/urlencoding/UrlEncodingService.java
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/services/urlencoding/UrlEncodingService.java
@@ -20,14 +20,9 @@ import java.nio.charset.StandardCharsets;
 
 import org.apache.isis.applib.annotation.Programmatic;
 import org.apache.isis.applib.internal.base._Strings;
+import org.apache.isis.applib.internal.memento._Mementos.EncoderDecoder;
 
-public interface UrlEncodingService {
-
-@Programmatic
-public String encode(final byte[] bytes);
-
-@Programmatic
-public byte[] decode(String str);
+public interface UrlEncodingService extends EncoderDecoder {
 
 @Programmatic
 public default String encodeString(final String str) {
diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/internal/_Constants.java 
b/core/commons/src/main/java/org/apache/isis/applib/internal/_Constants.java
similarity index 100%
rename from 
core/applib/src/main/java/org/apache/isis/applib/internal/_Constants.java
rename to 
core/commons/src/main/java/org/apache/isis/applib/internal/_Constants.java
diff --git 
a/core/appl

[isis] branch master updated: ISIS-1949: cleanup default method filter

2018-05-19 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new bc6ab40  ISIS-1949: cleanup default method filter
bc6ab40 is described below

commit bc6ab4077964bc0d7ce9bcdfaf58c7e9afd0fe65
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 19 11:44:07 2018 +0200

ISIS-1949: cleanup default method filter

Task-Url: https://issues.apache.org/jira/browse/ISIS-1949
---
 .../java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactory.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/core/runtime/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactory.java
 
b/core/runtime/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactory.java
index 1748c07..ec0aad1 100644
--- 
a/core/runtime/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactory.java
+++ 
b/core/runtime/src/main/java/org/apache/isis/core/runtime/plugins/codegen/ProxyFactory.java
@@ -38,7 +38,7 @@ public interface ProxyFactory {

public static class ProxyFactoryBuilder {
private static final Predicate DEFAULT_METHOD_FILTER = 
-   m->!m.getName().equals("finalize") || 
m.isBridge();
+   m->!"finalize".equals(m.getName());
private final Class base;
private Class[] interfaces;
private Predicate methodFilter = DEFAULT_METHOD_FILTER;

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


[isis] 02/03: ISIS-1948: Introduce -legacy module for 'unittestsupport'

2018-05-20 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit daee0d9c1fc2035b483cb86990528edb9ee7fa74
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sun May 20 07:23:30 2018 +0200

ISIS-1948: Introduce -legacy module for 'unittestsupport'

in order to move deprecated classes out

Task-Url: https://issues.apache.org/jira/browse/ISIS-1948
---
 core/unittestsupport-legacy/.gitignore |  1 +
 .../pom.xml| 26 --
 core/unittestsupport/pom.xml   |  1 +
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/core/unittestsupport-legacy/.gitignore 
b/core/unittestsupport-legacy/.gitignore
new file mode 100644
index 000..a48e45b
--- /dev/null
+++ b/core/unittestsupport-legacy/.gitignore
@@ -0,0 +1 @@
+/target-ide
diff --git a/core/unittestsupport/pom.xml b/core/unittestsupport-legacy/pom.xml
similarity index 82%
copy from core/unittestsupport/pom.xml
copy to core/unittestsupport-legacy/pom.xml
index fecf2db..5c5ab3e 100644
--- a/core/unittestsupport/pom.xml
+++ b/core/unittestsupport-legacy/pom.xml
@@ -20,12 +20,12 @@
${revision}

 
-   isis-core-unittestsupport
-   Apache Isis Unit Test Support
+   isis-core-unittestsupport-legacy
+   Apache Isis Unit Test Support (Legacy)
 

-   
org.apache.isis.core.unittestsupport
-   
org/apache/isis/core/unittestsupport
+   
org.apache.isis.core.unittestsupport-legacy
+   
org/apache/isis/core/unittestsupport-legacy

 

@@ -35,10 +35,22 @@
 


+   
+

-org.apache.isis.core
-isis-core-commons
-
+   org.apache.isis.core
+   isis-core-unittestsupport
+   compile
+   
+   
+   org.apache.isis.core
+   isis-core-unittestsupport
+   test-jar
+   test
+   
+   
+   
+   


junit
diff --git a/core/unittestsupport/pom.xml b/core/unittestsupport/pom.xml
index fecf2db..69a5511 100644
--- a/core/unittestsupport/pom.xml
+++ b/core/unittestsupport/pom.xml
@@ -35,6 +35,7 @@
 


+   

 org.apache.isis.core
 isis-core-commons

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


[isis] 03/03: ISIS-1948: provides a means to load plugins not initially on classpath

2018-05-20 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit 2792d6e819cc8417f241fc7857988e1a7b3ec7e3
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sun May 20 10:00:03 2018 +0200

ISIS-1948: provides a means to load plugins not initially on classpath

Task-Url: https://issues.apache.org/jira/browse/ISIS-1948
---
 .../isis/commons/internal/context/_Plugin.java | 50 
 core/plugins/codegen-javassist/pom.xml |  2 +-
 .../codegen/ProxyFactoryPluginUsingJavassist.java  |  5 +-
 .../jmocking/JavassistImposteriser.java|  0
 .../jmocking/JavassistImposteriserTest.java|  0
 core/unittestsupport/pom.xml   | 21 ---
 .../jmocking/JUnitRuleMockery2.java|  2 +-
 ...riserTest.java => DefaultImposteriserTest.java} | 69 --
 8 files changed, 118 insertions(+), 31 deletions(-)

diff --git 
a/core/commons/src/main/java/org/apache/isis/commons/internal/context/_Plugin.java
 
b/core/commons/src/main/java/org/apache/isis/commons/internal/context/_Plugin.java
index c2ac726..d9c5152 100644
--- 
a/core/commons/src/main/java/org/apache/isis/commons/internal/context/_Plugin.java
+++ 
b/core/commons/src/main/java/org/apache/isis/commons/internal/context/_Plugin.java
@@ -19,13 +19,18 @@
 
 package org.apache.isis.commons.internal.context;
 
+import java.io.File;
+import java.net.URL;
+import java.net.URLClassLoader;
 import java.util.Objects;
 import java.util.ServiceLoader;
 import java.util.Set;
 import java.util.function.Function;
 import java.util.function.Supplier;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
+import org.apache.isis.commons.internal.base._Casts;
 import org.apache.isis.commons.internal.base._NullSafe;
 import org.apache.isis.commons.internal.collections._Sets;
 import org.apache.isis.core.plugins.PluginResolveException;
@@ -142,6 +147,51 @@ public final class _Plugin {
pluginInterfaceClass.getName() 
));
}
 
+   // -- JUNIT TEST SUPPORT 

+   /**
+* TODO will break with java 9+
+* @return file-system path, where the frameworks core classes reside 
(after a build).
+*/
+   public static URL getCoreCommonsTargetFolder() {
+   return Stream.of(((URLClassLoader 
)_Plugin.class.getClassLoader()).getURLs())
+   .filter(url->url.toString().contains("/core/commons/"))
+   .findFirst()
+   .orElseThrow(()->new RuntimeException("Failed to find 
file-system path, where the frameworks core classes reside."))
+   ;
+   }
+   
+   /**
+* Loads a plugin by name and class-path. (Most likely used by JUnit 
Tests.)
+* @param pluginClass
+* @param classPath
+* @param pluginFullyQualifiedClassName
+* @return
+*/
+   public static  S load(Class pluginInterfaceClass, File classPath, 
String pluginFullyQualifiedClassName) {
+
+   try {
+   
+   ClassLoader parentCL = 
pluginInterfaceClass.getClassLoader();
+   URL[] urls = {classPath.toURI().toURL()};
+   ClassLoader cl = URLClassLoader.newInstance(urls, 
parentCL);
+   Class pluginClass = _Casts.uncheckedCast(
+   
cl.loadClass(pluginFullyQualifiedClassName));
+   S plugin = pluginClass.newInstance(); 
+   
+   _Context.putSingleton(pluginInterfaceClass, plugin);
+   
+   return plugin;
+   
+   } catch (Exception e) {
+   throw new PluginResolveException(
+   String.format("Failed to load plugin 
'%s' implementing '%s' from path '%s'.", 
+   
pluginFullyQualifiedClassName,
+   
pluginInterfaceClass.getName(),
+   
classPath.getAbsolutePath()
+   ), e);
+   }
+   
+   }

 }
diff --git a/core/plugins/codegen-javassist/pom.xml 
b/core/plugins/codegen-javassist/pom.xml
index a0f7382..2e5cf62 100644
--- a/core/plugins/codegen-javassist/pom.xml
+++ b/core/plugins/codegen-javassist/pom.xml
@@ -67,7 +67,7 @@
 

org.apache.isis.core
-   isis-core-runtime
+   isis-core-commons
compile


diff --git 
a/core/plugins/codegen-javassist/src/main/java/org/apache/isis/core/plugins/code

[isis] 01/03: ISIS-1948: setting the new 'plugin-driven' Imposteriser as default

2018-05-20 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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

commit 7daacd943fd3133befee1300e7c44816d7d48ce6
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sun May 20 07:21:59 2018 +0200

ISIS-1948: setting the new 'plugin-driven' Imposteriser as default

Task-Url: https://issues.apache.org/jira/browse/ISIS-1948
---
 .../scenarios/DomainServiceProviderMockery.java| 11 
 .../jmocking/ImposteriserUsingCodegenPlugin.java   |  2 +-
 .../unittestsupport/jmocking/Imposterisers.java| 32 ++
 3 files changed, 38 insertions(+), 7 deletions(-)

diff --git 
a/core/specsupport/src/main/java/org/apache/isis/core/specsupport/scenarios/DomainServiceProviderMockery.java
 
b/core/specsupport/src/main/java/org/apache/isis/core/specsupport/scenarios/DomainServiceProviderMockery.java
index e79a19e..6ec6588 100644
--- 
a/core/specsupport/src/main/java/org/apache/isis/core/specsupport/scenarios/DomainServiceProviderMockery.java
+++ 
b/core/specsupport/src/main/java/org/apache/isis/core/specsupport/scenarios/DomainServiceProviderMockery.java
@@ -19,17 +19,16 @@ package org.apache.isis.core.specsupport.scenarios;
 import java.util.Map;
 import java.util.Set;
 
-import com.google.common.collect.Maps;
-
+import org.apache.isis.applib.services.factory.FactoryService;
+import org.apache.isis.applib.services.repository.RepositoryService;
+import org.apache.isis.core.unittestsupport.jmocking.Imposterisers;
 import org.hamcrest.Description;
 import org.jmock.Expectations;
 import org.jmock.Mockery;
 import org.jmock.api.Action;
 import org.jmock.api.Invocation;
 
-import org.apache.isis.applib.services.factory.FactoryService;
-import org.apache.isis.applib.services.repository.RepositoryService;
-import org.apache.isis.core.unittestsupport.jmocking.JavassistImposteriser;
+import com.google.common.collect.Maps;
 
 /**
  * @deprecated - with no replacement
@@ -51,7 +50,7 @@ class DomainServiceProviderMockery implements 
DomainServiceProvider {
 
 private void init() {
 context = new Mockery() {{
-setImposteriser(JavassistImposteriser.INSTANCE);
+setImposteriser(Imposterisers.getDefault());
 }};
 mocks.clear();
 }
diff --git 
a/core/unittestsupport/src/main/java/org/apache/isis/core/unittestsupport/jmocking/ImposteriserUsingCodegenPlugin.java
 
b/core/unittestsupport/src/main/java/org/apache/isis/core/unittestsupport/jmocking/ImposteriserUsingCodegenPlugin.java
index 17b901f..48540d1 100644
--- 
a/core/unittestsupport/src/main/java/org/apache/isis/core/unittestsupport/jmocking/ImposteriserUsingCodegenPlugin.java
+++ 
b/core/unittestsupport/src/main/java/org/apache/isis/core/unittestsupport/jmocking/ImposteriserUsingCodegenPlugin.java
@@ -25,7 +25,7 @@ import org.jmock.api.Invocation;
 import org.jmock.api.Invokable;
 import org.jmock.lib.JavaReflectionImposteriser;
 
-public class ImposteriserUsingCodegenPlugin implements Imposteriser {
+class ImposteriserUsingCodegenPlugin implements Imposteriser {
 
 public static final Imposteriser INSTANCE = new 
ImposteriserUsingCodegenPlugin();
 
diff --git 
a/core/unittestsupport/src/main/java/org/apache/isis/core/unittestsupport/jmocking/Imposterisers.java
 
b/core/unittestsupport/src/main/java/org/apache/isis/core/unittestsupport/jmocking/Imposterisers.java
new file mode 100644
index 000..836218d
--- /dev/null
+++ 
b/core/unittestsupport/src/main/java/org/apache/isis/core/unittestsupport/jmocking/Imposterisers.java
@@ -0,0 +1,32 @@
+/**
+ *  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.unittestsupport.jmocking;
+
+import org.jmock.api.Imposteriser;
+
+public final class Imposterisers {
+   
+   private Imposterisers() {}
+
+   /**
+* @return framework's default Imposteriser instance 
+*/
+   public static Imposteriser getDefault() {
+   return ImposteriserUsingCodegenPlugin.INSTANCE;
+   }
+   
+}

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


[isis] branch master updated: ISIS-1929: gives IsisWicketApplication precedence when registering CL

2018-05-17 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 2a7c035  ISIS-1929: gives IsisWicketApplication precedence when 
registering CL
2a7c035 is described below

commit 2a7c0356b246b3922c292d8a4904bcb8c4117676
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Thu May 17 14:35:10 2018 +0200

ISIS-1929: gives IsisWicketApplication precedence when registering CL

Task-Url: https://issues.apache.org/jira/browse/ISIS-1929
---
 .../org/apache/isis/applib/internal/context/_Context.java  | 14 ++
 .../restfulobjects/server/RestfulObjectsApplication.java   |  3 ++-
 .../isis/viewer/wicket/viewer/IsisWicketApplication.java   |  2 +-
 3 files changed, 13 insertions(+), 6 deletions(-)

diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/internal/context/_Context.java
 
b/core/applib/src/main/java/org/apache/isis/applib/internal/context/_Context.java
index c600225..93bf27c 100644
--- 
a/core/applib/src/main/java/org/apache/isis/applib/internal/context/_Context.java
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/internal/context/_Context.java
@@ -207,11 +207,17 @@ public final class _Context {

/**
 * Set by the framework's bootstrapping mechanism.
+* @param classLoader the framework's default class loader
+* @param override whether to override if already registered
 */
-   public static void setDefaultClassLoaderIfAbsent(ClassLoader 
classLoader) {
-   if(_Context.getIfAny(ClassLoader.class)==null) {
-   _Context.putSingleton(ClassLoader.class, 
Objects.requireNonNull(classLoader, "classLoader required"));  
-}
+   public static void setDefaultClassLoader(ClassLoader classLoader, 
boolean override) {
+   final boolean alreadyRegistered = 
_Context.getIfAny(ClassLoader.class)!=null; 
+   if(!alreadyRegistered || override) {
+   // let writes to the map be atomic
+   synchronized (singletonMap) {   
+   singletonMap.put(toKey(ClassLoader.class), 
Objects.requireNonNull(classLoader, "classLoader required"));
+   }
+   }
}

// -- CLASS LOADING SHORTCUTS
diff --git 
a/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/RestfulObjectsApplication.java
 
b/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/RestfulObjectsApplication.java
index e82d6f0..3f5864a 100644
--- 
a/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/RestfulObjectsApplication.java
+++ 
b/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/RestfulObjectsApplication.java
@@ -49,7 +49,8 @@ public class RestfulObjectsApplication extends 
AbstractJaxRsApplication {
 
 addClass(SwaggerSpecResource.class);
 
-
_Context.setDefaultClassLoaderIfAbsent(this.getClass().getClassLoader());
+//override=false, allows for IsisWicketApplication to take precedence
+_Context.setDefaultClassLoader(this.getClass().getClassLoader(), 
/*override*/false);
 
addSingleton(IsisJaxrsServerPlugin.get().newRestfulObjectsJaxbWriterForXml());
 
 
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 4984b24..17719fa 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
@@ -337,7 +337,7 @@ public class IsisWicketApplication
 try {
 super.init();
 
-
_Context.setDefaultClassLoaderIfAbsent(this.getClass().getClassLoader());
+_Context.setDefaultClassLoader(this.getClass().getClassLoader(), 
true);
 
 futures = startBackgroundInitializationThreads();
 

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


[isis] branch master updated: ISIS-1929: Lets RestfulObjectsApplication also register the default CL

2018-05-17 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 8f13a87  ISIS-1929: Lets RestfulObjectsApplication also register the 
default CL
8f13a87 is described below

commit 8f13a87c7e869e660346e04a511c05a45af97b25
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Thu May 17 13:07:20 2018 +0200

ISIS-1929: Lets RestfulObjectsApplication also register the default CL

Who ever get bootstrapped first, RestfulObjectsApplication or
IsisWicketApplication, will regesiter the frameworks default
class-loader.

Task-Url: https://issues.apache.org/jira/browse/ISIS-1929
---
 .../org/apache/isis/applib/internal/context/_Context.java | 11 ++-
 .../restfulobjects/server/RestfulObjectsApplication.java  |  2 ++
 .../isis/viewer/wicket/viewer/IsisWicketApplication.java  |  2 +-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/internal/context/_Context.java
 
b/core/applib/src/main/java/org/apache/isis/applib/internal/context/_Context.java
index 85278bc..c600225 100644
--- 
a/core/applib/src/main/java/org/apache/isis/applib/internal/context/_Context.java
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/internal/context/_Context.java
@@ -198,13 +198,22 @@ public final class _Context {
Thread.currentThread()::getContextClassLoader;

/**
-* Will be set by the framework's bootstrapping mechanism if required.
+* As set by the framework's bootstrapping mechanism.
 * @return the default class loader
 */
public static @NotNull ClassLoader getDefaultClassLoader() {
return getOrElse(ClassLoader.class, FALLBACK_CLASSLOADER);
}

+   /**
+* Set by the framework's bootstrapping mechanism.
+*/
+   public static void setDefaultClassLoaderIfAbsent(ClassLoader 
classLoader) {
+   if(_Context.getIfAny(ClassLoader.class)==null) {
+   _Context.putSingleton(ClassLoader.class, 
Objects.requireNonNull(classLoader, "classLoader required"));  
+}
+   }
+   
// -- CLASS LOADING SHORTCUTS

/**
diff --git 
a/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/RestfulObjectsApplication.java
 
b/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/RestfulObjectsApplication.java
index f42ebbd..e82d6f0 100644
--- 
a/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/RestfulObjectsApplication.java
+++ 
b/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/RestfulObjectsApplication.java
@@ -18,6 +18,7 @@
  */
 package org.apache.isis.viewer.restfulobjects.server;
 
+import org.apache.isis.applib.internal.context._Context;
 import 
org.apache.isis.viewer.restfulobjects.rendering.service.acceptheader.AcceptHeaderServiceForRest;
 import 
org.apache.isis.viewer.restfulobjects.server.mappers.ExceptionMapperForObjectNotFound;
 import 
org.apache.isis.viewer.restfulobjects.server.mappers.ExceptionMapperForRestfulObjectsApplication;
@@ -48,6 +49,7 @@ public class RestfulObjectsApplication extends 
AbstractJaxRsApplication {
 
 addClass(SwaggerSpecResource.class);
 
+
_Context.setDefaultClassLoaderIfAbsent(this.getClass().getClassLoader());
 
addSingleton(IsisJaxrsServerPlugin.get().newRestfulObjectsJaxbWriterForXml());
 
 
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 9cc168b..4984b24 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
@@ -337,7 +337,7 @@ public class IsisWicketApplication
 try {
 super.init();
 
-_Context.putSingleton(ClassLoader.class, 
this.getClass().getClassLoader());
+
_Context.setDefaultClassLoaderIfAbsent(this.getClass().getClassLoader());
 
 futures = startBackgroundInitializationThreads();
 

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


[isis] branch master updated: ISIS-1947 fixes several issues

2018-05-15 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new aedaeb9  ISIS-1947 fixes several issues
aedaeb9 is described below

commit aedaeb980ce9c1e0fe177e20508bd06a5d7b4854
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Tue May 15 18:03:24 2018 +0200

ISIS-1947 fixes several issues
---
 .../org/apache/isis/applib/tree/LazyTreeNode.java  | 12 
 .../treenode/TreeNodeValueSemanticsProvider.java   |  8 +++--
 .../bookmarks/BookmarkServiceInternalDefault.java  |  4 ++-
 .../components/tree/IsisToWicketTreeAdapter.java   | 35 +++---
 4 files changed, 34 insertions(+), 25 deletions(-)

diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/tree/LazyTreeNode.java 
b/core/applib/src/main/java/org/apache/isis/applib/tree/LazyTreeNode.java
index 2446c21..ffe6554 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/tree/LazyTreeNode.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/tree/LazyTreeNode.java
@@ -85,18 +85,6 @@ public class LazyTreeNode implements TreeNode {
public TreeState getTreeState() {
return sharedState;
}
-
-// @Override
-// public boolean isExpanded() {
-// // TODO Auto-generated method stub
-// return false;
-// }
-// 
-// @Override
-// public void setExpanded(boolean expanded) {
-// // TODO Auto-generated method stub
-// 
-// }

// -- HELPER

diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/value/treenode/TreeNodeValueSemanticsProvider.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/value/treenode/TreeNodeValueSemanticsProvider.java
index 66f3a8b..fcd12f7 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/value/treenode/TreeNodeValueSemanticsProvider.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/value/treenode/TreeNodeValueSemanticsProvider.java
@@ -26,7 +26,9 @@ import org.apache.isis.applib.internal.memento._Mementos;
 import org.apache.isis.applib.internal.memento._Mementos.Memento;
 import org.apache.isis.applib.internal.memento._Mementos.SerializingAdapter;
 import org.apache.isis.applib.services.urlencoding.UrlEncodingService;
+import org.apache.isis.applib.tree.LazyTreeNode;
 import org.apache.isis.applib.tree.TreeNode;
+import org.apache.isis.applib.tree.TreeState;
 import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import 
org.apache.isis.core.metamodel.facets.object.value.vsp.ValueSemanticsProviderAndFacetAbstract;
@@ -97,6 +99,7 @@ implements TreeNodeValueFacet {
final Memento memento = newMemento();
memento.put("primaryValue", treeNode.getValue());
memento.put("adapterClass", treeNode.getTreeAdapterClass());
+   memento.put("treeState", treeNode.getTreeState());
return memento.asString(); 
}
 
@@ -104,9 +107,10 @@ implements TreeNodeValueFacet {
@Override
protected TreeNode doRestore(final String input) {
final Memento memento = parseMemento(input);
-   return TreeNode.lazy(
+   return LazyTreeNode.of(
memento.get("primaryValue", Object.class), 
-   memento.get("adapterClass", Class.class));
+   memento.get("adapterClass", Class.class),
+   memento.get("treeState", TreeState.class));
}
 
// /// toString ///
diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/bookmarks/BookmarkServiceInternalDefault.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/bookmarks/BookmarkServiceInternalDefault.java
index e08334a..14c4edc 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/bookmarks/BookmarkServiceInternalDefault.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/bookmarks/BookmarkServiceInternalDefault.java
@@ -39,6 +39,7 @@ import 
org.apache.isis.applib.services.bookmark.BookmarkHolder;
 import org.apache.isis.applib.services.bookmark.BookmarkService;
 import org.apache.isis.applib.services.registry.ServiceRegistry;
 import org.apache.isis.applib.services.wrapper.WrapperFactory;
+import org.apache.isis.applib.tree.TreeState;
 import 
org.apache.isis.core.metamodel.services.persistsession.PersistenceSessionServiceInternal;
 import org.apache.isis.core.runtime.persistence.ObjectNotFoundException;
 
@@ -219,7 +220,8 @@ public class BookmarkServiceInternalDefaul

[isis] branch master updated: ISIS-1841 reorg dependencies such that 'commons' is the root of all

2018-05-22 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 8d959e7  ISIS-1841 reorg dependencies such that 'commons' is the root 
of all
8d959e7 is described below

commit 8d959e731d87ab3ca6b888f052b96a05072c9f21
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Tue May 22 14:04:57 2018 +0200

ISIS-1841 reorg dependencies such that 'commons' is the root of all

provides compile dependency of JEE API for 'schema' and
'unittestsupport' which is now required for builds on jdk 10+, because
java.xml.bind and java.xml.ws do no longer live in the jdk
---
 core/applib/pom.xml  | 91 +++-
 core/commons/pom.xml |  6 
 core/schema/pom.xml  |  6 
 3 files changed, 52 insertions(+), 51 deletions(-)

diff --git a/core/applib/pom.xml b/core/applib/pom.xml
index 84481d7..db3d15c 100644
--- a/core/applib/pom.xml
+++ b/core/applib/pom.xml
@@ -56,60 +56,55 @@
 
 
 
-
-
-
-
-org.eclipse.m2e
-lifecycle-mapping
-1.0.0
-
-
-
-
-
-
-org.datanucleus
-
-
-datanucleus-maven-plugin
-
-
-[4.0.0-release,)
-
-
-enhance
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 
 
 
-
+   
 org.apache.isis.core
-isis-core-schema
+isis-core-commons
 
-
+
 
 org.apache.isis.core
-isis-core-commons
+isis-core-schema
 
-
-   
-   
-   javax
-   javaee-api
-   


 
@@ -144,12 +139,6 @@

 
 
-
-   
-
-   com.google.code.findbugs
-   annotations
-
 
 
 
diff --git a/core/commons/pom.xml b/core/commons/pom.xml
index 12d1e38..9e69a91 100644
--- a/core/commons/pom.xml
+++ b/core/commons/pom.xml
@@ -58,6 +58,12 @@
 
 
 
+
+   
+
+   javax
+   javaee-api
+   
 

 
diff --git a/core/schema/pom.xml b/core/schema/pom.xml
index 59f14ee..cdeccdc 100644
--- a/core/schema/pom.xml
+++ b/core/schema/pom.xml
@@ -40,6 +40,12 @@
 
 
 
+
+   
+org.apache.isis.core
+isis-core-commons
+
+
 
 joda-time
 joda-time

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


[isis] branch master updated: ISIS-1841 Internal API: polishing _With

2018-05-22 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 1bdf869  ISIS-1841 Internal API: polishing _With
1bdf869 is described below

commit 1bdf869f24c6c93db5846489e7936d5e0a909307
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Tue May 22 11:04:44 2018 +0200

ISIS-1841 Internal API: polishing _With
---
 .../main/java/org/apache/isis/commons/internal/base/_With.java   | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git 
a/core/commons/src/main/java/org/apache/isis/commons/internal/base/_With.java 
b/core/commons/src/main/java/org/apache/isis/commons/internal/base/_With.java
index c128a54..2e67d45 100644
--- 
a/core/commons/src/main/java/org/apache/isis/commons/internal/base/_With.java
+++ 
b/core/commons/src/main/java/org/apache/isis/commons/internal/base/_With.java
@@ -124,33 +124,36 @@ public final class _With {
// -- MAPPING IDIOMS

/**
+* Equivalent to {@code 
Optional.ofNullable(obj).map(mapper).orElse(orElse);}
 * @param obj (nullable)
 * @param mapper
 * @param orElse (nullable)
 * @return {@code obj!=null ? mapper.apply(obj) : orElse}
 */
-   public static <X, R> R mapIfPresent(@Nullable X obj, Function<X, R> 
mapper, @Nullable R orElse) {
+   public static <X, R> R mapIfPresentElse(@Nullable X obj, Function<X, R> 
mapper, @Nullable R orElse) {
return obj!=null ? requires(mapper, "mapper").apply(obj) : 
orElse;  
}

/**
+* Equivalent to {@code 
Optional.ofNullable(obj).map(mapper).orElseGet(elseGet);} 
 * @param obj (nullable)
 * @param mapper
 * @param elseGet
 * @return {@code obj!=null ? mapper.apply(obj) : elseGet.get()}
 */
-   public static <X, R> R mapIfPresent(@Nullable X obj, Function<X, R> 
mapper, Supplier elseGet) {
+   public static <X, R> R mapIfPresentElseGet(@Nullable X obj, Function<X, 
R> mapper, Supplier elseGet) {
return obj!=null ? requires(mapper, "mapper").apply(obj) : 
requires(elseGet, "elseGet").get();
}

/**
+* Equivalent to {@code 
Optional.ofNullable(obj).map(mapper).orElseThrow(elseThrow);}
 * @param obj (nullable)
 * @param mapper
 * @param elseThrow
 * @return {@code obj!=null ? mapper.apply(obj) : throw( 
elseThrow.get() )}
 * @throws E
 */
-   public static <X, R, E extends Exception> R applyIfPresentElseThrow(
+   public static <X, R, E extends Exception> R mapIfPresentElseThrow(
@Nullable X obj, 
Function<X, R> mapper, 
Supplier elseThrow) 

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


[isis] branch master updated: ISIS-1841 further preparing for jdk 10+ build

2018-05-22 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 84a55cf  ISIS-1841 further preparing for jdk 10+ build
84a55cf is described below

commit 84a55cf0e152f304a807bfc125c44a529cab910c
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Tue May 22 15:42:21 2018 +0200

ISIS-1841 further preparing for jdk 10+ build
---
 core/maven-plugin/pom.xml | 20 
 core/pom.xml  | 25 +
 2 files changed, 17 insertions(+), 28 deletions(-)

diff --git a/core/maven-plugin/pom.xml b/core/maven-plugin/pom.xml
index 5620e29..c16385a 100644
--- a/core/maven-plugin/pom.xml
+++ b/core/maven-plugin/pom.xml
@@ -37,17 +37,19 @@
 
 
 
-3.0.4
+3.5.3
 
 
 
 
org.apache.isis.tool.mavenplugin
 
org/apache/isis/tool/mavenplugin
 
-3.3.9
+3.5.3
 3.0-alpha-2
-
3.4
-
1.7
+
3.5.1
+
1.7.1
+3.1.0
+
 
 
 
@@ -120,6 +122,12 @@
 
 It's all a bit of a pig's ear...
 -->
+
+
+   org.codehaus.plexus
+plexus-utils
+${plexus-utils.version}
+
 
 
 org.apache.maven
@@ -130,6 +138,10 @@
 org.codehaus.plexus
 plexus-component-annotations
 
+
+   org.codehaus.plexus
+   plexus-utils
+
 
 
 
diff --git a/core/pom.xml b/core/pom.xml
index e432086..3fcd4a3 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -172,11 +172,6 @@
 
 7.0
 
-   
-
 2.1
 
 4.12
@@ -602,7 +597,7 @@
 
 org.apache.maven.plugins
 maven-compiler-plugin
-3.1
+3.7.0
 
 false
 false
@@ -1674,24 +1669,6 @@ ${license.additional-notes}
 ${javassist.version}
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 
 
 com.fasterxml.jackson.core

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


[isis] branch master updated: ISIS-1841 Adds FunctionalInterface variants allowing checked Exceptions

2018-05-24 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new d378d05  ISIS-1841 Adds FunctionalInterface variants allowing checked 
Exceptions
d378d05 is described below

commit d378d0501705512cb18dae158c3550969c513812
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Thu May 24 13:25:42 2018 +0200

ISIS-1841 Adds FunctionalInterface variants allowing checked Exceptions

- CheckedFunction
- CheckedConsumer
- CheckedRunnable
- CheckedSupplier
---
 .../isis/applib/NonRecoverableException.java   |  33 +
 .../commons/internal/exceptions/_Exceptions.java   |  46 ++-
 .../commons/internal/functions/_Functions.java | 133 -
 .../components/tree/IsisToWicketTreeAdapter.java   |   2 +-
 4 files changed, 211 insertions(+), 3 deletions(-)

diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/NonRecoverableException.java 
b/core/applib/src/main/java/org/apache/isis/applib/NonRecoverableException.java
index 8620703..ee8af1f 100644
--- 
a/core/applib/src/main/java/org/apache/isis/applib/NonRecoverableException.java
+++ 
b/core/applib/src/main/java/org/apache/isis/applib/NonRecoverableException.java
@@ -22,6 +22,7 @@ package org.apache.isis.applib;
 import org.apache.isis.applib.services.exceprecog.TranslatableException;
 import org.apache.isis.applib.services.i18n.TranslatableString;
 import org.apache.isis.commons.internal.base._Strings;
+import org.apache.isis.commons.internal.functions._Functions;
 
 /**
  * Indicates that an unexpected, non-recoverable (fatal) exception has 
occurred within
@@ -106,4 +107,36 @@ public class NonRecoverableException extends 
RuntimeException implements Transla
 public String getTranslationContext() {
 return translationContext;
 }
+
+// -- SHORTCUTS
+
+   /**
+* 
+* Path path = ...
+*
+* ## OLD
+*
+* try {
+* Files.createDirectories(path);
+* } catch (IOException e) {
+* throw new NonRecoverableException(e);
+* }
+* 
+* ## NEW
+*  
+* NonRecoverableException.tryRun(()->Files.createDirectories(path));
+* 
+* 
+*  
+* @param checkedRunnable
+*/
+   public static void tryRun(_Functions.CheckedRunnable checkedRunnable) {
+   try {
+   checkedRunnable.run();
+   } catch (Exception cause) {
+   throw new NonRecoverableException(cause);
+   }
+   }
+
+
 }
diff --git 
a/core/commons/src/main/java/org/apache/isis/commons/internal/exceptions/_Exceptions.java
 
b/core/commons/src/main/java/org/apache/isis/commons/internal/exceptions/_Exceptions.java
index 4d1c557..ceea19e 100644
--- 
a/core/commons/src/main/java/org/apache/isis/commons/internal/exceptions/_Exceptions.java
+++ 
b/core/commons/src/main/java/org/apache/isis/commons/internal/exceptions/_Exceptions.java
@@ -22,12 +22,15 @@ package org.apache.isis.commons.internal.exceptions;
 import java.util.Collections;
 import java.util.List;
 import java.util.Objects;
+import java.util.function.Consumer;
+import java.util.function.Function;
 import java.util.stream.Stream;
 
 import javax.annotation.Nullable;
 
 import org.apache.isis.commons.internal.base._NullSafe;
 import org.apache.isis.commons.internal.collections._Lists;
+import org.apache.isis.commons.internal.functions._Functions;
 
 /**
  * - internal use only -
@@ -76,7 +79,7 @@ public final class _Exceptions {
}

/**
-* Used, to hide from the compiler the fact, that this call always 
throws.
+* Used to hide from the compiler the fact, that this call always 
throws.
 * 
 * {
 *throw notImplemented();
@@ -135,6 +138,47 @@ public final class _Exceptions {
}
 
// --
+   
+   /**
+    * [ahuber] Experimental, remove if it adds no value. 
+*/
+   public static class TryContext {
+   
+   private final Function<Exception, ? extends RuntimeException> 
toUnchecked;
+   
+   public TryContext(Function<Exception, ? extends 
RuntimeException> toUnchecked) {
+   this.toUnchecked = toUnchecked;
+   }
+
+   // -- SHORTCUTS (RUNNABLE)
+   
+   public Runnable uncheckedRunnable(_Functions.CheckedRunnable 
checkedRunnable) {
+   return checkedRunnable.toUnchecked(toUnchecked);
+   }
+   
+   public void tryRun(_Functions.CheckedRunnable checkedRunnable) {
+   uncheckedRunnable(checkedRunnable).run();
+   }
+   
+   // -

[isis] branch master updated: ISIS-1954: adds JUnit 5 support

2018-05-26 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new d18ed11  ISIS-1954: adds JUnit 5 support
d18ed11 is described below

commit d18ed11148a93e9322b4d070d6be9c11fd437f07
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 26 08:01:07 2018 +0200

ISIS-1954: adds JUnit 5 support

Task-Url: https://issues.apache.org/jira/browse/ISIS-1954
---
 core/integtestsupport/pom.xml  | 20 ++--
 core/pom.xml   | 56 --
 core/specsupport/pom.xml   | 21 ++--
 core/unittestsupport-legacy/pom.xml|  1 +
 core/unittestsupport/pom.xml   | 18 +--
 example/application/helloworld/.gitignore  |  1 +
 .../application/simpleapp/module-simple/.gitignore |  1 +
 7 files changed, 93 insertions(+), 25 deletions(-)

diff --git a/core/integtestsupport/pom.xml b/core/integtestsupport/pom.xml
index 36e0b7c..e81a748 100644
--- a/core/integtestsupport/pom.xml
+++ b/core/integtestsupport/pom.xml
@@ -54,10 +54,22 @@
 isis-core-specsupport
 
 
-
-junit
-junit
-
+   
+   
+   
+   org.junit.jupiter
+   junit-jupiter-api
+   
+   
+   
+   org.junit.jupiter
+   junit-jupiter-engine
+   
+   
+   
+   org.junit.vintage
+   junit-vintage-engine
+   
 
 
 org.jmock
diff --git a/core/pom.xml b/core/pom.xml
index 3fcd4a3..42160ea 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -174,7 +174,8 @@
 
 2.1
 
-4.12
+5.2.0
+
 
 2.6.0
 2.5.2
@@ -2042,12 +2043,26 @@ ${license.additional-notes}

 
 
-
-
-junit
-junit
-${junit.version}
-
+
+
+   
+   
+   org.junit.jupiter
+   junit-jupiter-api
+   ${junit.version}
+   
+   
+   
+   org.junit.jupiter
+   junit-jupiter-engine
+   ${junit.version}
+   
+   
+   
+   org.junit.vintage
+   junit-vintage-engine
+   ${junit.version}
+   
 
 
 org.jmock
@@ -2134,7 +2149,7 @@ ${license.additional-notes}
 
 
 
-
+
 
 org.hamcrest
 hamcrest-library
@@ -2144,12 +2159,25 @@ ${license.additional-notes}
   slf4j-api
 
 
-
-
-junit
-junit
-test
-
+
+   
+   
+   org.junit.jupiter
+   junit-jupiter-api
+   test
+   
+   
+   
+   org.junit.jupiter
+   junit-jupiter-engine
+   test
+   
+   
+   
+   org.junit.vintage
+   junit-vintage-engine
+   test
+   
 
 org.jmock
 jmock-junit4
diff --git a/core/specsupport/pom.xml b/core/specsupport/pom.xml
index 1bf20da..9e3cc6f 100644
--- a/core/specsupport/pom.xml
+++ b/core/specsupport/pom.xml
@@ -41,10 +41,23 @@
 isis-core-wrapper
 
 
-
-   junit
-   junit
-
+   
+   
+   
+   org.junit.jupiter
+   junit-jupiter-api
+   
+   
+   
+   org.junit.jupiter
+   junit-jupiter-engine
+   
+   
+   
+   org.junit.vintage
+   junit-vintage-engine
+   
+
 
org.jmock
jmock
diff --git a/core/unittestsupport-legacy/pom.xml 
b/core/unittestsupport-legacy/pom.xml
index 5c5ab3e..5a2f572 100644
--- a/core/unittestsupport-legacy/pom.xml
+++ b/core/unittestsupport-legacy/pom.xml
@@ -55,6

[isis] branch master updated: ISIS-1954: fixes JUnit4 compile dependency in unittestsupport

2018-05-26 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 3948643  ISIS-1954: fixes JUnit4 compile dependency in unittestsupport
3948643 is described below

commit 3948643a394bbe3378b1e2b0ffe013dba8546097
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 26 08:15:13 2018 +0200

ISIS-1954: fixes JUnit4 compile dependency in unittestsupport

Task-Url: https://issues.apache.org/jira/browse/ISIS-1954
---
 core/unittestsupport/pom.xml | 8 
 1 file changed, 8 insertions(+)

diff --git a/core/unittestsupport/pom.xml b/core/unittestsupport/pom.xml
index cf05cb5..e57c302 100644
--- a/core/unittestsupport/pom.xml
+++ b/core/unittestsupport/pom.xml
@@ -65,6 +65,14 @@
org.junit.vintage
junit-vintage-engine

+   
+   
+   junit
+   junit
+   4.12
+   compile
+   true
+   
 

org.picocontainer

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


[isis] branch master updated: ISIS-1841: aligning test package names (Internal API)

2018-05-26 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 5f43bd4  ISIS-1841: aligning test package names (Internal API)
5f43bd4 is described below

commit 5f43bd4bfab9b7b42a5c1a7779b1915fd0815fdb
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 26 10:43:10 2018 +0200

ISIS-1841: aligning test package names (Internal API)

Task-Url: https://issues.apache.org/jira/browse/ISIS-1841
---
 .../org/apache/isis/{applib => commons}/internal/base/BytesTest.java| 2 +-
 .../org/apache/isis/{applib => commons}/internal/base/NullSafeTest.java | 2 +-
 .../apache/isis/{applib => commons}/internal/base/ReductionTest.java| 2 +-
 .../org/apache/isis/{applib => commons}/internal/base/StringsTest.java  | 2 +-
 .../isis/{applib => commons}/internal/compare/ComparatorsTest.java  | 2 +-
 .../apache/isis/{applib => commons}/internal/memento/MementosTest.java  | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/core/applib/src/test/java/org/apache/isis/applib/internal/base/BytesTest.java 
b/core/applib/src/test/java/org/apache/isis/commons/internal/base/BytesTest.java
similarity index 99%
rename from 
core/applib/src/test/java/org/apache/isis/applib/internal/base/BytesTest.java
rename to 
core/applib/src/test/java/org/apache/isis/commons/internal/base/BytesTest.java
index 66585bd..da942ff 100644
--- 
a/core/applib/src/test/java/org/apache/isis/applib/internal/base/BytesTest.java
+++ 
b/core/applib/src/test/java/org/apache/isis/commons/internal/base/BytesTest.java
@@ -17,7 +17,7 @@
  *  under the License.
  */
 
-package org.apache.isis.applib.internal.base;
+package org.apache.isis.commons.internal.base;
 
 import static org.hamcrest.Matchers.lessThan;
 
diff --git 
a/core/applib/src/test/java/org/apache/isis/applib/internal/base/NullSafeTest.java
 
b/core/applib/src/test/java/org/apache/isis/commons/internal/base/NullSafeTest.java
similarity index 98%
rename from 
core/applib/src/test/java/org/apache/isis/applib/internal/base/NullSafeTest.java
rename to 
core/applib/src/test/java/org/apache/isis/commons/internal/base/NullSafeTest.java
index 58c1834..570a417 100644
--- 
a/core/applib/src/test/java/org/apache/isis/applib/internal/base/NullSafeTest.java
+++ 
b/core/applib/src/test/java/org/apache/isis/commons/internal/base/NullSafeTest.java
@@ -17,7 +17,7 @@
  *  under the License.
  */
 
-package org.apache.isis.applib.internal.base;
+package org.apache.isis.commons.internal.base;
 
 import static org.hamcrest.CoreMatchers.is;
 
diff --git 
a/core/applib/src/test/java/org/apache/isis/applib/internal/base/ReductionTest.java
 
b/core/applib/src/test/java/org/apache/isis/commons/internal/base/ReductionTest.java
similarity index 97%
rename from 
core/applib/src/test/java/org/apache/isis/applib/internal/base/ReductionTest.java
rename to 
core/applib/src/test/java/org/apache/isis/commons/internal/base/ReductionTest.java
index 7b5a4ea..3a53121 100644
--- 
a/core/applib/src/test/java/org/apache/isis/applib/internal/base/ReductionTest.java
+++ 
b/core/applib/src/test/java/org/apache/isis/commons/internal/base/ReductionTest.java
@@ -17,7 +17,7 @@
  *  under the License.
  */
 
-package org.apache.isis.applib.internal.base;
+package org.apache.isis.commons.internal.base;
 
 import static org.hamcrest.CoreMatchers.is;
 
diff --git 
a/core/applib/src/test/java/org/apache/isis/applib/internal/base/StringsTest.java
 
b/core/applib/src/test/java/org/apache/isis/commons/internal/base/StringsTest.java
similarity index 99%
rename from 
core/applib/src/test/java/org/apache/isis/applib/internal/base/StringsTest.java
rename to 
core/applib/src/test/java/org/apache/isis/commons/internal/base/StringsTest.java
index 3ebc1ed..4e66ca7 100644
--- 
a/core/applib/src/test/java/org/apache/isis/applib/internal/base/StringsTest.java
+++ 
b/core/applib/src/test/java/org/apache/isis/commons/internal/base/StringsTest.java
@@ -17,7 +17,7 @@
  *  under the License.
  */
 
-package org.apache.isis.applib.internal.base;
+package org.apache.isis.commons.internal.base;
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.nullValue;
diff --git 
a/core/applib/src/test/java/org/apache/isis/applib/internal/compare/ComparatorsTest.java
 
b/core/applib/src/test/java/org/apache/isis/commons/internal/compare/ComparatorsTest.java
similarity index 98%
rename from 
core/applib/src/test/java/org/apache/isis/applib/internal/compare/ComparatorsTest.java
rename to 
core/applib/src/test/java/org/apache/isis/commons/internal/compare/ComparatorsTest.java
index dc83cf2..b2390bf 100644
--- 
a/core/applib/src/test/java/org/apache/isis/applib/internal/compare/ComparatorsTest.java
+++ 
b/core/applib/src/test/java/org/apache/isis/commons/internal/compare/ComparatorsTest.java
@@ -17,7 +17,7 @

[isis] branch master updated: ISIS-1954: fixes DefaultImposteriserTest

2018-05-26 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 1460d1a  ISIS-1954: fixes DefaultImposteriserTest
1460d1a is described below

commit 1460d1aea0923b96c579341be8fd6a8556d01930
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 26 09:07:19 2018 +0200

ISIS-1954: fixes DefaultImposteriserTest

Task-Url: https://issues.apache.org/jira/browse/ISIS-1954
---
 .../isis/commons/internal/context/_Plugin.java | 13 -
 .../jmocking/DefaultImposteriserTest.java  | 56 ++
 2 files changed, 46 insertions(+), 23 deletions(-)

diff --git 
a/core/commons/src/main/java/org/apache/isis/commons/internal/context/_Plugin.java
 
b/core/commons/src/main/java/org/apache/isis/commons/internal/context/_Plugin.java
index d9c5152..7acfb11 100644
--- 
a/core/commons/src/main/java/org/apache/isis/commons/internal/context/_Plugin.java
+++ 
b/core/commons/src/main/java/org/apache/isis/commons/internal/context/_Plugin.java
@@ -28,7 +28,6 @@ import java.util.Set;
 import java.util.function.Function;
 import java.util.function.Supplier;
 import java.util.stream.Collectors;
-import java.util.stream.Stream;
 
 import org.apache.isis.commons.internal.base._Casts;
 import org.apache.isis.commons.internal.base._NullSafe;
@@ -150,18 +149,6 @@ public final class _Plugin {
// -- JUNIT TEST SUPPORT 

/**
-* TODO will break with java 9+
-* @return file-system path, where the frameworks core classes reside 
(after a build).
-*/
-   public static URL getCoreCommonsTargetFolder() {
-   return Stream.of(((URLClassLoader 
)_Plugin.class.getClassLoader()).getURLs())
-   .filter(url->url.toString().contains("/core/commons/"))
-   .findFirst()
-   .orElseThrow(()->new RuntimeException("Failed to find 
file-system path, where the frameworks core classes reside."))
-   ;
-   }
-   
-   /**
 * Loads a plugin by name and class-path. (Most likely used by JUnit 
Tests.)
 * @param pluginClass
 * @param classPath
diff --git 
a/core/unittestsupport/src/test/java/org/apache/isis/core/unittestsupport/jmocking/DefaultImposteriserTest.java
 
b/core/unittestsupport/src/test/java/org/apache/isis/core/unittestsupport/jmocking/DefaultImposteriserTest.java
index 7563493..ba8f9f1 100644
--- 
a/core/unittestsupport/src/test/java/org/apache/isis/core/unittestsupport/jmocking/DefaultImposteriserTest.java
+++ 
b/core/unittestsupport/src/test/java/org/apache/isis/core/unittestsupport/jmocking/DefaultImposteriserTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.isis.core.unittestsupport.jmocking;
 
+import static 
org.apache.isis.commons.internal.functions._Functions.uncheckedFunction;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -30,9 +31,13 @@ import java.lang.reflect.Method;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
+import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Date;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Stream;
 
+import org.apache.isis.commons.internal.base._Strings;
 import org.apache.isis.commons.internal.context._Context;
 import org.apache.isis.commons.internal.context._Plugin;
 import org.apache.isis.core.plugins.codegen.ProxyFactoryPlugin;
@@ -52,7 +57,7 @@ public class DefaultImposteriserTest {
 private Invokable invokable;
 @SuppressWarnings("unused")
private Invocation invocation;
-
+
 @Before
 public void setUp() throws Exception {
 invokable = new Invokable() {
@@ -66,16 +71,10 @@ public class DefaultImposteriserTest {
 // -- loading codegen plugin by name (because not configured as a 
maven dependency) 
 {
String pluginFullyQualifiedClassName = 
"org.apache.isis.core.plugins.codegen.ProxyFactoryPluginUsingJavassist";
-   // we are guessing where to find the pluginTarget based on the 
'commons' target location
-   String commonsTarget = 
-   
Paths.get(_Plugin.getCoreCommonsTargetFolder().toURI())
-   .toFile()
-   .getCanonicalPath()
-   .replace('\\', '/');
-   ;   
-   String pluginTarget = commonsTarget.replace("/core/commons/", 
"/core/plugins/codegen-javassist/");
+   // we are guessing where to find the pluginTarget
+   File pluginTarget = 
getCoreTargetFolder("/core/plugins/codegen-javassist/")

[isis] branch master updated: ISIS-1954: breaks cyclic dependencies with jassist plugin tests

2018-05-26 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 340f5e3  ISIS-1954: breaks cyclic dependencies with jassist plugin 
tests
340f5e3 is described below

commit 340f5e30e9baffa4c2770453e956bc472fdca3b1
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 26 10:01:47 2018 +0200

ISIS-1954: breaks cyclic dependencies with jassist plugin tests

introduces a new module: plugins-test/codegen-javassist-test

Task-Url: https://issues.apache.org/jira/browse/ISIS-1954
---
 .../plugins-test/codegen-javassist-test/.gitignore |  1 +
 .../codegen-javassist-test}/pom.xml| 27 +++---
 .../ServiceInstantiatorTestUsingJavassist.java |  0
 .../proxy/ProxyCreatorTestUsingJavassist.java  |  0
 core/plugins/codegen-javassist/pom.xml | 14 ---
 core/pom.xml   |  4 
 core/unittestsupport/pom.xml   |  5 
 7 files changed, 18 insertions(+), 33 deletions(-)

diff --git a/core/plugins-test/codegen-javassist-test/.gitignore 
b/core/plugins-test/codegen-javassist-test/.gitignore
new file mode 100644
index 000..a48e45b
--- /dev/null
+++ b/core/plugins-test/codegen-javassist-test/.gitignore
@@ -0,0 +1 @@
+/target-ide
diff --git a/core/plugins/codegen-javassist/pom.xml 
b/core/plugins-test/codegen-javassist-test/pom.xml
similarity index 79%
copy from core/plugins/codegen-javassist/pom.xml
copy to core/plugins-test/codegen-javassist-test/pom.xml
index 2e5cf62..eecc45d 100644
--- a/core/plugins/codegen-javassist/pom.xml
+++ b/core/plugins-test/codegen-javassist-test/pom.xml
@@ -20,16 +20,16 @@
../../pom.xml

 
-   isis-core-plugins-codegen-javassist
+   isis-core-plugins-codegen-javassist-test
 
-   Apache Isis Plugin for Code Generation (Javassist)
+   Tests for Apache Isis Plugin for Code Generation 
(Javassist)

-Code generation plugin using Javassist.
+To break cyclic dependencies some tests needed to be moved to their 
own module (this).
 
 

-   
org.apache.isis.plugins.codegen-javassist
-   
org/apache/isis/plugins/codegen-javassist
+   
org.apache.isis.plugins.codegen-javassist-test
+   
org/apache/isis/plugins/codegen-javassist-test

 

@@ -53,26 +53,15 @@
 


-   

-   
-   org.javassist
-   javassist
-   
+   


-   org.objenesis
-   objenesis
-   
-
-   
org.apache.isis.core
-   isis-core-commons
-   compile
+   
isis-core-plugins-codegen-javassist
+   test


-   
-   

org.apache.isis.core
isis-core-wrapper
diff --git 
a/core/plugins/codegen-javassist/src/test/java/org/apache/isis/core/runtime/services/ServiceInstantiatorTestUsingJavassist.java
 
b/core/plugins-test/codegen-javassist-test/src/test/java/org/apache/isis/core/runtime/services/ServiceInstantiatorTestUsingJavassist.java
similarity index 100%
rename from 
core/plugins/codegen-javassist/src/test/java/org/apache/isis/core/runtime/services/ServiceInstantiatorTestUsingJavassist.java
rename to 
core/plugins-test/codegen-javassist-test/src/test/java/org/apache/isis/core/runtime/services/ServiceInstantiatorTestUsingJavassist.java
diff --git 
a/core/plugins/codegen-javassist/src/test/java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTestUsingJavassist.java
 
b/core/plugins-test/codegen-javassist-test/src/test/java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTestUsingJavassist.java
similarity index 100%
rename from 
core/plugins/codegen-javassist/src/test/java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTestUsingJavassist.java
rename to 
core/plugins-test/codegen-javassist-test/src/test/java/org/apache/isis/core/wrapper/proxy/ProxyCreatorTestUsingJavassist.java
diff --git a/core/plugins/codegen-javassist/pom.xml 
b/core/plugins/codegen-javassist/pom.xml
index 2e5cf62..eaad977 100644
--- a/core/plugins/codegen-javassist/pom.xml
+++ b/core/plugins/codegen-javassist/pom.xml
@@ -70,20 +70,6 @@
isis-core-commons
compile

-   
-   
-   
-   
-   org.apache.isis.core
-   isis-core-wrapper
-   test
-   
-
-   
-   org.apache.isi

[isis] branch master updated: ISIS-1841: moving all -legacy modules into new subfolder /core/legacy

2018-05-26 Thread ahuber
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new c5d8980  ISIS-1841: moving all -legacy modules into new subfolder 
/core/legacy
c5d8980 is described below

commit c5d89805842ed8d49a248d52f771561538cd35db
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Sat May 26 10:15:30 2018 +0200

ISIS-1841: moving all -legacy modules into new subfolder /core/legacy

Task-Url: https://issues.apache.org/jira/browse/ISIS-1841
---
 core/{viewer-wicket-ui-legacy => legacy/applib-legacy}/.gitignore | 0
 core/{ => legacy}/applib-legacy/pom.xml   | 0
 .../src/main/java/org/apache/isis/applib/DomainObjectContainer.java   | 0
 .../src/main/java/org/apache/isis/applib/annotation/Encodable.java| 0
 .../src/main/java/org/apache/isis/applib/annotation/Parseable.java| 0
 .../src/main/java/org/apache/isis/applib/fixtures/AbstractFixture.java| 0
 .../main/java/org/apache/isis/applib/fixtures/AbstractFixtureSusa.java| 0
 .../src/main/java/org/apache/isis/applib/fixtures/BaseFixture.java| 0
 .../src/main/java/org/apache/isis/applib/fixtures/DateFixture.java| 0
 .../src/main/java/org/apache/isis/applib/fixtures/SwitchUserFixture.java  | 0
 .../org/apache/isis/applib/fixtures/switchuser/SwitchUserService.java | 0
 .../apache/isis/applib/fixtures/switchuser/SwitchUserServiceAware.java| 0
 .../java/org/apache/isis/applib/fixtures/switchuser/package-info.java | 0
 .../applib-legacy/src/main/java/org/apache/isis/applib/layout/Util.java   | 0
 .../apache/isis/applib/layout/component/CollectionLayoutData_legacy.java  | 0
 .../java/org/apache/isis/applib/layout/component/FieldSet_legacy.java | 0
 .../applib/services/exceprecog/ExceptionRecognizerAbstractLegacy.java | 0
 .../isis/applib/services/exceprecog/ExceptionRecognizerForTypeLegacy.java | 0
 .../main/java/org/apache/isis/applib/services/memento/MementoService.java | 0
 .../main/java/org/apache/isis/applib/services/memento/package-info.java   | 0
 .../apache/isis/applib/services/repository/RepositoryServiceLegacy.java   | 0
 ...rlEncodingServiceUsingBaseEncodingWithSupportForLargeUrlsAbstract.java | 0
 .../applib-legacy/src/main/java/org/apache/isis/applib/util/Clause.java   | 0
 .../src/main/java/org/apache/isis/applib/util/ObjectContractsLegacy.java  | 0
 .../applib-legacy/src/main/java/org/apache/isis/applib/value/Date.java| 0
 .../src/main/java/org/apache/isis/applib/value/DateTime.java  | 0
 .../applib-legacy/src/main/java/org/apache/isis/applib/value/Time.java| 0
 .../src/main/java/org/apache/isis/applib/value/TimeStamp.java | 0
 .../applib/services/exceprecog/ExceptionRecognizerForTypeLegacyTest.java  | 0
 .../applib/services/exceprecog/ExceptionRecognizerGeneralLegacyTest.java  | 0
 .../applib-legacy/src/test/java/org/apache/isis/applib/util/Invoice.java  | 0
 .../src/test/java/org/apache/isis/applib/util/InvoiceItem.java| 0
 .../src/test/java/org/apache/isis/applib/util/NumberedEvaluator.java  | 0
 .../org/apache/isis/applib/util/ObjectContractsLegacyTest_compareTo.java  | 0
 .../org/apache/isis/applib/util/ObjectContractsLegacyTest_equals.java | 0
 .../isis/applib/util/ObjectContractsLegacyTest_equals_and_hashCode.java   | 0
 .../org/apache/isis/applib/util/ObjectContractsLegacyTest_toString.java   | 0
 .../src/test/java/org/apache/isis/applib/value/DateTest.java  | 0
 .../src/test/java/org/apache/isis/applib/value/DateTimeTest.java  | 0
 .../src/test/java/org/apache/isis/applib/value/TimeStampTest.java | 0
 .../src/test/java/org/apache/isis/applib/value/TimeTest.java  | 0
 core/{unittestsupport-legacy => legacy/metamodel-legacy}/.gitignore   | 0
 core/{ => legacy}/metamodel-legacy/pom.xml| 0
 .../facets/object/encodeable/annotcfg/EncodableFacetAnnotation.java   | 0
 .../annotcfg/EncodableFacetAnnotationElseConfigurationFactory.java| 0
 .../facets/object/parseable/annotcfg/ParseableFacetAnnotation.java| 0
 .../annotcfg/ParseableFacetAnnotationElseConfigurationFactory.java| 0
 .../facets/value/date/DateValueFacetUsingSemanticsProviderFactory.java| 0
 .../isis/core/metamodel/facets/value/date/DateValueSemanticsProvider.java | 0
 .../value/datetime/DateTimeValueFacetUsingSemanticsProviderFactory.java   | 0
 .../metamodel/facets/value/datetime/DateTimeValueSemanticsProvider.java   | 0
 .../facets/value/time/TimeValueFacetUsingSemanticsProviderFactory.java| 0
 .../isis/core/metamodel/facets/value/time/TimeValueSemanticsProvider.java | 0
 .../value/timestamp/TimeStampValueFacetUsingSemanticsProviderFactory.java | 0
 .../metamodel/facets/value/timestamp/TimeStampValueSemanticsProvider.java | 0

  1   2   3   4   5   6   7   8   9   10   >