You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2015/09/17 11:46:50 UTC

[01/10] isis git commit: ISIS-1194: pass ServicesInjectorSpi into the constructor of ObjectReflectorDefault

Repository: isis
Updated Branches:
  refs/heads/master a129fd2d5 -> 0a4a039b0


ISIS-1194: pass ServicesInjectorSpi into the constructor of ObjectReflectorDefault

... rather than injecting afterwards via a setter.


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/66f4825d
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/66f4825d
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/66f4825d

Branch: refs/heads/master
Commit: 66f4825d94b1d28a50dfe5e8e820cb4593b1c182
Parents: a129fd2
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Sep 16 06:22:36 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Sep 16 06:22:36 2015 +0100

----------------------------------------------------------------------
 .../isis/core/metamodel/app/IsisMetaModel.java  |  3 +-
 .../metamodel/spec/SpecificationLoaderSpi.java  |  5 ---
 .../specloader/ObjectReflectorDefault.java      | 33 +++++++++-----------
 .../specloader/ObjectReflectorInstaller.java    |  3 +-
 .../progmodels/dflt/JavaReflectorHelper.java    |  6 ++--
 .../JavaReflectorInstallerNoDecorators.java     |  7 +++--
 .../metamodel/facets/ProgrammableReflector.java |  5 ---
 .../ObjectReflectorDefaultTestAbstract.java     | 18 +++++++----
 .../isis/core/runtime/system/IsisSystem.java    |  7 ++---
 .../IsisComponentProvider.java                  |  5 +--
 .../IsisComponentProviderDefault2.java          | 11 ++++---
 .../IsisComponentProviderUsingInstallers.java   |  8 +++--
 12 files changed, 55 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/66f4825d/core/metamodel/src/main/java/org/apache/isis/core/metamodel/app/IsisMetaModel.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/app/IsisMetaModel.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/app/IsisMetaModel.java
index 476b356..b6a9874 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/app/IsisMetaModel.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/app/IsisMetaModel.java
@@ -104,8 +104,7 @@ public class IsisMetaModel implements ApplicationScopedComponent {
         this.specificationLoader = new ObjectReflectorDefault(
                 deploymentCategory, configuration,
                 this.programmingModel, facetDecorators,
-                metaModelValidator, layoutMetadataReaders);
-        specificationLoader.setServiceInjector(servicesInjector);
+                metaModelValidator, layoutMetadataReaders, servicesInjector);
 
         this.runtimeContext = new RuntimeContextNoRuntime(
                 deploymentCategory, configuration, servicesInjector, specificationLoader);

http://git-wip-us.apache.org/repos/asf/isis/blob/66f4825d/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoaderSpi.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoaderSpi.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoaderSpi.java
index 130ced2..ca1d679 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoaderSpi.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoaderSpi.java
@@ -30,11 +30,6 @@ public interface SpecificationLoaderSpi extends ApplicationScopedComponent, Debu
     public void init();
     public void shutdown();
 
-    /**
-     * Specify the services to pro-actively prime the cache, and to initialize them also.
-     */
-    void setServiceInjector(ServicesInjectorSpi services);
-
     void invalidateCacheFor(Object domainObject);
     
     void invalidateCache(Class<?> domainClass);

http://git-wip-us.apache.org/repos/asf/isis/blob/66f4825d/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefault.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefault.java
index 04ff7c9..5a56437 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefault.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefault.java
@@ -128,27 +128,25 @@ public final class ObjectReflectorDefault implements SpecificationLoaderSpi, App
      */
     private final FacetDecoratorSet facetDecoratorSet;
 
+    private final ServicesInjectorSpi servicesInjector;
+
+    private final SpecificationTraverser specificationTraverser = new SpecificationTraverser();
+
+    private final MetaModelValidator metaModelValidator;
+    private final SpecificationCacheDefault cache = new SpecificationCacheDefault();
+    private final List<LayoutMetadataReader> layoutMetadataReaders;
+
     /**
      * Can optionally be injected, but will default (to
      * {@link RuntimeContextNoRuntime}) otherwise.
-     * 
+     *
      * <p>
      * Should be injected when used by framework, but will default to a no-op implementation if the metamodel is
      * being used standalone (eg for a code-generator).
      */
     private RuntimeContext runtimeContext;
 
-    private final SpecificationTraverser specificationTraverser = new SpecificationTraverser();
-
-    private final MetaModelValidator metaModelValidator;
-    private final SpecificationCacheDefault cache = new SpecificationCacheDefault();
-    private final List<LayoutMetadataReader> layoutMetadataReaders;
-
     private boolean initialized = false;
-    /**
-     * Populated in {@link SpecificationLoaderSpi#setServiceInjector(org.apache.isis.core.metamodel.services.ServicesInjectorSpi)}.
-     */
-    private ServicesInjectorSpi servicesInjector;
     private ValidationFailures validationFailures;
 
     // /////////////////////////////////////////////////////////////
@@ -161,10 +159,12 @@ public final class ObjectReflectorDefault implements SpecificationLoaderSpi, App
             final ProgrammingModel programmingModel,
             final Set<FacetDecorator> facetDecorators,
             final MetaModelValidator metaModelValidator,
-            final List<LayoutMetadataReader> layoutMetadataReaders) {
+            final List<LayoutMetadataReader> layoutMetadataReaders,
+            final ServicesInjectorSpi servicesInjector) {
 
         ensureThatArg(deploymentCategory, is(notNullValue()));
         ensureThatArg(configuration, is(notNullValue()));
+        ensureThatArg(servicesInjector, is(notNullValue()));
         ensureThatArg(programmingModel, is(notNullValue()));
         ensureThatArg(facetDecorators, is(notNullValue()));
         ensureThatArg(metaModelValidator, is(notNullValue()));
@@ -173,6 +173,8 @@ public final class ObjectReflectorDefault implements SpecificationLoaderSpi, App
 
         this.deploymentCategory = deploymentCategory;
         this.configuration = configuration;
+        this.servicesInjector = servicesInjector;
+
         this.programmingModel = programmingModel;
 
         this.facetDecoratorSet = new FacetDecoratorSet();
@@ -197,7 +199,7 @@ public final class ObjectReflectorDefault implements SpecificationLoaderSpi, App
 
     /**
      * Initializes and wires up, and primes the cache based on any service
-     * classes that may have been {@link SpecificationLoaderSpi#setServiceInjector(org.apache.isis.core.metamodel.services.ServicesInjectorSpi) injected}.
+     * classes (provided by the {@link ServicesInjectorSpi}).
      */
     public void init() {
 
@@ -625,11 +627,6 @@ public final class ObjectReflectorDefault implements SpecificationLoaderSpi, App
         return this.servicesInjector.isRegisteredService(cls);
     }
 
-    @Override
-    public void setServiceInjector(final ServicesInjectorSpi services) {
-        servicesInjector = services;
-    }
-
     // ////////////////////////////////////////////////////////////////////
     // Dependencies (injected from constructor)
     // ////////////////////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/isis/blob/66f4825d/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorInstaller.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorInstaller.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorInstaller.java
index b132603..a787f91 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorInstaller.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorInstaller.java
@@ -23,6 +23,7 @@ import java.util.Collection;
 import org.apache.isis.core.commons.components.Installer;
 import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
 import org.apache.isis.core.metamodel.facetapi.MetaModelRefiner;
+import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
 import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
 
 /**
@@ -34,7 +35,7 @@ public interface ObjectReflectorInstaller extends Installer {
 
     SpecificationLoaderSpi createReflector(
             final DeploymentCategory deploymentCategory,
-            final Collection<MetaModelRefiner> metaModelRefiners);
+            final Collection<MetaModelRefiner> metaModelRefiners, final ServicesInjectorSpi servicesInjector);
 
     void addFacetDecoratorInstaller(final FacetDecoratorInstaller decoratorInstaller);
 

http://git-wip-us.apache.org/repos/asf/isis/blob/66f4825d/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/JavaReflectorHelper.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/JavaReflectorHelper.java b/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/JavaReflectorHelper.java
index 61dae20..8d468cf 100644
--- a/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/JavaReflectorHelper.java
+++ b/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/JavaReflectorHelper.java
@@ -30,6 +30,7 @@ import org.apache.isis.core.metamodel.facetapi.MetaModelRefiner;
 import org.apache.isis.core.metamodel.facetdecorator.FacetDecorator;
 import org.apache.isis.core.metamodel.layoutmetadata.LayoutMetadataReader;
 import org.apache.isis.core.metamodel.progmodel.ProgrammingModel;
+import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
 import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
 import org.apache.isis.core.metamodel.specloader.ObjectReflectorDefault;
 import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidator;
@@ -49,7 +50,8 @@ public final class JavaReflectorHelper  {
             final Collection<MetaModelRefiner> metaModelRefiners,
             final Set<FacetDecorator> facetDecorators,
             final List<LayoutMetadataReader> layoutMetadataReaders,
-            final MetaModelValidator mmv) {
+            final MetaModelValidator mmv,
+            final ServicesInjectorSpi servicesInjector) {
 
         MetaModelValidatorComposite metaModelValidator = MetaModelValidatorComposite.asComposite(mmv);
         for (MetaModelRefiner metaModelRefiner : metaModelRefiners) {
@@ -64,7 +66,7 @@ public final class JavaReflectorHelper  {
 
         return new ObjectReflectorDefault(
                 deploymentCategory, configuration,
-                programmingModel, facetDecorators, metaModelValidator, layoutMetadataReaders);
+                programmingModel, facetDecorators, metaModelValidator, layoutMetadataReaders, servicesInjector);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/66f4825d/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/JavaReflectorInstallerNoDecorators.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/JavaReflectorInstallerNoDecorators.java b/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/JavaReflectorInstallerNoDecorators.java
index f287ec0..d958192 100644
--- a/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/JavaReflectorInstallerNoDecorators.java
+++ b/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/JavaReflectorInstallerNoDecorators.java
@@ -38,6 +38,7 @@ import org.apache.isis.core.metamodel.facetdecorator.FacetDecorator;
 import org.apache.isis.core.metamodel.facets.FacetFactory;
 import org.apache.isis.core.metamodel.layoutmetadata.LayoutMetadataReader;
 import org.apache.isis.core.metamodel.progmodel.ProgrammingModel;
+import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
 import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
 import org.apache.isis.core.metamodel.specloader.FacetDecoratorInstaller;
 import org.apache.isis.core.metamodel.specloader.ObjectReflectorInstaller;
@@ -76,14 +77,16 @@ public class JavaReflectorInstallerNoDecorators extends InstallerAbstract implem
     @Override
     public SpecificationLoaderSpi createReflector(
             final DeploymentCategory deploymentCategory,
-            final Collection<MetaModelRefiner> metaModelRefiners) {
+            final Collection<MetaModelRefiner> metaModelRefiners,
+            final ServicesInjectorSpi servicesInjector) {
 
         final ProgrammingModel programmingModel = createProgrammingModel(getConfiguration());
         final Set<FacetDecorator> facetDecorators = createFacetDecorators(getConfiguration());
         final MetaModelValidator mmv = createMetaModelValidator(getConfiguration());
         final List<LayoutMetadataReader> layoutMetadataReaders = createLayoutMetadataReaders(getConfiguration());
 
-        return JavaReflectorHelper.createObjectReflector(deploymentCategory, getConfiguration(), programmingModel, metaModelRefiners, facetDecorators, layoutMetadataReaders, mmv);
+        return JavaReflectorHelper.createObjectReflector(deploymentCategory, getConfiguration(), programmingModel, metaModelRefiners, facetDecorators, layoutMetadataReaders, mmv,
+                servicesInjector);
     }
 
 

http://git-wip-us.apache.org/repos/asf/isis/blob/66f4825d/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/ProgrammableReflector.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/ProgrammableReflector.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/ProgrammableReflector.java
index 9f15094..d243501 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/ProgrammableReflector.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/ProgrammableReflector.java
@@ -111,11 +111,6 @@ public class ProgrammableReflector extends SpecificationLoaderAbstract implement
     }
 
     @Override
-    public void setServiceInjector(final ServicesInjectorSpi serviceInjector) {
-        throw new NotYetImplementedException();
-    }
-
-    @Override
     public ObjectSpecification introspectIfRequired(ObjectSpecification spec) {
         throw new NotYetImplementedException();
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/66f4825d/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefaultTestAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefaultTestAbstract.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefaultTestAbstract.java
index 914dcd2..5bb9269 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefaultTestAbstract.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefaultTestAbstract.java
@@ -21,7 +21,9 @@ package org.apache.isis.core.metamodel.specloader;
 
 import java.util.Collections;
 import java.util.HashSet;
+
 import com.google.common.collect.Lists;
+
 import org.jmock.Expectations;
 import org.jmock.auto.Mock;
 import org.junit.Assert;
@@ -29,6 +31,7 @@ import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
+
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
 import org.apache.isis.core.metamodel.facetapi.Facet;
@@ -44,7 +47,7 @@ import org.apache.isis.core.metamodel.metamodelvalidator.dflt.MetaModelValidator
 import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
 import org.apache.isis.core.metamodel.runtimecontext.noruntime.RuntimeContextNoRuntime;
 import org.apache.isis.core.metamodel.services.ServicesInjectorDefault;
-import org.apache.isis.core.metamodel.services.container.DomainObjectContainerDefault;
+import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.unittestsupport.jmocking.InjectIntoJMockAction;
 import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
@@ -63,7 +66,9 @@ public abstract class ObjectReflectorDefaultTestAbstract {
 
     @Mock
     private IsisConfiguration mockConfiguration;
-    
+    @Mock
+    private ServicesInjectorSpi mockServicesInjector;
+
     // is loaded by subclasses
     protected ObjectSpecification specification;
 
@@ -86,12 +91,11 @@ public abstract class ObjectReflectorDefaultTestAbstract {
                         new ProgrammingModelFacetsJava5(),
                         new HashSet<FacetDecorator>(),
                         new MetaModelValidatorDefault(),
-                        Lists.<LayoutMetadataReader>newArrayList(new LayoutMetadataReaderFromJson()));
+                        Lists.<LayoutMetadataReader>newArrayList(new LayoutMetadataReaderFromJson()), mockServicesInjector);
         runtimeContext =
                 new RuntimeContextNoRuntime(
                         new ServicesInjectorDefault(Collections.emptyList()), reflector);
         reflector.setRuntimeContext(runtimeContext);
-        reflector.setServiceInjector(new ServicesInjectorDefault(Collections.<Object>singletonList(new DomainObjectContainerDefault())));
         reflector.init();
         
         specification = loadSpecification(reflector);
@@ -109,7 +113,8 @@ public abstract class ObjectReflectorDefaultTestAbstract {
                 new ProgrammingModelFacetsJava5(),
                 new HashSet<FacetDecorator>(),
                 new MetaModelValidatorDefault(),
-                Lists.<LayoutMetadataReader>newArrayList());
+                Lists.<LayoutMetadataReader>newArrayList(),
+                mockServicesInjector);
     }
 
     @Test
@@ -122,7 +127,8 @@ public abstract class ObjectReflectorDefaultTestAbstract {
                 new ProgrammingModelFacetsJava5(),
                 new HashSet<FacetDecorator>(),
                 new MetaModelValidatorDefault(),
-                null);
+                null,
+                mockServicesInjector);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/isis/blob/66f4825d/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystem.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystem.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystem.java
index 794c093..dfee47f 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystem.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystem.java
@@ -127,8 +127,7 @@ public class IsisSystem implements DebugSelection, ApplicationScopedComponent {
             sessionFactory = createSessionFactory(deploymentType);
 
             // temporarily make a configuration available
-            // REVIEW: would rather inject this, or perhaps even the
-            // ConfigurationBuilder
+            // TODO: REVIEW: would rather inject this, or perhaps even the ConfigurationBuilder
             IsisContext.setConfiguration(getConfiguration());
 
             initContext(sessionFactory);
@@ -174,9 +173,7 @@ public class IsisSystem implements DebugSelection, ApplicationScopedComponent {
                 refiners(authenticationManager, authorizationManager,
                         new PersistenceSessionFactoryMetamodelRefiner());
         final SpecificationLoaderSpi specificationLoader =
-                isisComponentProvider.provideSpecificationLoaderSpi(deploymentType, metaModelRefiners);
-
-        specificationLoader.setServiceInjector(servicesInjector);
+                isisComponentProvider.provideSpecificationLoaderSpi(deploymentType, servicesInjector, metaModelRefiners);
 
         // persistenceSessionFactory
         final PersistenceSessionFactory persistenceSessionFactory =

http://git-wip-us.apache.org/repos/asf/isis/blob/66f4825d/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
index b2bbeb0..9faa7bd 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
@@ -51,12 +51,13 @@ public interface IsisComponentProvider {
 
     SpecificationLoaderSpi provideSpecificationLoaderSpi(
             final DeploymentType deploymentType,
-            Collection<MetaModelRefiner> metaModelRefiners)
+            final ServicesInjectorSpi servicesInjector,
+            final Collection<MetaModelRefiner> metaModelRefiners)
             throws IsisSystemException;
 
     PersistenceSessionFactory providePersistenceSessionFactory(
             final DeploymentType deploymentType,
-            final ServicesInjectorSpi servicesInjectorSpi,
+            final ServicesInjectorSpi servicesInjector,
             final SpecificationLoaderSpi specificationLoader);
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/66f4825d/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderDefault2.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderDefault2.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderDefault2.java
index 2f112c4..10e6e6d 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderDefault2.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderDefault2.java
@@ -244,7 +244,8 @@ public class IsisComponentProviderDefault2 extends IsisComponentProviderAbstract
     @Override
     public SpecificationLoaderSpi provideSpecificationLoaderSpi(
             final DeploymentType deploymentType,
-            Collection<MetaModelRefiner> metaModelRefiners) throws IsisSystemException {
+            final ServicesInjectorSpi servicesInjector,
+            final Collection<MetaModelRefiner> metaModelRefiners) throws IsisSystemException {
 
         final DeploymentCategory deploymentCategory = deploymentType.getDeploymentCategory();
 
@@ -258,8 +259,8 @@ public class IsisComponentProviderDefault2 extends IsisComponentProviderAbstract
                         deploymentCategory, getConfiguration(), programmingModel,
                         metaModelRefiners,
                         facetDecorators, layoutMetadataReaders,
-                        metaModelValidator
-                );
+                        metaModelValidator,
+                        servicesInjector);
     }
 
     @Override
@@ -275,12 +276,12 @@ public class IsisComponentProviderDefault2 extends IsisComponentProviderAbstract
     @Override
     public PersistenceSessionFactory providePersistenceSessionFactory(
             DeploymentType deploymentType,
-            final ServicesInjectorSpi servicesInjectorSpi,
+            final ServicesInjectorSpi servicesInjector,
             final SpecificationLoaderSpi specificationLoader) {
         DataNucleusPersistenceMechanismInstaller installer =
                 new DataNucleusPersistenceMechanismInstaller();
         return installer.createPersistenceSessionFactory(
-                deploymentType, configuration, servicesInjectorSpi
+                deploymentType, configuration, servicesInjector
         );
     }
 

http://git-wip-us.apache.org/repos/asf/isis/blob/66f4825d/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderUsingInstallers.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderUsingInstallers.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderUsingInstallers.java
index ea2afe4..9b3a612 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderUsingInstallers.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderUsingInstallers.java
@@ -168,19 +168,21 @@ public class IsisComponentProviderUsingInstallers extends IsisComponentProviderA
     @Override
     public SpecificationLoaderSpi provideSpecificationLoaderSpi(
             final DeploymentType deploymentType,
+            final ServicesInjectorSpi servicesInjector,
             final Collection<MetaModelRefiner> metaModelRefiners) {
-        return reflectorInstaller.createReflector(deploymentType.getDeploymentCategory(), metaModelRefiners);
+        return reflectorInstaller.createReflector(deploymentType.getDeploymentCategory(), metaModelRefiners,
+                servicesInjector);
     }
 
 
     @Override
     public PersistenceSessionFactory providePersistenceSessionFactory(
             final DeploymentType deploymentType,
-            final ServicesInjectorSpi servicesInjectorSpi,
+            final ServicesInjectorSpi servicesInjector,
             final SpecificationLoaderSpi specificationLoader) {
         return persistenceMechanismInstaller.createPersistenceSessionFactory(
                     deploymentType, getConfiguration(),
-                    servicesInjectorSpi);
+                servicesInjector);
     }
 
     //region > helpers


[10/10] isis git commit: ISIS-1195: fixing errors on home README, fixing version number for archetype page, converting home page README from markdown to asciidoc.

Posted by da...@apache.org.
ISIS-1195: fixing errors on home README, fixing version number for archetype page, converting home page README from markdown to asciidoc.


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/0a4a039b
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/0a4a039b
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/0a4a039b

Branch: refs/heads/master
Commit: 0a4a039b070b2370b0533fe9a5507f05ef7211c5
Parents: 4ec74f8
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Thu Sep 17 10:10:36 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Thu Sep 17 10:10:36 2015 +0100

----------------------------------------------------------------------
 README.adoc                                     | 211 +++++++++++++++++++
 README.md                                       | 193 -----------------
 ..._ug_getting-started_simpleapp-archetype.adoc |   2 +-
 .../src/main/asciidoc/support.adoc              |   3 +-
 4 files changed, 214 insertions(+), 195 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/0a4a039b/README.adoc
----------------------------------------------------------------------
diff --git a/README.adoc b/README.adoc
new file mode 100644
index 0000000..4396b48
--- /dev/null
+++ b/README.adoc
@@ -0,0 +1,211 @@
+= Apache Isis
+
+_http://isis.apache.org[Apache Isis]� software is a framework for rapidly developing domain-driven apps in Java. Write your business logic in entities, domain services and repositories, and the framework dynamically generates a representation of that domain model as a webapp or a RESTful API._
+
+Get started using our "simpleapp" https://isis.apache.org/guides/ug.html#_ug_getting-started_simpleapp-archetype[Maven archetype].
+
+For help and support, join the http://isis.apache.org/support.html[mailing lists]. To contribute to our documentation, see our https://github.com/apache/isis/tree/master/adocs/documentation[Asciidoctor source].
+
+
+
+== Core Features
+
+Isis automatically generates the UI from the domain classes. The following screenshots are taken from the Isis Addons' http://github.com/isisaddons/isis-app-todoapp[todoapp example], which you are free to fork and use as you will. The corresponding domain classes from which this UI was built can be found https://github.com/isisaddons/isis-app-todoapp/tree/0669d6e2acc5bcad1d9978a4514a17bcf7beab1f/dom/src/main/java/todoapp/dom/module/todoitem[here]. 
+
+The todoapp also integrates with a number of other http://www.isisaddons.org[Isis Addons] modules. (Please note that the Isis Addons are not part of ASF, but they are all licensed under Apache License 2.0 and are maintained by the Isis committers).
+
+=== Sign-in
+
+Apache Isis integrates with http://shiro.apache.org[Apache Shiro]�. The core framework supports file-based realms, while the Isis Addons http://github.com/isisaddons/isis-module-security[security module] provides a well-features subdomain of users, roles and permissions against features derived from the Isis metamodel. The example todoapp integrates with the security module.
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/010-login.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/010-login.png"]
+
+=== Install Fixtures
+
+Apache Isis has lots of features to help you prototype and then fully test your application. One such are fixture scripts, which allow pre-canned data to be installed in the running application. This is great to act as the starting point for identifying new stories; later on when the feature is being implemented, the same fixture script can be re-used within that feature's integration tests. (More on tests later).
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/020-install-fixtures.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/020-install-fixtures.png"]
+
+=== Dashboard and View Models
+
+Most of the time the end-user interacts with representations of persistent domain entities, but Isis also supports view models which can aggregate data from multiple sources. The todoapp example uses a "dashboard" view model to list todo items not yet done vs those completed.
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/030-dashboard-view-model.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/030-dashboard-view-model.png"]
+
+In general we recommend to initially focus only on domain entities; this will help drive out a good domain model. Later on view models can be introduced in support of specific use cases.
+
+=== Domain Entity
+
+The screenshot below is of the todoapp's `ToDoItem` domain entity. Like all web pages, this UI is generated at runtime, directly from the domain object itself. There are no controllers or HTML to write.
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/040-domain-entity.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/040-domain-entity.png"]
+
+In addition to the domain entity, Apache Isis allows layout metadata hints to be provided, for example to specify the grouping of properties, the positioning of those groups into columns, the association of actions (the buttons) with properties or collections, the icons on the buttons, and so on. This metadata can be specified either as annotations or in JSON form; the benefit of the latter is that it can be updated (and the UI redrawn) without restarting the app.
+
+Any production-ready app will require this metadata but (like the view models discussed above) this metadata can be added gradually on top of the core domain model.
+
+=== Edit properties
+
+By default properties on domain entities are editable, meaning they can be changed directly. In the todoapp example, the `ToDoItem`'s description is one such editable property:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/050-edit-property.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/050-edit-property.png"]
+
+Note that some of the properties are read-only even in edit mode; individual properties can be made non-editable. It is also possible to make all properties disabled and thus enforce changes only through actions (below).
+
+=== Actions
+
+The other way to modify an entity is to an invoke an action. In the screenshot below the `ToDoItem`'s category and subcategory can be updated together using an action:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/060-invoke-action.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/060-invoke-action.png"]
+
+There are no limitations on what an action can do; it might just update a single object, it could update multiple objects. Or, it might not update any objects at all, but could instead perform some other activity, such as sending out email or printing a document.
+
+In general though, all actions are associated with some object, and are (at least initially) also implemented by that object: good old-fashioned encapsulation. We sometimes use the term "behaviourally complete" for such domain objects.
+
+=== Contributions
+
+As an alternative to placing actions (business logic) on a domain object, it can instead be placed on an (application-scoped, stateless) domain service. When an object is rendered by Apache Isis, it will automatically render all "contributed" behaviour; rather like traits or aspect-oriented mix-ins).
+
+In the screenshot below the highlighted "export as xml" action, the "relative priority" property (and "previous" and "next" actions) and also the "similar to" collection are all contributed:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/065-contributions.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/065-contributions.png"]
+
+Contributions are defined by the signature of the actions on the contributing service. The code snippet below shows how this works for the "export as xml" action:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/067-contributed-action.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/067-contributed-action.png"]
+
+
+
+
+== Extensible Views
+
+The Apache Isis viewer is implemented using http://wicket.apache.org[Apache Wicket]�, and has been architected to be extensible. For example, when a collection of objects is rendered, this is just one several views, as shown in the selector drop-down:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/070-pluggable-views.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/070-pluggable-views.png"]
+
+The Isis Addons' https://github.com/isisaddons/isis-wicket-gmap3[gmap3 component] will render any domain entity (such as `ToDoItem`) that implements its `Locatable` interface:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/080-gmap3-view.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/080-gmap3-view.png"]
+
+Simiarly the Isis Addons' https://github.com/isisaddons/isis-wicket-fullcalendar2[fullcalendar2 component] will render any domain entity (such as `ToDoItem`) that implements its `Calendarable` interface:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/090-fullcalendar2-view.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/090-fullcalendar2-view.png"]
+
+
+Yet another "view" (though this one is rather simpler is that provided by the Isis Addons https://github.com/isisaddons/isis-wicket-excel[excel component]. This provides a download button to the table as a spreadsheet:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/100-excel-view-and-docx.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/100-excel-view-and-docx.png"]
+
+The screenshot above also shows an "export to Word" action. This is _not_ a view but instead is a (contributed) action that uses the Isis Addons https://github.com/isisaddons/isis-module-docx[docx module] to perform a "mail-merge":
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/110-docx.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/110-docx.png"]
+
+
+
+
+== Security, Auditing and other Services
+
+As well as providing extensions to the UI, the Isis addons provides a rich set of modules to support various cross-cutting concerns.
+
+Under the activity menu are four sets of services which provide support for https://github.com/isisaddons/isis-module-sessionlogger[user session logging/auditing], https://github.com/isisaddons/isis-module-command[command profiling], https://github.com/isisaddons/isis-module-audit[(object change) auditing] (shown) and (inter-system) https://github.com/isisaddons/isis-module-publishing[event publishing]:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/120-auditing.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/120-auditing.png"]
+
+In the security menu is access to the rich set of functionality provided by the Isis addons https://github.com/isisaddons/isis-module-security[security module]:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/130-security.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/130-security.png"]
+
+In the prototyping menu is the ability to download a GNU gettext `.po` file for translation. This file can then be translated into multiple languages so that your app can support different locales. Note that this feature is part of Apache Isis core (it is not in Isis Addons):
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/140-i18n.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/140-i18n.png"]
+
+The Isis addons also provides a module for managing application and user https://github.com/isisaddons/isis-module-settings[settings]. Most apps (the todoapp example included) won't expose these services directly, but will usually wrap them in their own app-specific settings service that trivially delegates to the settings module's services:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/150-appsettings.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/150-appsettings.png"]
+
+=== Multi-tenancy support
+
+Of the various Isis addons, the https://github.com/isisaddons/isis-module-security[security module] has the most features. One significant feature is the ability to associate users and objects with a "tenancy". The todoapp uses this feature so that different users' list of todo items are kept separate from one another. A user with administrator is able to switch their own "tenancy" to the tenancy of some other user, in order to access the objects in that tenancy:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/160-switch-tenancy.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/160-switch-tenancy.png"]
+
+For more details, see the https://github.com/isisaddons/isis-module-security[security module] README.
+
+=== Me
+
+Most of the https://github.com/isisaddons/isis-module-security[security module]'s services are on the security module, which would normally be provided only to administrators. Kept separate is the "me" action:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/170-me.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/170-me.png"]
+
+Assuming they have been granted permissions, this allows a user to access an entity representing their own user account:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/180-app-user-entity.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/180-app-user-entity.png"]
+
+If not all of these properties are required, then they can be hidden either using security or though Isis' internal event bus (described below). Conversely, additional properties can be "grafted onto" the user using the contributed properties/collections discussed previously.
+
+=== Themes
+
+Apache Isis' Wicket viewer uses http://getbootstrap.com[Twitter Bootstrap], which means that it can be themed. If more than one theme has been configured for the app, then the viewer allows the end-user to switch their theme:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/190-switch-theme.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/190-switch-theme.png"]
+
+
+
+== REST API
+
+In addition to Isis' Wicket viewer, it also provides a fully fledged REST API, as an implementation of the http://restfulobjects.org[Restful Objects] specification. The screenshot below shows accessing this REST API using a Chrome plugin:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/200-rest-api.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/200-rest-api.png"]
+
+Like the Wicket viewer, the REST API is generated automatically from the domain objects (entities and view models).
+
+
+
+== Integration Testing Support
+
+Earlier on we noted that Apache Isis allows fixtures to be installed through the UI. These same fixture scripts can be reused within integration tests. For example, the code snippet below shows how the `FixtureScripts` service injected into an integration test can then be used to set up data:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/210-fixture-scripts.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/210-fixture-scripts.png"]
+
+The tests themselves are run in junit. While these are integration tests (so talking to a real database), they are no more complex than a regular unit test:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/220-testing-happy-case.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/220-testing-happy-case.png"]
+
+
+To simulate the business rules enforced by Apache Isis, the domain object can be "wrapped" in a proxy. For example, if using the Wicket viewer then Apache Isis will enforce the rule (implemented in the `ToDoItem` class itself) that a completed item cannot have the "completed" action invoked upon it. The wrapper simulates this by throwing an appropriate exception:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/230-testing-wrapper-factory.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/230-testing-wrapper-factory.png"]
+
+
+
+
+== Internal Event Bus
+
+Contributions, discussed earlier, are an important tool in ensuring that the packages within your Isis application are decoupled; by extracting out actions the order of dependency between packages can effectively be reversed.
+
+Another important tool to ensure your codebase remains maintainable is Isis' internal event bus. It is probably best explained by example; the code below says that the "complete" action should emit a `ToDoItem.Completed` event:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/240-domain-events.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/240-domain-events.png"]
+
+Domain service (application-scoped, stateless) can then subscribe to this event:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/250-domain-event-subscriber.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/250-domain-event-subscriber.png"]
+
+And this test verifies that completing an action causes the subscriber to be called:
+
+image::https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/260-domain-event-test.png[link="https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/260-domain-event-test.png"]
+
+In fact, the domain event is fired not once, but (up to) 5 times. It is called 3 times prior to execution, to check that the action is visible, enabled and that arguments are valid. It is then additionally called prior to execution, and also called after execution. What this means is that a subscriber can in either veto access to an action of some publishing object, and/or it can perform cascading updates if the action is allowed to proceed.
+
+Moreover, domain events are fired for all properties and collections, not just actions. Thus, subscribers can therefore switch on or switch off different parts of an application. Indeed, the example todoapp demonstrates this.
+
+
+
+
+== Learning More
+
+The Apache Isis http://isis.apache.org[website] has lots of useful information and is being continually updated.
+
+Or, you can just start coding using the http://isis.apache.org/intro/getting-started/simple-archetype.html[Maven archetype].
+
+And if you need help or support, join the http://isis.apache.org/support.html[mailing lists].
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/0a4a039b/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
deleted file mode 100644
index a17d764..0000000
--- a/README.md
+++ /dev/null
@@ -1,193 +0,0 @@
-Apache Isis
-===========
-
-*[Apache Isis](http://isis.apache.org)™ software is a framework for rapidly developing domain-driven apps in Java.  Write your business logic in entities, domain services and repositories, and the framework dynamically generates a representation of that domain model as a webapp or a RESTful API.*
-
-Get started using the [Maven archetype](http://isis.apache.org/intro/getting-started/simple-archetype.html).
-
-For help and support, join the [mailing lists](http://isis.apache.org/support.html).  To contribute to our documentation, see our [Asciidoctor source](https://github.com/apache/isis/tree/master/adocs/documentation).
-
-
-## Core Features
-
-Isis automatically generates the UI from the domain classes.  The following screenshots are taken from the Isis Addons' [todoapp example](http://github.com/isisaddons/isis-app-todoapp), which you are free to fork and use as you will.   The corresponding domain classes from which this UI was built can be found [here](https://github.com/isisaddons/isis-app-todoapp/tree/0669d6e2acc5bcad1d9978a4514a17bcf7beab1f/dom/src/main/java/todoapp/dom/module/todoitem). 
-
-The todoapp also integrates with a number of other [Isis Addons](http://www.isisaddons.org) modules.  (Please note that the Isis Addons are not part of ASF, but they are all licensed under Apache License 2.0 and are maintained by the Isis committers).
-
-### Sign-in
-
-Apache Isis integrates with [Apache Shiro](http://shiro.apache.org)™.  The core framework supports file-based realms, while the Isis Addons [security module](http://github.com/isisaddons/isis-module-security) provides a well-features subdomain of users, roles and permissions against features derived from the Isis metamodel.  The example todoapp integrates with the security module.
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/010-login.png)
-
-### Install Fixtures
-
-Apache Isis has lots of features to help you prototype and then fully test your application.  One such are fixture scripts, which allow pre-canned data to be installed in the running application.  This is great to act as the starting point for identifying new stories; later on when the feature is being implemented, the same fixture script can be re-used within that feature's integration tests.  (More on tests later).
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/020-install-fixtures.png)
-
-### Dashboard and View Models
-
-Most of the time the end-user interacts with representations of persistent domain entities, but Isis also supports view models which can aggregate data from multiple sources.  The todoapp example uses a "dashboard" view model to list todo items not yet done vs those completed.
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/030-dashboard-view-model.png)
-
-In general we recommend to initially focus only on domain entities; this will help drive out a good domain model.  Later on view models can be introduced in support of specific use cases.
-
-### Domain Entity
-
-The screenshot below is of the todoapp's `ToDoItem` domain entity.  Like all web pages, this UI is generated at runtime, directly from the domain object itself.  There are no controllers or HTML to write.
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/040-domain-entity.png)
-
-In addition to the domain entity, Apache Isis allows layout metadata hints to be provided, for example to specify the grouping of properties, the positioning of those groups into columns, the association of actions (the buttons) with properties or collections, the icons on the buttons, and so on.  This metadata can be specified either as annotations or in JSON form; the benefit of the latter is that it can be updated (and the UI redrawn) without restarting the app.
-
-Any production-ready app will require this metadata but (like the view models discussed above) this metadata can be added gradually on top of the core domain model.
-
-### Edit properties
-
-By default properties on domain entities are editable, meaning they can be changed directly.  In the todoapp example, the `ToDoItem`'s description is one such editable property:
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/050-edit-property.png)
-
-Note that some of the properties are read-only even in edit mode; individual properties can be made non-editable.  It is also possible to make all properties disabled and thus enforce changes only through actions (below).
-
-### Actions
-
-The other way to modify an entity is to an invoke an action.  In the screenshot below the `ToDoItem`'s category and subcategory can be updated together using an action:
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/060-invoke-action.png)
-
-There are no limitations on what an action can do; it might just update a single object, it could update multiple objects.  Or, it might not update any objects at all, but could instead perform some other activity, such as sending out email or printing a document.
-
-In general though, all actions are associated with some object, and are (at least initially) also implemented by that object: good old-fashioned encapsulation.  We sometimes use the term "behaviourally complete" for such domain objects.
-
-### Contributions
-
-As an alternative to placing actions (business logic) on a domain object, it can instead be placed on an (application-scoped, stateless) domain service.  When an object is rendered by Apache Isis, it will automatically render all "contributed" behaviour; rather like traits or aspect-oriented mix-ins).
-
-In the screenshot below the highlighted "export as xml" action, the "relative priority" property (and "previous" and "next" actions) and also the "similar to" collection are all contributed:
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/065-contributions.png)
-
-Contributions are defined by the signature of the actions on the contributing service.  The code snippet below shows how this works for the "export as xml" action:
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/067-contributed-action.png)
-
-## Extensible Views
-
-The Apache Isis viewer is implemented using [Apache Wicket](http://wicket.apache.org)™, and has been architected to be extensible.  For example, when a collection of objects is rendered, this is just one several views, as shown in the selector drop-down:
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/070-pluggable-views.png)
-
-The Isis Addons' [gmap3 component](https://github.com/isisaddons/isis-wicket-gmap3) will render any domain entity (such as `ToDoItem`) that implements its `Locatable` interface:
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/080-gmap3-view.png)
-
-Simiarly the Isis Addons' [fullcalendar2 component](https://github.com/isisaddons/isis-wicket-fullcalendar2) will render any domain entity (such as `ToDoItem`) that implements its `Calendarable` interface:
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/090-fullcalendar2-view.png)
-
-Yet another "view" (though this one is rather simpler is that provided by the Isis Addons [excel component](https://github.com/isisaddons/isis-wicket-excel).  This provides a download button to the table as a spreadsheet:
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/100-excel-view-and-docx.png)
-
-The screenshot above also shows an "export to Word" action.  This is *not* a view but instead is a (contributed) action that uses the Isis Addons [docx module](https://github.com/isisaddons/isis-module-docx) to perform a "mail-merge":
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/110-docx.png)
-
-## Security, Auditing and other Services
-
-As well as providing extensions to the UI, the Isis addons provides a rich set of modules to support various cross-cutting concerns.
-
-Under the activity menu are four sets of services which provide support for [user session logging/auditing](https://github.com/isisaddons/isis-module-sessionlogger), [command profiling](https://github.com/isisaddons/isis-module-command), [(object change) auditing](https://github.com/isisaddons/isis-module-audit) (shown) and (inter-system) [event publishing](https://github.com/isisaddons/isis-module-publishing):
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/120-auditing.png)
-
-In the security menu is access to the rich set of functionality provided by the Isis addons [security module](https://github.com/isisaddons/isis-module-security):
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/130-security.png)
-
-In the prototyping menu is the ability to download a GNU gettext `.po` file for translation.  This file can then be translated into multiple languages so that your app can support different locales.  Note that this feature is part of Apache Isis core (it is not in Isis Addons):
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/140-i18n.png)
-
-The Isis addons also provides a module for managing application and user [settings](https://github.com/isisaddons/isis-module-settings).  Most apps (the todoapp example included) won't expose these services directly, but will usually wrap them in their own app-specific settings service that trivially delegates to the settings module's services:
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/150-appsettings.png)
-
-### Multi-tenancy support
-
-Of the various Isis addons, the [security module](https://github.com/isisaddons/isis-module-security) has the most features.  One significant feature is the ability to associate users and objects with a "tenancy".  The todoapp uses this feature so that different users' list of todo items are kept separate from one another.  A user with administrator is able to switch their own "tenancy" to the tenancy of some other user, in order to access the objects in that tenancy:
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/160-switch-tenancy.png)
-
-For more details, see the [security module](https://github.com/isisaddons/isis-module-security) README.
-
-### Me
-
-Most of the [security module](https://github.com/isisaddons/isis-module-security)'s services are on the security module, which would normally be provided only to administrators.  Kept separate is the "me" action:
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/170-me.png)
-
-Assuming they have been granted permissions, this allows a user to access an entity representing their own user account:
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/180-app-user-entity.png)
-
-If not all of these properties are required, then they can be hidden either using security or though Isis' internal event bus (described below).  Conversely, additional properties can be "grafted onto" the user using the contributed properties/collections discussed previously.
-
-### Themes
-
-Apache Isis' Wicket viewer uses [Twitter Bootstrap](http://getbootstrap.com), which means that it can be themed.  If more than one theme has been configured for the app, then the viewer allows the end-user to switch their theme:
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/190-switch-theme.png)
-
-## REST API
-
-In addition to Isis' Wicket viewer, it also provides a fully fledged REST API, as an implementation of the [Restful Objects](http://restfulobjects.org) specification.  The screenshot below shows accessing this REST API using a Chrome plugin:
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/200-rest-api.png)
-
-Like the Wicket viewer, the REST API is generated automatically from the domain objects (entities and view models).
-
-## Integration Testing Support
-
-Earlier on we noted that Apache Isis allows fixtures to be installed through the UI.  These same fixture scripts can be reused within integration tests.  For example, the code snippet below shows how the  `FixtureScripts` service injected into an integration test can then be used to set up data:
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/210-fixture-scripts.png)
-
-The tests themselves are run in junit.  While these are integration tests (so talking to a real database), they are no more complex than a regular unit test:
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/220-testing-happy-case.png)
-
-To simulate the business rules enforced by Apache Isis, the domain object can be "wrapped" in a proxy.  For example, if using the Wicket viewer then Apache Isis will enforce the rule (implemented in the `ToDoItem` class itself) that a completed item cannot have the "completed" action invoked upon it.  The wrapper simulates this by throwing an appropriate exception:
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/230-testing-wrapper-factory.png)
-
-## Internal Event Bus
-
-Contributions, discussed earlier, are an important tool in ensuring that the packages within your Isis application are decoupled; by extracting out actions the order of dependency between packages can effectively be reversed.
-
-Another important tool to ensure your codebase remains maintainable is Isis' internal event bus.  It is probably best explained by example; the code below says that the "complete" action should emit a `ToDoItem.Completed` event:
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/240-domain-events.png)
-
-Domain service (application-scoped, stateless) can then subscribe to this event:
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/250-domain-event-subscriber.png)
-
-And this test verifies that completing an action causes the subscriber to be called:
-
-![](https://raw.github.com/apache/isis/master/adocs/documentation/src/main/asciidoc/images/isis-in-pictures/260-domain-event-test.png)
-
-In fact, the domain event is fired not once, but (up to) 5 times.  It is called 3 times prior to execution, to check that the action is visible, enabled and that arguments are valid.  It is then additionally called prior to execution, and also called after execution.  What this means is that a subscriber can in either veto access to an action of some publishing object, and/or it can perform cascading updates if the action is allowed to proceed.
-
-Moreover, domain events are fired for all properties and collections, not just actions.  Thus, subscribers can therefore switch on or switch off different parts of an application.  Indeed, the example todoapp demonstrates this.
-
-## Learning More
-
-The Apache Isis [website](http://isis.apache.org) has lots of useful information and is being continually updated.
-
-Or, you can just start coding using the [Maven archetype](http://isis.apache.org/intro/getting-started/simple-archetype.html).
-
-And if you need help or support, join the [mailing lists](http://isis.apache.org/support.html).  

http://git-wip-us.apache.org/repos/asf/isis/blob/0a4a039b/adocs/documentation/src/main/asciidoc/guides/_ug_getting-started_simpleapp-archetype.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ug_getting-started_simpleapp-archetype.adoc b/adocs/documentation/src/main/asciidoc/guides/_ug_getting-started_simpleapp-archetype.adoc
index 0631a36..1cfb0d5 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ug_getting-started_simpleapp-archetype.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ug_getting-started_simpleapp-archetype.adoc
@@ -22,7 +22,7 @@ To build the app from the latest stable release, then run the following command:
 mvn archetype:generate  \
     -D archetypeGroupId=org.apache.isis.archetype \
     -D archetypeArtifactId=simpleapp-archetype \
-    -D archetypeVersion=1.8.0 \
+    -D archetypeVersion=1.9.0 \
     -D groupId=com.mycompany \
     -D artifactId=myapp \
     -D version=1.0-SNAPSHOT \

http://git-wip-us.apache.org/repos/asf/isis/blob/0a4a039b/adocs/documentation/src/main/asciidoc/support.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/support.adoc b/adocs/documentation/src/main/asciidoc/support.adoc
index 174ab17..21c466b 100644
--- a/adocs/documentation/src/main/asciidoc/support.adoc
+++ b/adocs/documentation/src/main/asciidoc/support.adoc
@@ -44,7 +44,7 @@ The Markmail archives span both our current (TLP) mailing lists and also our ori
 
 
 
-[[how-to-subscribe]
+[[how-to-subscribe]]
 == How to subscribe
 
 To subscribe to the `users` mailing list:
@@ -58,6 +58,7 @@ Then, to ask questions, simply mail to link:mailto:users@isis.apache.org[users@i
 If you ever want to unsubscribe, then you can send a mail to the `users-unsubscribe` email address.
 
 
+[[mailing-list-etiquette]]
 == Mailing list etiquette
 
 Just a couple of rules/suggestions:


[09/10] isis git commit: ISIS-1195: recreating simpleapp archetype

Posted by da...@apache.org.
ISIS-1195: recreating simpleapp archetype


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/4ec74f82
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/4ec74f82
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/4ec74f82

Branch: refs/heads/master
Commit: 4ec74f82b06635fcffb48de489de9cd7b635bbf4
Parents: 4cad017
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Thu Sep 17 09:15:07 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Thu Sep 17 09:15:07 2015 +0100

----------------------------------------------------------------------
 .../resources/archetype-resources/dom/pom.xml   |  4 ++-
 .../domainapp/dom/DomainAppDomManifest.java     | 31 +++-----------------
 .../java/domainapp/dom/simple/SimpleObject.java |  1 -
 .../projects/basic/archetype.properties         |  2 +-
 4 files changed, 8 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/4ec74f82/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/pom.xml b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/pom.xml
index 747bacf..db2bcdf 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/pom.xml
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/pom.xml
@@ -154,6 +154,9 @@
         <profile>
             <id>isis-validate</id>
             <activation>
+                <property>
+                    <name>isis-validate</name>
+                </property>
             </activation>
             <build>
                 <plugins>
@@ -163,7 +166,6 @@
                         <version>${isis.version}</version>
                         <configuration>
                             <appManifest>domainapp.dom.DomainAppDomManifest</appManifest>
-                            <isisConfigDir>../webapp/src/main/webapp/WEB-INF</isisConfigDir>
                         </configuration>
                         <dependencies>
                             <dependency>

http://git-wip-us.apache.org/repos/asf/isis/blob/4ec74f82/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/DomainAppDomManifest.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/DomainAppDomManifest.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/DomainAppDomManifest.java
index e7f0875..5bc404b 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/DomainAppDomManifest.java
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/DomainAppDomManifest.java
@@ -30,13 +30,10 @@ import org.apache.isis.applib.AppManifest;
 import org.apache.isis.applib.fixturescripts.FixtureScript;
 
 /**
- * Bootstrap the application.
+ * Provided for <tt>isis-maven-plugin</tt>.
  */
 public class DomainAppDomManifest implements AppManifest {
 
-    /**
-     * Load all services and entities found in (the packages and subpackages within) these modules
-     */
     @Override
     public List<Class<?>> getModules() {
         return Arrays.asList(
@@ -44,44 +41,24 @@ public class DomainAppDomManifest implements AppManifest {
         );
     }
 
-    /**
-     * No additional services.
-     */
     @Override
     public List<Class<?>> getAdditionalServices() {
         return Collections.emptyList();
     }
 
-    /**
-     * Use shiro for authentication.
-     *
-     * <p>
-     *     NB: this is ignored for integration tests, which always use "bypass".
-     * </p>
-     */
     @Override
     public String getAuthenticationMechanism() {
-        return "shiro";
+        return null;
     }
 
-    /**
-     * Use shiro for authorization.
-     *
-     * <p>
-     *     NB: this is ignored for integration tests, which always use "bypass".
-     * </p>
-     */
     @Override
     public String getAuthorizationMechanism() {
-        return "shiro";
+        return null;
     }
 
-    /**
-     * No fixtures.
-     */
     @Override
     public List<Class<? extends FixtureScript>> getFixtures() {
-        return Collections.emptyList();
+        return null;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/isis/blob/4ec74f82/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObject.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
index f756587..954cfe8 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
@@ -115,7 +115,6 @@ public class SimpleObject implements Comparable<SimpleObject> {
         return this;
     }
 
-
     public String default0UpdateName() {
         return getName();
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/4ec74f82/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties b/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
index b0954aa..12eb151 100644
--- a/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
+++ b/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
@@ -1,4 +1,4 @@
-#Wed Sep 16 17:36:27 BST 2015
+#Thu Sep 17 09:14:56 BST 2015
 package=it.pkg
 version=0.1-SNAPSHOT
 groupId=archetype.it


[07/10] isis git commit: ISIS-1195: recreating simpleapp archetype

Posted by da...@apache.org.
ISIS-1195: recreating simpleapp archetype


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/0e65fa53
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/0e65fa53
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/0e65fa53

Branch: refs/heads/master
Commit: 0e65fa5307d9682cc8778b63a8dcccc70fd71ac8
Parents: a701d5e
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Sep 16 17:36:37 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Sep 16 17:36:37 2015 +0100

----------------------------------------------------------------------
 example/archetype/simpleapp/pom.xml             |  2 +-
 .../resources/archetype-resources/dom/pom.xml   | 11 ++-
 .../domainapp/dom/DomainAppDomManifest.java     | 95 ++++++++++++++++++++
 .../java/domainapp/dom/simple/SimpleObject.java |  1 +
 .../main/resources/archetype-resources/pom.xml  | 10 +--
 .../projects/basic/archetype.properties         |  2 +-
 6 files changed, 107 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/0e65fa53/example/archetype/simpleapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/pom.xml b/example/archetype/simpleapp/pom.xml
index 6c2ef4f..0a01558 100644
--- a/example/archetype/simpleapp/pom.xml
+++ b/example/archetype/simpleapp/pom.xml
@@ -17,7 +17,7 @@
   specific language governing permissions and limitations
   under the License.
 -->
-<project xmlns="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/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.apache.isis.archetype</groupId>
     <artifactId>simpleapp-archetype</artifactId>

http://git-wip-us.apache.org/repos/asf/isis/blob/0e65fa53/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/pom.xml b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/pom.xml
index 0a25a19..747bacf 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/pom.xml
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/pom.xml
@@ -76,7 +76,9 @@
         <profile>
             <id>enhance</id>
             <activation>
-                <activeByDefault>true</activeByDefault>
+                <property>
+                    <name>!skip.enhance</name>
+                </property>
             </activation>
             <properties>
                 <datanucleus-maven-plugin.version>4.0.1</datanucleus-maven-plugin.version>
@@ -148,6 +150,7 @@
                 </dependency>
             </dependencies>
         </profile>
+
         <profile>
             <id>isis-validate</id>
             <activation>
@@ -157,15 +160,16 @@
                     <plugin>
                         <groupId>org.apache.isis.tool</groupId>
                         <artifactId>isis-maven-plugin</artifactId>
-                        <version>1.9.0-SNAPSHOT</version>
+                        <version>${isis.version}</version>
                         <configuration>
+                            <appManifest>domainapp.dom.DomainAppDomManifest</appManifest>
                             <isisConfigDir>../webapp/src/main/webapp/WEB-INF</isisConfigDir>
                         </configuration>
                         <dependencies>
                             <dependency>
                                 <groupId>org.apache.isis.example.application</groupId>
                                 <artifactId>simpleapp-dom</artifactId>
-                                <version>${isis.version}</version>
+                                <version>1.10.0-SNAPSHOT</version>
                             </dependency>
                             <!--
                             ... workaround to avoid conflict with plexus-default
@@ -189,6 +193,7 @@
                 </plugins>
             </build>
         </profile>
+
     </profiles>
 
 </project>

http://git-wip-us.apache.org/repos/asf/isis/blob/0e65fa53/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/DomainAppDomManifest.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/DomainAppDomManifest.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/DomainAppDomManifest.java
new file mode 100644
index 0000000..e7f0875
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/DomainAppDomManifest.java
@@ -0,0 +1,95 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ *  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 domainapp.dom;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.isis.applib.AppManifest;
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+/**
+ * Bootstrap the application.
+ */
+public class DomainAppDomManifest implements AppManifest {
+
+    /**
+     * Load all services and entities found in (the packages and subpackages within) these modules
+     */
+    @Override
+    public List<Class<?>> getModules() {
+        return Arrays.asList(
+                DomainAppDomainModule.class  // domain (entities and repositories)
+        );
+    }
+
+    /**
+     * No additional services.
+     */
+    @Override
+    public List<Class<?>> getAdditionalServices() {
+        return Collections.emptyList();
+    }
+
+    /**
+     * Use shiro for authentication.
+     *
+     * <p>
+     *     NB: this is ignored for integration tests, which always use "bypass".
+     * </p>
+     */
+    @Override
+    public String getAuthenticationMechanism() {
+        return "shiro";
+    }
+
+    /**
+     * Use shiro for authorization.
+     *
+     * <p>
+     *     NB: this is ignored for integration tests, which always use "bypass".
+     * </p>
+     */
+    @Override
+    public String getAuthorizationMechanism() {
+        return "shiro";
+    }
+
+    /**
+     * No fixtures.
+     */
+    @Override
+    public List<Class<? extends FixtureScript>> getFixtures() {
+        return Collections.emptyList();
+    }
+
+    /**
+     * No overrides.
+     */
+    @Override
+    public Map<String, String> getConfigurationProperties() {
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0e65fa53/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObject.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
index 954cfe8..f756587 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
@@ -115,6 +115,7 @@ public class SimpleObject implements Comparable<SimpleObject> {
         return this;
     }
 
+
     public String default0UpdateName() {
         return getName();
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/0e65fa53/example/archetype/simpleapp/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/pom.xml b/example/archetype/simpleapp/src/main/resources/archetype-resources/pom.xml
index 9102ca75..3efdb37 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/pom.xml
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/pom.xml
@@ -32,7 +32,7 @@
     </prerequisites>
 
     <properties>
-        <isis.version>1.9.0</isis.version>
+        <isis.version>1.10.0-SNAPSHOT</isis.version>
 
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
@@ -237,14 +237,6 @@
             </dependency>
 
             <dependency>
-                <groupId>org.apache.isis.viewer</groupId>
-                <artifactId>isis-viewer-wicket</artifactId>
-                <version>${isis.version}</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
-
-            <dependency>
                 <groupId>org.assertj</groupId>
                 <artifactId>assertj-core</artifactId>
                 <version>${assertj-core.version}</version>

http://git-wip-us.apache.org/repos/asf/isis/blob/0e65fa53/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties b/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
index 226e46c..b0954aa 100644
--- a/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
+++ b/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
@@ -1,4 +1,4 @@
-#Sat Aug 29 09:06:31 BST 2015
+#Wed Sep 16 17:36:27 BST 2015
 package=it.pkg
 version=0.1-SNAPSHOT
 groupId=archetype.it


[04/10] isis git commit: ISIS-1194: minor refactor of IsisComponentProvider, return ServicesInjector rather than simple list of services

Posted by da...@apache.org.
ISIS-1194: minor refactor of IsisComponentProvider, return ServicesInjector rather than simple list of services


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/fe2b2ba5
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/fe2b2ba5
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/fe2b2ba5

Branch: refs/heads/master
Commit: fe2b2ba55d4b865d4428d56899b7dcc215730e07
Parents: 5e9d281
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Sep 16 07:48:03 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Sep 16 07:48:03 2015 +0100

----------------------------------------------------------------------
 .../org/apache/isis/core/runtime/system/IsisSystem.java     | 3 +--
 .../systemusinginstallers/IsisComponentProvider.java        | 5 +++--
 .../IsisComponentProviderAbstract.java                      | 9 ++++++---
 .../IsisComponentProviderDefault2.java                      | 6 +-----
 4 files changed, 11 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/fe2b2ba5/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystem.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystem.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystem.java
index 5e2dafe..bc635b3 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystem.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystem.java
@@ -142,8 +142,7 @@ public class IsisSystem implements DebugSelection, ApplicationScopedComponent {
             final IsisConfigurationDefault configuration = isisComponentProvider.getConfiguration();
 
             // services
-            final List<Object> services = isisComponentProvider.provideServices();
-            ServicesInjectorDefault servicesInjector = new ServicesInjectorDefault(services);
+            ServicesInjectorDefault servicesInjector = isisComponentProvider.provideServiceInjector();
             servicesInjector.addFallbackIfRequired(FixtureScripts.class, new FixtureScriptsDefault());
             servicesInjector.validateServices();
 

http://git-wip-us.apache.org/repos/asf/isis/blob/fe2b2ba5/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
index 9faa7bd..6916be9 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
@@ -20,10 +20,10 @@
 package org.apache.isis.core.runtime.systemusinginstallers;
 
 import java.util.Collection;
-import java.util.List;
 
 import org.apache.isis.core.commons.config.IsisConfigurationDefault;
 import org.apache.isis.core.metamodel.facetapi.MetaModelRefiner;
+import org.apache.isis.core.metamodel.services.ServicesInjectorDefault;
 import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
 import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
 import org.apache.isis.core.runtime.authentication.AuthenticationManager;
@@ -45,7 +45,8 @@ public interface IsisComponentProvider {
     AuthenticationManager provideAuthenticationManager(DeploymentType deploymentType);
     AuthorizationManager provideAuthorizationManager(final DeploymentType deploymentType);
 
-    List<Object> provideServices();
+    ServicesInjectorDefault provideServiceInjector();
+
 
     FixturesInstaller provideFixturesInstaller();
 

http://git-wip-us.apache.org/repos/asf/isis/blob/fe2b2ba5/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderAbstract.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderAbstract.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderAbstract.java
index 78ea3c3..2a645b8 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderAbstract.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderAbstract.java
@@ -41,6 +41,7 @@ import org.apache.isis.applib.services.classdiscovery.ClassDiscoveryServiceUsing
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.config.IsisConfigurationDefault;
 import org.apache.isis.core.commons.lang.ClassUtil;
+import org.apache.isis.core.metamodel.services.ServicesInjectorDefault;
 import org.apache.isis.core.runtime.authentication.AuthenticationManager;
 import org.apache.isis.core.runtime.authorization.AuthorizationManager;
 import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
@@ -204,7 +205,7 @@ public abstract class IsisComponentProviderAbstract implements IsisComponentProv
     //endregion
 
     //region > API impl.
-    
+
     @Override
     public DeploymentType getDeploymentType() {
         return deploymentType;
@@ -231,9 +232,11 @@ public abstract class IsisComponentProviderAbstract implements IsisComponentProv
     }
 
     @Override
-    public List<Object> provideServices() {
-        return services;
+    public ServicesInjectorDefault provideServiceInjector() {
+        return new ServicesInjectorDefault(services);
     }
+
     //endregion
 
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/fe2b2ba5/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderDefault2.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderDefault2.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderDefault2.java
index 10e6e6d..6356335 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderDefault2.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderDefault2.java
@@ -39,6 +39,7 @@ import org.apache.isis.core.metamodel.layoutmetadata.LayoutMetadataReader;
 import org.apache.isis.core.metamodel.layoutmetadata.json.LayoutMetadataReaderFromJson;
 import org.apache.isis.core.metamodel.metamodelvalidator.dflt.MetaModelValidatorDefault;
 import org.apache.isis.core.metamodel.progmodel.ProgrammingModel;
+import org.apache.isis.core.metamodel.services.ServicesInjectorDefault;
 import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
 import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
 import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidator;
@@ -232,11 +233,6 @@ public class IsisComponentProviderDefault2 extends IsisComponentProviderAbstract
     }
 
     @Override
-    public List<Object> provideServices() {
-        return services;
-    }
-
-    @Override
     public FixturesInstaller provideFixturesInstaller()  {
         return fixturesInstaller;
     }


[03/10] isis git commit: ISIS-1194: inlining IsisSessionFactory#init, combining ObjectReflectorDefault's init() and setRuntimeContext

Posted by da...@apache.org.
ISIS-1194: inlining IsisSessionFactory#init, combining ObjectReflectorDefault's init() and setRuntimeContext


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/5e9d2813
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/5e9d2813
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/5e9d2813

Branch: refs/heads/master
Commit: 5e9d28136451adf5dbb949cbd46a35d6f2069568
Parents: d0bf6e0
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Sep 16 07:42:44 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Sep 16 07:42:44 2015 +0100

----------------------------------------------------------------------
 .../isis/core/metamodel/app/IsisMetaModel.java  |  4 +-
 .../services/ServicesInjectorDefault.java       | 19 ------
 .../metamodel/services/ServicesInjectorSpi.java |  2 -
 .../services/ServicesInjectorSpiDelegator.java  | 67 --------------------
 .../metamodel/spec/SpecificationLoaderSpi.java  |  6 +-
 .../specloader/ObjectReflectorDefault.java      | 32 ++++------
 .../metamodel/facets/ProgrammableReflector.java | 16 +----
 .../ObjectReflectorDefaultTestAbstract.java     |  6 +-
 .../isis/core/runtime/system/IsisSystem.java    | 45 ++++++++-----
 .../system/session/IsisSessionFactory.java      | 30 ---------
 10 files changed, 54 insertions(+), 173 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/5e9d2813/core/metamodel/src/main/java/org/apache/isis/core/metamodel/app/IsisMetaModel.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/app/IsisMetaModel.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/app/IsisMetaModel.java
index b6a9874..79e568a 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/app/IsisMetaModel.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/app/IsisMetaModel.java
@@ -122,9 +122,7 @@ public class IsisMetaModel implements ApplicationScopedComponent {
     public void init() {
         ensureNotInitialized();
 
-        runtimeContext.injectInto(specificationLoader);
-
-        specificationLoader.initialize();
+        specificationLoader.initialize(runtimeContext);
 
         for (final Object service : servicesInjector.getRegisteredServices()) {
             final ObjectSpecification serviceSpec = specificationLoader.loadSpecification(service.getClass());

http://git-wip-us.apache.org/repos/asf/isis/blob/5e9d2813/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorDefault.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorDefault.java
index 8761a9b..0813295 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorDefault.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorDefault.java
@@ -48,8 +48,6 @@ import org.apache.isis.core.commons.util.ToString;
 import org.apache.isis.core.metamodel.exceptions.MetaModelException;
 import org.apache.isis.core.metamodel.runtimecontext.ServicesInjectorAware;
 import org.apache.isis.core.metamodel.spec.InjectorMethodEvaluator;
-import org.apache.isis.core.metamodel.spec.SpecificationLoader;
-import org.apache.isis.core.metamodel.spec.SpecificationLoaderAware;
 import org.apache.isis.core.metamodel.specloader.InjectorMethodEvaluatorDefault;
 import org.apache.isis.core.metamodel.specloader.ServiceInitializer;
 
@@ -81,12 +79,6 @@ public class ServicesInjectorDefault implements ServicesInjectorSpi {
 
     /**
      * For testing.  
-     * 
-     * <p>
-     *     In production code, {@link #setSpecificationLoader(org.apache.isis.core.metamodel.spec.SpecificationLoader)}
-     *     Pis used instead.
-     * </p>
-     * @param injectorMethodEvaluator
      */
     public ServicesInjectorDefault(final List<Object> services, final InjectorMethodEvaluator injectorMethodEvaluator) {
         this.services.addAll(services);
@@ -95,17 +87,6 @@ public class ServicesInjectorDefault implements ServicesInjectorSpi {
         autowireServicesAndContainer();
     }
 
-//region > init, shutdown
-
-    public void init() {
-        autowireServicesAndContainer();
-    }
-
-    public void shutdown() {
-    }
-
-    //endregion
-
     //region > replaceServices
 
     @Override

http://git-wip-us.apache.org/repos/asf/isis/blob/5e9d2813/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorSpi.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorSpi.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorSpi.java
index 9bf8d01..ef8f7e6 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorSpi.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorSpi.java
@@ -30,8 +30,6 @@ import org.apache.isis.core.metamodel.runtimecontext.ServicesInjector;
  */
 public interface ServicesInjectorSpi extends ApplicationScopedComponent, ServicesInjector {
 
-    public void init();
-
     /**
      * Update an individual service.
      *

http://git-wip-us.apache.org/repos/asf/isis/blob/5e9d2813/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorSpiDelegator.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorSpiDelegator.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorSpiDelegator.java
deleted file mode 100644
index 5cdf24a..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/ServicesInjectorSpiDelegator.java
+++ /dev/null
@@ -1,67 +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.services;
-
-import java.util.List;
-import org.apache.isis.core.metamodel.runtimecontext.ServicesInjector;
-import org.apache.isis.core.metamodel.runtimecontext.ServicesInjectorAware;
-
-public class ServicesInjectorSpiDelegator implements ServicesInjector {
-
-    private org.apache.isis.core.metamodel.services.ServicesInjectorSpi servicesInjectorSpi;
-
-    public void setServicesInjectorSpi(org.apache.isis.core.metamodel.services.ServicesInjectorSpi servicesInjectorSpi) {
-        this.servicesInjectorSpi = servicesInjectorSpi;
-        servicesInjectorSpi.init();
-    }
-
-    @Override
-    public List<Object> getRegisteredServices() {
-        return servicesInjectorSpi.getRegisteredServices();
-    }
-
-    @Override
-    public void injectServicesInto(Object domainObject) {
-        servicesInjectorSpi.injectServicesInto(domainObject);
-    }
-
-    @Override
-    public void injectServicesInto(List<Object> domainObjects) {
-        servicesInjectorSpi.injectServicesInto(domainObjects);
-    }
-
-    @Override
-    public <T> T lookupService(Class<T> serviceClass) {
-        return servicesInjectorSpi.lookupService(serviceClass);
-    }
-
-    @Override
-    public <T> List<T> lookupServices(Class<T> serviceClass) {
-        return servicesInjectorSpi.lookupServices(serviceClass);
-    }
-
-    @Override
-    public void injectInto(Object candidate) {
-        if (ServicesInjectorAware.class.isAssignableFrom(candidate.getClass())) {
-            final ServicesInjectorAware cast = ServicesInjectorAware.class.cast(candidate);
-            cast.setServicesInjector(this);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/5e9d2813/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoaderSpi.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoaderSpi.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoaderSpi.java
index ca1d679..4f06391 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoaderSpi.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoaderSpi.java
@@ -21,14 +21,14 @@ package org.apache.isis.core.metamodel.spec;
 
 import org.apache.isis.core.commons.components.ApplicationScopedComponent;
 import org.apache.isis.core.commons.debug.DebuggableWithTitle;
-import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
+import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
 
 public interface SpecificationLoaderSpi extends ApplicationScopedComponent, DebuggableWithTitle, SpecificationLoader {
 
     void injectInto(final Object candidate);
 
-    public void init();
-    public void shutdown();
+    void init(final RuntimeContext runtimeContext);
+    void shutdown();
 
     void invalidateCacheFor(Object domainObject);
     

http://git-wip-us.apache.org/repos/asf/isis/blob/5e9d2813/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefault.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefault.java
index 5a56437..cdea01b 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefault.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefault.java
@@ -50,7 +50,6 @@ import org.apache.isis.core.metamodel.layoutmetadata.LayoutMetadataReader;
 import org.apache.isis.core.metamodel.progmodel.ProgrammingModel;
 import org.apache.isis.core.metamodel.runtimecontext.PersistenceSessionService;
 import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContextAware;
 import org.apache.isis.core.metamodel.runtimecontext.ServicesInjector;
 import org.apache.isis.core.metamodel.runtimecontext.ServicesInjectorAware;
 import org.apache.isis.core.metamodel.runtimecontext.noruntime.RuntimeContextNoRuntime;
@@ -100,7 +99,7 @@ import static org.hamcrest.Matchers.notNullValue;
  * <p>
  * In addition, the {@link RuntimeContext} can optionally be injected, but will
  * default to {@link RuntimeContextNoRuntime} if not provided prior to
- * {@link #init() initialization}. The purpose of {@link RuntimeContext} is to
+ * {@link SpecificationLoaderSpi#init(RuntimeContext) initialization}. The purpose of {@link RuntimeContext} is to
  * allow the metamodel to be used standalone, for example in a Maven plugin. The
  * {@link RuntimeContextNoRuntime} implementation will through an exception for
  * any methods (such as finding an {@link ObjectAdapter adapter}) because there
@@ -110,7 +109,8 @@ import static org.hamcrest.Matchers.notNullValue;
  * to its <tt>IsisContext</tt>.
  */
 
-public final class ObjectReflectorDefault implements SpecificationLoaderSpi, ApplicationScopedComponent, RuntimeContextAware, DebuggableWithTitle {
+public final class ObjectReflectorDefault
+        implements SpecificationLoaderSpi, ApplicationScopedComponent, DebuggableWithTitle {
 
     private final static Logger LOG = LoggerFactory.getLogger(ObjectReflectorDefault.class);
 
@@ -123,7 +123,7 @@ public final class ObjectReflectorDefault implements SpecificationLoaderSpi, App
 
     /**
      * <p>
-     * {@link FacetDecorator}s must be added prior to {@link #init()
+     * {@link FacetDecorator}s must be added prior to {@link SpecificationLoaderSpi#init(RuntimeContext)
      * initialization.}
      */
     private final FacetDecoratorSet facetDecoratorSet;
@@ -200,10 +200,11 @@ public final class ObjectReflectorDefault implements SpecificationLoaderSpi, App
     /**
      * Initializes and wires up, and primes the cache based on any service
      * classes (provided by the {@link ServicesInjectorSpi}).
+     * @param runtimeContext
      */
-    public void init() {
+    public void init(final RuntimeContext runtimeContext) {
 
-        initialize();
+        initialize(runtimeContext);
 
         cacheBySpecId();
         
@@ -225,20 +226,22 @@ public final class ObjectReflectorDefault implements SpecificationLoaderSpi, App
         return validationFailures;
     }
 
-    public void initialize() {
+    public void initialize(final RuntimeContext runtimeContext) {
+        this.runtimeContext = runtimeContext;
+
         if (LOG.isDebugEnabled()) {
             LOG.debug("initialising " + this);
         }
 
         // default subcomponents
-        if (runtimeContext == null) {
-            runtimeContext = new RuntimeContextNoRuntime(servicesInjector, this);
+        if (this.runtimeContext == null) {
+            this.runtimeContext = new RuntimeContextNoRuntime(servicesInjector, this);
         }
 
         injectInto(metaModelValidator);
 
         // wire subcomponents into each other
-        runtimeContext.injectInto(facetProcessor);
+        this.runtimeContext.injectInto(facetProcessor);
 
         // initialize subcomponents
         facetDecoratorSet.init();
@@ -595,19 +598,12 @@ public final class ObjectReflectorDefault implements SpecificationLoaderSpi, App
     // ////////////////////////////////////////////////////////////////////
 
     /**
-     * As per {@link #setRuntimeContext(RuntimeContext)}.
+     * Injected in {@link #initialize(RuntimeContext)}.
      */
     public RuntimeContext getRuntimeContext() {
         return runtimeContext;
     }
 
-    /**
-     * Due to {@link RuntimeContextAware}.
-     */
-    @Override
-    public void setRuntimeContext(final RuntimeContext runtimeContext) {
-        this.runtimeContext = runtimeContext;
-    }
 
     // ////////////////////////////////////////////////////////////////////
     // Dependencies (setters, optional)

http://git-wip-us.apache.org/repos/asf/isis/blob/5e9d2813/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/ProgrammableReflector.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/ProgrammableReflector.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/ProgrammableReflector.java
index d243501..90dcdd7 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/ProgrammableReflector.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/ProgrammableReflector.java
@@ -19,25 +19,21 @@
 
 package org.apache.isis.core.metamodel.facets;
 
-import java.lang.reflect.Method;
 import java.util.Collection;
 import java.util.List;
-import java.util.Map;
-import com.google.common.collect.Maps;
+
 import org.apache.isis.core.commons.components.ApplicationScopedComponent;
 import org.apache.isis.core.commons.debug.DebugBuilder;
 import org.apache.isis.core.commons.exceptions.NotYetImplementedException;
 import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContextAware;
-import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
 import org.apache.isis.core.metamodel.spec.ObjectSpecId;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.SpecificationLoaderAbstract;
 import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
 
-public class ProgrammableReflector extends SpecificationLoaderAbstract implements SpecificationLoaderSpi, ApplicationScopedComponent, RuntimeContextAware {
+public class ProgrammableReflector extends SpecificationLoaderAbstract implements SpecificationLoaderSpi, ApplicationScopedComponent {
 
-    public void init() {
+    public void init(final RuntimeContext runtimeContext) {
     }
 
     public void shutdown() {
@@ -80,12 +76,6 @@ public class ProgrammableReflector extends SpecificationLoaderAbstract implement
     public void injectInto(final Object candidate) {
     }
 
-
-    @Override
-    public void setRuntimeContext(final RuntimeContext runtimeContext) {
-        // ignored
-    }
-
     @Override
     public void debugData(final DebugBuilder debug) {
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/5e9d2813/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefaultTestAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefaultTestAbstract.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefaultTestAbstract.java
index 5bb9269..cdf9399 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefaultTestAbstract.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/ObjectReflectorDefaultTestAbstract.java
@@ -91,12 +91,12 @@ public abstract class ObjectReflectorDefaultTestAbstract {
                         new ProgrammingModelFacetsJava5(),
                         new HashSet<FacetDecorator>(),
                         new MetaModelValidatorDefault(),
-                        Lists.<LayoutMetadataReader>newArrayList(new LayoutMetadataReaderFromJson()), mockServicesInjector);
+                        Lists.<LayoutMetadataReader>newArrayList(
+                                new LayoutMetadataReaderFromJson()), mockServicesInjector);
         runtimeContext =
                 new RuntimeContextNoRuntime(
                         new ServicesInjectorDefault(Collections.emptyList()), reflector);
-        reflector.setRuntimeContext(runtimeContext);
-        reflector.init();
+        reflector.init(runtimeContext);
         
         specification = loadSpecification(reflector);
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/5e9d2813/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystem.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystem.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystem.java
index 603d74e..5e2dafe 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystem.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystem.java
@@ -28,6 +28,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.clock.Clock;
+import org.apache.isis.applib.fixtures.FixtureClock;
 import org.apache.isis.applib.fixtures.LogonFixture;
 import org.apache.isis.applib.fixturescripts.FixtureScripts;
 import org.apache.isis.applib.services.fixturespec.FixtureScriptsDefault;
@@ -123,6 +125,17 @@ public class IsisSystem implements DebugSelection, ApplicationScopedComponent {
         localeInitializer.initLocale(getConfiguration());
         timeZoneInitializer.initTimeZone(getConfiguration());
 
+        // a bit of a workaround, but required if anything in the metamodel (for
+        // example, a
+        // ValueSemanticsProvider for a date value type) needs to use the Clock
+        // singleton
+        // we do this after loading the services to allow a service to prime a
+        // different clock
+        // implementation (eg to use an NTP time service).
+        if (!deploymentType.isProduction() && !Clock.isInitialized()) {
+            FixtureClock.initialize();
+        }
+
         try {
 
             // configuration
@@ -144,41 +157,48 @@ public class IsisSystem implements DebugSelection, ApplicationScopedComponent {
             final Collection<MetaModelRefiner> metaModelRefiners =
                     refiners(authenticationManager, authorizationManager,
                             new PersistenceSessionFactoryMetamodelRefiner());
-            final SpecificationLoaderSpi specificationLoader1 =
+            final SpecificationLoaderSpi specificationLoader =
                     isisComponentProvider.provideSpecificationLoaderSpi(deploymentType, servicesInjector, metaModelRefiners);
 
             // persistenceSessionFactory
             final PersistenceSessionFactory persistenceSessionFactory =
                     isisComponentProvider.providePersistenceSessionFactory(
-                            deploymentType, servicesInjector, specificationLoader1);
+                            deploymentType, servicesInjector, specificationLoader);
 
             // runtimeContext
             final RuntimeContextFromSession runtimeContext =
                     new RuntimeContextFromSession(
                             deploymentType.getDeploymentCategory(), configuration,
-                            servicesInjector, specificationLoader1);
+                            servicesInjector, specificationLoader);
 
             // wire up components and components into services...
-            runtimeContext.injectInto(specificationLoader1);
+            runtimeContext.injectInto(specificationLoader);
 
             for (Object service : servicesInjector.getRegisteredServices()) {
                 runtimeContext.injectInto(service);
             }
 
-            // finally instantiate
+            // instantiate
             sessionFactory = new IsisSessionFactory(
-                    deploymentType, configuration, servicesInjector, specificationLoader1,
+                    deploymentType, configuration, servicesInjector, specificationLoader,
                     authenticationManager, authorizationManager, persistenceSessionFactory);
 
             // temporarily make a configuration available
             // TODO: REVIEW: would rather inject this, or perhaps even the ConfigurationBuilder
-            IsisContext.setConfiguration(getConfiguration());
+            IsisContext.setConfiguration(configuration);
+
+            // set up the "appropriate" IsisContext (usually IsisContextThreadLocal) to hold
+            // a reference to the sessionFactory just created
+            deploymentType.initContext(sessionFactory);
+
+            specificationLoader.init(runtimeContext);
 
-            initContext(sessionFactory);
-            sessionFactory.init();
+            authenticationManager.init();
+            authorizationManager.init();
+
+            persistenceSessionFactory.init();
 
             // validate here after all entities have been registered in the persistence session factory
-            final SpecificationLoaderSpi specificationLoader = sessionFactory.getSpecificationLoader();
             specificationLoader.validateAndAssert();
 
             // store simply so can do postConstruct when shutdown
@@ -198,11 +218,6 @@ public class IsisSystem implements DebugSelection, ApplicationScopedComponent {
         return ListExtensions.filtered(Arrays.asList(possibleRefiners), MetaModelRefiner.class);
     }
 
-
-    private void initContext(final IsisSessionFactory sessionFactory) {
-        getDeploymentType().initContext(sessionFactory);
-    }
-
     /**
      * @see #shutdownServices(ServiceInitializer)
      */

http://git-wip-us.apache.org/repos/asf/isis/blob/5e9d2813/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactory.java
index 48267b1..0e3b9a9 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactory.java
@@ -109,36 +109,6 @@ public class IsisSessionFactory implements ApplicationScopedComponent {
     // init, shutdown
     // ///////////////////////////////////////////
 
-    /**
-     * Wires components as necessary, and then init}ializes all.
-     */
-    public void init() {
-
-        // a bit of a workaround, but required if anything in the metamodel (for
-        // example, a
-        // ValueSemanticsProvider for a date value type) needs to use the Clock
-        // singleton
-        // we do this after loading the services to allow a service to prime a
-        // different clock
-        // implementation (eg to use an NTP time service).
-        if (!deploymentType.isProduction() && !Clock.isInitialized()) {
-            FixtureClock.initialize();
-        }
-
-        specificationLoaderSpi.init();
-
-        // must come after init of spec loader.
-        specificationLoaderSpi.injectInto(persistenceSessionFactory);
-
-        authenticationManager.init();
-        authorizationManager.init();
-
-        servicesInjector.init();
-
-        persistenceSessionFactory.init();
-    }
-
-
     public void shutdown() {
         persistenceSessionFactory.shutdown();
         authenticationManager.shutdown();


[08/10] isis git commit: ISIS-1195: updating docs for isis-maven-plugin.

Posted by da...@apache.org.
ISIS-1195: updating docs for isis-maven-plugin.


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/4cad0178
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/4cad0178
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/4cad0178

Branch: refs/heads/master
Commit: 4cad017829b121eaa560febfaca155fc1a2f83f6
Parents: 0e65fa5
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Thu Sep 17 09:14:16 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Thu Sep 17 09:14:16 2015 +0100

----------------------------------------------------------------------
 .../src/main/asciidoc/documentation.adoc        |   6 +-
 .../main/asciidoc/guides/_cg_building-isis.adoc |   8 +-
 .../asciidoc/guides/_cg_isis-maven-plugin.adoc  | 253 ++++++++++++++++++-
 ...ding_programming-model_custom-validator.adoc |   2 +-
 example/application/simpleapp/dom/pom.xml       |   5 +-
 .../domainapp/dom/DomainAppDomManifest.java     |  31 +--
 .../java/domainapp/dom/simple/SimpleObject.java |   1 -
 recreate_archetype_RELEASE.sh                   |   7 +-
 recreate_archetype_SNAPSHOT.sh                  |   6 +-
 9 files changed, 274 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/4cad0178/adocs/documentation/src/main/asciidoc/documentation.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/documentation.adoc b/adocs/documentation/src/main/asciidoc/documentation.adoc
index 36a8e9b..829ed57 100644
--- a/adocs/documentation/src/main/asciidoc/documentation.adoc
+++ b/adocs/documentation/src/main/asciidoc/documentation.adoc
@@ -98,8 +98,8 @@ including:
 * Setting up link:./guides/cg.html#_cg_ide_intellij[IntelliJ] or link:./guides/cg.html#_cg_ide_eclipse[Eclipse]
 * link:./guides/cg.html#_cg_ide-templates[*IDE templates*] (IntelliJ and Eclipse)
 * link:./guides/cg.html#_cg_contributing[Contributing patches] (pull requests)
-* link:./guides/cg.html#_cg_committers_cutting-a-release[Cutting a release]
-* link:./guides/cg.html#_cg_committers_verifying-releases[Verifying a release]
+* link:./guides/cg.html#_cg_isis-maven-plugin[Isis Maven plugin]
+* link:./guides/cg.html#_cg_committers_cutting-a-release[Cutting a release] ; link:./guides/cg.html#_cg_committers_verifying-releases[Verifying a release]
 
 
 
@@ -116,6 +116,8 @@ including:
 * http://github.com/estatio/estatio[Estatio] (not ASF)
 * http://github.com/isisaddons/isis-app-todoapp[TodoApp Example App] (not ASF)
 * http://github.com/isisaddons/isis-app-kitchensink[Kitchensink App] (not ASF)
+* http://github.com/isisaddons/isis-app-neoapp[Neo4J Example App] (not ASF)
+* http://github.com/isisaddons/isis-app-simpledsl[Isis DSL Example App] (not ASF)
 
 
 

http://git-wip-us.apache.org/repos/asf/isis/blob/4cad0178/adocs/documentation/src/main/asciidoc/guides/_cg_building-isis.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_cg_building-isis.adoc b/adocs/documentation/src/main/asciidoc/guides/_cg_building-isis.adoc
index 6354326..dd45a28 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_cg_building-isis.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_cg_building-isis.adoc
@@ -140,15 +140,15 @@ Install Maven 3.0.x, downloadable http://maven.apache.org/download.html[here].
 
 Set `MAVEN_OPTS` environment variable:
 
-[source,ini]
+[source,bash]
 ----
-MAVEN_OPTS=-Xms512m -Xmx1024m -XX:MaxPermSize=256m
+export MAVEN_OPTS="-Xms512m -Xmx1024m"
 ----
 
 
 [NOTE]
 ====
-Previously we suggested `128m` for the `MaxPermSize`, but that would no longer seem to be sufficient.
+Previously we suggested `-XX:MaxPermSize=256m`, but this option has been removed in Java 8.  (As of 1.9.0, Apache Isis is built using Java 8 but with source and target set to JDK 1.7).
 ====
 
 
@@ -168,7 +168,7 @@ Thereafter you can speed up the build by adding the `-o` (offline flag).  To sav
 
 [source,bash]
 ----
-export MAVEN_OPTS="-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
+export MAVEN_OPTS="-Xms512m -Xmx1024m -XX:+TieredCompilation -XX:TieredStopAtLevel=1"
 mvn clean install -o -T1C
 ----
 

http://git-wip-us.apache.org/repos/asf/isis/blob/4cad0178/adocs/documentation/src/main/asciidoc/guides/_cg_isis-maven-plugin.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_cg_isis-maven-plugin.adoc b/adocs/documentation/src/main/asciidoc/guides/_cg_isis-maven-plugin.adoc
index 01bb257..f18c301 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_cg_isis-maven-plugin.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_cg_isis-maven-plugin.adoc
@@ -5,6 +5,257 @@
 :_imagesdir: images/
 :toc: right
 
-NOTE: TODO
+
+The Apache Isis programming model requires that a number of naming conventions are followed.
+
+For example, the validator will detect any orphaned supporting methods (eg `hideXxx()`) if the corresponding property or action has been renamed or deleted but the supporting method was not also updated.  Another example is that a class cannot have a title specified both using `title()` method and also using `@Title` annotation.
+
+When running the application these are enforced by the `MetaModelValidator` component that detects these errors, failing fast.
+
+The purpose of the `isis-maven-plugin` is to enforce these naming conventions at build time, typically enforced by way of a continuous integration server.
+
+[NOTE]
+====
+The instructions given here relate to `1.10.0-SNAPSHOT`.   The plugin was also released for `1.9.0`, but with a slightly different configuration; see the final section for differences.
+====
+
+== `dom` project
+
+To start with, we need an xref:rg.adoc#_rg_classes_AppManifest-bootstrapping[`AppManifest`] to point the plugin at so that it knows which services and entities are to be validated.
+
+This can be extremely minimal.  For example, the xref:ug.adoc#_ug_getting-started_simpleapp-archetype[SimpleApp]'s manifest is:
+
+[source,java]
+----
+package domainapp.dom;
+...
+public class DomainAppDomManifest implements AppManifest {
+    @Override
+    public List<Class<?>> getModules() {
+        return Arrays.asList(
+                DomainAppDomainModule.class  // domain (entities and repositories)
+        );
+    }
+    @Override
+    public List<Class<?>> getAdditionalServices() { return Collections.emptyList(); }
+    @Override
+    public String getAuthenticationMechanism() { return null; }
+    @Override
+    public String getAuthorizationMechanism() { return null; }
+    @Override
+    public List<Class<? extends FixtureScript>> getFixtures() { return null; }
+    @Override
+    public Map<String, String> getConfigurationProperties() { return null; }
+}
+----
+
+where `DomainAppDomainModule` simply identifies the package for the manifest to search under:
+
+[source,java]
+----
+package domainapp.dom;
+public final class DomainAppDomainModule {
+}
+----
+
+Next, update the `pom.xml` (in your project's `dom` module):
+
+[source,xml]
+----
+<profile>
+    <id>isis-validate</id>
+    <activation>
+        <property>
+            <name>isis-validate</name>                                                  <!-- 1 -->
+        </property>
+    </activation>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.isis.tool</groupId>
+                <artifactId>isis-maven-plugin</artifactId>
+                <version>${isis.version}</version>                                      <!-- 2 -->
+                <configuration>
+                    <appManifest>domainapp.dom.DomainAppDomManifest</appManifest>       <!-- 3 -->
+                </configuration>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.isis.example.application</groupId>          <!-- 4 -->
+                        <artifactId>simpleapp-dom</artifactId>
+                        <version>1.10.0-SNAPSHOT</version>
+                    </dependency>
+                    <!-- workaround to avoid conflict with plexus-default -->
+                    <dependency>
+                        <groupId>com.google.guava</groupId>
+                        <artifactId>guava</artifactId>
+                        <version>16.0.1</version>
+                    </dependency>
+                </dependencies>
+                <executions>
+                    <execution>
+                        <phase>test</phase>
+                        <goals>
+                            <goal>validate</goal>                                       <!-- 5 -->
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</profile>
+----
+<1> the profile can be activated using `-Disis-validate`
+<2> set to `1.10.0-SNAPSHOT` or any later version
+<3> the manifest discussed previously; adjust as required
+<4> the `dom` module containing itself; adjust as required
+<5> binds the plugin's `validate` goal to the Maven `test` lifecycle phase (ie will be called using `mvn test`).
+
+
+
+
+== To run
+
+The plugin is activated by enabling the profile and invoking the `test` phase:
+
+[source,bash]
+----
+mvn test -Disis-validate
+----
+
+This will run any tests, and then also - because the plugin is activated by the `isis-validate` property and bound to the `test` phase, will run the plugin's `validate` goal.
+
+
+
+
+== Example of failure
+
+In the xref:ug.adoc#_ug_getting-started_simpleapp-archetype[SimpleApp] application the `SimpleObject` defines an `updateName` action.  This has a supporting method:
+
+
+[source,java]
+----
+public SimpleObject updateName( ... ) { ... }
+public String default0UpdateName() { ... }
+----
+
+We can introduce an error by misspelling the supporting method, for example:
+
+[source,java]
+----
+public String default0XUpdateName() { ... }
+----
+
+Running `mvn -Disis-valdate test` then generates this output:
+
+
+[source,bash]
+----
+[error]
+[error]
+[error]
+[error] domainapp.dom.simple.SimpleObject#default0XUpdateName: has prefix default, is probably a supporting method for a property, collection or action.  If the method is intended to be an action, then rename and use @ActionLayout(named="...") or ignore completely using @Programmatic
+[error]
+[error]
+[error]
+[INFO] ------------------------------------------------------------------------
+[INFO] Reactor Summary:
+[INFO]
+[INFO] Simple App ......................................... SUCCESS [  0.087 s]
+[INFO] Simple App DOM ..................................... FAILURE [  4.182 s]
+[INFO] Simple App Fixtures ................................ SKIPPED
+[INFO] Simple App Application ............................. SKIPPED
+[INFO] Simple App Integration Tests ....................... SKIPPED
+[INFO] Simple App Webapp .................................. SKIPPED
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD FAILURE
+[INFO] ------------------------------------------------------------------------
+[INFO] ...
+[ERROR] Failed to execute goal org.apache.isis.tool:isis-maven-plugin:1.10.0-SNAPSHOT:validate (default) on project simpleapp-dom: 1 problems found. -> [Help 1]
+----
+
+If one were to attempt to run the application, the same error would appear in the log files on startup (and the application would not boot).
+
+
+
+
+== Custom validation rules
+
+It is also possible to customize the validation, explained xref:ug.adoc#_ug_extending_programming-model_custom-validator[here].  For example, you could enforce project-specific conventions by implementing a custom `MetaModelValidator`, and registering using a configuration property.
+
+To support this using `AppManifest`s, override its `getConfigurationProperties()` method:
+
+[source,ini]
+----
+public class DomainAppDomManifest implements AppManifest {
+    ...
+    public Map<String, String> getConfigurationProperties() {
+        final Map<String, String> map = Maps.newTreeMap();
+        map.put("isis.reflector.validator","com.mycompany.myapp.MyMetaModelValidator");
+        return map;
+    }
+}
+----
+
+
+== 1.9.0 version
+
+The `1.9.0` version of the plugin requires slightly different configuratoin.  Rather than using an `AppManifest`, instead the configuration directory containing `isis.properties` is specified:
+
+[source,xml]
+----
+<profile>
+    <id>isis-validate</id>
+    <activation>
+        <activeByDefault>false</activeByDefault>                                        <!-- 1 -->
+    </activation>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.isis.tool</groupId>
+                <artifactId>isis-maven-plugin</artifactId>
+                <version>1.9.0-SNAPSHOT</version>
+                <configuration>
+                    <isisConfigDir>../webapp/src/main/webapp/WEB-INF</isisConfigDir>    <!-- 2 -->
+                </configuration>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.isis.example.application</groupId>
+                        <artifactId>simpleapp-dom</artifactId>
+                        <version>1.9.0-SNAPSHOT</version>
+                    </dependency>
+                    <!-- workaround to avoid conflict with plexus-default -->
+                    <dependency>
+                        <groupId>com.google.guava</groupId>
+                        <artifactId>guava</artifactId>
+                        <version>16.0.1</version>
+                    </dependency>
+                </dependencies>
+                <executions>
+                    <execution>
+                        <phase>test</phase>
+                        <goals>
+                            <goal>validate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</profile>
+----
+<1> activated using the `-P` profile flag rather than a `-D` system property
+<2> specify the `isisConfigDir` directory (containing the `isis.properties` file).
+
+To use the `1.9.0` version, use:
+
+[source,bash]
+----
+mvn -P isis-validate test
+----
+
+[NOTE]
+====
+Note that the `isisConfigDir` property was removed in `1.10.0`; only the `AppManifest` approach is supported.
+====
 
 

http://git-wip-us.apache.org/repos/asf/isis/blob/4cad0178/adocs/documentation/src/main/asciidoc/guides/_ug_extending_programming-model_custom-validator.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ug_extending_programming-model_custom-validator.adoc b/adocs/documentation/src/main/asciidoc/guides/_ug_extending_programming-model_custom-validator.adoc
index e364969..16f32e0 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ug_extending_programming-model_custom-validator.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ug_extending_programming-model_custom-validator.adoc
@@ -4,7 +4,7 @@
 :_basedir: ../
 :_imagesdir: images/
 
-Apache Isis' programming model includes a validator component that detects and prevents (by failing fast) a number of situations where the domain model is logically inconsistent with itself.
+Apache Isis' programming model includes a validator component that detects and prevents (by failing fast) a number of situations where the domain model is logically inconsistent.
 
 For example, the validator will detect any orphaned supporting methods (eg `hideXxx()`) if the corresponding property or action has been renamed or deleted but the supporting method was not also updated.  Another example is that a class cannot have a title specified both using `title()` method and also using `@Title` annotation.
 

http://git-wip-us.apache.org/repos/asf/isis/blob/4cad0178/example/application/simpleapp/dom/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/pom.xml b/example/application/simpleapp/dom/pom.xml
index c671dde..11d6ae3 100644
--- a/example/application/simpleapp/dom/pom.xml
+++ b/example/application/simpleapp/dom/pom.xml
@@ -157,7 +157,9 @@
         <profile>
             <id>isis-validate</id>
             <activation>
-                <activeByDefault>false</activeByDefault>
+                <property>
+                    <name>isis-validate</name>
+                </property>
             </activation>
             <build>
                 <plugins>
@@ -167,7 +169,6 @@
                         <version>${isis.version}</version>
                         <configuration>
                             <appManifest>domainapp.dom.DomainAppDomManifest</appManifest>
-                            <isisConfigDir>../webapp/src/main/webapp/WEB-INF</isisConfigDir>
                         </configuration>
                         <dependencies>
                             <dependency>

http://git-wip-us.apache.org/repos/asf/isis/blob/4cad0178/example/application/simpleapp/dom/src/main/java/domainapp/dom/DomainAppDomManifest.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/DomainAppDomManifest.java b/example/application/simpleapp/dom/src/main/java/domainapp/dom/DomainAppDomManifest.java
index c32996f..101cf27 100644
--- a/example/application/simpleapp/dom/src/main/java/domainapp/dom/DomainAppDomManifest.java
+++ b/example/application/simpleapp/dom/src/main/java/domainapp/dom/DomainAppDomManifest.java
@@ -27,13 +27,10 @@ import org.apache.isis.applib.AppManifest;
 import org.apache.isis.applib.fixturescripts.FixtureScript;
 
 /**
- * Bootstrap the application.
+ * Provided for <tt>isis-maven-plugin</tt>.
  */
 public class DomainAppDomManifest implements AppManifest {
 
-    /**
-     * Load all services and entities found in (the packages and subpackages within) these modules
-     */
     @Override
     public List<Class<?>> getModules() {
         return Arrays.asList(
@@ -41,44 +38,24 @@ public class DomainAppDomManifest implements AppManifest {
         );
     }
 
-    /**
-     * No additional services.
-     */
     @Override
     public List<Class<?>> getAdditionalServices() {
         return Collections.emptyList();
     }
 
-    /**
-     * Use shiro for authentication.
-     *
-     * <p>
-     *     NB: this is ignored for integration tests, which always use "bypass".
-     * </p>
-     */
     @Override
     public String getAuthenticationMechanism() {
-        return "shiro";
+        return null;
     }
 
-    /**
-     * Use shiro for authorization.
-     *
-     * <p>
-     *     NB: this is ignored for integration tests, which always use "bypass".
-     * </p>
-     */
     @Override
     public String getAuthorizationMechanism() {
-        return "shiro";
+        return null;
     }
 
-    /**
-     * No fixtures.
-     */
     @Override
     public List<Class<? extends FixtureScript>> getFixtures() {
-        return Collections.emptyList();
+        return null;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/isis/blob/4cad0178/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.java b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
index fff1099..1bd9c35 100644
--- a/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
+++ b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
@@ -112,7 +112,6 @@ public class SimpleObject implements Comparable<SimpleObject> {
         return this;
     }
 
-
     public String default0UpdateName() {
         return getName();
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/4cad0178/recreate_archetype_RELEASE.sh
----------------------------------------------------------------------
diff --git a/recreate_archetype_RELEASE.sh b/recreate_archetype_RELEASE.sh
index 1653e9f..4d9e029 100644
--- a/recreate_archetype_RELEASE.sh
+++ b/recreate_archetype_RELEASE.sh
@@ -1,7 +1,6 @@
-export ISISREL=1.8.0
-export ISISDEV=1.9.0-SNAPSHOT
-export JIRA=ISIS-928
-#export JIRA=ISIS-1052
+export ISISREL=1.9.0
+export ISISDEV=1.10.0-SNAPSHOT
+export JIRA=ISIS-1195
 
 export ISISTMP=/c/tmp   # or as required
 export ISISPAR=$ISISREL

http://git-wip-us.apache.org/repos/asf/isis/blob/4cad0178/recreate_archetype_SNAPSHOT.sh
----------------------------------------------------------------------
diff --git a/recreate_archetype_SNAPSHOT.sh b/recreate_archetype_SNAPSHOT.sh
index d8db578..b8507cf 100644
--- a/recreate_archetype_SNAPSHOT.sh
+++ b/recreate_archetype_SNAPSHOT.sh
@@ -1,6 +1,6 @@
-export ISISREL=1.9.0-SNAPSHOT
-export ISISDEV=1.9.0-SNAPSHOT
-export JIRA=ISIS-1052
+export ISISREL=1.10.0-SNAPSHOT
+export ISISDEV=1.10.0-SNAPSHOT
+export JIRA=ISIS-1195
 
 export ISISTMP=/c/tmp   # or as required
 export ISISPAR=$ISISREL


[02/10] isis git commit: ISIS-1194: inlining IsisSystem#createSessionFactory

Posted by da...@apache.org.
ISIS-1194: inlining IsisSystem#createSessionFactory

... so can simplify wiring of ObjectReflectorDefault later


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/d0bf6e05
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/d0bf6e05
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/d0bf6e05

Branch: refs/heads/master
Commit: d0bf6e05dd9670381acd4ec76e147af757bdb23b
Parents: 66f4825
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Sep 16 06:23:26 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Sep 16 06:23:26 2015 +0100

----------------------------------------------------------------------
 .../isis/core/runtime/system/IsisSystem.java    | 95 ++++++++++----------
 1 file changed, 45 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/d0bf6e05/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystem.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystem.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystem.java
index dfee47f..603d74e 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystem.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystem.java
@@ -124,7 +124,51 @@ public class IsisSystem implements DebugSelection, ApplicationScopedComponent {
         timeZoneInitializer.initTimeZone(getConfiguration());
 
         try {
-            sessionFactory = createSessionFactory(deploymentType);
+
+            // configuration
+            final IsisConfigurationDefault configuration = isisComponentProvider.getConfiguration();
+
+            // services
+            final List<Object> services = isisComponentProvider.provideServices();
+            ServicesInjectorDefault servicesInjector = new ServicesInjectorDefault(services);
+            servicesInjector.addFallbackIfRequired(FixtureScripts.class, new FixtureScriptsDefault());
+            servicesInjector.validateServices();
+
+            // authentication, authorization
+            final AuthenticationManager authenticationManager =
+                    isisComponentProvider.provideAuthenticationManager(deploymentType);
+            final AuthorizationManager authorizationManager =
+                    isisComponentProvider.provideAuthorizationManager(deploymentType);
+
+            // specificationLoader
+            final Collection<MetaModelRefiner> metaModelRefiners =
+                    refiners(authenticationManager, authorizationManager,
+                            new PersistenceSessionFactoryMetamodelRefiner());
+            final SpecificationLoaderSpi specificationLoader1 =
+                    isisComponentProvider.provideSpecificationLoaderSpi(deploymentType, servicesInjector, metaModelRefiners);
+
+            // persistenceSessionFactory
+            final PersistenceSessionFactory persistenceSessionFactory =
+                    isisComponentProvider.providePersistenceSessionFactory(
+                            deploymentType, servicesInjector, specificationLoader1);
+
+            // runtimeContext
+            final RuntimeContextFromSession runtimeContext =
+                    new RuntimeContextFromSession(
+                            deploymentType.getDeploymentCategory(), configuration,
+                            servicesInjector, specificationLoader1);
+
+            // wire up components and components into services...
+            runtimeContext.injectInto(specificationLoader1);
+
+            for (Object service : servicesInjector.getRegisteredServices()) {
+                runtimeContext.injectInto(service);
+            }
+
+            // finally instantiate
+            sessionFactory = new IsisSessionFactory(
+                    deploymentType, configuration, servicesInjector, specificationLoader1,
+                    authenticationManager, authorizationManager, persistenceSessionFactory);
 
             // temporarily make a configuration available
             // TODO: REVIEW: would rather inject this, or perhaps even the ConfigurationBuilder
@@ -150,55 +194,6 @@ public class IsisSystem implements DebugSelection, ApplicationScopedComponent {
         }
     }
 
-
-    private IsisSessionFactory createSessionFactory(final DeploymentType deploymentType) throws IsisSystemException {
-
-        // configuration
-        final IsisConfigurationDefault configuration = isisComponentProvider.getConfiguration();
-
-        // services
-        final List<Object> services = isisComponentProvider.provideServices();
-        ServicesInjectorDefault servicesInjector = new ServicesInjectorDefault(services);
-        servicesInjector.addFallbackIfRequired(FixtureScripts.class, new FixtureScriptsDefault());
-        servicesInjector.validateServices();
-
-        // authentication, authorization
-        final AuthenticationManager authenticationManager =
-                isisComponentProvider.provideAuthenticationManager(deploymentType);
-        final AuthorizationManager authorizationManager =
-                isisComponentProvider.provideAuthorizationManager(deploymentType);
-
-        // specificationLoader
-        final Collection<MetaModelRefiner> metaModelRefiners =
-                refiners(authenticationManager, authorizationManager,
-                        new PersistenceSessionFactoryMetamodelRefiner());
-        final SpecificationLoaderSpi specificationLoader =
-                isisComponentProvider.provideSpecificationLoaderSpi(deploymentType, servicesInjector, metaModelRefiners);
-
-        // persistenceSessionFactory
-        final PersistenceSessionFactory persistenceSessionFactory =
-                isisComponentProvider.providePersistenceSessionFactory(
-                        deploymentType, servicesInjector, specificationLoader);
-
-        // runtimeContext
-        final RuntimeContextFromSession runtimeContext =
-                new RuntimeContextFromSession(
-                        deploymentType.getDeploymentCategory(), configuration,
-                        servicesInjector, specificationLoader);
-
-        // wire up components and components into services...
-        runtimeContext.injectInto(specificationLoader);
-
-        for (Object service : servicesInjector.getRegisteredServices()) {
-            runtimeContext.injectInto(service);
-        }
-
-        // finally instantiate
-        return new IsisSessionFactory (
-                deploymentType, configuration, servicesInjector, specificationLoader,
-                authenticationManager, authorizationManager, persistenceSessionFactory);
-    }
-
     private static Collection<MetaModelRefiner> refiners(Object... possibleRefiners ) {
         return ListExtensions.filtered(Arrays.asList(possibleRefiners), MetaModelRefiner.class);
     }


[06/10] isis git commit: ISIS-1194: simplify isis-maven-plugin to use appManifest (rather than isisConfigDir).

Posted by da...@apache.org.
ISIS-1194: simplify isis-maven-plugin to use appManifest (rather than isisConfigDir).

As a result, delete the IsisMetaModel class, since no longer required.


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/a701d5e6
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/a701d5e6
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/a701d5e6

Branch: refs/heads/master
Commit: a701d5e6fb63bcbaaac3ad3bde995d8084ba041c
Parents: 6352f06
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Sep 16 17:33:56 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Sep 16 17:33:56 2015 +0100

----------------------------------------------------------------------
 .../isis/tool/mavenplugin/IsisMojoAbstract.java | 106 +------
 .../tool/mavenplugin/util/IsisMetaModels.java   |  36 ---
 .../isis/core/metamodel/app/IsisMetaModel.java  | 166 -----------
 ...IsisMetaModelBaseTest_constructDefaults.java |  57 ----
 ...IsisMetaModelTest_constructWithServices.java |  78 ------
 ...sMetaModelTest_getDomainObjectContainer.java |  66 -----
 .../persistence/PersistenceSessionTest.java     | 276 -------------------
 7 files changed, 15 insertions(+), 770 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/a701d5e6/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java
----------------------------------------------------------------------
diff --git a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java
index 10344a8..5aca2ea 100644
--- a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java
+++ b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/IsisMojoAbstract.java
@@ -18,8 +18,6 @@
  */
 package org.apache.isis.tool.mavenplugin;
 
-import java.io.File;
-import java.util.List;
 import java.util.Set;
 
 import org.apache.maven.model.Plugin;
@@ -32,19 +30,11 @@ import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProject;
 
 import org.apache.isis.applib.AppManifest;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.commons.config.IsisConfigurationBuilderDefault;
 import org.apache.isis.core.commons.factory.InstanceUtil;
-import org.apache.isis.core.metamodel.app.IsisMetaModel;
 import org.apache.isis.core.metamodel.specloader.ObjectReflectorDefault;
-import org.apache.isis.core.runtime.services.ServicesInstaller;
-import org.apache.isis.core.runtime.services.ServicesInstallerFromAnnotation;
-import org.apache.isis.core.runtime.services.ServicesInstallerFromConfigurationAndAnnotation;
 import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.core.runtime.system.IsisSystem;
 import org.apache.isis.core.runtime.systemusinginstallers.IsisComponentProviderDefault2;
-import org.apache.isis.progmodels.dflt.ProgrammingModelFacetsJava5;
-import org.apache.isis.tool.mavenplugin.util.IsisMetaModels;
 import org.apache.isis.tool.mavenplugin.util.MavenProjects;
 
 public abstract class IsisMojoAbstract extends AbstractMojo {
@@ -54,10 +44,7 @@ public abstract class IsisMojoAbstract extends AbstractMojo {
     @Component
     private MavenProject mavenProject;
 
-    @Parameter(required = true, readonly = false, property = "isisConfigDir")
-    private String isisConfigDir;
-
-    @Parameter(required = false, readonly = false, property = "appManifest")
+    @Parameter(required = true, readonly = false, property = "appManifest")
     private String appManifest;
 
     private final MetaModelProcessor metaModelProcessor;
@@ -72,89 +59,26 @@ public abstract class IsisMojoAbstract extends AbstractMojo {
 
         final Plugin plugin = MavenProjects.lookupPlugin(mavenProject, CURRENT_PLUGIN_KEY);
 
-        if(this.appManifest != null) {
-
-            final AppManifest manifest = InstanceUtil.createInstance(this.appManifest, AppManifest.class);
-            final IsisComponentProviderDefault2 componentProvider = new IsisComponentProviderDefault2(
-                    DeploymentType.UNIT_TESTING, manifest, null, null, null, null, null);
-
-            final IsisSystem isisSystem = new IsisSystem(componentProvider);
-            try {
-                isisSystem.init();
-
-            } catch(RuntimeException ex) {
-                ;
-                // ignore
-            } finally {
-                isisSystem.shutdown();
-            }
-
-            final ObjectReflectorDefault specificationLoader =
-                    (ObjectReflectorDefault) isisSystem.getSessionFactory().getSpecificationLoader();
-            metaModelProcessor.process(specificationLoader, context);
-
-
-        } else {
-
-            final IsisConfiguration isisConfiguration = getIsisConfiguration();
-            final List<Object> serviceList = plugin != null ? serviceListFor(plugin, isisConfiguration) : null;
-            if (serviceList == null || serviceList.size() == 0) {
-                return;
-            }
-            getLog().info("Found " + serviceList.size() + " services");
-
-            IsisMetaModel isisMetaModel = null;
-            try {
-                isisMetaModel = bootstrapIsis(serviceList);
-                metaModelProcessor.process((ObjectReflectorDefault) isisMetaModel.getSpecificationLoader(), context);
-            } finally {
-                IsisMetaModels.disposeSafely(isisMetaModel);
-            }
-        }
-    }
+        final AppManifest manifest = InstanceUtil.createInstance(this.appManifest, AppManifest.class);
+        final IsisComponentProviderDefault2 componentProvider = new IsisComponentProviderDefault2(
+                DeploymentType.UNIT_TESTING, manifest, null, null, null, null, null);
 
-    private List<Object> serviceListFor(Plugin plugin, final IsisConfiguration isisConfiguration) throws MojoFailureException {
+        final IsisSystem isisSystem = new IsisSystem(componentProvider);
+        try {
+            isisSystem.init();
 
-        final ServicesInstaller servicesInstaller;
-        if(isisConfiguration == null) {
-            servicesInstaller = new ServicesInstallerFromAnnotation();
-        } else {
-            final ServicesInstallerFromConfigurationAndAnnotation servicesInstallerFromConfigurationAndAnnotation = new ServicesInstallerFromConfigurationAndAnnotation();
-            servicesInstallerFromConfigurationAndAnnotation.setConfiguration(isisConfiguration);
-            servicesInstaller = servicesInstallerFromConfigurationAndAnnotation;
+        } catch(RuntimeException ex) {
+            ;
+            // ignore
+        } finally {
+            isisSystem.shutdown();
         }
 
-        servicesInstaller.setIgnoreFailures(true);
-        servicesInstaller.init();
-
-        return servicesInstaller.getServices();
-    }
-
-    private IsisConfiguration getIsisConfiguration() throws MojoFailureException {
-        final File file = getIsisConfigDir();
-        final String absoluteConfigDir = file.getAbsolutePath();
-        if(!file.exists() || !file.isDirectory()) {
-            context.throwFailureException("Configuration error",
-                    String.format("isisConfigDir (%s) does not exist or is not a directory", absoluteConfigDir));
-        }
-        final IsisConfigurationBuilderDefault configBuilder = new IsisConfigurationBuilderDefault(absoluteConfigDir);
-        configBuilder.addDefaultConfigurationResources();
-        return configBuilder.getConfiguration();
-    }
+        final ObjectReflectorDefault specificationLoader =
+                (ObjectReflectorDefault) isisSystem.getSessionFactory().getSpecificationLoader();
+        metaModelProcessor.process(specificationLoader, context);
 
-    private File getIsisConfigDir() {
-        File file = new File(isisConfigDir);
-        if(!file.isAbsolute()) {
-            final File basedir = mavenProject.getBasedir();
-            file = new File(basedir, isisConfigDir);
-        }
-        return file;
-    }
 
-    private static IsisMetaModel bootstrapIsis(List<Object> serviceList) {
-        IsisMetaModel isisMetaModel = new IsisMetaModel(new ProgrammingModelFacetsJava5(), serviceList);
-        isisMetaModel.init();
-        return isisMetaModel;
     }
 
     //region > Context

http://git-wip-us.apache.org/repos/asf/isis/blob/a701d5e6/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/util/IsisMetaModels.java
----------------------------------------------------------------------
diff --git a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/util/IsisMetaModels.java b/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/util/IsisMetaModels.java
deleted file mode 100644
index 9d6cc50..0000000
--- a/core/maven-plugin/src/main/java/org/apache/isis/tool/mavenplugin/util/IsisMetaModels.java
+++ /dev/null
@@ -1,36 +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.tool.mavenplugin.util;
-
-import org.apache.isis.core.metamodel.app.IsisMetaModel;
-
-public final class IsisMetaModels {
-    
-    private IsisMetaModels(){}
-
-    public static void disposeSafely(IsisMetaModel isisMetaModel) {
-        if (isisMetaModel == null) {
-            return;
-        }
-        isisMetaModel.shutdown();
-    }
-
-
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/a701d5e6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/app/IsisMetaModel.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/app/IsisMetaModel.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/app/IsisMetaModel.java
deleted file mode 100644
index 79e568a..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/app/IsisMetaModel.java
+++ /dev/null
@@ -1,166 +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.app;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-
-import com.google.common.collect.Lists;
-
-import org.apache.isis.core.commons.components.ApplicationScopedComponent;
-import org.apache.isis.core.commons.config.IsisConfigurationDefault;
-import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
-import org.apache.isis.core.metamodel.facetdecorator.FacetDecorator;
-import org.apache.isis.core.metamodel.layoutmetadata.LayoutMetadataReader;
-import org.apache.isis.core.metamodel.layoutmetadata.json.LayoutMetadataReaderFromJson;
-import org.apache.isis.core.metamodel.progmodel.ProgrammingModel;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.runtimecontext.noruntime.RuntimeContextNoRuntime;
-import org.apache.isis.core.metamodel.services.ServicesInjectorDefault;
-import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
-import org.apache.isis.core.metamodel.specloader.ObjectReflectorDefault;
-import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorComposite;
-import org.apache.isis.core.metamodel.specloader.validator.ValidationFailures;
-
-import static org.apache.isis.core.commons.ensure.Ensure.ensureThatState;
-import static org.hamcrest.CoreMatchers.is;
-
-/**
- * Facade for the entire Isis metamodel and supporting components.
- * 
- * <p>
- * Currently this is <i>not</i> used by Isis proper, but is available for use by integration tests.
- * The intention is to factor it into <tt>IsisSystem</tt>.
- */
-public class IsisMetaModel implements ApplicationScopedComponent {
-
-
-    private static enum State {
-        NOT_INITIALIZED, INITIALIZED, SHUTDOWN;
-    }
-
-    private State state = State.NOT_INITIALIZED;
-
-    private final ServicesInjectorSpi servicesInjector;
-
-    private ObjectReflectorDefault specificationLoader;
-    private RuntimeContext runtimeContext;
-
-    private IsisConfigurationDefault configuration;
-    private ProgrammingModel programmingModel;
-    private Set<FacetDecorator> facetDecorators;
-    private MetaModelValidatorComposite metaModelValidator;
-
-    private ValidationFailures validationFailures;
-
-    public IsisMetaModel(
-            final ProgrammingModel programmingModel,
-            final List<Object> services) {
-        this(programmingModel, services.toArray());
-    }
-    
-    public IsisMetaModel(
-            final ProgrammingModel programmingModel,
-            final Object... services) {
-
-        this.programmingModel = programmingModel;
-
-        final List<Object> serviceList = Lists.newArrayList();
-        serviceList.addAll(Arrays.asList(services));
-        this.servicesInjector = new ServicesInjectorDefault(serviceList);
-
-        this.configuration = new IsisConfigurationDefault();
-
-        this.facetDecorators = new TreeSet<>();
-
-        this.metaModelValidator = new MetaModelValidatorComposite();
-        this.programmingModel.refineMetaModelValidator(metaModelValidator, configuration);
-
-        final DeploymentCategory deploymentCategory = DeploymentCategory.PRODUCTION;
-        final List<LayoutMetadataReader> layoutMetadataReaders =
-                Lists.<LayoutMetadataReader>newArrayList(new LayoutMetadataReaderFromJson());
-
-        this.specificationLoader = new ObjectReflectorDefault(
-                deploymentCategory, configuration,
-                this.programmingModel, facetDecorators,
-                metaModelValidator, layoutMetadataReaders, servicesInjector);
-
-        this.runtimeContext = new RuntimeContextNoRuntime(
-                deploymentCategory, configuration, servicesInjector, specificationLoader);
-
-    }
-
-    public ServicesInjectorSpi getServicesInjector() {
-        return servicesInjector;
-    }
-
-    // ///////////////////////////////////////////////////////
-    // init, shutdown
-    // ///////////////////////////////////////////////////////
-
-    public void init() {
-        ensureNotInitialized();
-
-        specificationLoader.initialize(runtimeContext);
-
-        for (final Object service : servicesInjector.getRegisteredServices()) {
-            final ObjectSpecification serviceSpec = specificationLoader.loadSpecification(service.getClass());
-            serviceSpec.markAsService();
-        }
-
-        validationFailures = specificationLoader.validate();
-
-        state = State.INITIALIZED;
-    }
-    
-    public ValidationFailures getValidationFailures() {
-        return validationFailures;
-    }
-
-    public void shutdown() {
-        ensureInitialized();
-        state = State.SHUTDOWN;
-    }
-
-
-    /**
-     * Available once {@link #init() initialized}.
-     */
-    public SpecificationLoaderSpi getSpecificationLoader() {
-        return specificationLoader;
-    }
-
-    //region > State management
-
-    private State ensureNotInitialized() {
-        return ensureThatState(state, is(State.NOT_INITIALIZED));
-    }
-
-    private State ensureInitialized() {
-        return ensureThatState(state, is(State.INITIALIZED));
-    }
-
-    //endregion
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/a701d5e6/core/metamodel/src/test/java/org/apache/isis/core/metamodel/app/IsisMetaModelBaseTest_constructDefaults.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/app/IsisMetaModelBaseTest_constructDefaults.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/app/IsisMetaModelBaseTest_constructDefaults.java
deleted file mode 100644
index 3dd2ad2..0000000
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/app/IsisMetaModelBaseTest_constructDefaults.java
+++ /dev/null
@@ -1,57 +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.app;
-
-import org.jmock.auto.Mock;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-
-import org.apache.isis.core.metamodel.progmodel.ProgrammingModel;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
-
-public class IsisMetaModelBaseTest_constructDefaults {
-
-    @Rule
-    public final JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_ONLY);
-
-    @Mock
-    private RuntimeContext mockContext;
-
-    @Mock
-    private ProgrammingModel mockProgrammingModel;
-    
-    private IsisMetaModel metaModel;
-
-    @Before
-    public void setUp() {
-        context.ignoring(mockProgrammingModel);
-        metaModel = new IsisMetaModel(mockProgrammingModel);
-    }
-
-
-    @Test(expected = IllegalStateException.class)
-    public void shouldNotBeAbleToShutdown() {
-        metaModel.shutdown();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/a701d5e6/core/metamodel/src/test/java/org/apache/isis/core/metamodel/app/IsisMetaModelTest_constructWithServices.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/app/IsisMetaModelTest_constructWithServices.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/app/IsisMetaModelTest_constructWithServices.java
deleted file mode 100644
index 8573067..0000000
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/app/IsisMetaModelTest_constructWithServices.java
+++ /dev/null
@@ -1,78 +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.app;
-
-import java.util.List;
-import org.jmock.auto.Mock;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.apache.isis.core.commons.matchers.IsisMatchers;
-import org.apache.isis.core.metamodel.progmodel.ProgrammingModel;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class IsisMetaModelTest_constructWithServices {
-
-    @Rule
-    public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
-
-    @Mock
-    private RuntimeContext mockContext;
-
-    @Mock
-    private ProgrammingModel mockProgrammingModel;
-
-    @Mock
-    private SomeRepo mockService1;
-
-    @Mock
-    private SomeOtherRepo mockService2;
-
-    private IsisMetaModel metaModel;
-
-    private static class SomeRepo {}
-    private static class SomeOtherRepo {}
-
-    @Before
-    public void setUp() throws Exception {
-        context.ignoring(mockProgrammingModel);
-    }
-
-    @Test
-    public void shouldSucceedWithoutThrowingAnyExceptions() {
-        metaModel = new IsisMetaModel(mockProgrammingModel);
-    }
-
-    @Test
-    public void shouldBeAbleToRegisterServices() {
-        metaModel = new IsisMetaModel(mockProgrammingModel, mockService1, mockService2);
-        final List<Object> services = metaModel.getServicesInjector().getRegisteredServices();
-        assertThat(services.size(), is(3));
-        assertThat(services, IsisMatchers.containsObjectOfType(SomeRepo.class));
-        assertThat(services, IsisMatchers.containsObjectOfType(SomeOtherRepo.class));
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/a701d5e6/core/metamodel/src/test/java/org/apache/isis/core/metamodel/app/IsisMetaModelTest_getDomainObjectContainer.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/app/IsisMetaModelTest_getDomainObjectContainer.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/app/IsisMetaModelTest_getDomainObjectContainer.java
deleted file mode 100644
index 929fcca..0000000
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/app/IsisMetaModelTest_getDomainObjectContainer.java
+++ /dev/null
@@ -1,66 +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.app;
-
-import org.jmock.Expectations;
-import org.jmock.auto.Mock;
-import org.junit.Before;
-import org.junit.Rule;
-import org.apache.isis.core.metamodel.progmodel.ProgrammingModel;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.unittestsupport.jmocking.IsisActions;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
-
-public class IsisMetaModelTest_getDomainObjectContainer {
-
-    @Rule
-    public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
-
-    @Mock
-    private RuntimeContext mockContext;
-
-    @Mock
-    private ProgrammingModel mockProgrammingModel;
-    
-    private IsisMetaModel metaModel;
-
-
-    @Before
-    public void setUp() {
-        metaModel = new IsisMetaModel(mockProgrammingModel);
-        expectingMetaModelToBeInitialized();
-        metaModel.init();
-    }
-    
-    private void expectingMetaModelToBeInitialized() {
-        context.checking(new Expectations() {
-            {
-                allowing(mockContext).injectInto(with(any(Object.class)));
-                will(IsisActions.injectInto());
-                
-                ignoring(mockContext);
-                
-                ignoring(mockProgrammingModel);
-            }
-        });
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/a701d5e6/core/runtime/src/test/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionTest.java b/core/runtime/src/test/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionTest.java
deleted file mode 100644
index 35a3dbe..0000000
--- a/core/runtime/src/test/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionTest.java
+++ /dev/null
@@ -1,276 +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.runtime.system.persistence;
-
-import java.util.Collections;
-
-import javax.jdo.PersistenceManagerFactory;
-
-import org.jmock.Expectations;
-import org.jmock.Sequence;
-import org.jmock.auto.Mock;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
-
-import org.apache.isis.applib.services.audit.AuditingService3;
-import org.apache.isis.core.commons.authentication.AuthenticationSession;
-import org.apache.isis.core.commons.authentication.MessageBroker;
-import org.apache.isis.core.commons.config.IsisConfigurationDefault;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.version.Version;
-import org.apache.isis.core.metamodel.app.IsisMetaModel;
-import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.services.ServicesInjectorDefault;
-import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
-import org.apache.isis.core.metamodel.services.container.DomainObjectContainerDefault;
-import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
-import org.apache.isis.core.metamodel.specloader.InjectorMethodEvaluatorDefault;
-import org.apache.isis.core.runtime.persistence.adapter.PojoAdapter;
-import org.apache.isis.core.runtime.persistence.internal.RuntimeContextFromSession;
-import org.apache.isis.core.runtime.persistence.objectstore.transaction.CreateObjectCommand;
-import org.apache.isis.core.runtime.persistence.objectstore.transaction.DestroyObjectCommand;
-import org.apache.isis.core.runtime.persistence.objectstore.transaction.PojoAdapterBuilder;
-import org.apache.isis.core.runtime.persistence.objectstore.transaction.PojoAdapterBuilder.Persistence;
-import org.apache.isis.core.runtime.persistence.objectstore.transaction.PublishingServiceWithDefaultPayloadFactories;
-import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
-import org.apache.isis.progmodels.dflt.ProgrammingModelFacetsJava5;
-
-public class PersistenceSessionTest {
-
-    @Rule
-    public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
-
-    private ServicesInjectorDefault servicesInjector;
-
-    
-    private PersistenceSession persistenceSession;
-    private IsisTransactionManager transactionManager;
-    
-    private ObjectAdapter persistentAdapter;
-    private PojoAdapter transientAdapter;
-    
-    @Mock
-    private PersistenceSessionFactory mockPersistenceSessionFactory;
-    
-    @Mock
-    private AuthenticationSession mockAuthenticationSession;
-    @Mock
-    private SpecificationLoaderSpi mockSpecificationLoader;
-
-    @Mock
-    private AuditingService3 mockAuditingService3;
-    @Mock
-    private PublishingServiceWithDefaultPayloadFactories mockPublishingService;
-
-    @Mock
-    private CreateObjectCommand createObjectCommand;
-    @Mock
-    private DestroyObjectCommand destroyObjectCommand;
-
-    @Mock
-    private Version mockVersion;
-
-    @Mock
-    private RuntimeContext mockRuntimeContext;
-
-    @Mock
-    private ServicesInjectorSpi mockServicesInjector;
-
-    @Mock
-    private IsisConfigurationDefault mockConfiguration;
-
-    @Mock
-    private PersistenceManagerFactory mockPersistenceManager;
-
-    @Mock
-    private MessageBroker mockMessageBroker;
-
-    private IsisMetaModel isisMetaModel;
-
-    public static class Customer {
-    }
-
-    public static class CustomerRepository {
-        public Customer x() {return null;}
-    }
-    
-    @Before
-    public void setUp() throws Exception {
-        org.apache.log4j.Logger.getRootLogger().setLevel(org.apache.log4j.Level.OFF);
-
-        context.ignoring(mockRuntimeContext);
-        context.ignoring(mockConfiguration);
-        context.ignoring(mockAuditingService3);
-
-        isisMetaModel = new IsisMetaModel(new ProgrammingModelFacetsJava5(), new CustomerRepository());
-        isisMetaModel.init();
-        
-        context.checking(new Expectations() {
-            {
-                ignoring(mockConfiguration);
-
-                ignoring(createObjectCommand);
-                ignoring(destroyObjectCommand);
-                ignoring(mockVersion);
-                
-                allowing(mockAuthenticationSession).getMessageBroker();
-                will(returnValue(mockMessageBroker));
-            }
-        });
-
-        final RuntimeContextFromSession runtimeContext =
-                new RuntimeContextFromSession(
-                        DeploymentCategory.PRODUCTION,
-                        mockConfiguration,
-                        servicesInjector,
-                        mockSpecificationLoader);
-        final DomainObjectContainerDefault container = new DomainObjectContainerDefault();
-
-        runtimeContext.injectInto(container);
-
-        servicesInjector = new ServicesInjectorDefault(
-                Collections.<Object>singletonList(container),new InjectorMethodEvaluatorDefault());
-
-        persistenceSession = new PersistenceSession(mockConfiguration, mockServicesInjector, mockSpecificationLoader,
-                mockAuthenticationSession,
-                mockPersistenceManager, mockPersistenceSessionFactory
-        ) {
-            @Override
-            protected SpecificationLoaderSpi getSpecificationLoader() {
-                return isisMetaModel.getSpecificationLoader();
-            }
-            
-        };
-
-        context.checking(new Expectations(){{
-            allowing(mockAuthenticationSession).getUserName();
-            will(returnValue("sven"));
-        }});
-
-        
-        transactionManager = persistenceSession.getTransactionManager();
-        new IsisTransactionManager(persistenceSession, servicesInjector) {
-            @Override
-            public AuthenticationSession getAuthenticationSession() {
-                return mockAuthenticationSession;
-            }
-        };
-        persistenceSession.setTransactionManager(transactionManager);
-
-        persistentAdapter = PojoAdapterBuilder.create().withOid("CUS|1").withPojo(new Customer()).with(Persistence.PERSISTENT).with(mockVersion).with(isisMetaModel.getSpecificationLoader()).build();
-        transientAdapter = PojoAdapterBuilder.create().withOid("CUS|2").withPojo(new Customer()).with(Persistence.TRANSIENT).with(isisMetaModel.getSpecificationLoader()).build();
-    }
-
-
-    @Ignore // ISIS-1194
-    @Test
-    public void destroyObjectThenAbort() {
-        
-        final Sequence tran = context.sequence("tran");
-        context.checking(new Expectations() {
-            {
-//                one(mockObjectStore).startTransaction();
-//                inSequence(tran);
-
-//                one(mockObjectStore).createDestroyObjectCommand(persistentAdapter);
-//                inSequence(tran);
-
-//                one(mockObjectStore).abortTransaction();
-//                inSequence(tran);
-            }
-        });
-        
-        transactionManager.startTransaction();
-        persistenceSession.destroyObjectInTransaction(persistentAdapter);
-        transactionManager.abortTransaction();
-    }
-
-    @Ignore // ISIS-1194
-    @Test
-    public void destroyObject_thenCommit() {
-
-        final Sequence tran = context.sequence("tran");
-        context.checking(new Expectations() {
-            {
-//                oneOf(mockObjectStore).startTransaction();
-//                inSequence(tran);
-
-//                oneOf(mockObjectStore).createDestroyObjectCommand(persistentAdapter);
-//                inSequence(tran);
-//                will(returnValue(destroyObjectCommand));
-                
-//                oneOf(mockObjectStore).execute(with(IsisMatchers.listContaining((PersistenceCommand)destroyObjectCommand)));
-//                inSequence(tran);
-
-//                // second flush after publish
-//                oneOf(mockObjectStore).execute(with(equalTo(Collections.<PersistenceCommand>emptyList())));
-//                inSequence(tran);
-
-//                // third flush after commands
-//                oneOf(mockObjectStore).execute(with(equalTo(Collections.<PersistenceCommand>emptyList())));
-//                inSequence(tran);
-
-//                oneOf(mockObjectStore).endTransaction();
-//                inSequence(tran);
-            }
-
-        });
-
-        transactionManager.startTransaction();
-        persistenceSession.destroyObjectInTransaction(persistentAdapter);
-        transactionManager.endTransaction();
-    }
-
-    @Ignore // ISIS-1194
-    @Test
-    public void makePersistent_happyCase() {
-
-        final Sequence tran = context.sequence("tran");
-        context.checking(new Expectations() {
-            {
-//                oneOf(mockObjectStore).startTransaction();
-//                inSequence(tran);
-
-//                oneOf(mockObjectStore).execute(with(equalTo(Collections.<PersistenceCommand>emptyList())));
-//                inSequence(tran);
-
-//                // second flush after publish
-//                oneOf(mockObjectStore).execute(with(equalTo(Collections.<PersistenceCommand>emptyList())));
-//                inSequence(tran);
-
-//                // third flush after commands
-//                oneOf(mockObjectStore).execute(with(equalTo(Collections.<PersistenceCommand>emptyList())));
-//                inSequence(tran);
-
-//                oneOf(mockObjectStore).endTransaction();
-//                inSequence(tran);
-            }
-        });
-
-        transactionManager.startTransaction();
-        persistenceSession.makePersistentInTransaction(transientAdapter);
-        transactionManager.endTransaction();
-    }
-}


[05/10] isis git commit: ISIS-1194: extending ResourceContext so that DomainResourceHelper can interact with ServicesInjector directly (rather than by way of PersistenceSession)

Posted by da...@apache.org.
ISIS-1194: extending ResourceContext so that DomainResourceHelper can interact with ServicesInjector directly (rather than by way of PersistenceSession)


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/6352f06a
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/6352f06a
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/6352f06a

Branch: refs/heads/master
Commit: 6352f06a8dc981773c4b83a83d2f97b75327baf2
Parents: fe2b2ba
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Sep 16 16:56:32 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Sep 16 16:56:32 2015 +0100

----------------------------------------------------------------------
 .../system/persistence/PersistenceSession.java  |  7 ----
 .../system/session/IsisSessionFactory.java      | 42 +++++++++++---------
 .../rendering/RendererContext.java              |  4 ++
 .../rendering/RendererContext5.java             |  2 +
 .../service/RepresentationService.java          |  7 ++++
 .../restfulobjects/server/ResourceContext.java  | 34 +++++++++++-----
 .../server/resources/DomainResourceHelper.java  | 34 +++++++++++-----
 .../server/resources/ResourceAbstract.java      | 13 ++++--
 ...ontextTest_ensureCompatibleAcceptHeader.java |  3 +-
 .../server/ResourceContextTest_getArg.java      |  6 +--
 10 files changed, 96 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/6352f06a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java
index 4327cf4..476d76d 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java
@@ -301,13 +301,6 @@ public class PersistenceSession implements TransactionalResource, SessionScopedC
         }
     }
 
-    /**
-     * @return - the service, or <tt>null</tt> if no service registered of specified type.
-     */
-    public <T> T getServiceOrNull(final Class<T> serviceType) {
-        return servicesInjector.lookupService(serviceType);
-    }
-
     //endregion
 
     //region > close

http://git-wip-us.apache.org/repos/asf/isis/blob/6352f06a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactory.java
index 0e3b9a9..9b4d08a 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactory.java
@@ -24,21 +24,20 @@ import java.util.List;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.isis.applib.clock.Clock;
-import org.apache.isis.applib.fixtures.FixtureClock;
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.commons.components.ApplicationScopedComponent;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
 import org.apache.isis.core.metamodel.adapter.oid.OidMarshaller;
+import org.apache.isis.core.metamodel.runtimecontext.ServicesInjector;
 import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
 import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
 import org.apache.isis.core.runtime.authentication.AuthenticationManager;
 import org.apache.isis.core.runtime.authorization.AuthorizationManager;
 import org.apache.isis.core.runtime.installerregistry.InstallerLookup;
-import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
 import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
+import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
 
 import static org.apache.isis.core.commons.ensure.Ensure.ensureThatArg;
 import static org.hamcrest.CoreMatchers.is;
@@ -104,18 +103,12 @@ public class IsisSessionFactory implements ApplicationScopedComponent {
     }
 
 
-
-    // ///////////////////////////////////////////
-    // init, shutdown
-    // ///////////////////////////////////////////
-
     public void shutdown() {
         persistenceSessionFactory.shutdown();
         authenticationManager.shutdown();
         specificationLoaderSpi.shutdown();
     }
 
-    // //////////////////////////////////////
 
 
     /**
@@ -138,6 +131,14 @@ public class IsisSessionFactory implements ApplicationScopedComponent {
 
     /**
      * The {@link ApplicationScopedComponent application-scoped}
+     * {@link DeploymentType}.
+     */
+    public DeploymentType getDeploymentType() {
+        return deploymentType;
+    }
+
+    /**
+     * The {@link ApplicationScopedComponent application-scoped}
      * {@link IsisConfiguration}.
      */
     public IsisConfiguration getConfiguration() {
@@ -145,13 +146,23 @@ public class IsisSessionFactory implements ApplicationScopedComponent {
     }
 
     /**
-     * The {@link ApplicationScopedComponent application-scoped}
-     * {@link DeploymentType}.
+     * The {@link ApplicationScopedComponent application-scoped} {@link ServicesInjector}.
      */
-    public DeploymentType getDeploymentType() {
-        return deploymentType;
+    public ServicesInjector getServicesInjector() {
+        return servicesInjector;
+    }
+
+    /**
+     * Derived from {@link #getServicesInjector()}.
+     * 
+     * @deprecated - use {@link #getServicesInjector()} instead.
+     */
+    @Deprecated
+    public List<Object> getServices() {
+        return servicesInjector.getRegisteredServices();
     }
 
+
     /**
      * The {@link ApplicationScopedComponent application-scoped}
      * {@link SpecificationLoaderSpi}.
@@ -187,10 +198,6 @@ public class IsisSessionFactory implements ApplicationScopedComponent {
         return persistenceSessionFactory;
     }
 
-    public List<Object> getServices() {
-        return servicesInjector.getRegisteredServices();
-    }
-
     /**
      * The {@link OidMarshaller} to use for marshalling and unmarshalling {@link Oid}s
      * into strings.
@@ -199,5 +206,4 @@ public class IsisSessionFactory implements ApplicationScopedComponent {
         return oidMarshaller;
     }
 
-
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/6352f06a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/RendererContext.java
----------------------------------------------------------------------
diff --git a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/RendererContext.java b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/RendererContext.java
index a1b0821..3ee6991 100644
--- a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/RendererContext.java
+++ b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/RendererContext.java
@@ -40,6 +40,10 @@ public interface RendererContext {
     
     public PersistenceSession getPersistenceSession();
 
+    /**
+     * @deprecated - replaced by {@link #getPersistenceSession()}.
+     */
+    @Deprecated
     public AdapterManager getAdapterManager();
 
     public Where getWhere();

http://git-wip-us.apache.org/repos/asf/isis/blob/6352f06a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/RendererContext5.java
----------------------------------------------------------------------
diff --git a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/RendererContext5.java b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/RendererContext5.java
index f91d9d2..76b8b95 100644
--- a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/RendererContext5.java
+++ b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/RendererContext5.java
@@ -18,6 +18,7 @@
  */
 package org.apache.isis.viewer.restfulobjects.rendering;
 
+import org.apache.isis.core.metamodel.runtimecontext.ServicesInjector;
 import org.apache.isis.core.metamodel.spec.SpecificationLoader;
 
 /**
@@ -26,5 +27,6 @@ import org.apache.isis.core.metamodel.spec.SpecificationLoader;
 public interface RendererContext5 extends RendererContext4 {
 
     public SpecificationLoader getSpecificationLoader();
+    public ServicesInjector getServicesInjector();
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/6352f06a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/RepresentationService.java
----------------------------------------------------------------------
diff --git a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/RepresentationService.java b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/RepresentationService.java
index 4028fe5..b49fcf4 100644
--- a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/RepresentationService.java
+++ b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/RepresentationService.java
@@ -21,11 +21,14 @@ import javax.ws.rs.core.Response;
 import org.apache.isis.applib.annotation.Programmatic;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
+import org.apache.isis.core.metamodel.runtimecontext.ServicesInjector;
+import org.apache.isis.core.metamodel.spec.SpecificationLoader;
 import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.viewer.restfulobjects.rendering.RendererContext;
 import org.apache.isis.viewer.restfulobjects.rendering.RendererContext2;
 import org.apache.isis.viewer.restfulobjects.rendering.RendererContext3;
 import org.apache.isis.viewer.restfulobjects.rendering.RendererContext4;
+import org.apache.isis.viewer.restfulobjects.rendering.RendererContext5;
 import org.apache.isis.viewer.restfulobjects.rendering.domainobjects.ActionResultReprRenderer;
 import org.apache.isis.viewer.restfulobjects.rendering.domainobjects.MemberReprMode;
 import org.apache.isis.viewer.restfulobjects.rendering.domainobjects.ObjectAdapterLinkTo;
@@ -84,4 +87,8 @@ public interface RepresentationService {
     public static interface Context4 extends Context3, RendererContext4 {
         InteractionInitiatedBy getInteractionInitiatedBy();
     }
+    public static interface Context5 extends Context3, RendererContext5 {
+        public SpecificationLoader getSpecificationLoader();
+        public ServicesInjector getServicesInjector();
+    }
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/6352f06a/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/ResourceContext.java
----------------------------------------------------------------------
diff --git a/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/ResourceContext.java b/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/ResourceContext.java
index 999959a..ae59797 100644
--- a/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/ResourceContext.java
+++ b/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/ResourceContext.java
@@ -43,6 +43,7 @@ import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
 import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
+import org.apache.isis.core.metamodel.runtimecontext.ServicesInjector;
 import org.apache.isis.core.metamodel.spec.SpecificationLoader;
 import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
@@ -65,17 +66,17 @@ public class ResourceContext implements RendererContext5 {
     private final HttpServletResponse httpServletResponse;
     private final SecurityContext securityContext;
 
-    private final Localization localization;
+    private final DeploymentType deploymentType;
     private final IsisConfiguration configuration;
+    private final ServicesInjector servicesInjector;
+    private final SpecificationLoader specificationLoader;
     private final AuthenticationSession authenticationSession;
+    private final Localization localization;
     private final PersistenceSession persistenceSession;
-    private final AdapterManager adapterManager;
-    private final SpecificationLoader specificationLoader;
 
     private List<List<String>> followLinks;
 
     private final Where where;
-    private final DeploymentType deploymentType;
     private final InteractionInitiatedBy interactionInitiatedBy;
     private final String urlUnencodedQueryString;
 
@@ -94,13 +95,13 @@ public class ResourceContext implements RendererContext5 {
             final HttpServletRequest httpServletRequest,
             final HttpServletResponse httpServletResponse,
             final SecurityContext securityContext,
-            final Localization localization,
+            final DeploymentType deploymentType,
+            final IsisConfiguration configuration,
+            final ServicesInjector servicesInjector,
+            final SpecificationLoader specificationLoader,
             final AuthenticationSession authenticationSession,
+            final Localization localization,
             final PersistenceSession persistenceSession,
-            final AdapterManager objectAdapterLookup,
-            final SpecificationLoader specificationLoader,
-            final IsisConfiguration configuration,
-            final DeploymentType deploymentType,
             final InteractionInitiatedBy interactionInitiatedBy) {
 
         this.httpHeaders = httpHeaders;
@@ -111,11 +112,11 @@ public class ResourceContext implements RendererContext5 {
         this.httpServletRequest = httpServletRequest;
         this.httpServletResponse = httpServletResponse;
         this.securityContext = securityContext;
+        this.servicesInjector = servicesInjector;
         this.localization = localization;
         this.configuration = configuration;
         this.authenticationSession = authenticationSession;
         this.persistenceSession = persistenceSession;
-        this.adapterManager = objectAdapterLookup;
         this.specificationLoader = specificationLoader;
         this.where = where;
         this.deploymentType = deploymentType;
@@ -264,6 +265,7 @@ public class ResourceContext implements RendererContext5 {
         return securityContext;
     }
 
+    @Override
     public DeploymentType getDeploymentType() {
         return deploymentType;
     }
@@ -288,9 +290,18 @@ public class ResourceContext implements RendererContext5 {
         return authenticationSession;
     }
 
+    /**
+     * @deprecated - use {@link #getPersistenceSession()}.
+     */
+    @Deprecated
     @Override
     public AdapterManager getAdapterManager() {
-        return adapterManager;
+        return persistenceSession;
+    }
+
+    @Override
+    public ServicesInjector getServicesInjector() {
+        return servicesInjector;
     }
 
     @Override
@@ -302,6 +313,7 @@ public class ResourceContext implements RendererContext5 {
         return persistenceSession.getServices();
     }
 
+    @Override
     public SpecificationLoader getSpecificationLoader() {
         return specificationLoader;
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/6352f06a/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/resources/DomainResourceHelper.java
----------------------------------------------------------------------
diff --git a/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/resources/DomainResourceHelper.java b/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/resources/DomainResourceHelper.java
index ebef262..1f652d9 100644
--- a/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/resources/DomainResourceHelper.java
+++ b/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/resources/DomainResourceHelper.java
@@ -29,15 +29,16 @@ import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
 import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
+import org.apache.isis.core.metamodel.runtimecontext.ServicesInjector;
+import org.apache.isis.core.metamodel.spec.SpecificationLoader;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
 import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
 import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
 import org.apache.isis.core.runtime.system.DeploymentType;
-import org.apache.isis.core.runtime.system.context.IsisContext;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
 import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
 import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse;
-import org.apache.isis.viewer.restfulobjects.rendering.RendererContext4;
+import org.apache.isis.viewer.restfulobjects.rendering.RendererContext5;
 import org.apache.isis.viewer.restfulobjects.rendering.RestfulObjectsApplicationException;
 import org.apache.isis.viewer.restfulobjects.rendering.domainobjects.ActionResultReprRenderer;
 import org.apache.isis.viewer.restfulobjects.rendering.domainobjects.DomainObjectLinkTo;
@@ -52,13 +53,13 @@ import org.apache.isis.viewer.restfulobjects.server.ResourceContext;
 
 public class DomainResourceHelper {
 
-    static class RepresentationServiceContextAdapter implements RepresentationService.Context4 {
+    static class RepresentationServiceContextAdapter implements RepresentationService.Context5 {
 
-        private final RendererContext4 rendererContext;
+        private final RendererContext5 rendererContext;
         private final ObjectAdapterLinkTo adapterLinkTo;
 
         RepresentationServiceContextAdapter(
-                final RendererContext4 rendererContext,
+                final RendererContext5 rendererContext,
                 final ObjectAdapterLinkTo adapterLinkTo) {
             this.rendererContext = rendererContext;
             this.adapterLinkTo = adapterLinkTo;
@@ -91,7 +92,7 @@ public class DomainResourceHelper {
 
         @Override
         public AdapterManager getAdapterManager() {
-            return rendererContext.getAdapterManager();
+            return rendererContext.getPersistenceSession();
         }
 
         @Override
@@ -168,6 +169,16 @@ public class DomainResourceHelper {
         public InteractionInitiatedBy getInteractionInitiatedBy() {
             return rendererContext.getInteractionInitiatedBy();
         }
+
+        @Override
+        public SpecificationLoader getSpecificationLoader() {
+            return rendererContext.getSpecificationLoader();
+        }
+
+        @Override
+        public ServicesInjector getServicesInjector() {
+            return rendererContext.getServicesInjector();
+        }
     }
 
     private final RepresentationService representationService;
@@ -347,14 +358,15 @@ public class DomainResourceHelper {
     // //////////////////////////////////////
 
     private PersistenceSession getPersistenceSession() {
-        return IsisContext.getPersistenceSession();
+        return resourceContext.getPersistenceSession();
+    }
+
+    private ServicesInjector getServicesInjector() {
+        return resourceContext.getServicesInjector();
     }
 
-    /**
-     * Service locator
-     */
     private <T> T lookupService(Class<T> serviceType) {
-        return getPersistenceSession().getServiceOrNull(serviceType);
+        return getServicesInjector().lookupService(serviceType);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/6352f06a/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/resources/ResourceAbstract.java
----------------------------------------------------------------------
diff --git a/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/resources/ResourceAbstract.java b/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/resources/ResourceAbstract.java
index 9d725d3..46c3e58 100644
--- a/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/resources/ResourceAbstract.java
+++ b/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/resources/ResourceAbstract.java
@@ -38,6 +38,7 @@ import org.apache.isis.core.commons.url.UrlEncodingUtils;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.oid.OidMarshaller;
 import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
+import org.apache.isis.core.metamodel.runtimecontext.ServicesInjector;
 import org.apache.isis.core.metamodel.services.ServiceUtil;
 import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
 import org.apache.isis.core.runtime.authentication.AuthenticationManager;
@@ -112,9 +113,11 @@ public abstract class ResourceAbstract {
 
         this.resourceContext = new ResourceContext(
                 representationType, httpHeaders, providers, uriInfo, request, where, urlUnencodedQueryString, httpServletRequest, httpServletResponse,
-                securityContext, getLocalization(), getAuthenticationSession(), getPersistenceSession(),
-                getPersistenceSession(), getSpecificationLoader(), getConfiguration(),
-                getDeploymentType(), InteractionInitiatedBy.USER);
+                securityContext,
+                getDeploymentType(), getConfiguration(),
+                getServicesInjector(), getSpecificationLoader(),
+                getAuthenticationSession(), getLocalization(),
+                getPersistenceSession(), InteractionInitiatedBy.USER);
     }
 
     protected ResourceContext getResourceContext() {
@@ -164,6 +167,10 @@ public abstract class ResourceAbstract {
         return IsisContext.getConfiguration();
     }
 
+    protected ServicesInjector getServicesInjector () {
+        return IsisContext.getSessionFactory().getServicesInjector();
+    }
+
     protected AuthenticationSession getAuthenticationSession() {
         return IsisContext.getAuthenticationSession();
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/6352f06a/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContextTest_ensureCompatibleAcceptHeader.java
----------------------------------------------------------------------
diff --git a/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContextTest_ensureCompatibleAcceptHeader.java b/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContextTest_ensureCompatibleAcceptHeader.java
index 8f65ede..9c60ec0 100644
--- a/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContextTest_ensureCompatibleAcceptHeader.java
+++ b/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContextTest_ensureCompatibleAcceptHeader.java
@@ -161,8 +161,7 @@ public class ResourceContextTest_ensureCompatibleAcceptHeader {
 
     private ResourceContext instantiateResourceContext(
             final RepresentationType representationType) {
-        return new ResourceContext(representationType, httpHeaders, null, null, null, null, null, httpServletRequest, null, null, null, null, null, null, null, null, null,
-                null);
+        return new ResourceContext(representationType, httpHeaders, null, null, null, null, null, httpServletRequest, null, null, null, null, null, null, null, null, null, null);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/6352f06a/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContextTest_getArg.java
----------------------------------------------------------------------
diff --git a/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContextTest_getArg.java b/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContextTest_getArg.java
index 184f28f..7a3ced3 100644
--- a/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContextTest_getArg.java
+++ b/core/viewer-restfulobjects-server/src/test/java/org/apache/isis/viewer/restfulobjects/server/ResourceContextTest_getArg.java
@@ -56,8 +56,7 @@ public class ResourceContextTest_getArg {
         givenServletRequestQueryString(queryString);
         givenServletRequestParameterMapEmpty();
 
-        resourceContext = new ResourceContext(null, null, null, null, null, null, (String)null, httpServletRequest, null, null, null, null, null, null, null, null, null,
-                null) {
+        resourceContext = new ResourceContext(null, null, null, null, null, null, (String)null, httpServletRequest, null, null, null, null, null, null, null, null, null, null) {
             @Override
             void init(final RepresentationType representationType) {
                 //
@@ -73,8 +72,7 @@ public class ResourceContextTest_getArg {
         givenServletRequestQueryString(queryString);
         givenServletRequestParameterMapEmpty();
 
-        resourceContext = new ResourceContext(null, null, null, null, null, null, (String)null, httpServletRequest, null, null, null, null, null, null, null, null, null,
-                null) {
+        resourceContext = new ResourceContext(null, null, null, null, null, null, (String)null, httpServletRequest, null, null, null, null, null, null, null, null, null, null) {
             @Override
             void init(final RepresentationType representationType) {
                 //