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/08/07 12:11:28 UTC

[01/17] isis git commit: ISIS-1188: removed requirement to create an anonymous subclass of IsisSystemDefault.

Repository: isis
Updated Branches:
  refs/heads/master a930c1da1 -> cd84e55a6


ISIS-1188: removed requirement to create an anonymous subclass of IsisSystemDefault.


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

Branch: refs/heads/master
Commit: d16add77b71f4ed0d576b7cdf0cb45c03c46cd42
Parents: a930c1d
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Aug 5 08:20:31 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Aug 5 08:20:31 2015 +0100

----------------------------------------------------------------------
 .../integtestsupport/IsisSystemDefault.java     | 54 ++++++++++++--------
 .../integtestsupport/IsisSystemForTest.java     | 47 +++++------------
 2 files changed, 46 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/d16add77/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemDefault.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemDefault.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemDefault.java
index 4c7b875..47979aa 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemDefault.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemDefault.java
@@ -19,7 +19,6 @@
 package org.apache.isis.core.integtestsupport;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.Set;
 
@@ -58,13 +57,26 @@ import org.apache.isis.progmodels.dflt.ProgrammingModelFacetsJava5;
 
 public class IsisSystemDefault extends IsisSystemAbstract {
 
-    private final IsisConfigurationDefault configuration;
+    private final IsisConfiguration configuration;
     private final List<Object> servicesIfAny;
-
-    public IsisSystemDefault(DeploymentType deploymentType, List<Object> services) {
+    private final ProgrammingModel programmingModelOverride;
+    private final MetaModelValidator metaModelValidatorOverride;
+
+    public IsisSystemDefault(
+            final DeploymentType deploymentType,
+            final List<Object> services,
+            final IsisConfiguration configuration,
+            final ProgrammingModel programmingModelOverride,
+            final MetaModelValidator metaModelValidatorOverride) {
         super(deploymentType);
-        this.configuration = new IsisConfigurationDefault(ResourceStreamSourceContextLoaderClassPath.create("config"));
+        this.configuration = configuration;
         this.servicesIfAny = services;
+        this.programmingModelOverride = programmingModelOverride;
+        this.metaModelValidatorOverride = metaModelValidatorOverride;
+    }
+
+    static IsisConfiguration defaultConfiguration() {
+        return new IsisConfigurationDefault(ResourceStreamSourceContextLoaderClassPath.create("config"));
     }
 
     /**
@@ -112,7 +124,8 @@ public class IsisSystemDefault extends IsisSystemAbstract {
      */
     @Override
     protected SpecificationLoaderSpi obtainSpecificationLoaderSpi(DeploymentType deploymentType, Collection<MetaModelRefiner> metaModelRefiners) throws IsisSystemException {
-        
+
+
         final ProgrammingModel programmingModel = obtainReflectorProgrammingModel();
         final Set<FacetDecorator> facetDecorators = obtainReflectorFacetDecoratorSet();
         final MetaModelValidator mmv = obtainReflectorMetaModelValidator();
@@ -125,6 +138,11 @@ public class IsisSystemDefault extends IsisSystemAbstract {
      * Optional hook method.
      */
     protected ProgrammingModel obtainReflectorProgrammingModel() {
+
+        if (programmingModelOverride != null) {
+            return programmingModelOverride;
+        }
+
         final ProgrammingModelFacetsJava5 programmingModel = new ProgrammingModelFacetsJava5();
 
         // TODO: this is duplicating logic in JavaReflectorInstallerNoDecorators; need to unify.
@@ -138,13 +156,16 @@ public class IsisSystemDefault extends IsisSystemAbstract {
      * Optional hook method.
      */
     protected Set<FacetDecorator> obtainReflectorFacetDecoratorSet() {
-        return Sets.newHashSet((FacetDecorator)new StandardTransactionFacetDecorator(getConfiguration()));
+        return Sets.newHashSet((FacetDecorator) new StandardTransactionFacetDecorator(getConfiguration()));
     }
 
     /**
      * Optional hook method.
      */
     protected MetaModelValidator obtainReflectorMetaModelValidator() {
+        if(metaModelValidatorOverride != null) {
+            return metaModelValidatorOverride;
+        }
         return new MetaModelValidatorDefault();
     }
 
@@ -175,27 +196,16 @@ public class IsisSystemDefault extends IsisSystemAbstract {
         return new AuthorizationManagerStandard(getConfiguration());
     }
 
-    /**
-     * The in-memory object store (unless overridden by {@link #obtainPersistenceMechanismInstaller(IsisConfiguration)}).
-     */
     @Override
     protected PersistenceSessionFactory obtainPersistenceSessionFactory(DeploymentType deploymentType, final List<Object> services) throws IsisSystemException {
-        PersistenceMechanismInstaller installer = obtainPersistenceMechanismInstaller(getConfiguration());
-        if(installer == null) {
-            final DataNucleusPersistenceMechanismInstaller persistenceMechanismInstaller = new DataNucleusPersistenceMechanismInstaller();
-            persistenceMechanismInstaller.setConfiguration(getConfiguration());
-            installer = persistenceMechanismInstaller;
-        }
+        PersistenceMechanismInstaller installer =
+                createPersistenceMechanismInstaller(getConfiguration());
         return installer.createPersistenceSessionFactory(deploymentType, services);
     }
 
-
-    /**
-     * Optional hook; if returns <tt>null</tt> then the {@link #obtainPersistenceSessionFactory(DeploymentType)} is used.
-     */
-    protected PersistenceMechanismInstaller obtainPersistenceMechanismInstaller(IsisConfiguration configuration) throws IsisSystemException {
+    private PersistenceMechanismInstaller createPersistenceMechanismInstaller(IsisConfiguration configuration) throws IsisSystemException {
         DataNucleusPersistenceMechanismInstaller installer = new DataNucleusPersistenceMechanismInstaller();
-        installer.setConfiguration(getConfiguration());
+        installer.setConfiguration(configuration);
         return installer;
     }
 

http://git-wip-us.apache.org/repos/asf/isis/blob/d16add77/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
index d55efcc..a645f5c 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
@@ -452,45 +452,26 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
         IsisContext.closeSession();
     }
 
+    private IsisConfiguration getConfigurationElseDefault() {
+        if(this.configuration != null) {
+            return this.configuration;
+        } else {
+            return IsisSystemDefault.defaultConfiguration();
+        }
+    }
+
+
     private IsisSystemDefault createIsisSystem(List<Object> services) {
 
-        final IsisSystemDefault system = new IsisSystemDefault(DeploymentType.UNIT_TESTING, services) {
-            @Override
-            public IsisConfiguration getConfiguration() {
-                if(IsisSystemForTest.this.configuration != null) {
-                    return IsisSystemForTest.this.configuration;
-                } else {
-                    return super.getConfiguration();
-                }
-            }
-            @Override
-            protected ProgrammingModel obtainReflectorProgrammingModel() {
-                if(IsisSystemForTest.this.programmingModel != null) {
-                    return IsisSystemForTest.this.programmingModel;
-                } else {
-                    return super.obtainReflectorProgrammingModel();
-                }
-            }
-            @Override
-            protected MetaModelValidator obtainReflectorMetaModelValidator() {
-                if(IsisSystemForTest.this.metaModelValidator != null) {
-                    return IsisSystemForTest.this.metaModelValidator;
-                } else {
-                    return super.obtainReflectorMetaModelValidator();
-                }
-            }
-            @Override
-            protected PersistenceMechanismInstaller obtainPersistenceMechanismInstaller(IsisConfiguration configuration) {
-                final PersistenceMechanismInstaller installer = IsisSystemForTest.this.persistenceMechanismInstaller;
-                configuration.injectInto(installer);
-                return installer;
-            }
-        };
+        final IsisSystemDefault system = new IsisSystemDefault(
+                DeploymentType.UNIT_TESTING, services,
+                getConfigurationElseDefault(),
+                this.programmingModel,
+                this.metaModelValidator);
         return system;
     }
 
 
-
     ////////////////////////////////////////////////////////////
     // listeners
     ////////////////////////////////////////////////////////////


[13/17] isis git commit: ISIS-848: provide the ability to specify the AppManifest programmatically within the IsisWicketApplication subclass.

Posted by da...@apache.org.
ISIS-848: provide the ability to specify the AppManifest programmatically within the IsisWicketApplication subclass.


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

Branch: refs/heads/master
Commit: b286e57af2d0a55e78b3418a4d8de69d1620fb06
Parents: 0778019
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Aug 7 10:30:18 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Aug 7 10:30:18 2015 +0100

----------------------------------------------------------------------
 .../IsisComponentProviderDefault.java           | 10 +--
 .../core/runtime/runner/IsisInjectModule.java   | 12 +++-
 .../core/runtime/system/IsisSystemFactory.java  |  3 +-
 .../IsisComponentProviderAbstract.java          | 14 ++++
 .../IsisComponentProviderUsingInstallers.java   | 21 ++++--
 .../IsisSystemThatUsesInstallersFactory.java    |  5 +-
 .../viewer/wicket/viewer/IsisWicketModule.java  |  4 +-
 .../domainapp/webapp/SimpleApplication.java     | 60 ++---------------
 .../src/main/webapp/WEB-INF/isis.properties     | 69 ++++++++++----------
 9 files changed, 91 insertions(+), 107 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/b286e57a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
index 343306e..5f8b9c1 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
@@ -53,7 +53,6 @@ import org.apache.isis.core.runtime.services.ServicesInstallerFromConfiguration;
 import org.apache.isis.core.runtime.services.ServicesInstallerFromConfigurationAndAnnotation;
 import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.core.runtime.system.IsisSystemException;
-import org.apache.isis.core.runtime.system.SystemConstants;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
 import org.apache.isis.core.runtime.systemusinginstallers.IsisComponentProviderAbstract;
 import org.apache.isis.core.runtime.transaction.facetdecorator.standard.StandardTransactionFacetDecorator;
@@ -82,14 +81,9 @@ public class IsisComponentProviderDefault extends IsisComponentProviderAbstract
         final String fixtureClassNamesCsv;
         if(appManifest != null) {
 
-            specifyServicesAndRegisteredEntitiesUsing(appManifest);
+            putAppManifestKey();
 
-            // required to prevent RegisterEntities validation from complaining
-            // if it can't find any @PersistenceCapable entities in a module
-            // that contains only services.
-            putConfigurationProperty(
-                    SystemConstants.APP_MANIFEST_KEY, appManifestIfAny.getClass().getName()
-            );
+            specifyServicesAndRegisteredEntitiesUsing(appManifest);
 
             List<Class<? extends FixtureScript>> fixtureClasses = appManifest.getFixtures();
             fixtureClassNamesCsv = classNamesFrom(fixtureClasses);

http://git-wip-us.apache.org/repos/asf/isis/blob/b286e57a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/IsisInjectModule.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/IsisInjectModule.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/IsisInjectModule.java
index bdf5932..c963b91 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/IsisInjectModule.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/IsisInjectModule.java
@@ -20,11 +20,16 @@
 package org.apache.isis.core.runtime.runner;
 
 import java.util.List;
+
+import javax.annotation.Nullable;
+
 import com.google.common.collect.Lists;
 import com.google.inject.AbstractModule;
 import com.google.inject.Inject;
 import com.google.inject.Provides;
 import com.google.inject.Singleton;
+
+import org.apache.isis.applib.AppManifest;
 import org.apache.isis.core.commons.config.IsisConfigurationBuilder;
 import org.apache.isis.core.commons.config.IsisConfigurationBuilderDefault;
 import org.apache.isis.core.runtime.installerregistry.InstallerLookup;
@@ -128,8 +133,11 @@ public class IsisInjectModule extends AbstractModule {
     @Provides
     @Inject
     @Singleton
-    protected IsisSystem provideIsisSystem(final DeploymentType deploymentType, final IsisSystemFactory systemFactory) {
-        final IsisSystem system = systemFactory.createSystem(deploymentType);
+    protected IsisSystem provideIsisSystem(
+            final DeploymentType deploymentType,
+            final IsisSystemFactory systemFactory,
+            @Nullable final AppManifest appManifestIfAny) {
+        final IsisSystem system = systemFactory.createSystem(deploymentType, appManifestIfAny);
         system.init();
         return system;
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/b286e57a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemFactory.java
index bac99bc..cd39b87 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemFactory.java
@@ -19,6 +19,7 @@
 
 package org.apache.isis.core.runtime.system;
 
+import org.apache.isis.applib.AppManifest;
 import org.apache.isis.core.commons.components.ApplicationScopedComponent;
 
 /**
@@ -26,6 +27,6 @@ import org.apache.isis.core.commons.components.ApplicationScopedComponent;
  */
 public interface IsisSystemFactory extends ApplicationScopedComponent {
 
-    IsisSystem createSystem(final DeploymentType deploymentType);
+    IsisSystem createSystem(final DeploymentType deploymentType, final AppManifest appManifestIfAny);
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/b286e57a/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 a662371..4c4e75e 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
@@ -37,6 +37,7 @@ import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
 import org.apache.isis.core.runtime.services.ServicesInstallerFromAnnotation;
 import org.apache.isis.core.runtime.services.ServicesInstallerFromConfiguration;
 import org.apache.isis.core.runtime.system.DeploymentType;
+import org.apache.isis.core.runtime.system.SystemConstants;
 import org.apache.isis.objectstore.jdo.service.RegisterEntities;
 
 import static org.apache.isis.core.commons.ensure.Ensure.ensureThatState;
@@ -79,6 +80,19 @@ public abstract class IsisComponentProviderAbstract implements IsisComponentProv
 
         this.deploymentType = deploymentType;
         this.appManifest = appManifest;
+
+    }
+
+    protected void putAppManifestKey() {
+        if (this.appManifest == null) {
+            return;
+        }
+        // required to prevent RegisterEntities validation from complaining
+        // if it can't find any @PersistenceCapable entities in a module
+        // that contains only services.
+        putConfigurationProperty(
+                SystemConstants.APP_MANIFEST_KEY, this.appManifest.getClass().getName()
+        );
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/isis/blob/b286e57a/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 e0fd90e..d1d58a7 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
@@ -57,8 +57,9 @@ public class IsisComponentProviderUsingInstallers extends IsisComponentProviderA
 
     public IsisComponentProviderUsingInstallers(
             final DeploymentType deploymentType,
+            final AppManifest appManifestIfAny,
             final InstallerLookup installerLookup) {
-        super(deploymentType, appManifestIfAny(installerLookup));
+        super(deploymentType, appManifestIfAny(appManifestIfAny, installerLookup));
 
         ensureThatArg(deploymentType, is(not(nullValue())));
         ensureThatArg(installerLookup, is(not(nullValue())));
@@ -67,6 +68,8 @@ public class IsisComponentProviderUsingInstallers extends IsisComponentProviderA
 
         if(appManifest != null) {
 
+            putAppManifestKey();
+
             specifyServicesAndRegisteredEntitiesUsing(appManifest);
 
             putConfigurationProperty(SystemConstants.SERVICES_INSTALLER_KEY, ServicesInstallerFromConfigurationAndAnnotation.NAME);
@@ -141,9 +144,19 @@ public class IsisComponentProviderUsingInstallers extends IsisComponentProviderA
         ensureInitialized();
     }
 
-    private static AppManifest appManifestIfAny(final InstallerLookup installerLookup) {
-        final String appManifestIfAny = installerLookup.getConfiguration().getString(SystemConstants.APP_MANIFEST_KEY);
-        return appManifestIfAny != null? InstanceUtil.createInstance(appManifestIfAny, AppManifest.class): null;
+    /**
+     * If an {@link AppManifest} was explicitly provided (eg from the Guice <tt>IsisWicketModule</tt> when running
+     * unde the Wicket viewer) then use that; otherwise read the <tt>isis.properties</tt> config file and look
+     * for an <tt>isis.appManifest</tt> entry instead.
+     */
+    private static AppManifest appManifestIfAny(
+            final AppManifest appManifestFromConstructor,
+            final InstallerLookup installerLookup) {
+        if(appManifestFromConstructor != null) {
+            return appManifestFromConstructor;
+        }
+        final String appManifestFromConfiguration = installerLookup.getConfiguration().getString(SystemConstants.APP_MANIFEST_KEY);
+        return appManifestFromConfiguration != null? InstanceUtil.createInstance(appManifestFromConfiguration, AppManifest.class): null;
     }
 
     protected void doPutConfigurationProperty(final String key, final String value) {

http://git-wip-us.apache.org/repos/asf/isis/blob/b286e57a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java
index f0160ff..a668624 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java
@@ -21,6 +21,7 @@ package org.apache.isis.core.runtime.systemusinginstallers;
 
 import com.google.inject.Inject;
 
+import org.apache.isis.applib.AppManifest;
 import org.apache.isis.core.runtime.installerregistry.InstallerLookup;
 import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.core.runtime.system.IsisSystem;
@@ -52,9 +53,9 @@ public class IsisSystemThatUsesInstallersFactory implements IsisSystemFactory {
     //endregion
 
     @Override
-    public IsisSystem createSystem(final DeploymentType deploymentType) {
+    public IsisSystem createSystem(final DeploymentType deploymentType, final AppManifest appManifestIfAny) {
         IsisComponentProviderUsingInstallers componentProvider =
-                new IsisComponentProviderUsingInstallers(deploymentType, installerLookup);
+                new IsisComponentProviderUsingInstallers(deploymentType, appManifestIfAny, installerLookup);
         return new IsisSystem(componentProvider);
     }
 

http://git-wip-us.apache.org/repos/asf/isis/blob/b286e57a/core/viewer-wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java b/core/viewer-wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java
index 4d3ae8d..12ea8b6 100644
--- a/core/viewer-wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java
+++ b/core/viewer-wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java
@@ -22,10 +22,11 @@ package org.apache.isis.viewer.wicket.viewer;
 import com.google.inject.AbstractModule;
 import com.google.inject.name.Names;
 import com.google.inject.util.Providers;
+
 import org.apache.isis.applib.services.email.EmailService;
 import org.apache.isis.applib.services.userreg.EmailNotificationService;
-import org.apache.isis.core.runtime.services.userreg.EmailNotificationServiceDefault;
 import org.apache.isis.core.runtime.services.email.EmailServiceDefault;
+import org.apache.isis.core.runtime.services.userreg.EmailNotificationServiceDefault;
 import org.apache.isis.viewer.wicket.model.isis.WicketViewerSettings;
 import org.apache.isis.viewer.wicket.model.models.ImageResourceCache;
 import org.apache.isis.viewer.wicket.ui.app.registry.ComponentFactoryRegistrar;
@@ -62,6 +63,7 @@ import org.apache.isis.viewer.wicket.viewer.settings.WicketViewerSettingsDefault
  *         bind(String.class).annotatedWith(Names.named("applicationJs")).toInstance("scripts/application.js");
  *         bind(String.class).annotatedWith(Names.named("welcomeMessage")).toInstance("Hello, welcome to my app");
  *         bind(String.class).annotatedWith(Names.named("aboutMessage")).toInstance("MyApp v1.0.0");
+ *         bind(AppManifest.class).toInstance(new MyAppManifest());
  *      }
  *  };
  * final Module overridden = Modules.override(isisDefaults).with(myAppOverrides);

http://git-wip-us.apache.org/repos/asf/isis/blob/b286e57a/example/application/simpleapp/webapp/src/main/java/domainapp/webapp/SimpleApplication.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/webapp/src/main/java/domainapp/webapp/SimpleApplication.java b/example/application/simpleapp/webapp/src/main/java/domainapp/webapp/SimpleApplication.java
index 57d1e0b..35a8984 100644
--- a/example/application/simpleapp/webapp/src/main/java/domainapp/webapp/SimpleApplication.java
+++ b/example/application/simpleapp/webapp/src/main/java/domainapp/webapp/SimpleApplication.java
@@ -23,8 +23,6 @@ import java.io.InputStream;
 import java.nio.charset.Charset;
 import java.util.List;
 
-import javax.servlet.http.HttpServletRequest;
-
 import com.google.common.base.Joiner;
 import com.google.common.io.Resources;
 import com.google.inject.AbstractModule;
@@ -33,20 +31,14 @@ import com.google.inject.name.Names;
 import com.google.inject.util.Modules;
 import com.google.inject.util.Providers;
 
-import org.apache.wicket.Session;
-import org.apache.wicket.request.IRequestParameters;
-import org.apache.wicket.request.Request;
-import org.apache.wicket.request.Response;
-import org.apache.wicket.request.http.WebRequest;
-
+import org.apache.isis.applib.AppManifest;
 import org.apache.isis.viewer.wicket.viewer.IsisWicketApplication;
-import org.apache.isis.viewer.wicket.viewer.integration.wicket.AuthenticatedWebSessionForIsis;
 
 import de.agilecoders.wicket.core.Bootstrap;
 import de.agilecoders.wicket.core.settings.IBootstrapSettings;
 import de.agilecoders.wicket.themes.markup.html.bootswatch.BootswatchTheme;
 import de.agilecoders.wicket.themes.markup.html.bootswatch.BootswatchThemeProvider;
-
+import domainapp.home.SimpleAppManifest;
 
 /**
  * As specified in <tt>web.xml</tt>.
@@ -69,16 +61,6 @@ public class SimpleApplication extends IsisWicketApplication {
 
     private static final long serialVersionUID = 1L;
 
-    /**
-     * uncomment for a (slightly hacky) way of allowing logins using query args, eg:
-     * 
-     * <tt>?user=sven&pass=pass</tt>
-     * 
-     * <p>
-     * for demos only, obvious.
-     */
-    private final static boolean DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS = false;
-
 
     @Override
     protected void init() {
@@ -89,39 +71,6 @@ public class SimpleApplication extends IsisWicketApplication {
     }
 
     @Override
-    public Session newSession(final Request request, final Response response) {
-        if(!DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS) {
-            return super.newSession(request, response);
-        } 
-        
-        // else demo mode
-        final AuthenticatedWebSessionForIsis s = (AuthenticatedWebSessionForIsis) super.newSession(request, response);
-        IRequestParameters requestParameters = request.getRequestParameters();
-        final org.apache.wicket.util.string.StringValue user = requestParameters.getParameterValue("user");
-        final org.apache.wicket.util.string.StringValue password = requestParameters.getParameterValue("pass");
-        s.signIn(user.toString(), password.toString());
-        return s;
-    }
-
-    @Override
-    public WebRequest newWebRequest(HttpServletRequest servletRequest, String filterPath) {
-        if(!DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS) {
-            return super.newWebRequest(servletRequest, filterPath);
-        } 
-
-        // else demo mode
-        try {
-            String uname = servletRequest.getParameter("user");
-            if (uname != null) {
-                servletRequest.getSession().invalidate();
-            }
-        } catch (Exception e) {
-        }
-        WebRequest request = super.newWebRequest(servletRequest, filterPath);
-        return request;
-    }
-    
-    @Override
     protected Module newIsisWicketModule() {
         final Module isisDefaults = super.newIsisWicketModule();
         
@@ -133,7 +82,10 @@ public class SimpleApplication extends IsisWicketApplication {
                 bind(String.class).annotatedWith(Names.named("applicationJs")).toInstance("scripts/application.js");
                 bind(String.class).annotatedWith(Names.named("welcomeMessage")).toInstance(readLines(getClass(), "welcome.html"));
                 bind(String.class).annotatedWith(Names.named("aboutMessage")).toInstance("Simple App");
-                bind(InputStream.class).annotatedWith(Names.named("metaInfManifest")).toProvider(Providers.of(getServletContext().getResourceAsStream("/META-INF/MANIFEST.MF")));
+                bind(InputStream.class).annotatedWith(Names.named("metaInfManifest")).toProvider(
+                        Providers.of(getServletContext().getResourceAsStream("/META-INF/MANIFEST.MF")));
+                // if uncommented, then overrides isis.appManifest in config file.
+                // bind(AppManifest.class).toInstance(new SimpleAppManifest());
             }
         };
 

http://git-wip-us.apache.org/repos/asf/isis/blob/b286e57a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
index 4184589..1ce1f41 100644
--- a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
+++ b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -22,6 +22,13 @@
 #
 #################################################################################
 
+#
+# Specify the modules (= entities + services) and other components that make up
+# this application.
+#
+# alternatively, can provide the AppManifest programmatically by overriding
+# IsisWicketApplication#newIsisWicketModule()
+#
 
 isis.appManifest=domainapp.home.SimpleAppManifest
 #isis.appManifest=domainapp.home.SimpleAppManifestBypassSecurity
@@ -29,8 +36,6 @@ isis.appManifest=domainapp.home.SimpleAppManifest
 
 
 
-
-
 #################################################################################
 #
 # MetaModel
@@ -66,14 +71,13 @@ isis.appManifest=domainapp.home.SimpleAppManifest
 isis.reflector.validator.allowDeprecated=false
 
 
-
 #
-# Implementation to use for reading dynamic layout.  Default implementation reads Xxx.layout.json files from classpath.
+# Implementation to use for reading dynamic layout.
+# Default implementation reads Xxx.layout.json files from classpath.
 #
 #isis.reflector.layoutMetadataReaders=org.apache.isis.core.metamodel.layoutmetadata.json.LayoutMetadataReaderFromJson
 
 
-
 #
 # patterns for applying CssClassFa facet (font-awesome icons), matching on action names
 #
@@ -112,25 +116,10 @@ isis.reflector.facet.cssClass.patterns=\
 
 #################################################################################
 #
-# Value facet defaults
-#
-# (see also viewer-specific config files, eg viewer_wicket.properties)
+# Domain Service configuration
 #
 #################################################################################
 
-# as used by @Title of a date
-isis.value.format.date=dd-MM-yyyy
-
-
-
-#################################################################################
-#
-# Domain service Configuration
-#
-#################################################################################
-
-
-
 #
 # required by EmailServiceDefault
 #
@@ -138,7 +127,6 @@ isis.value.format.date=dd-MM-yyyy
 #isis.service.email.sender.password=the.password.for-isis.notification.email.sender.address
 
 
-
 #
 # whether ExceptionRecognizers should also log any recognized exceptions
 # (default false; enable for diagnostics/debugging)
@@ -157,7 +145,7 @@ isis.value.format.date=dd-MM-yyyy
 
 ################################################################################
 #
-# Auditing, Publishing, Command
+# Auditing, Commands, Publishing
 #
 ################################################################################
 
@@ -168,6 +156,7 @@ isis.value.format.date=dd-MM-yyyy
 #
 #isis.services.audit.objects=all|none
 
+
 #
 # Whether changes to objects should be published; if not set, defaults to "none"
 # - if not set or set to "none", can explicitly enable using @DomainObject(publishing=Publishing.ENABLED)
@@ -175,22 +164,21 @@ isis.value.format.date=dd-MM-yyyy
 #
 #isis.services.publish.objects=all|none
 
-#
-# Whether all (or all non-query only) actions should be published; if not set, defaults to "none"
-# - if not set or set to "none", can explicitly enable using @Action(publishing=Publishing.ENABLED)
-# - if set to "all", can explicitly disable using @Action(publishing=Publishing.DISABLED)
-#
-#isis.services.publish.actions=all|none|ignoreQueryOnly
-
 
 #
 # Whether all (or all non-query only) actions should be reified as commands; if not set, defaults to "none"
 # - if not set or set to "none", can explicitly enable using @Action(command=CommandReification.ENABLED)
 # - if set to "all", can explicitly disable using @Action(command=CommandReification.DISABLED)
 #
-#isis.services.command.actions=all|none|ignoreQueryOnly
+#isis.services.command.actions=all|none|ignoreSafe
 
 
+#
+# Whether all (or all non-query only) actions should be published; if not set, defaults to "none"
+# - if not set or set to "none", can explicitly enable using @Action(publishing=Publishing.ENABLED)
+# - if set to "all", can explicitly disable using @Action(publishing=Publishing.DISABLED)
+#
+#isis.services.publish.actions=all|none|ignoreSafe
 
 
 
@@ -209,8 +197,6 @@ isis.value.format.date=dd-MM-yyyy
 
 
 
-
-
 ################################################################################
 #
 # i18n
@@ -224,8 +210,6 @@ isis.value.format.date=dd-MM-yyyy
 
 
 
-
-
 ################################################################################
 #
 # Viewer defaults
@@ -241,3 +225,18 @@ isis.value.format.date=dd-MM-yyyy
 
 #isis.viewers.propertyLayout.labelPosition=LEFT
 #isis.viewers.parameterLayout.labelPosition=LEFT
+
+
+#################################################################################
+#
+# Value facet defaults
+#
+# (see also viewer-specific config files, eg viewer_wicket.properties)
+#
+#################################################################################
+
+# as used by @Title of a date
+isis.value.format.date=dd-MM-yyyy
+
+
+


[02/17] isis git commit: ISIS-1188: collapsing and disentangling IsisSystem hierarchy..

Posted by da...@apache.org.
ISIS-1188: collapsing and disentangling IsisSystem hierarchy..

introduced IsisComponentProvider interface to represent the responsibilities of the subclasses if IsisSystemAbstract.


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

Branch: refs/heads/master
Commit: 860511794ca3a4e54cd2a8a1c3f92b1f43d9f504
Parents: d16add7
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Aug 5 17:24:02 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Aug 5 17:24:02 2015 +0100

----------------------------------------------------------------------
 .../IsisComponentProviderDefault.java           | 224 +++++++++++
 .../integtestsupport/IsisSystemDefault.java     | 212 ----------
 .../integtestsupport/IsisSystemForTest.java     |  26 +-
 .../specloader/ServiceInitializer.java          |   3 -
 .../IsisComponentProvider.java                  |  61 +++
 .../IsisComponentProviderUsingInstallers.java   | 167 ++++++++
 .../IsisSystemAbstract.java                     | 402 -------------------
 .../IsisSystemThatUsesInstallersFactory.java    |   8 +-
 .../IsisSystemUsingComponentProvider.java       | 392 ++++++++++++++++++
 .../IsisSystemUsingInstallers.java              | 192 ---------
 10 files changed, 861 insertions(+), 826 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/86051179/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
new file mode 100644
index 0000000..b710fe1
--- /dev/null
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
@@ -0,0 +1,224 @@
+/*
+ *  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.integtestsupport;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.commons.config.IsisConfigurationDefault;
+import org.apache.isis.core.commons.resource.ResourceStreamSourceContextLoaderClassPath;
+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.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.spec.SpecificationLoaderSpi;
+import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidator;
+import org.apache.isis.core.runtime.authentication.AuthenticationManager;
+import org.apache.isis.core.runtime.authentication.standard.AuthenticationManagerStandard;
+import org.apache.isis.core.runtime.authentication.standard.Authenticator;
+import org.apache.isis.core.runtime.authorization.AuthorizationManager;
+import org.apache.isis.core.runtime.authorization.standard.AuthorizationManagerStandard;
+import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
+import org.apache.isis.core.runtime.fixtures.FixturesInstallerFromConfiguration;
+import org.apache.isis.core.runtime.installerregistry.installerapi.PersistenceMechanismInstaller;
+import org.apache.isis.core.runtime.services.ServicesInstallerFromConfiguration;
+import org.apache.isis.core.runtime.system.DeploymentType;
+import org.apache.isis.core.runtime.system.IsisSystemException;
+import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
+import org.apache.isis.core.runtime.systemusinginstallers.IsisComponentProvider;
+import org.apache.isis.core.runtime.transaction.facetdecorator.standard.StandardTransactionFacetDecorator;
+import org.apache.isis.core.security.authentication.AuthenticatorBypass;
+import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
+import org.apache.isis.progmodels.dflt.JavaReflectorHelper;
+import org.apache.isis.progmodels.dflt.ProgrammingModelFacetsJava5;
+
+public class IsisComponentProviderDefault implements IsisComponentProvider {
+
+    private final DeploymentType deploymentType;
+
+    private final IsisConfiguration configuration;
+    private final List<Object> servicesIfAny;
+    private final ProgrammingModel programmingModelOverride;
+    private final MetaModelValidator metaModelValidatorOverride;
+
+    public IsisComponentProviderDefault(
+            final DeploymentType deploymentType,
+            final List<Object> services,
+            final IsisConfiguration configuration,
+            final ProgrammingModel programmingModelOverride,
+            final MetaModelValidator metaModelValidatorOverride) {
+        this.deploymentType = deploymentType;
+        this.configuration = configuration;
+        this.servicesIfAny = services;
+        this.programmingModelOverride = programmingModelOverride;
+        this.metaModelValidatorOverride = metaModelValidatorOverride;
+    }
+
+    static IsisConfiguration defaultConfiguration() {
+        return new IsisConfigurationDefault(ResourceStreamSourceContextLoaderClassPath.create("config"));
+    }
+
+
+    @Override
+    public DeploymentType getDeploymentType() {
+        return deploymentType;
+    }
+
+
+    /**
+     * Reads <tt>isis.properties</tt> (and other optional property files) from the &quot;config&quot; package on the current classpath.
+     */
+    @Override
+    public IsisConfiguration getConfiguration() {
+        return configuration;
+    }
+
+
+    /**
+     * Either the services explicitly provided by a constructor, otherwise reads from the configuration.
+     */
+    @Override
+    public List<Object> obtainServices() {
+        if(servicesIfAny != null) {
+            return servicesIfAny;
+        }
+        // else
+        final ServicesInstallerFromConfiguration servicesInstaller = new ServicesInstallerFromConfiguration();
+        return servicesInstaller.getServices(getDeploymentType());
+    }
+
+    /**
+     * Install fixtures from configuration.
+     */
+    @Override
+    public FixturesInstaller obtainFixturesInstaller() throws IsisSystemException {
+        final FixturesInstallerFromConfiguration fixturesInstallerFromConfiguration = new FixturesInstallerFromConfiguration();
+        fixturesInstallerFromConfiguration.setConfiguration(getConfiguration());
+        return fixturesInstallerFromConfiguration;
+    }
+
+
+    /**
+     * <p>
+     * Each of the subcomponents can be overridden if required.
+     *
+     * @see #obtainReflectorFacetDecoratorSet()
+     * @see #obtainReflectorMetaModelValidator()
+     * @see #obtainReflectorProgrammingModel()
+     */
+    @Override
+    public SpecificationLoaderSpi provideSpecificationLoaderSpi(
+            DeploymentType deploymentType,
+            Collection<MetaModelRefiner> metaModelRefiners) throws IsisSystemException {
+
+
+        final ProgrammingModel programmingModel = obtainReflectorProgrammingModel();
+        final Set<FacetDecorator> facetDecorators = obtainReflectorFacetDecoratorSet();
+        final MetaModelValidator mmv = obtainReflectorMetaModelValidator();
+        final List<LayoutMetadataReader> layoutMetadataReaders = obtainLayoutMetadataReaders();
+        return JavaReflectorHelper
+                .createObjectReflector(programmingModel, metaModelRefiners, facetDecorators, layoutMetadataReaders, mmv,
+                        getConfiguration());
+    }
+
+
+    private ProgrammingModel obtainReflectorProgrammingModel() {
+
+        if (programmingModelOverride != null) {
+            return programmingModelOverride;
+        }
+
+        final ProgrammingModelFacetsJava5 programmingModel = new ProgrammingModelFacetsJava5();
+
+        // TODO: this is duplicating logic in JavaReflectorInstallerNoDecorators; need to unify.
+
+        ProgrammingModel.Util.includeFacetFactories(getConfiguration(), programmingModel);
+        ProgrammingModel.Util.excludeFacetFactories(getConfiguration(), programmingModel);
+        return programmingModel;
+    }
+
+    /**
+     * Optional hook method.
+     */
+    private Set<FacetDecorator> obtainReflectorFacetDecoratorSet() {
+        return Sets.newHashSet((FacetDecorator) new StandardTransactionFacetDecorator(getConfiguration()));
+    }
+
+    /**
+     * Optional hook method.
+     */
+    protected MetaModelValidator obtainReflectorMetaModelValidator() {
+        if(metaModelValidatorOverride != null) {
+            return metaModelValidatorOverride;
+        }
+        return new MetaModelValidatorDefault();
+    }
+
+    /**
+     * Optional hook method.
+     */
+    protected List<LayoutMetadataReader> obtainLayoutMetadataReaders() {
+        return Lists.<LayoutMetadataReader>newArrayList(new LayoutMetadataReaderFromJson());
+    }
+
+
+    /**
+     * The standard authentication manager, configured with the default authenticator (allows all requests through).
+     */
+    @Override
+    public AuthenticationManager provideAuthenticationManager(DeploymentType deploymentType) throws IsisSystemException {
+        final AuthenticationManagerStandard authenticationManager = new AuthenticationManagerStandard(getConfiguration());
+        Authenticator authenticator = new AuthenticatorBypass(configuration);
+        authenticationManager.addAuthenticator(authenticator);
+        return authenticationManager;
+    }
+
+    /**
+     * The standard authorization manager, allowing all access.
+     */
+    @Override
+    public AuthorizationManager provideAuthorizationManager(DeploymentType deploymentType) {
+        return new AuthorizationManagerStandard(getConfiguration());
+    }
+
+    @Override
+    public PersistenceSessionFactory providePersistenceSessionFactory(
+            DeploymentType deploymentType,
+            final List<Object> services) throws IsisSystemException {
+        PersistenceMechanismInstaller installer =
+                createPersistenceMechanismInstaller(getConfiguration());
+        return installer.createPersistenceSessionFactory(deploymentType, services);
+    }
+
+    private PersistenceMechanismInstaller createPersistenceMechanismInstaller(IsisConfiguration configuration) throws IsisSystemException {
+        DataNucleusPersistenceMechanismInstaller installer = new DataNucleusPersistenceMechanismInstaller();
+        installer.setConfiguration(configuration);
+        return installer;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/86051179/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemDefault.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemDefault.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemDefault.java
deleted file mode 100644
index 47979aa..0000000
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemDefault.java
+++ /dev/null
@@ -1,212 +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.integtestsupport;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.commons.config.IsisConfigurationDefault;
-import org.apache.isis.core.commons.resource.ResourceStreamSourceContextLoaderClassPath;
-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.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.spec.SpecificationLoaderSpi;
-import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidator;
-import org.apache.isis.core.runtime.authentication.AuthenticationManager;
-import org.apache.isis.core.runtime.authentication.standard.AuthenticationManagerStandard;
-import org.apache.isis.core.runtime.authentication.standard.Authenticator;
-import org.apache.isis.core.runtime.authorization.AuthorizationManager;
-import org.apache.isis.core.runtime.authorization.standard.AuthorizationManagerStandard;
-import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
-import org.apache.isis.core.runtime.fixtures.FixturesInstallerFromConfiguration;
-import org.apache.isis.core.runtime.installerregistry.installerapi.PersistenceMechanismInstaller;
-import org.apache.isis.core.runtime.services.ServicesInstallerFromConfiguration;
-import org.apache.isis.core.runtime.system.DeploymentType;
-import org.apache.isis.core.runtime.system.IsisSystemException;
-import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
-import org.apache.isis.core.runtime.systemusinginstallers.IsisSystemAbstract;
-import org.apache.isis.core.runtime.transaction.facetdecorator.standard.StandardTransactionFacetDecorator;
-import org.apache.isis.core.security.authentication.AuthenticatorBypass;
-import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
-import org.apache.isis.progmodels.dflt.JavaReflectorHelper;
-import org.apache.isis.progmodels.dflt.ProgrammingModelFacetsJava5;
-
-public class IsisSystemDefault extends IsisSystemAbstract {
-
-    private final IsisConfiguration configuration;
-    private final List<Object> servicesIfAny;
-    private final ProgrammingModel programmingModelOverride;
-    private final MetaModelValidator metaModelValidatorOverride;
-
-    public IsisSystemDefault(
-            final DeploymentType deploymentType,
-            final List<Object> services,
-            final IsisConfiguration configuration,
-            final ProgrammingModel programmingModelOverride,
-            final MetaModelValidator metaModelValidatorOverride) {
-        super(deploymentType);
-        this.configuration = configuration;
-        this.servicesIfAny = services;
-        this.programmingModelOverride = programmingModelOverride;
-        this.metaModelValidatorOverride = metaModelValidatorOverride;
-    }
-
-    static IsisConfiguration defaultConfiguration() {
-        return new IsisConfigurationDefault(ResourceStreamSourceContextLoaderClassPath.create("config"));
-    }
-
-    /**
-     * Reads <tt>isis.properties</tt> (and other optional property files) from the &quot;config&quot; package on the current classpath.
-     */
-    @Override
-    public IsisConfiguration getConfiguration() {
-        return configuration;
-    }
-
-
-    /**
-     * Either the services explicitly provided by a constructor, otherwise reads from the configuration.
-     */
-    @Override
-    protected List<Object> obtainServices() {
-        if(servicesIfAny != null) {
-            return servicesIfAny;
-        }
-        // else
-        final ServicesInstallerFromConfiguration servicesInstaller = new ServicesInstallerFromConfiguration();
-        return servicesInstaller.getServices(getDeploymentType());
-    }
-
-    /**
-     * Install fixtures from configuration.
-     */
-    @Override
-    protected FixturesInstaller obtainFixturesInstaller() throws IsisSystemException {
-        final FixturesInstallerFromConfiguration fixturesInstallerFromConfiguration = new FixturesInstallerFromConfiguration();
-        fixturesInstallerFromConfiguration.setConfiguration(getConfiguration());
-        return fixturesInstallerFromConfiguration;
-    }
-
-
-    /**
-     * Optional hook method, to create the reflector with defaults (Java5, with cglib, and only the transaction facet decorators)
-     * 
-     * <p>
-     * Each of the subcomponents can be overridden if required.
-     * 
-     * @see #obtainReflectorFacetDecoratorSet()
-     * @see #obtainReflectorMetaModelValidator()
-     * @see #obtainReflectorProgrammingModel()
-     */
-    @Override
-    protected SpecificationLoaderSpi obtainSpecificationLoaderSpi(DeploymentType deploymentType, Collection<MetaModelRefiner> metaModelRefiners) throws IsisSystemException {
-
-
-        final ProgrammingModel programmingModel = obtainReflectorProgrammingModel();
-        final Set<FacetDecorator> facetDecorators = obtainReflectorFacetDecoratorSet();
-        final MetaModelValidator mmv = obtainReflectorMetaModelValidator();
-        final List<LayoutMetadataReader> layoutMetadataReaders = obtainLayoutMetadataReaders();
-        return JavaReflectorHelper.createObjectReflector(programmingModel, metaModelRefiners, facetDecorators, layoutMetadataReaders, mmv, getConfiguration());
-    }
-
-
-    /**
-     * Optional hook method.
-     */
-    protected ProgrammingModel obtainReflectorProgrammingModel() {
-
-        if (programmingModelOverride != null) {
-            return programmingModelOverride;
-        }
-
-        final ProgrammingModelFacetsJava5 programmingModel = new ProgrammingModelFacetsJava5();
-
-        // TODO: this is duplicating logic in JavaReflectorInstallerNoDecorators; need to unify.
-
-        ProgrammingModel.Util.includeFacetFactories(getConfiguration(), programmingModel);
-        ProgrammingModel.Util.excludeFacetFactories(getConfiguration(), programmingModel);
-        return programmingModel;
-    }
-
-    /**
-     * Optional hook method.
-     */
-    protected Set<FacetDecorator> obtainReflectorFacetDecoratorSet() {
-        return Sets.newHashSet((FacetDecorator) new StandardTransactionFacetDecorator(getConfiguration()));
-    }
-
-    /**
-     * Optional hook method.
-     */
-    protected MetaModelValidator obtainReflectorMetaModelValidator() {
-        if(metaModelValidatorOverride != null) {
-            return metaModelValidatorOverride;
-        }
-        return new MetaModelValidatorDefault();
-    }
-
-    /**
-     * Optional hook method.
-     */
-    protected List<LayoutMetadataReader> obtainLayoutMetadataReaders() {
-        return Lists.<LayoutMetadataReader>newArrayList(new LayoutMetadataReaderFromJson());
-    }
-
-
-    /**
-     * The standard authentication manager, configured with the default authenticator (allows all requests through).
-     */
-    @Override
-    protected AuthenticationManager obtainAuthenticationManager(DeploymentType deploymentType) throws IsisSystemException {
-        final AuthenticationManagerStandard authenticationManager = new AuthenticationManagerStandard(getConfiguration());
-        Authenticator authenticator = new AuthenticatorBypass(configuration);
-        authenticationManager.addAuthenticator(authenticator);
-        return authenticationManager;
-    }
-
-    /**
-     * The standard authorization manager, allowing all access.
-     */
-    @Override
-    protected AuthorizationManager obtainAuthorizationManager(DeploymentType deploymentType) {
-        return new AuthorizationManagerStandard(getConfiguration());
-    }
-
-    @Override
-    protected PersistenceSessionFactory obtainPersistenceSessionFactory(DeploymentType deploymentType, final List<Object> services) throws IsisSystemException {
-        PersistenceMechanismInstaller installer =
-                createPersistenceMechanismInstaller(getConfiguration());
-        return installer.createPersistenceSessionFactory(deploymentType, services);
-    }
-
-    private PersistenceMechanismInstaller createPersistenceMechanismInstaller(IsisConfiguration configuration) throws IsisSystemException {
-        DataNucleusPersistenceMechanismInstaller installer = new DataNucleusPersistenceMechanismInstaller();
-        installer.setConfiguration(configuration);
-        return installer;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/86051179/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
index a645f5c..345305e 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
@@ -54,18 +54,20 @@ import org.apache.isis.core.runtime.logging.IsisLoggingConfigurer;
 import org.apache.isis.core.runtime.services.ServicesInstaller;
 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.system.context.IsisContext;
 import org.apache.isis.core.runtime.system.persistence.ObjectStore;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
 import org.apache.isis.core.runtime.system.transaction.IsisTransaction;
 import org.apache.isis.core.runtime.system.transaction.IsisTransaction.State;
 import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;
+import org.apache.isis.core.runtime.systemusinginstallers.IsisSystemUsingComponentProvider;
 import org.apache.isis.core.security.authentication.AuthenticationRequestNameOnly;
 import org.apache.isis.core.specsupport.scenarios.DomainServiceProvider;
 import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
 
 /**
- * Wraps a plain {@link IsisSystemDefault}, and provides a number of features to assist with testing.
+ * Wraps a plain {@link IsisSystem}, and provides a number of features to assist with testing.
  */
 public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServiceProvider {
 
@@ -146,7 +148,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
     // //////////////////////////////////////
 
 
-    private IsisSystemDefault isisSystem;
+    private IsisSystem isisSystem;
     private AuthenticationSession authenticationSession;
 
     private final IsisConfiguration configuration;
@@ -453,22 +455,22 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
     }
 
     private IsisConfiguration getConfigurationElseDefault() {
-        if(this.configuration != null) {
-            return this.configuration;
-        } else {
-            return IsisSystemDefault.defaultConfiguration();
-        }
+        return configuration != null
+                ? configuration
+                : IsisComponentProviderDefault.defaultConfiguration();
     }
 
 
-    private IsisSystemDefault createIsisSystem(List<Object> services) {
+    private IsisSystem createIsisSystem(List<Object> services) {
 
-        final IsisSystemDefault system = new IsisSystemDefault(
+        IsisComponentProviderDefault componentProvider = new IsisComponentProviderDefault(
                 DeploymentType.UNIT_TESTING, services,
                 getConfigurationElseDefault(),
                 this.programmingModel,
                 this.metaModelValidator);
-        return system;
+
+        return new IsisSystemUsingComponentProvider(
+                componentProvider);
     }
 
 
@@ -523,12 +525,12 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
     ////////////////////////////////////////////////////////////
 
     /**
-     * The {@link IsisSystemDefault} created during {@link #setUpSystem()}.
+     * The {@link IsisSystem} created during {@link #setUpSystem()}.
      *
      * <p>
      * Can fine-tune the actual implementation using the hook {@link #createIsisSystem(List)}.
      */
-    public IsisSystemDefault getIsisSystem() {
+    public IsisSystem getIsisSystem() {
         return isisSystem;
     }
 

http://git-wip-us.apache.org/repos/asf/isis/blob/86051179/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ServiceInitializer.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ServiceInitializer.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ServiceInitializer.java
index 65404ab..f4d32bc 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ServiceInitializer.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/ServiceInitializer.java
@@ -32,7 +32,6 @@ public class ServiceInitializer {
     private final static Logger LOG = LoggerFactory.getLogger(ServiceInitializer.class);
 
     private Map<String, String> props;
-    
 
     private Map<Object, Method> postConstructMethodsByService = Maps.newLinkedHashMap(); 
     private Map<Object, Method> preDestroyMethodsByService = Maps.newLinkedHashMap(); 
@@ -120,7 +119,6 @@ public class ServiceInitializer {
         }
     }
 
-
     public void preDestroy() {
         LOG.info("calling @PreDestroy on all domain services");
         for (final Map.Entry<Object, Method> entry : preDestroyMethodsByService.entrySet()) {
@@ -138,5 +136,4 @@ public class ServiceInitializer {
         }
     }
 
-
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/86051179/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
new file mode 100644
index 0000000..8194a6c
--- /dev/null
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
@@ -0,0 +1,61 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.runtime.systemusinginstallers;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.metamodel.facetapi.MetaModelRefiner;
+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.fixtures.FixturesInstaller;
+import org.apache.isis.core.runtime.system.DeploymentType;
+import org.apache.isis.core.runtime.system.IsisSystemException;
+import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
+
+/**
+ * 
+ */
+public interface IsisComponentProvider {
+
+    DeploymentType getDeploymentType();
+
+    IsisConfiguration getConfiguration();
+
+    SpecificationLoaderSpi provideSpecificationLoaderSpi(
+            DeploymentType deploymentType,
+            Collection<MetaModelRefiner> metaModelRefiners) throws
+            IsisSystemException;
+
+    PersistenceSessionFactory providePersistenceSessionFactory(
+            DeploymentType deploymentType,
+            final List<Object> services) throws IsisSystemException;
+
+    AuthenticationManager provideAuthenticationManager(DeploymentType deploymentType) throws IsisSystemException;
+
+    AuthorizationManager provideAuthorizationManager(final DeploymentType deploymentType);
+
+    List<Object> obtainServices();
+
+    FixturesInstaller obtainFixturesInstaller() throws IsisSystemException;
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/86051179/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
new file mode 100644
index 0000000..561d54c
--- /dev/null
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderUsingInstallers.java
@@ -0,0 +1,167 @@
+/*
+ *  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.systemusinginstallers;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.metamodel.facetapi.MetaModelRefiner;
+import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
+import org.apache.isis.core.metamodel.specloader.ObjectReflectorInstaller;
+import org.apache.isis.core.runtime.authentication.AuthenticationManager;
+import org.apache.isis.core.runtime.authentication.AuthenticationManagerInstaller;
+import org.apache.isis.core.runtime.authorization.AuthorizationManager;
+import org.apache.isis.core.runtime.authorization.AuthorizationManagerInstaller;
+import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
+import org.apache.isis.core.runtime.installerregistry.InstallerLookup;
+import org.apache.isis.core.runtime.installerregistry.installerapi.PersistenceMechanismInstaller;
+import org.apache.isis.core.runtime.services.ServicesInstaller;
+import org.apache.isis.core.runtime.system.DeploymentType;
+import org.apache.isis.core.runtime.system.IsisSystemException;
+import org.apache.isis.core.runtime.system.SystemConstants;
+import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
+import org.apache.isis.core.runtime.transaction.facetdecorator.standard.TransactionFacetDecoratorInstaller;
+
+import static org.apache.isis.core.commons.ensure.Ensure.ensureThatArg;
+import static org.apache.isis.core.commons.ensure.Ensure.ensureThatState;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+
+public class IsisComponentProviderUsingInstallers implements IsisComponentProvider {
+
+    private final DeploymentType deploymentType;
+    private final InstallerLookup installerLookup;
+
+    private AuthenticationManagerInstaller authenticationInstaller;
+    private AuthorizationManagerInstaller authorizationInstaller;
+    private ObjectReflectorInstaller reflectorInstaller;
+    private ServicesInstaller servicesInstaller;
+    private PersistenceMechanismInstaller persistenceMechanismInstaller;
+    private FixturesInstaller fixtureInstaller;
+
+    public IsisComponentProviderUsingInstallers(
+            final DeploymentType deploymentType,
+            final InstallerLookup installerLookup) {
+        this.deploymentType = deploymentType;
+        ensureThatArg(installerLookup, is(not(nullValue())));
+        this.installerLookup = installerLookup;
+
+        lookupAndSetInstallers(deploymentType);
+    }
+
+    private void lookupAndSetInstallers(final DeploymentType deploymentType) {
+
+        this.authenticationInstaller = installerLookup.authenticationManagerInstaller(
+                getConfiguration().getString(SystemConstants.AUTHENTICATION_INSTALLER_KEY),
+                deploymentType);
+
+        this.authorizationInstaller = installerLookup.authorizationManagerInstaller(
+                getConfiguration().getString(SystemConstants.AUTHORIZATION_INSTALLER_KEY), deploymentType);
+
+        this.fixtureInstaller = installerLookup.fixturesInstaller(
+                getConfiguration().getString(SystemConstants.FIXTURES_INSTALLER_KEY));
+
+        persistenceMechanismInstaller = installerLookup.persistenceMechanismInstaller(
+                getConfiguration().getString(SystemConstants.OBJECT_PERSISTOR_INSTALLER_KEY),
+                deploymentType);
+
+        reflectorInstaller = installerLookup.reflectorInstaller(
+                getConfiguration().getString(SystemConstants.REFLECTOR_KEY));
+
+        servicesInstaller = installerLookup.servicesInstaller(null);
+
+        TransactionFacetDecoratorInstaller transactionFacetDecoratorInstaller =
+                installerLookup.getInstaller(TransactionFacetDecoratorInstaller.class);
+
+        ensureThatState(authenticationInstaller, is(not(nullValue())), "authenticationInstaller could not be looked up");
+        ensureThatState(authorizationInstaller, is(not(nullValue())), "authorizationInstaller could not be looked up");
+        ensureThatState(fixtureInstaller, is(not(nullValue())), "fixtureInstaller could not be looked up");
+        ensureThatState(persistenceMechanismInstaller, is(not(nullValue())), "persistenceMechanismInstaller could not be looked up");
+        ensureThatState(reflectorInstaller, is(not(nullValue())), "reflectorInstaller could not be looked up");
+        ensureThatState(transactionFacetDecoratorInstaller, is(not(nullValue())), "transactionFacetDecoratorInstaller could not be looked up");
+        ensureThatState(servicesInstaller, is(not(nullValue())), "servicesInstaller could not be looked up");
+
+        // add in transaction support
+        reflectorInstaller.addFacetDecoratorInstaller(transactionFacetDecoratorInstaller);
+    }
+
+    //region > API
+
+    public DeploymentType getDeploymentType() {
+        return deploymentType;
+    }
+
+    /**
+     * Returns a <i>snapshot</i> of the {@link IsisConfiguration configuration}.
+     *
+     * <p>
+     *     ... as held by the internal {@link InstallerLookup}.
+     * </p>
+     *
+     * @see InstallerLookup#getConfiguration()
+     */
+    @Override
+    public IsisConfiguration getConfiguration() {
+        return installerLookup.getConfiguration();
+    }
+
+    //endregion
+
+
+    @Override
+    public AuthenticationManager provideAuthenticationManager(final DeploymentType deploymentType) {
+        return authenticationInstaller.createAuthenticationManager();
+    }
+
+    @Override
+    public  AuthorizationManager provideAuthorizationManager(final DeploymentType deploymentType) {
+        return authorizationInstaller.createAuthorizationManager();
+    }
+
+    @Override
+    public FixturesInstaller obtainFixturesInstaller() throws IsisSystemException {
+        return fixtureInstaller;
+    }
+
+    @Override
+    public SpecificationLoaderSpi provideSpecificationLoaderSpi(
+            final DeploymentType deploymentType,
+            final Collection<MetaModelRefiner> metaModelRefiners) throws IsisSystemException {
+
+
+        return reflectorInstaller.createReflector(metaModelRefiners);
+    }
+
+    @Override
+    public List<Object> obtainServices() {
+
+        return servicesInstaller.getServices(getDeploymentType());
+    }
+
+    @Override
+    public PersistenceSessionFactory providePersistenceSessionFactory(
+            final DeploymentType deploymentType,
+            final List<Object> services) throws IsisSystemException {
+        return persistenceMechanismInstaller.createPersistenceSessionFactory(deploymentType, services);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/86051179/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemAbstract.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemAbstract.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemAbstract.java
index 73e27bf..54436ee 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemAbstract.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemAbstract.java
@@ -19,414 +19,12 @@
 
 package org.apache.isis.core.runtime.systemusinginstallers;
 
-import java.io.File;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.fixtures.LogonFixture;
-import org.apache.isis.applib.fixturescripts.FixtureScripts;
-import org.apache.isis.applib.services.fixturespec.FixtureScriptsDefault;
-import org.apache.isis.core.commons.components.Installer;
-import org.apache.isis.core.commons.components.Noop;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.commons.debug.DebugBuilder;
-import org.apache.isis.core.commons.debug.DebuggableWithTitle;
-import org.apache.isis.core.commons.lang.ListExtensions;
-import org.apache.isis.core.metamodel.adapter.oid.OidMarshaller;
-import org.apache.isis.core.metamodel.facetapi.MetaModelRefiner;
-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.ServiceInitializer;
-import org.apache.isis.core.runtime.authentication.AuthenticationManager;
-import org.apache.isis.core.runtime.authentication.exploration.ExplorationSession;
-import org.apache.isis.core.runtime.authorization.AuthorizationManager;
-import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
-import org.apache.isis.core.runtime.installerregistry.InstallerLookup;
-import org.apache.isis.core.runtime.persistence.internal.RuntimeContextFromSession;
-import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.core.runtime.system.IsisSystem;
-import org.apache.isis.core.runtime.system.IsisSystemException;
-import org.apache.isis.core.runtime.system.context.IsisContext;
-import org.apache.isis.core.runtime.system.internal.InitialisationSession;
-import org.apache.isis.core.runtime.system.internal.IsisLocaleInitializer;
-import org.apache.isis.core.runtime.system.internal.IsisTimeZoneInitializer;
-import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
-import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
-import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
-import org.apache.isis.core.runtime.system.session.IsisSessionFactoryDefault;
-import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;
-import org.apache.isis.core.runtime.system.transaction.IsisTransactionManagerException;
 
 /**
  * 
  */
 public abstract class IsisSystemAbstract implements IsisSystem {
 
-    public static final Logger LOG = LoggerFactory.getLogger(IsisSystemAbstract.class);
-
-
-    private final IsisLocaleInitializer localeInitializer;
-    private final IsisTimeZoneInitializer timeZoneInitializer;
-    private final DeploymentType deploymentType;
-
-    private boolean initialized = false;
-
-    private ServiceInitializer serviceInitializer;
-    private FixturesInstaller fixtureInstaller;
-
-    //region > constructors
-
-    public IsisSystemAbstract(final DeploymentType deploymentType) {
-        this(deploymentType, new IsisLocaleInitializer(), new IsisTimeZoneInitializer());
-    }
-
-    public IsisSystemAbstract(final DeploymentType deploymentType, final IsisLocaleInitializer localeInitializer, final IsisTimeZoneInitializer timeZoneInitializer) {
-        this.deploymentType = deploymentType;
-        this.localeInitializer = localeInitializer;
-        this.timeZoneInitializer = timeZoneInitializer;
-    }
-    //endregion
-
-    //region > deploymentType
-    @Override
-    public DeploymentType getDeploymentType() {
-        return deploymentType;
-    }
-
-    //endregion
-
-    //region > init
-
-    @Override
-    public void init() {
-
-        if (initialized) {
-            throw new IllegalStateException("Already initialized");
-        } else {
-            initialized = true;
-        }
-
-        LOG.info("initialising Isis System");
-        LOG.info("working directory: " + new File(".").getAbsolutePath());
-        LOG.info("resource stream source: " + getConfiguration().getResourceStreamSource());
-
-        localeInitializer.initLocale(getConfiguration());
-        timeZoneInitializer.initTimeZone(getConfiguration());
-
-        try {
-            sessionFactory = createSessionFactory(deploymentType);
-
-            // temporarily make a configuration available
-            // REVIEW: would rather inject this, or perhaps even the
-            // ConfigurationBuilder
-            IsisContext.setConfiguration(getConfiguration());
-
-            initContext(sessionFactory);
-            sessionFactory.init();
-
-            // validate here after all entities have been registered in the persistence session factory
-            final SpecificationLoaderSpi specificationLoader = sessionFactory.getSpecificationLoader();
-            specificationLoader.validateAndAssert();
-
-            serviceInitializer = initializeServices();
-
-            installFixturesIfRequired();
-
-            translateServicesAndEnumConstants();
-
-        } catch (final IsisSystemException ex) {
-            LOG.error("failed to initialise", ex);
-            throw new RuntimeException(ex);
-        }
-    }
-
-    //region > createSessionFactory
-
-    private IsisSessionFactory sessionFactory;
-
-    /**
-     * Populated after {@link #init()}.
-     */
-    @Override
-    public IsisSessionFactory getSessionFactory() {
-        return sessionFactory;
-    }
-
-    private IsisSessionFactory createSessionFactory(final DeploymentType deploymentType) throws IsisSystemException {
-        final List<Object> services = obtainServices();
-        final PersistenceSessionFactory persistenceSessionFactory =
-                obtainPersistenceSessionFactory(deploymentType, services);
-
-        final IsisConfiguration configuration = getConfiguration();
-        final AuthenticationManager authenticationManager = obtainAuthenticationManager(deploymentType);
-        final AuthorizationManager authorizationManager = obtainAuthorizationManager(deploymentType);
-        final OidMarshaller oidMarshaller = obtainOidMarshaller();
-
-        final Collection<MetaModelRefiner> metaModelRefiners =
-                refiners(authenticationManager, authorizationManager, persistenceSessionFactory);
-        final SpecificationLoaderSpi reflector = obtainSpecificationLoaderSpi(deploymentType, metaModelRefiners);
-
-        ServicesInjectorSpi servicesInjector = persistenceSessionFactory.getServicesInjector();
-        servicesInjector.addFallbackIfRequired(FixtureScripts.class, new FixtureScriptsDefault());
-        servicesInjector.validateServices();
-
-        // bind metamodel to the (runtime) framework
-        final RuntimeContextFromSession runtimeContext = obtainRuntimeContextFromSession();
-        runtimeContext.injectInto(reflector);
-
-        return new IsisSessionFactoryDefault(
-                deploymentType, configuration, reflector,
-                authenticationManager, authorizationManager,
-                persistenceSessionFactory, oidMarshaller);
-    }
-
-    private static Collection<MetaModelRefiner> refiners(Object... possibleRefiners ) {
-        return ListExtensions.filtered(Arrays.asList(possibleRefiners), MetaModelRefiner.class);
-    }
-    //endregion
-
-
-    private void initContext(final IsisSessionFactory sessionFactory) {
-        getDeploymentType().initContext(sessionFactory);
-    }
-
-    /**
-     * @see #shutdownServices(ServiceInitializer)
-     */
-    private ServiceInitializer initializeServices() {
-
-        final List<Object> services = sessionFactory.getServices();
-
-        // validate
-        final ServiceInitializer serviceInitializer = new ServiceInitializer();
-        serviceInitializer.validate(getConfiguration(), services);
-
-        // call @PostConstruct (in a session)
-        IsisContext.openSession(new InitialisationSession());
-        try {
-            getTransactionManager().startTransaction();
-            try {
-                serviceInitializer.postConstruct();
-
-                return serviceInitializer;
-            } catch(RuntimeException ex) {
-                getTransactionManager().getTransaction().setAbortCause(new IsisTransactionManagerException(ex));
-                return serviceInitializer;
-            } finally {
-                // will commit or abort
-                getTransactionManager().endTransaction();
-            }
-        } finally {
-            IsisContext.closeSession();
-        }
-    }
-
-    private void installFixturesIfRequired() throws IsisSystemException {
-
-        fixtureInstaller = obtainFixturesInstaller();
-        if (isNoop(fixtureInstaller)) {
-            return;
-        }
-
-        IsisContext.openSession(new InitialisationSession());
-        fixtureInstaller.installFixtures();
-        try {
-
-            // only allow logon fixtures if not in production mode.
-            if (!getDeploymentType().isProduction()) {
-                logonFixture = fixtureInstaller.getLogonFixture();
-            }
-        } finally {
-            IsisContext.closeSession();
-        }
-    }
-
-    private boolean isNoop(final FixturesInstaller candidate) {
-        return candidate == null || (fixtureInstaller instanceof Noop);
-    }
-
-    /**
-     * The act of invoking titleOf(...) will cause translations to be requested.
-     */
-    private void translateServicesAndEnumConstants() {
-        IsisContext.openSession(new InitialisationSession());
-        try {
-            final List<Object> services = sessionFactory.getServices();
-            final DomainObjectContainer container = lookupService(DomainObjectContainer.class);
-            for (Object service : services) {
-                final String unused = container.titleOf(service);
-            }
-            for (final ObjectSpecification objSpec : allSpecifications()) {
-                final Class<?> correspondingClass = objSpec.getCorrespondingClass();
-                if(correspondingClass.isEnum()) {
-                    final Object[] enumConstants = correspondingClass.getEnumConstants();
-                    for (Object enumConstant : enumConstants) {
-                        final String unused = container.titleOf(enumConstant);
-                    }
-                }
-            }
-        } finally {
-            IsisContext.closeSession();
-        }
-
-    }
-
-    private <T> T lookupService(final Class<T> serviceClass) {
-        return getServicesInjector().lookupService(serviceClass);
-    }
-
-    private ServicesInjectorSpi getServicesInjector() {
-        return getPersistenceSession().getServicesInjector();
-    }
-
-    private PersistenceSession getPersistenceSession() {
-        return IsisContext.getPersistenceSession();
-    }
-
-    Collection<ObjectSpecification> allSpecifications() {
-        return IsisContext.getSpecificationLoader().allSpecifications();
-    }
-
-    //endregion
-
-    //region > obtainXxx: specificationLoaderSpi, persistenceSessionFactory, oidMarshaller, runtimeContextFromSession, authenticationManager authorizationManager, services, fixturesInstaller
-
-    protected abstract SpecificationLoaderSpi obtainSpecificationLoaderSpi(DeploymentType deploymentType, Collection<MetaModelRefiner> metaModelRefiners) throws IsisSystemException;
-
-    protected abstract PersistenceSessionFactory obtainPersistenceSessionFactory(DeploymentType deploymentType, final List<Object> services) throws IsisSystemException;
-
-    protected OidMarshaller obtainOidMarshaller() {
-        return new OidMarshaller();
-    }
-
-    protected RuntimeContextFromSession obtainRuntimeContextFromSession() {
-        return new RuntimeContextFromSession();
-    }
-
-    protected abstract AuthenticationManager obtainAuthenticationManager(DeploymentType deploymentType) throws IsisSystemException;
-
-    protected abstract AuthorizationManager obtainAuthorizationManager(final DeploymentType deploymentType);
-
-    protected abstract List<Object> obtainServices();
-
-    /**
-     * This is the only {@link Installer} that is used by any (all) subclass
-     * implementations, because it effectively <i>is</i> the component we need
-     * (as opposed to a builder/factory of the component we need).
-     *
-     * <p>
-     * The fact that the component <i>is</i> an installer (and therefore can be
-     * {@link InstallerLookup} looked up} is at this level really just an
-     * incidental implementation detail useful for the subclass that uses
-     * {@link InstallerLookup} to create the other components.
-     */
-    protected abstract FixturesInstaller obtainFixturesInstaller() throws IsisSystemException;
-
-
-    //endregion
-
-    //region > shutdown
-
-    @Override
-    public void shutdown() {
-        LOG.info("shutting down system");
-
-        shutdownServices(this.serviceInitializer);
-
-        IsisContext.closeAllSessions();
-    }
-
-    /**
-     * @see #initializeServices()
-     */
-    private void shutdownServices(final ServiceInitializer serviceInitializer) {
-
-        // call @PostDestroy (in a session)
-        IsisContext.openSession(new InitialisationSession());
-        try {
-            getTransactionManager().startTransaction();
-            try {
-                serviceInitializer.preDestroy();
-
-            } catch(RuntimeException ex) {
-                getTransactionManager().getTransaction().setAbortCause(new IsisTransactionManagerException(ex));
-            } finally {
-                // will commit or abort
-                getTransactionManager().endTransaction();
-            }
-        } finally {
-            IsisContext.closeSession();
-        }
-    }
-
-    //endregion
-
-    //region > configuration
-    @Override
-    public abstract IsisConfiguration getConfiguration();
-    //endregion
-
-    //region > logonFixture
-    private LogonFixture logonFixture;
-
-    /**
-     * The {@link LogonFixture}, if any, obtained by running fixtures.
-     *
-     * <p>
-     * Intended to be used when for {@link DeploymentType#SERVER_EXPLORATION
-     * exploration} (instead of an {@link ExplorationSession}) or
-     * {@link DeploymentType#SERVER_PROTOTYPE prototype} deployments (saves logging
-     * in). Should be <i>ignored</i> in other {@link DeploymentType}s.
-     */
-    @Override
-    public LogonFixture getLogonFixture() {
-        return logonFixture;
-    }
-    //endregion
-
-
-    //region > debugging
-
-    private void debug(final DebugBuilder debug, final Object object) {
-        if (object instanceof DebuggableWithTitle) {
-            final DebuggableWithTitle d = (DebuggableWithTitle) object;
-            debug.appendTitle(d.debugTitle());
-            d.debugData(debug);
-        } else {
-            debug.appendln(object.toString());
-            debug.appendln("... no further debug information");
-        }
-    }
-
-    @Override
-    public DebuggableWithTitle debugSection(final String selectionName) {
-        // DebugInfo deb;
-        if (selectionName.equals("Configuration")) {
-            return getConfiguration();
-        }
-        return null;
-    }
-
-    @Override
-    public String[] debugSectionNames() {
-        final String[] general = new String[] { "Overview", "Authenticator", "Configuration", "Reflector", "Requests", "Contexts" };
-        final String[] contextIds = IsisContext.getInstance().allSessionIds();
-        final String[] combined = new String[general.length + contextIds.length];
-        System.arraycopy(general, 0, combined, 0, general.length);
-        System.arraycopy(contextIds, 0, combined, general.length, contextIds.length);
-        return combined;
-    }
-
-    IsisTransactionManager getTransactionManager() {
-        return IsisContext.getTransactionManager();
-    }
-
-    //endregion
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/86051179/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java
index 19de635..057cbab 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java
@@ -65,11 +65,9 @@ public class IsisSystemThatUsesInstallersFactory implements IsisSystemFactory {
     @Override
     public IsisSystem createSystem(final DeploymentType deploymentType) {
 
-        final IsisSystemUsingInstallers system = new IsisSystemUsingInstallers(deploymentType, installerLookup);
-
-        system.lookupAndSetAuthenticatorAndAuthorization(deploymentType);
-        system.lookupAndSetFixturesInstaller();
-        return system;
+        IsisComponentProviderUsingInstallers componentProvider =
+                new IsisComponentProviderUsingInstallers(deploymentType, installerLookup);
+        return new IsisSystemUsingComponentProvider(componentProvider);
     }
 
     // //////////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/isis/blob/86051179/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemUsingComponentProvider.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemUsingComponentProvider.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemUsingComponentProvider.java
new file mode 100644
index 0000000..7c246aa
--- /dev/null
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemUsingComponentProvider.java
@@ -0,0 +1,392 @@
+/*
+ *  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.systemusinginstallers;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.fixtures.LogonFixture;
+import org.apache.isis.applib.fixturescripts.FixtureScripts;
+import org.apache.isis.applib.services.fixturespec.FixtureScriptsDefault;
+import org.apache.isis.core.commons.components.Noop;
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.commons.debug.DebuggableWithTitle;
+import org.apache.isis.core.commons.lang.ListExtensions;
+import org.apache.isis.core.metamodel.adapter.oid.OidMarshaller;
+import org.apache.isis.core.metamodel.facetapi.MetaModelRefiner;
+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.ServiceInitializer;
+import org.apache.isis.core.runtime.authentication.AuthenticationManager;
+import org.apache.isis.core.runtime.authentication.exploration.ExplorationSession;
+import org.apache.isis.core.runtime.authorization.AuthorizationManager;
+import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
+import org.apache.isis.core.runtime.persistence.internal.RuntimeContextFromSession;
+import org.apache.isis.core.runtime.system.DeploymentType;
+import org.apache.isis.core.runtime.system.IsisSystem;
+import org.apache.isis.core.runtime.system.IsisSystemException;
+import org.apache.isis.core.runtime.system.context.IsisContext;
+import org.apache.isis.core.runtime.system.internal.InitialisationSession;
+import org.apache.isis.core.runtime.system.internal.IsisLocaleInitializer;
+import org.apache.isis.core.runtime.system.internal.IsisTimeZoneInitializer;
+import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
+import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
+import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
+import org.apache.isis.core.runtime.system.session.IsisSessionFactoryDefault;
+import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;
+import org.apache.isis.core.runtime.system.transaction.IsisTransactionManagerException;
+
+public class IsisSystemUsingComponentProvider implements IsisSystem {
+
+    public static final Logger LOG = LoggerFactory.getLogger(IsisSystemAbstract.class);
+
+    private final IsisLocaleInitializer localeInitializer;
+    private final IsisTimeZoneInitializer timeZoneInitializer;
+    private final DeploymentType deploymentType;
+
+    private boolean initialized = false;
+
+    private ServiceInitializer serviceInitializer;
+    private FixturesInstaller fixtureInstaller;
+    private IsisSessionFactory sessionFactory;
+
+    //region > constructors
+
+    private final IsisComponentProvider isisComponentProvider;
+
+    public IsisSystemUsingComponentProvider(IsisComponentProvider isisComponentProvider) {
+        this.deploymentType = isisComponentProvider.getDeploymentType();
+        this.localeInitializer = new IsisLocaleInitializer();
+        this.timeZoneInitializer = new IsisTimeZoneInitializer();
+
+        this.isisComponentProvider = isisComponentProvider;
+    }
+
+    //endregion
+
+    //region > deploymentType
+    @Override
+    public DeploymentType getDeploymentType() {
+        return deploymentType;
+    }
+    //endregion
+
+    //region > sessionFactory
+
+    /**
+     * Populated after {@link #init()}.
+     */
+    @Override
+    public IsisSessionFactory getSessionFactory() {
+        return sessionFactory;
+    }
+
+    //endregion
+
+    //region > init
+
+
+    @Override
+    public void init() {
+
+        if (initialized) {
+            throw new IllegalStateException("Already initialized");
+        } else {
+            initialized = true;
+        }
+
+        LOG.info("initialising Isis System");
+        LOG.info("working directory: " + new File(".").getAbsolutePath());
+        LOG.info("resource stream source: " + getConfiguration().getResourceStreamSource());
+
+        localeInitializer.initLocale(getConfiguration());
+        timeZoneInitializer.initTimeZone(getConfiguration());
+
+        try {
+            sessionFactory = createSessionFactory(deploymentType);
+
+            // temporarily make a configuration available
+            // REVIEW: would rather inject this, or perhaps even the
+            // ConfigurationBuilder
+            IsisContext.setConfiguration(getConfiguration());
+
+            initContext(sessionFactory);
+            sessionFactory.init();
+
+            // validate here after all entities have been registered in the persistence session factory
+            final SpecificationLoaderSpi specificationLoader = sessionFactory.getSpecificationLoader();
+            specificationLoader.validateAndAssert();
+
+            serviceInitializer = initializeServices();
+
+            installFixturesIfRequired();
+
+            translateServicesAndEnumConstants();
+
+        } catch (final IsisSystemException ex) {
+            LOG.error("failed to initialise", ex);
+            throw new RuntimeException(ex);
+        }
+    }
+
+
+    private IsisSessionFactory createSessionFactory(final DeploymentType deploymentType) throws IsisSystemException {
+
+        final List<Object> services = isisComponentProvider.obtainServices();
+        final PersistenceSessionFactory persistenceSessionFactory =
+                isisComponentProvider.providePersistenceSessionFactory(deploymentType, services);
+
+        final IsisConfiguration configuration = getConfiguration();
+        final AuthenticationManager authenticationManager = isisComponentProvider
+                .provideAuthenticationManager(deploymentType);
+        final AuthorizationManager authorizationManager = isisComponentProvider
+                .provideAuthorizationManager(deploymentType);
+        final OidMarshaller oidMarshaller = createOidMarshaller();
+
+        final Collection<MetaModelRefiner> metaModelRefiners =
+                refiners(authenticationManager, authorizationManager, persistenceSessionFactory);
+        final SpecificationLoaderSpi reflector = isisComponentProvider
+                .provideSpecificationLoaderSpi(deploymentType, metaModelRefiners);
+
+        ServicesInjectorSpi servicesInjector = persistenceSessionFactory.getServicesInjector();
+        servicesInjector.addFallbackIfRequired(FixtureScripts.class, new FixtureScriptsDefault());
+        servicesInjector.validateServices();
+
+        // bind metamodel to the (runtime) framework
+        final RuntimeContextFromSession runtimeContext = createRuntimeContextFromSession();
+        runtimeContext.injectInto(reflector);
+
+        return new IsisSessionFactoryDefault(
+                deploymentType, configuration, reflector,
+                authenticationManager, authorizationManager,
+                persistenceSessionFactory, oidMarshaller);
+    }
+
+    private static Collection<MetaModelRefiner> refiners(Object... possibleRefiners ) {
+        return ListExtensions.filtered(Arrays.asList(possibleRefiners), MetaModelRefiner.class);
+    }
+
+
+    private void initContext(final IsisSessionFactory sessionFactory) {
+        getDeploymentType().initContext(sessionFactory);
+    }
+
+    /**
+     * @see #shutdownServices(ServiceInitializer)
+     */
+    private ServiceInitializer initializeServices() {
+
+        final List<Object> services = sessionFactory.getServices();
+
+        // validate
+        final ServiceInitializer serviceInitializer = new ServiceInitializer();
+        serviceInitializer.validate(getConfiguration(), services);
+
+        // call @PostConstruct (in a session)
+        IsisContext.openSession(new InitialisationSession());
+        try {
+            getTransactionManager().startTransaction();
+            try {
+                serviceInitializer.postConstruct();
+
+                return serviceInitializer;
+            } catch(RuntimeException ex) {
+                getTransactionManager().getTransaction().setAbortCause(new IsisTransactionManagerException(ex));
+                return serviceInitializer;
+            } finally {
+                // will commit or abort
+                getTransactionManager().endTransaction();
+            }
+        } finally {
+            IsisContext.closeSession();
+        }
+    }
+
+    private void installFixturesIfRequired() throws IsisSystemException {
+
+        fixtureInstaller = isisComponentProvider.obtainFixturesInstaller();
+        if (isNoop(fixtureInstaller)) {
+            return;
+        }
+
+        IsisContext.openSession(new InitialisationSession());
+        fixtureInstaller.installFixtures();
+        try {
+
+            // only allow logon fixtures if not in production mode.
+            if (!getDeploymentType().isProduction()) {
+                logonFixture = fixtureInstaller.getLogonFixture();
+            }
+        } finally {
+            IsisContext.closeSession();
+        }
+    }
+
+    private boolean isNoop(final FixturesInstaller candidate) {
+        return candidate == null || (fixtureInstaller instanceof Noop);
+    }
+
+    /**
+     * The act of invoking titleOf(...) will cause translations to be requested.
+     */
+    private void translateServicesAndEnumConstants() {
+        IsisContext.openSession(new InitialisationSession());
+        try {
+            final List<Object> services = sessionFactory.getServices();
+            final DomainObjectContainer container = lookupService(DomainObjectContainer.class);
+            for (Object service : services) {
+                final String unused = container.titleOf(service);
+            }
+            for (final ObjectSpecification objSpec : allSpecifications()) {
+                final Class<?> correspondingClass = objSpec.getCorrespondingClass();
+                if(correspondingClass.isEnum()) {
+                    final Object[] enumConstants = correspondingClass.getEnumConstants();
+                    for (Object enumConstant : enumConstants) {
+                        final String unused = container.titleOf(enumConstant);
+                    }
+                }
+            }
+        } finally {
+            IsisContext.closeSession();
+        }
+
+    }
+
+    private <T> T lookupService(final Class<T> serviceClass) {
+        return getServicesInjector().lookupService(serviceClass);
+    }
+
+    private ServicesInjectorSpi getServicesInjector() {
+        return getPersistenceSession().getServicesInjector();
+    }
+
+    private PersistenceSession getPersistenceSession() {
+        return IsisContext.getPersistenceSession();
+    }
+
+    Collection<ObjectSpecification> allSpecifications() {
+        return IsisContext.getSpecificationLoader().allSpecifications();
+    }
+
+    private OidMarshaller createOidMarshaller() {
+        return new OidMarshaller();
+    }
+
+    private RuntimeContextFromSession createRuntimeContextFromSession() {
+        return new RuntimeContextFromSession();
+    }
+
+    //endregion
+
+    //region > shutdown
+
+    @Override
+    public void shutdown() {
+        LOG.info("shutting down system");
+
+        shutdownServices(this.serviceInitializer);
+
+        IsisContext.closeAllSessions();
+    }
+
+    /**
+     * @see #initializeServices()
+     */
+    private void shutdownServices(final ServiceInitializer serviceInitializer) {
+
+        // call @PostDestroy (in a session)
+        IsisContext.openSession(new InitialisationSession());
+        try {
+            getTransactionManager().startTransaction();
+            try {
+                serviceInitializer.preDestroy();
+
+            } catch(RuntimeException ex) {
+                getTransactionManager().getTransaction().setAbortCause(new IsisTransactionManagerException(ex));
+            } finally {
+                // will commit or abort
+                getTransactionManager().endTransaction();
+            }
+        } finally {
+            IsisContext.closeSession();
+        }
+    }
+
+    //endregion
+
+    //region > configuration
+    public IsisConfiguration getConfiguration() {
+        return isisComponentProvider.getConfiguration();
+    }
+    //endregion
+
+    //region > logonFixture
+    private LogonFixture logonFixture;
+
+    /**
+     * The {@link LogonFixture}, if any, obtained by running fixtures.
+     *
+     * <p>
+     * Intended to be used when for {@link DeploymentType#SERVER_EXPLORATION
+     * exploration} (instead of an {@link ExplorationSession}) or
+     * {@link DeploymentType#SERVER_PROTOTYPE prototype} deployments (saves logging
+     * in). Should be <i>ignored</i> in other {@link DeploymentType}s.
+     */
+    @Override
+    public LogonFixture getLogonFixture() {
+        return logonFixture;
+    }
+    //endregion
+
+    //region > debugging
+
+    @Override
+    public DebuggableWithTitle debugSection(final String selectionName) {
+        // DebugInfo deb;
+        if (selectionName.equals("Configuration")) {
+            return getConfiguration();
+        }
+        return null;
+    }
+
+    @Override
+    public String[] debugSectionNames() {
+        final String[] general = new String[] { "Overview", "Authenticator", "Configuration", "Reflector", "Requests", "Contexts" };
+        final String[] contextIds = IsisContext.getInstance().allSessionIds();
+        final String[] combined = new String[general.length + contextIds.length];
+        System.arraycopy(general, 0, combined, 0, general.length);
+        System.arraycopy(contextIds, 0, combined, general.length, contextIds.length);
+        return combined;
+    }
+
+    IsisTransactionManager getTransactionManager() {
+        return IsisContext.getTransactionManager();
+    }
+
+    //endregion
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/86051179/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemUsingInstallers.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemUsingInstallers.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemUsingInstallers.java
deleted file mode 100644
index fa96621..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemUsingInstallers.java
+++ /dev/null
@@ -1,192 +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.systemusinginstallers;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.metamodel.facetapi.MetaModelRefiner;
-import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
-import org.apache.isis.core.metamodel.specloader.ObjectReflectorInstaller;
-import org.apache.isis.core.runtime.authentication.AuthenticationManager;
-import org.apache.isis.core.runtime.authentication.AuthenticationManagerInstaller;
-import org.apache.isis.core.runtime.authorization.AuthorizationManager;
-import org.apache.isis.core.runtime.authorization.AuthorizationManagerInstaller;
-import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
-import org.apache.isis.core.runtime.installerregistry.InstallerLookup;
-import org.apache.isis.core.runtime.installerregistry.installerapi.PersistenceMechanismInstaller;
-import org.apache.isis.core.runtime.services.ServicesInstaller;
-import org.apache.isis.core.runtime.system.DeploymentType;
-import org.apache.isis.core.runtime.system.IsisSystemException;
-import org.apache.isis.core.runtime.system.SystemConstants;
-import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
-import org.apache.isis.core.runtime.transaction.facetdecorator.standard.TransactionFacetDecoratorInstaller;
-
-import static org.apache.isis.core.commons.ensure.Ensure.ensureThatArg;
-import static org.apache.isis.core.commons.ensure.Ensure.ensureThatState;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.nullValue;
-
-public class IsisSystemUsingInstallers extends IsisSystemAbstract {
-
-    public static final Logger LOG = LoggerFactory.getLogger(IsisSystemUsingInstallers.class);
-
-    private final InstallerLookup installerLookup;
-
-    private AuthenticationManagerInstaller authenticationInstaller;
-    private AuthorizationManagerInstaller authorizationInstaller;
-    private ObjectReflectorInstaller reflectorInstaller;
-    private ServicesInstaller servicesInstaller;
-    private PersistenceMechanismInstaller persistenceMechanismInstaller;
-    private FixturesInstaller fixtureInstaller;
-
-
-    // ///////////////////////////////////////////
-    // Constructors
-    // ///////////////////////////////////////////
-
-    public IsisSystemUsingInstallers(final DeploymentType deploymentType, final InstallerLookup installerLookup) {
-        super(deploymentType);
-        ensureThatArg(installerLookup, is(not(nullValue())));
-        this.installerLookup = installerLookup;
-    }
-
-
-    // ///////////////////////////////////////////
-    // Configuration
-    // ///////////////////////////////////////////
-
-    /**
-     * Returns a <i>snapshot</i> of the {@link IsisConfiguration configuration}.
-     *
-     * <p>
-     *     ... as held by the internal {@link InstallerLookup}.
-     * </p>
-     *
-     * @see InstallerLookup#getConfiguration()
-     */
-    @Override
-    public IsisConfiguration getConfiguration() {
-        return installerLookup.getConfiguration();
-    }
-
-    // ///////////////////////////////////////////
-    // Authentication & Authorization
-    // ///////////////////////////////////////////
-
-    public void lookupAndSetAuthenticatorAndAuthorization(final DeploymentType deploymentType) {
-
-        //final IsisConfiguration configuration = installerLookup.getConfiguration();
-
-        // use the one specified in configuration
-        final String authenticationManagerKey = getConfiguration().getString(SystemConstants.AUTHENTICATION_INSTALLER_KEY);
-        final AuthenticationManagerInstaller authenticationInstaller = installerLookup.authenticationManagerInstaller(authenticationManagerKey, deploymentType);
-        if (authenticationInstaller != null) {
-            setAuthenticationInstaller(authenticationInstaller);
-        }
-        
-        // use the one specified in configuration
-        final String authorizationManagerKey = getConfiguration().getString(SystemConstants.AUTHORIZATION_INSTALLER_KEY);
-        final AuthorizationManagerInstaller authorizationInstaller = installerLookup.authorizationManagerInstaller(authorizationManagerKey, deploymentType);
-        if (authorizationInstaller != null) {
-            setAuthorizationInstaller(authorizationInstaller);
-        }
-    }
-
-    public void setAuthenticationInstaller(final AuthenticationManagerInstaller authenticationManagerInstaller) {
-        this.authenticationInstaller = authenticationManagerInstaller;
-    }
-
-    public void setAuthorizationInstaller(final AuthorizationManagerInstaller authorizationManagerInstaller) {
-        this.authorizationInstaller = authorizationManagerInstaller;
-    }
-
-    @Override
-    protected AuthenticationManager obtainAuthenticationManager(final DeploymentType deploymentType) {
-        return authenticationInstaller.createAuthenticationManager();
-    }
-
-    @Override
-    protected AuthorizationManager obtainAuthorizationManager(final DeploymentType deploymentType) {
-        return authorizationInstaller.createAuthorizationManager();
-    }
-
-    public void lookupAndSetFixturesInstaller() {
-        final IsisConfiguration configuration = installerLookup.getConfiguration();
-        final String fixture = configuration.getString(SystemConstants.FIXTURES_INSTALLER_KEY);
-
-        final FixturesInstaller fixturesInstaller = installerLookup.fixturesInstaller(fixture);
-        if (fixturesInstaller != null) {
-            this.fixtureInstaller = fixturesInstaller;
-        }
-    }
-
-    @Override
-    protected FixturesInstaller obtainFixturesInstaller() throws IsisSystemException {
-        return fixtureInstaller;
-    }
-
-    // ///////////////////////////////////////////
-    // Reflector
-    // ///////////////////////////////////////////
-
-    @Override
-    protected SpecificationLoaderSpi obtainSpecificationLoaderSpi(final DeploymentType deploymentType, final Collection<MetaModelRefiner> metaModelRefiners) throws IsisSystemException {
-        if (reflectorInstaller == null) {
-            final String fromCmdLine = getConfiguration().getString(SystemConstants.REFLECTOR_KEY);
-            reflectorInstaller = installerLookup.reflectorInstaller(fromCmdLine);
-        }
-        ensureThatState(reflectorInstaller, is(not(nullValue())), "reflector installer has not been injected and could not be looked up");
-
-        // add in transaction support (if already in set then will be ignored)
-        reflectorInstaller.addFacetDecoratorInstaller(installerLookup.getInstaller(TransactionFacetDecoratorInstaller.class));
-
-        return reflectorInstaller.createReflector(metaModelRefiners);
-    }
-
-    @Override
-    protected List<Object> obtainServices() {
-        if (servicesInstaller == null) {
-            servicesInstaller = installerLookup.servicesInstaller(null);
-        }
-        ensureThatState(servicesInstaller, is(not(nullValue())), "services installer has not been injected and could not be looked up");
-
-        return servicesInstaller.getServices(getDeploymentType());
-    }
-
-
-    @Override
-    protected PersistenceSessionFactory obtainPersistenceSessionFactory(final DeploymentType deploymentType, final List<Object> services) throws IsisSystemException {
-
-        // look for a object store persistor
-        if (persistenceMechanismInstaller == null) {
-            final String persistenceMechanism = getConfiguration().getString(SystemConstants.OBJECT_PERSISTOR_INSTALLER_KEY);
-            persistenceMechanismInstaller = installerLookup.persistenceMechanismInstaller(persistenceMechanism, deploymentType);
-        }
-
-        ensureThatState(persistenceMechanismInstaller, is(not(nullValue())), "persistor installer has not been injected and could not be looked up");
-        return persistenceMechanismInstaller.createPersistenceSessionFactory(deploymentType, services);
-    }
-}


[09/17] isis git commit: ISIS-848: enhancing IsisComponentProvider impls to honour GlobSpec if present.

Posted by da...@apache.org.
ISIS-848: enhancing IsisComponentProvider impls to honour GlobSpec if present.

also:
- chaged GlobSpec API to return list of classes of fixture scripts, rather than the fixture scripts themselves.
- standardized method names of IsisComponentProvider interface ("provide..." instead of a mixture of "provide..." and "obtain...")
-moved common functionality into IsisComponentProviderAbstract, including having InstallerComponentProviderUsingInstallers eagerly evaluating
- removed superfluous constants in SystemConstants
- simplified ServicesInstaller#getServices(DeploymentType) to just #getServices(...), since the globSpec will now be the preferred way to vary runtimes
- made the ServicesInstaller impls all inherit from ServicesInstallerAbstract
- extending IsisConfigurationBuilder and InstallerLookup to allow the IsisComponentProvider to put new properties into the config


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

Branch: refs/heads/master
Commit: 306002e5a9c041793c8a39db8c11190adb862949
Parents: d5f4482
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Thu Aug 6 13:09:59 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Thu Aug 6 13:09:59 2015 +0100

----------------------------------------------------------------------
 .../asciidoc/guides/_cg_isis-maven-plugin.adoc  |   1 +
 .../java/org/apache/isis/applib/GlobSpec.java   |  12 +-
 .../IsisComponentProviderDefault.java           |  77 +++++---
 .../integtestsupport/IsisSystemForTest.java     |   2 +-
 .../isis/tool/mavenplugin/IsisMojoAbstract.java |   5 +-
 .../config/IsisConfigurationBuilder.java        |   8 +
 ...IsisConfigurationBuilderResourceStreams.java |  11 +-
 .../isis/core/commons/lang/ClassUtil.java       |  32 ++++
 .../FixturesInstallerFromConfiguration.java     |   3 +-
 .../installerregistry/InstallerLookup.java      | 123 ++++++------
 .../runtime/services/ServicesInstaller.java     |   3 +-
 .../services/ServicesInstallerAbstract.java     |  35 ----
 .../ServicesInstallerFromAnnotation.java        |  29 ++-
 .../ServicesInstallerFromConfiguration.java     |  68 +++----
 ...InstallerFromConfigurationAndAnnotation.java |  24 ++-
 .../isis/core/runtime/system/IsisSystem.java    |   6 +-
 .../core/runtime/system/SystemConstants.java    |  24 +--
 .../IsisComponentProvider.java                  |  21 +--
 .../IsisComponentProviderAbstract.java          | 185 +++++++++++++++++++
 .../IsisComponentProviderUsingInstallers.java   | 149 +++++++++------
 .../java/domainapp/glob/DomainAppGlobSpec.java  |   4 +-
 21 files changed, 531 insertions(+), 291 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/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 327f14a..01bb257 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
@@ -7,3 +7,4 @@
 
 NOTE: TODO
 
+

http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/core/applib/src/main/java/org/apache/isis/applib/GlobSpec.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/GlobSpec.java b/core/applib/src/main/java/org/apache/isis/applib/GlobSpec.java
index c5ede73..c3939e3 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/GlobSpec.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/GlobSpec.java
@@ -113,22 +113,30 @@ public interface GlobSpec {
 
     /**
      * If non-null, overrides the value of <tt>isis.authentication</tt> configuration property.
+     *
+     * <p>
+     *     Ignored for integration tests (which always uses the 'bypass' mechanism).
+     * </p>
      */
     public String getAuthenticationMechanism();
 
     /**
      * If non-null, overrides the value of <tt>isis.authorization</tt> configuration property.
+     *
+     * <p>
+     *     Ignored for integration tests (which always uses the 'bypass' mechanism).
+     * </p>
      */
     public String getAuthorizationMechanism();
 
     /**
      * If non-null, overrides the value of <tt>isis.fixtures</tt> configuration property.
      */
-    public List<FixtureScript> getFixtures();
+    public List<Class<? extends FixtureScript>> getFixtures();
 
     /**
      * Overrides for any other configuration properties.
      */
-    public Map<String,String> getConfiguration();
+    public Map<String,String> getConfigurationProperties();
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
index 2df42a0..36420c7 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
@@ -47,29 +47,22 @@ import org.apache.isis.core.runtime.authorization.standard.AuthorizationManagerS
 import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
 import org.apache.isis.core.runtime.fixtures.FixturesInstallerFromConfiguration;
 import org.apache.isis.core.runtime.persistence.internal.RuntimeContextFromSession;
+import org.apache.isis.core.runtime.services.ServicesInstallerFromAnnotation;
 import org.apache.isis.core.runtime.services.ServicesInstallerFromConfiguration;
 import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.core.runtime.system.IsisSystemException;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
-import org.apache.isis.core.runtime.systemusinginstallers.IsisComponentProvider;
+import org.apache.isis.core.runtime.systemusinginstallers.IsisComponentProviderAbstract;
 import org.apache.isis.core.runtime.transaction.facetdecorator.standard.StandardTransactionFacetDecorator;
 import org.apache.isis.core.security.authentication.AuthenticatorBypass;
 import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
 import org.apache.isis.progmodels.dflt.JavaReflectorHelper;
 import org.apache.isis.progmodels.dflt.ProgrammingModelFacetsJava5;
 
-public class IsisComponentProviderDefault implements IsisComponentProvider {
+public class IsisComponentProviderDefault extends IsisComponentProviderAbstract {
 
-    private final DeploymentType deploymentType;
-    private final GlobSpec globSpecIfAny;
-
-    private final IsisConfiguration configuration;
-    private final List<Object> services;
     private final ProgrammingModel programmingModel;
     private final MetaModelValidator metaModelValidator;
-    private final FixturesInstaller fixturesInstaller;
-    private final AuthenticationManager authenticationManager;
-    private final AuthorizationManager authorizationManager;
 
     public IsisComponentProviderDefault(
             final DeploymentType deploymentType,
@@ -78,45 +71,76 @@ public class IsisComponentProviderDefault implements IsisComponentProvider {
             final IsisConfiguration configurationOverride,
             final ProgrammingModel programmingModelOverride,
             final MetaModelValidator metaModelValidatorOverride) {
+        super(deploymentType, globSpecIfAny);
 
-        this.deploymentType = deploymentType;
-        this.globSpecIfAny = globSpecIfAny;
+        this.configuration = elseDefault(configurationOverride);
 
-        // TODO: alter behaviour accordingly if a globSpec has been provided.
+        if(globSpec != null) {
 
-        this.configuration = elseDefault(configurationOverride);
-        this.services = elseDefault(servicesOverride, deploymentType, configuration);
-        this.programmingModel = elseDefault(programmingModelOverride, configuration);
-        this.metaModelValidator = elseDefault(metaModelValidatorOverride);
+            specifyServicesAndRegisteredEntitiesUsing(globSpec);
+
+            specifyFixtureScriptsUsing(globSpec);
+            overrideConfigurationUsing(globSpec);
+
+            this.services = createServices(configuration);
+
+        } else {
+            this.services = elseDefault(servicesOverride, configuration);
+        }
 
         this.fixturesInstaller = createFixturesInstaller(configuration);
+
+        // integration tests ignore globSpec for authentication and authorization.
         this.authenticationManager = createAuthenticationManager(configuration);
         this.authorizationManager = createAuthorizationManager(configuration);
 
+        this.programmingModel = elseDefault(programmingModelOverride, configuration);
+        this.metaModelValidator = elseDefault(metaModelValidatorOverride);
+
     }
 
+    //region > globSpec
+
+    private List<Object> createServices(
+            final IsisConfiguration configuration) {
+        final ServicesInstallerFromAnnotation servicesInstaller = new ServicesInstallerFromAnnotation();
+        servicesInstaller.setConfiguration(configuration);
+        return servicesInstaller.getServices();
+    }
+
+
+    @Override
+    protected void doPutConfigurationProperty(final String key, final String value) {
+        // bit hacky :-(
+        IsisConfigurationDefault configurationDefault = (IsisConfigurationDefault) this.configuration;
+        configurationDefault.put(key, value);
+    }
+
+    //endregion
+
     /**
      * Default will read <tt>isis.properties</tt> (and other optional property files) from the &quot;config&quot;
      * package on the current classpath.
      */
-    private static IsisConfiguration elseDefault(final IsisConfiguration configuration) {
+    private static IsisConfigurationDefault elseDefault(final IsisConfiguration configuration) {
         return configuration != null
-                ? configuration
+                ? (IsisConfigurationDefault) configuration
                 : new IsisConfigurationDefault(ResourceStreamSourceContextLoaderClassPath.create("config"));
     }
 
-    private static List<Object> elseDefault(final List<Object> servicesOverride, DeploymentType deploymentType, final IsisConfiguration configuration) {
+    private static List<Object> elseDefault(
+            final List<Object> servicesOverride,
+            final IsisConfiguration configuration) {
         return servicesOverride != null
                 ? servicesOverride
-                : createDefaultServices(deploymentType, configuration);
+                : createDefaultServices(configuration);
     }
 
     private static List<Object> createDefaultServices(
-            final DeploymentType deploymentType,
             final IsisConfiguration configuration) {
         final ServicesInstallerFromConfiguration servicesInstaller = new ServicesInstallerFromConfiguration();
         servicesInstaller.setConfiguration(configuration);
-        return servicesInstaller.getServices(deploymentType);
+        return servicesInstaller.getServices();
     }
 
 
@@ -176,18 +200,17 @@ public class IsisComponentProviderDefault implements IsisComponentProvider {
     }
 
     @Override
-    public List<Object> obtainServices() {
+    public List<Object> provideServices() {
         return services;
     }
 
     @Override
-    public FixturesInstaller obtainFixturesInstaller() throws IsisSystemException {
+    public FixturesInstaller provideFixturesInstaller() throws IsisSystemException {
         return fixturesInstaller;
     }
 
     @Override
     public SpecificationLoaderSpi provideSpecificationLoaderSpi(
-            DeploymentType deploymentType, // unused
             Collection<MetaModelRefiner> metaModelRefiners) throws IsisSystemException {
 
         final Set<FacetDecorator> facetDecorators = Sets
@@ -205,7 +228,7 @@ public class IsisComponentProviderDefault implements IsisComponentProvider {
     }
 
     @Override
-    public AuthenticationManager provideAuthenticationManager(DeploymentType deploymentType) throws IsisSystemException {
+    public AuthenticationManager provideAuthenticationManager(DeploymentType deploymentType) {
         return authenticationManager;
     }
 

http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
index 949df0d..c3a38a8 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
@@ -235,7 +235,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
 
             final ServicesInstaller installer = new ServicesInstallerFromConfigurationAndAnnotation();
             installer.setConfiguration(configuration);
-            final List<Object> serviceList = installer.getServices(null);
+            final List<Object> serviceList = installer.getServices();
             this.services.addAll(serviceList);
 
             installer.init();

http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/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 7e9d958..58da31b 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
@@ -21,6 +21,7 @@ package org.apache.isis.tool.mavenplugin;
 import java.io.File;
 import java.util.List;
 import java.util.Set;
+
 import org.apache.maven.model.Plugin;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -29,6 +30,7 @@ import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.plugins.annotations.Component;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProject;
+
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.config.IsisConfigurationBuilderDefault;
 import org.apache.isis.core.metamodel.app.IsisMetaModel;
@@ -36,7 +38,6 @@ import org.apache.isis.core.metamodel.runtimecontext.noruntime.RuntimeContextNoR
 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.progmodels.dflt.ProgrammingModelFacetsJava5;
 import org.apache.isis.tool.mavenplugin.util.IsisMetaModels;
 import org.apache.isis.tool.mavenplugin.util.MavenProjects;
@@ -99,7 +100,7 @@ public abstract class IsisMojoAbstract extends AbstractMojo {
         servicesInstaller.setIgnoreFailures(true);
         servicesInstaller.init();
 
-        return servicesInstaller.getServices(DeploymentType.SERVER_PROTOTYPE);
+        return servicesInstaller.getServices();
     }
 
     private IsisConfiguration getIsisConfiguration() throws MojoFailureException {

http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/core/metamodel/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilder.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilder.java b/core/metamodel/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilder.java
index c6946ef..6976f4e 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilder.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilder.java
@@ -44,9 +44,17 @@ public interface IsisConfigurationBuilder extends Injectable {
     
     void addConfigurationResource(final String installerName, final NotFoundPolicy notFoundPolicy);
 
+    /**
+     * Adds additional property; if already present then will _not_ be replaced.
+     */
     void add(final String key, final String value);
 
     /**
+     * Adds/updates property; if already present then _will_ be replaced.
+     */
+    void put(final String key, final String value);
+
+    /**
      * The underlying {@link ResourceStreamSource} from which the configuration
      * is being read.
      * 

http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/core/metamodel/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderResourceStreams.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderResourceStreams.java b/core/metamodel/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderResourceStreams.java
index ed6a23d..729b89e 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderResourceStreams.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderResourceStreams.java
@@ -145,9 +145,6 @@ public class IsisConfigurationBuilderResourceStreams implements IsisConfiguratio
         configurationResources.add(new ConfigurationResourceAndPolicy(configurationResource, notFoundPolicy));
     }
 
-    /**
-     * Adds additional property.
-     */
     @Override
     public synchronized void add(final String key, final String value) {
         if (locked) {
@@ -156,6 +153,14 @@ public class IsisConfigurationBuilderResourceStreams implements IsisConfiguratio
         configuration.add(key, value);
     }
 
+    @Override
+    public synchronized void put(final String key, final String value) {
+        if (locked) {
+            throw new IsisException("Configuration has been locked and cannot be changed");
+        }
+        configuration.put(key, value);
+    }
+
     public void lockConfiguration() {
         locked = true;
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/core/metamodel/src/main/java/org/apache/isis/core/commons/lang/ClassUtil.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/commons/lang/ClassUtil.java b/core/metamodel/src/main/java/org/apache/isis/core/commons/lang/ClassUtil.java
index fc0d72e..85903c7 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/commons/lang/ClassUtil.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/commons/lang/ClassUtil.java
@@ -24,6 +24,9 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.annotation.Nullable;
+
+import com.google.common.base.Function;
 import com.google.common.collect.Maps;
 
 public final class ClassUtil {
@@ -175,4 +178,33 @@ public final class ClassUtil {
         }
     }
 
+    public static class Functions {
+        private Functions(){}
+
+        public static Function<Class<?>, String> nameOf() {
+            return new Function<Class<?>, String>() {
+                @Nullable @Override public String apply(final Class<?> input) {
+                    return input.getName();
+                }
+            };
+        }
+
+        public static Function<Class<?>, Package> packageOf() {
+            return new Function<Class<?>, Package>() {
+                @Nullable @Override
+                public Package apply(final Class<?> input) {
+                    return input.getPackage();
+                }
+            };
+        }
+
+        public static Function<Class<?>, String> packageNameOf() {
+            return new Function<Class<?>, String>() {
+                @Nullable @Override public String apply(final Class<?> input) {
+                    return input.getPackage().getName();
+                }
+            };
+        }
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/core/runtime/src/main/java/org/apache/isis/core/runtime/fixtures/FixturesInstallerFromConfiguration.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/fixtures/FixturesInstallerFromConfiguration.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/fixtures/FixturesInstallerFromConfiguration.java
index 1722513..6fbca9f 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/fixtures/FixturesInstallerFromConfiguration.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/fixtures/FixturesInstallerFromConfiguration.java
@@ -31,7 +31,8 @@ public class FixturesInstallerFromConfiguration extends FixturesInstallerAbstrac
 
     private static final Logger LOG = LoggerFactory.getLogger(FixturesInstallerFromConfiguration.class);
 
-    private static final String FIXTURES = ConfigurationConstants.ROOT + "fixtures";
+    public static final String FIXTURES = ConfigurationConstants.ROOT + "fixtures";
+
     /**
      * @deprecated - just adds to the cognotive load...
      */

http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/InstallerLookup.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/InstallerLookup.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/InstallerLookup.java
index a79a8ed..3b4e23b 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/InstallerLookup.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/InstallerLookup.java
@@ -25,10 +25,13 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.util.ArrayList;
 import java.util.List;
+
 import com.google.common.collect.Lists;
 import com.google.inject.Inject;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+
 import org.apache.isis.core.commons.components.ApplicationScopedComponent;
 import org.apache.isis.core.commons.components.Injectable;
 import org.apache.isis.core.commons.components.Installer;
@@ -54,13 +57,14 @@ import org.apache.isis.core.runtime.authorization.AuthorizationManagerInstaller;
 import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
 import org.apache.isis.core.runtime.installerregistry.installerapi.PersistenceMechanismInstaller;
 import org.apache.isis.core.runtime.services.ServicesInstaller;
-import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.core.runtime.system.IsisSystem;
 import org.apache.isis.core.runtime.system.SystemConstants;
 import org.apache.isis.core.runtime.systemdependencyinjector.SystemDependencyInjector;
 import org.apache.isis.core.runtime.systemdependencyinjector.SystemDependencyInjectorAware;
 
-import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
 
 /**
  * The installers correspond more-or-less to the configurable top-level
@@ -90,27 +94,11 @@ public class InstallerLookup implements InstallerRepository, ApplicationScopedCo
 
     private static final Logger LOG = LoggerFactory.getLogger(InstallerLookup.class);
 
-    private final List<Installer> installerList = Lists.newArrayList();
-
-    /**
-     * A mutable representation of the {@link IsisConfiguration configuration},
-     * injected prior to {@link #init()}.
-     *
-     * <p>
-     *
-     * @see #setConfigurationBuilder(IsisConfigurationBuilder)
-     */
-    private IsisConfigurationBuilder isisConfigurationBuilder;
+    //region > Constructor
 
-    // ////////////////////////////////////////////////////////
-    // Constructor
-    // ////////////////////////////////////////////////////////
+    private final List<Installer> installerList = Lists.newArrayList();
 
     public InstallerLookup() {
-        loadInstallers();
-    }
-
-    private void loadInstallers() {
         final InputStream in = getInstallerRegistryStream(IsisInstallerRegistry.INSTALLER_REGISTRY_FILE);
         final BufferedReader reader = new BufferedReader(new InputStreamReader(in));
         try {
@@ -145,10 +133,9 @@ public class InstallerLookup implements InstallerRepository, ApplicationScopedCo
         AboutIsis.setComponentDetails(installerVersionList);
     }
 
-    // ////////////////////////////////////////////////////////
-    // InstallerRepository impl.
-    // ////////////////////////////////////////////////////////
+    //endregion
 
+    //region > InstallerRepository impl.
     /**
      * This method (and only this method) may be called prior to {@link #init()
      * initialization}.
@@ -163,11 +150,9 @@ public class InstallerLookup implements InstallerRepository, ApplicationScopedCo
         }
         return list.toArray(new Installer[list.size()]);
     }
+    //endregion
 
-    // ////////////////////////////////////////////////////////
-    // init, shutdown
-    // ////////////////////////////////////////////////////////
-
+    //region > init, shutdown
     @Override
     public void init() {
         ensureDependenciesInjected();
@@ -181,44 +166,53 @@ public class InstallerLookup implements InstallerRepository, ApplicationScopedCo
     public void shutdown() {
         // nothing to do.
     }
+    //endregion
 
-    // /////////////////////////////////////////////////////////
-    // metamodel
-    // /////////////////////////////////////////////////////////
-
+    //region > metamodel
     public ObjectReflectorInstaller reflectorInstaller(final String requested) {
         return getInstaller(ObjectReflectorInstaller.class, requested, SystemConstants.REFLECTOR_KEY, SystemConstants.REFLECTOR_DEFAULT);
     }
+    //endregion
 
-    // /////////////////////////////////////////////////////////
-    // framework
-    // /////////////////////////////////////////////////////////
+    //region > framework
 
-    public AuthenticationManagerInstaller authenticationManagerInstaller(final String requested, final DeploymentType deploymentType) {
-        return getInstaller(AuthenticationManagerInstaller.class, requested, SystemConstants.AUTHENTICATION_INSTALLER_KEY, deploymentType.isExploring() ? SystemConstants.AUTHENTICATION_EXPLORATION_DEFAULT : SystemConstants.AUTHENTICATION_DEFAULT);
+    public AuthenticationManagerInstaller authenticationManagerInstaller(final String requested) {
+        return getInstaller(
+                AuthenticationManagerInstaller.class, requested,
+                SystemConstants.AUTHENTICATION_INSTALLER_KEY,
+                SystemConstants.AUTHENTICATION_DEFAULT);
     }
 
-    public AuthorizationManagerInstaller authorizationManagerInstaller(final String requested, final DeploymentType deploymentType) {
-        return getInstaller(AuthorizationManagerInstaller.class, requested, SystemConstants.AUTHORIZATION_INSTALLER_KEY, !deploymentType.isProduction() ? SystemConstants.AUTHORIZATION_NON_PRODUCTION_DEFAULT : SystemConstants.AUTHORIZATION_DEFAULT);
+    public AuthorizationManagerInstaller authorizationManagerInstaller(final String requested) {
+        return getInstaller(
+                AuthorizationManagerInstaller.class, requested,
+                SystemConstants.AUTHORIZATION_INSTALLER_KEY,
+                SystemConstants.AUTHORIZATION_DEFAULT);
     }
 
     public FixturesInstaller fixturesInstaller(final String requested) {
-        return getInstaller(FixturesInstaller.class, requested, SystemConstants.FIXTURES_INSTALLER_KEY, SystemConstants.FIXTURES_INSTALLER_DEFAULT);
+        return getInstaller(
+                FixturesInstaller.class, requested,
+                SystemConstants.FIXTURES_INSTALLER_KEY,
+                SystemConstants.FIXTURES_INSTALLER_DEFAULT);
     }
 
-    public PersistenceMechanismInstaller persistenceMechanismInstaller(final String requested, final DeploymentType deploymentType) {
-        final String persistorDefault = deploymentType.isExploring() || deploymentType.isPrototyping() ? SystemConstants.OBJECT_PERSISTOR_NON_PRODUCTION_DEFAULT : SystemConstants.OBJECT_PERSISTOR_PRODUCTION_DEFAULT;
-        return getInstaller(PersistenceMechanismInstaller.class, requested, SystemConstants.OBJECT_PERSISTOR_KEY, persistorDefault);
+    public PersistenceMechanismInstaller persistenceMechanismInstaller(final String requested) {
+        return getInstaller(
+                PersistenceMechanismInstaller.class, requested,
+                SystemConstants.OBJECT_PERSISTOR_KEY,
+                SystemConstants.OBJECT_PERSISTOR_DEFAULT);
     }
 
     public ServicesInstaller servicesInstaller(final String requestedImplementationName) {
-        return getInstaller(ServicesInstaller.class, requestedImplementationName, SystemConstants.SERVICES_INSTALLER_KEY, SystemConstants.SERVICES_INSTALLER_DEFAULT);
+        return getInstaller(
+                ServicesInstaller.class, requestedImplementationName,
+                SystemConstants.SERVICES_INSTALLER_KEY,
+                SystemConstants.SERVICES_INSTALLER_DEFAULT);
     }
+    //endregion
 
-    // /////////////////////////////////////////////////////////
-    // framework - generic
-    // /////////////////////////////////////////////////////////
-
+    //region > framework - generic
     @SuppressWarnings("unchecked")
     public <T extends Installer> T getInstaller(final Class<T> cls, final String implName) {
         Assert.assertNotNull("No name specified", implName);
@@ -263,10 +257,9 @@ public class InstallerLookup implements InstallerRepository, ApplicationScopedCo
             return null;
         }
     }
+    //endregion
 
-    // ////////////////////////////////////////////////////////
-    // Helpers
-    // ////////////////////////////////////////////////////////
+    //region > Helpers
 
     private <T extends Installer> T getInstaller(final Class<T> requiredType, String reqImpl, final String key, final String defaultImpl) {
         if (reqImpl == null) {
@@ -299,11 +292,9 @@ public class InstallerLookup implements InstallerRepository, ApplicationScopedCo
         }
         return in;
     }
+    //endregion
 
-    // ////////////////////////////////////////////////////////
-    // Configuration
-    // ////////////////////////////////////////////////////////
-
+    //region > Configuration
     /**
      * Returns a <i>snapshot</i> of the current {@link IsisConfiguration}.
      *
@@ -321,16 +312,18 @@ public class InstallerLookup implements InstallerRepository, ApplicationScopedCo
         }
     }
 
+    public void putConfigurationProperty(final String key, final String value) {
+        isisConfigurationBuilder.put(key, value);
+    }
+    //endregion
+
+    //region > SystemDependencyInjector, Injectable
     @Override
     public <T> T injectDependenciesInto(final T candidate) {
         injectInto(candidate);
         return candidate;
     }
 
-    // ////////////////////////////////////////////////////////////////////
-    // Injectable
-    // ////////////////////////////////////////////////////////////////////
-
     @Override
     public void injectInto(final Object candidate) {
         if (SystemDependencyInjectorAware.class.isAssignableFrom(candidate.getClass())) {
@@ -343,10 +336,17 @@ public class InstallerLookup implements InstallerRepository, ApplicationScopedCo
         }
         isisConfigurationBuilder.injectInto(candidate);
     }
+    //endregion
 
-    // ////////////////////////////////////////////////////////
-    // Dependencies (injected)
-    // ////////////////////////////////////////////////////////
+    //region > Dependencies (injected)
+
+    /**
+     * A mutable representation of the {@link IsisConfiguration configuration},
+     * injected prior to {@link #init()}.
+     *
+     * @see #setConfigurationBuilder(IsisConfigurationBuilder)
+     */
+    private IsisConfigurationBuilder isisConfigurationBuilder;
 
     public IsisConfigurationBuilder getConfigurationBuilder() {
         return isisConfigurationBuilder;
@@ -357,5 +357,6 @@ public class InstallerLookup implements InstallerRepository, ApplicationScopedCo
     public void setConfigurationBuilder(final IsisConfigurationBuilder configurationLoader) {
         this.isisConfigurationBuilder = configurationLoader;
     }
+    //endregion
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstaller.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstaller.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstaller.java
index 604c8bc..abe1fc9 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstaller.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstaller.java
@@ -23,7 +23,6 @@ import java.util.List;
 
 import org.apache.isis.core.commons.components.Installer;
 import org.apache.isis.core.commons.config.IsisConfigurationAware;
-import org.apache.isis.core.runtime.system.DeploymentType;
 
 public interface ServicesInstaller extends Installer, IsisConfigurationAware {
 
@@ -34,7 +33,7 @@ public interface ServicesInstaller extends Installer, IsisConfigurationAware {
      */
     static String TYPE = "services-installer";
 
-    List<Object> getServices(DeploymentType deploymentType);
+    List<Object> getServices();
 
     void setIgnoreFailures(boolean ignoreFailures);
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerAbstract.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerAbstract.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerAbstract.java
index d6abda5..5a6b102 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerAbstract.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerAbstract.java
@@ -19,48 +19,13 @@
 
 package org.apache.isis.core.runtime.services;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
 import org.apache.isis.core.commons.config.InstallerAbstract;
-import org.apache.isis.core.runtime.system.DeploymentType;
-
-import static org.apache.isis.core.commons.lang.ObjectExtensions.asCollectionT;
 
 public abstract class ServicesInstallerAbstract extends InstallerAbstract implements ServicesInstaller {
-    private final List<Object> services = new ArrayList<Object>();
 
     public ServicesInstallerAbstract(final String name) {
         super(ServicesInstaller.TYPE, name);
     }
 
-    /**
-     * Add this service, automatically unravelling if is a {@link Collection} of
-     * services.
-     * 
-     * @param service
-     */
-    public void addService(final Object service) {
-        if (service instanceof Collection) {
-            // unravel if necessary
-            final Collection<Object> services = asCollectionT(service, Object.class);
-            for (final Object eachService : services) {
-                addService(eachService);
-            }
-        } else {
-            services.add(service);
-        }
-    }
-
-    public void addServices(final List<Object> services) {
-        addService(services);
-    }
-
-    @Override
-    public List<Object> getServices(final DeploymentType deploymentType) {
-        return services;
-    }
-
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromAnnotation.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromAnnotation.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromAnnotation.java
index b4434d4..fce5ebb 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromAnnotation.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromAnnotation.java
@@ -21,11 +21,12 @@ package org.apache.isis.core.runtime.services;
 
 import java.lang.reflect.Modifier;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 import java.util.SortedMap;
 import java.util.SortedSet;
+
 import javax.annotation.PreDestroy;
+
 import com.google.common.base.Function;
 import com.google.common.base.Joiner;
 import com.google.common.base.Predicate;
@@ -34,23 +35,24 @@ import com.google.common.base.Strings;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+
 import org.reflections.Reflections;
 import org.reflections.vfs.Vfs;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+
 import org.apache.isis.applib.annotation.DomainService;
 import org.apache.isis.applib.annotation.DomainServiceLayout;
 import org.apache.isis.applib.services.classdiscovery.ClassDiscoveryServiceUsingReflections;
-import org.apache.isis.core.commons.config.InstallerAbstract;
-import org.apache.isis.core.runtime.system.DeploymentType;
 
 import static com.google.common.base.Predicates.and;
 import static com.google.common.base.Predicates.not;
 
-public class ServicesInstallerFromAnnotation extends InstallerAbstract implements ServicesInstaller {
+public class ServicesInstallerFromAnnotation extends ServicesInstallerAbstract {
 
     private static final Logger LOG = LoggerFactory.getLogger(ServicesInstallerFromAnnotation.class);
 
+    public static final String NAME = "annotation";
     public final static String PACKAGE_PREFIX_KEY = "isis.services.ServicesInstallerFromAnnotation.packagePrefix";
 
     /**
@@ -83,7 +85,7 @@ public class ServicesInstallerFromAnnotation extends InstallerAbstract implement
     }
 
     public ServicesInstallerFromAnnotation(final ServiceInstantiator serviceInstantiator) {
-        super(ServicesInstaller.TYPE, "annotation");
+        super(NAME);
         this.serviceInstantiator = serviceInstantiator;
     }
 
@@ -181,30 +183,25 @@ public class ServicesInstallerFromAnnotation extends InstallerAbstract implement
 
     // //////////////////////////////////////
 
-    private Map<DeploymentType, List<Object>> servicesByDeploymentType = Maps.newHashMap();
+    private List<Object> serviceList;
 
     @Override
-    public List<Object> getServices(final DeploymentType deploymentType) {
+    public List<Object> getServices() {
         initIfRequired();
 
-        List<Object> serviceList = servicesByDeploymentType.get(deploymentType);
-        if(serviceList == null) {
+        if(this.serviceList == null) {
 
             final SortedMap<String, SortedSet<String>> positionedServices = Maps.newTreeMap(new DeweyOrderComparator());
-            appendServices(deploymentType, positionedServices);
-
-            serviceList = ServicesInstallerUtils.instantiateServicesFrom(positionedServices, serviceInstantiator);
+            appendServices(positionedServices);
 
-            servicesByDeploymentType.put(deploymentType, serviceList);
+            this.serviceList = ServicesInstallerUtils.instantiateServicesFrom(positionedServices, serviceInstantiator);
         }
         return serviceList;
     }
 
     // //////////////////////////////////////
 
-    public void appendServices(
-            final DeploymentType deploymentType,
-            final SortedMap<String, SortedSet<String>> positionedServices) {
+    public void appendServices(final SortedMap<String, SortedSet<String>> positionedServices) {
         initIfRequired();
 
         final List<String> packagePrefixList = asList(packagePrefixes);

http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfiguration.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfiguration.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfiguration.java
index dff7bd0..514aae1 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfiguration.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfiguration.java
@@ -20,31 +20,40 @@
 package org.apache.isis.core.runtime.services;
 
 import java.util.List;
-import java.util.Map;
 import java.util.SortedMap;
 import java.util.SortedSet;
 import java.util.StringTokenizer;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+
 import com.google.common.base.Strings;
 import com.google.common.collect.Maps;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+
 import org.apache.isis.core.commons.config.ConfigurationConstants;
-import org.apache.isis.core.commons.config.InstallerAbstract;
+import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.runtime.fixturedomainservice.ObjectFixtureService;
 import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.core.runtime.system.SystemConstants;
 
-public class ServicesInstallerFromConfiguration extends InstallerAbstract implements ServicesInstaller {
+public class ServicesInstallerFromConfiguration extends ServicesInstallerAbstract  {
 
     private static final Logger LOG = LoggerFactory.getLogger(ServicesInstallerFromConfiguration.class);
 
+    public static final String NAME = "configuration";
+
     private static final String SERVICES = "services";
+
+    /**
+     * @deprecated
+     */
+    @Deprecated
     private static final String EXPLORATION_OBJECTS = "exploration-objects";
 
     /**
-     * @deprecated - just adds to the cognotive load...
+     * @deprecated - just adds to the cognitive load...
      */
     @Deprecated
     private static final String SERVICES_PREFIX = "services.prefix";
@@ -58,13 +67,12 @@ public class ServicesInstallerFromConfiguration extends InstallerAbstract implem
     }
 
     ServicesInstallerFromConfiguration(final ServiceInstantiator serviceInstantiator) {
-        super(ServicesInstaller.TYPE, "configuration");
+        super(NAME);
         this.serviceInstantiator = serviceInstantiator;
     }
 
     // //////////////////////////////////////
 
-    private Map<DeploymentType, List<Object>> servicesByDeploymentType = Maps.newHashMap();
 
     @Override
     public void setIgnoreFailures(boolean ignoreFailures) {
@@ -92,52 +100,42 @@ public class ServicesInstallerFromConfiguration extends InstallerAbstract implem
     }
 
 
-    @Override
-    public List<Object> getServices(final DeploymentType deploymentType) {
+    // //////////////////////////////////////
+
+    private List<Object> serviceList;
 
+    @Override
+    public List<Object> getServices() {
         LOG.info("installing " + this.getClass().getName());
 
         // rather nasty, lazily copy over the configuration to the instantiator
         serviceInstantiator.setConfiguration(getConfiguration());
 
-        List<Object> serviceList = servicesByDeploymentType.get(deploymentType);
         if(serviceList == null) {
 
             final SortedMap<String, SortedSet<String>> positionedServices = Maps.newTreeMap(new DeweyOrderComparator());
-            appendServices(deploymentType, positionedServices);
+            appendServices(positionedServices);
 
             serviceList = ServicesInstallerUtils.instantiateServicesFrom(positionedServices, serviceInstantiator);
-
-            servicesByDeploymentType.put(deploymentType, serviceList);
         }
         return serviceList;
-    }
 
+    }
 
     // //////////////////////////////////////
 
     public void appendServices(
-            final DeploymentType deploymentType,
             final SortedMap<String, SortedSet<String>> positionedServices) {
 
-        appendConfiguredServices(null, positionedServices);
-        appendConfiguredServices(deploymentType, positionedServices);
-
-        appendObjectFixtureService(null, positionedServices);
+        appendConfiguredServices(positionedServices);
+        appendObjectFixtureService(positionedServices, getConfiguration());
     }
 
     private void appendConfiguredServices(
-            final DeploymentType deploymentType,
             final SortedMap<String, SortedSet<String>> positionedServices) {
-        String group = deploymentType != null? deploymentType.name(): null;
-        final String root = ConfigurationConstants.ROOT + (group == null ? "" : group.toLowerCase() + ".");
-
-        String servicePrefix = getConfiguration().getString(root + SERVICES_PREFIX);
-        if (group != null && servicePrefix == null) {
-            servicePrefix = getConfiguration().getString(ConfigurationConstants.ROOT + SERVICES_PREFIX);
-        }
 
-        final String configuredServices = getConfiguration().getString(root + SERVICES);
+        String servicePrefix = getConfiguration().getString(ConfigurationConstants.ROOT + SERVICES_PREFIX);
+        final String configuredServices = getConfiguration().getString(ConfigurationConstants.ROOT + SERVICES);
         if (configuredServices == null) {
             return;
         }
@@ -174,14 +172,16 @@ public class ServicesInstallerFromConfiguration extends InstallerAbstract implem
         return buf.toString();
     }
 
+    /**
+     * @deprecated
+     */
+    @Deprecated
+    private static void appendObjectFixtureService(
+            final SortedMap<String, SortedSet<String>> positionedServices, final IsisConfiguration configuration) {
 
-    private void appendObjectFixtureService(DeploymentType deploymentType, final SortedMap<String, SortedSet<String>> positionedServices) {
-
-        final String group = deploymentType != null? deploymentType.name(): null;
-        final String root = ConfigurationConstants.ROOT + (group == null ? "" : group.toLowerCase() + ".");
-
-        if (getConfiguration().getBoolean(root + EXPLORATION_OBJECTS)) {
-            final DeploymentType explorationDeploymentType = DeploymentType.lookup(getConfiguration().getString(SystemConstants.DEPLOYMENT_TYPE_KEY));
+        if (configuration.getBoolean(ConfigurationConstants.ROOT + EXPLORATION_OBJECTS)) {
+            final DeploymentType explorationDeploymentType = DeploymentType.lookup(configuration.getString(
+                    SystemConstants.DEPLOYMENT_TYPE_KEY));
             if (explorationDeploymentType.isExploring()) {
                 ServicesInstallerUtils.appendInPosition(positionedServices, "" + Integer.MAX_VALUE, ObjectFixtureService.class.getName());
             }

http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfigurationAndAnnotation.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfigurationAndAnnotation.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfigurationAndAnnotation.java
index 44dbd52..3ef5ad7 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfigurationAndAnnotation.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfigurationAndAnnotation.java
@@ -20,21 +20,23 @@
 package org.apache.isis.core.runtime.services;
 
 import java.util.List;
-import java.util.Map;
 import java.util.SortedMap;
 import java.util.SortedSet;
+
 import com.google.common.collect.Maps;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.isis.core.commons.config.InstallerAbstract;
+
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.config.IsisConfigurationBuilder;
-import org.apache.isis.core.runtime.system.DeploymentType;
 
-public class ServicesInstallerFromConfigurationAndAnnotation extends InstallerAbstract implements ServicesInstaller {
+public class ServicesInstallerFromConfigurationAndAnnotation extends ServicesInstallerAbstract  {
 
     private static final Logger LOG = LoggerFactory.getLogger(ServicesInstallerFromConfigurationAndAnnotation.class);
 
+    public static final String NAME = "configuration-and-annotation";
+
     private final ServiceInstantiator serviceInstantiator;
     private final ServicesInstallerFromConfiguration servicesInstallerFromConfiguration;
     private final ServicesInstallerFromAnnotation servicesInstallerFromAnnotation;
@@ -45,7 +47,7 @@ public class ServicesInstallerFromConfigurationAndAnnotation extends InstallerAb
     }
 
     public ServicesInstallerFromConfigurationAndAnnotation(final ServiceInstantiator serviceInstantiator) {
-        super(ServicesInstaller.TYPE, "configuration-and-annotation");
+        super(NAME);
 
         this.serviceInstantiator = serviceInstantiator;
         servicesInstallerFromConfiguration = new ServicesInstallerFromConfiguration(serviceInstantiator);
@@ -80,23 +82,19 @@ public class ServicesInstallerFromConfigurationAndAnnotation extends InstallerAb
 
     // //////////////////////////////////////
 
-    private Map<DeploymentType, List<Object>> servicesByDeploymentType = Maps.newHashMap();
+    private List<Object> serviceList;
 
     @Override
-    public List<Object> getServices(final DeploymentType deploymentType) {
-
+    public List<Object> getServices() {
         LOG.info("installing " + this.getClass().getName());
 
-        List<Object> serviceList = servicesByDeploymentType.get(deploymentType);
         if(serviceList == null) {
 
             final SortedMap<String,SortedSet<String>> positionedServices = Maps.newTreeMap(new DeweyOrderComparator());
-            servicesInstallerFromConfiguration.appendServices(deploymentType, positionedServices);
-            servicesInstallerFromAnnotation.appendServices(deploymentType, positionedServices);
+            servicesInstallerFromConfiguration.appendServices(positionedServices);
+            servicesInstallerFromAnnotation.appendServices(positionedServices);
 
             serviceList = ServicesInstallerUtils.instantiateServicesFrom(positionedServices, serviceInstantiator);
-
-            servicesByDeploymentType.put(deploymentType, serviceList);
         }
 
         return serviceList;

http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/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 ed595ff..89393ce 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
@@ -153,7 +153,7 @@ public class IsisSystem implements DebugSelection, ApplicationScopedComponent {
     private IsisSessionFactory createSessionFactory(final DeploymentType deploymentType) throws IsisSystemException {
 
         final IsisConfiguration configuration = isisComponentProvider.getConfiguration();
-        final List<Object> services = isisComponentProvider.obtainServices();
+        final List<Object> services = isisComponentProvider.provideServices();
 
         ServicesInjectorSpi servicesInjectorSpi = new ServicesInjectorDefault(services);
         servicesInjectorSpi.addFallbackIfRequired(FixtureScripts.class, new FixtureScriptsDefault());
@@ -172,7 +172,7 @@ public class IsisSystem implements DebugSelection, ApplicationScopedComponent {
         final Collection<MetaModelRefiner> metaModelRefiners =
                 refiners(authenticationManager, authorizationManager, persistenceSessionFactory);
         final SpecificationLoaderSpi reflector =
-                isisComponentProvider.provideSpecificationLoaderSpi(deploymentType, metaModelRefiners);
+                isisComponentProvider.provideSpecificationLoaderSpi(metaModelRefiners);
 
         // bind metamodel to the (runtime) framework
         runtimeContext.injectInto(reflector);
@@ -225,7 +225,7 @@ public class IsisSystem implements DebugSelection, ApplicationScopedComponent {
 
     private void installFixturesIfRequired() throws IsisSystemException {
 
-        fixtureInstaller = isisComponentProvider.obtainFixturesInstaller();
+        fixtureInstaller = isisComponentProvider.provideFixturesInstaller();
         if (isNoop(fixtureInstaller)) {
             return;
         }

http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/core/runtime/src/main/java/org/apache/isis/core/runtime/system/SystemConstants.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/SystemConstants.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/SystemConstants.java
index 5d82d26..ce36840 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/SystemConstants.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/SystemConstants.java
@@ -63,15 +63,16 @@ public final class SystemConstants {
      */
     public final static String OBJECT_PERSISTOR_INSTALLER_KEY = ConfigurationConstants.ROOT + PersistenceMechanismInstaller.TYPE;
 
-    // TODO: inline
     public static final String OBJECT_PERSISTOR_KEY = OBJECT_PERSISTOR_INSTALLER_KEY;
-    // TODO: move to being a responsibility of DeploymentType instead
-    public static final String OBJECT_PERSISTOR_NON_PRODUCTION_DEFAULT = "datanucleus";
-    // TODO: move to being a responsibility of DeploymentType instead
-    public static final String OBJECT_PERSISTOR_PRODUCTION_DEFAULT = "datanucleus";
+    public static final String OBJECT_PERSISTOR_DEFAULT = "datanucleus";
 
 
     /**
+     * Key used to lookup {@link org.apache.isis.applib.GlobSpec} (if any) from the {@link IsisConfiguration}.
+     */
+    public static final String GLOB_SPEC_KEY = ConfigurationConstants.ROOT + "globSpec";
+
+    /**
      * Key used to lookup {@link AuthenticationManager authentication manager}
      * in {@link IsisConfiguration}, and root for any
      * {@link AuthenticationManagerInstaller authentication manager}-specific
@@ -79,13 +80,9 @@ public final class SystemConstants {
      */
     public static final String AUTHENTICATION_INSTALLER_KEY = ConfigurationConstants.ROOT + AuthenticationManagerInstaller.TYPE;
     /**
-     * Default for {@link #AUTHENTICATION_INSTALLER_KEY} if not exploring.
+     * Default for {@link #AUTHENTICATION_INSTALLER_KEY}.
      */
     public static final String AUTHENTICATION_DEFAULT = "shiro";
-    /**
-     * Default for {@link #AUTHENTICATION_INSTALLER_KEY} if exploring.
-     */
-    public static final String AUTHENTICATION_EXPLORATION_DEFAULT = "shiro";
 
     /**
      * Key used to lookup {@link AuthorizationManager authorization manager} in
@@ -95,16 +92,11 @@ public final class SystemConstants {
      */
     public static final String AUTHORIZATION_INSTALLER_KEY = ConfigurationConstants.ROOT + AuthorizationManagerInstaller.TYPE;
     /**
-     * Default for {@link #AUTHORIZATION_DEFAULT} if production.
+     * Default for {@link #AUTHORIZATION_DEFAULT}.
      */
     public static final String AUTHORIZATION_DEFAULT = "shiro";
 
     /**
-     * Default for {@link #AUTHORIZATION_DEFAULT} if not production.
-     */
-    public static final String AUTHORIZATION_NON_PRODUCTION_DEFAULT = "shiro";
-
-    /**
      * Key used to lookup {@link ServicesInstaller services installer} in
      * {@link IsisConfiguration}, and root for any {@link ServicesInstaller
      * services installer}-specific configuration keys.

http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/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 a14aa80..de394b5 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
@@ -43,22 +43,19 @@ public interface IsisComponentProvider {
 
     IsisConfiguration getConfiguration();
 
-    SpecificationLoaderSpi provideSpecificationLoaderSpi(
-            DeploymentType deploymentType,
-            Collection<MetaModelRefiner> metaModelRefiners) throws
-            IsisSystemException;
+    AuthenticationManager provideAuthenticationManager(DeploymentType deploymentType) throws IsisSystemException;
+    AuthorizationManager provideAuthorizationManager(final DeploymentType deploymentType);
+
+    List<Object> provideServices();
+
+    FixturesInstaller provideFixturesInstaller() throws IsisSystemException;
+
+    SpecificationLoaderSpi provideSpecificationLoaderSpi(Collection<MetaModelRefiner> metaModelRefiners)
+            throws IsisSystemException;
 
     PersistenceSessionFactory providePersistenceSessionFactory(
             final DeploymentType deploymentType,
             final ServicesInjectorSpi servicesInjectorSpi,
             final RuntimeContextFromSession runtimeContext) throws IsisSystemException;
 
-    AuthenticationManager provideAuthenticationManager(DeploymentType deploymentType) throws IsisSystemException;
-
-    AuthorizationManager provideAuthorizationManager(final DeploymentType deploymentType);
-
-    List<Object> obtainServices();
-
-    FixturesInstaller obtainFixturesInstaller() throws IsisSystemException;
-
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/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
new file mode 100644
index 0000000..0d57f61
--- /dev/null
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProviderAbstract.java
@@ -0,0 +1,185 @@
+/*
+ *  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.systemusinginstallers;
+
+import java.util.List;
+import java.util.Map;
+
+import com.google.common.base.Joiner;
+import com.google.common.collect.Iterables;
+
+import org.apache.isis.applib.GlobSpec;
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.commons.lang.ClassUtil;
+import org.apache.isis.core.runtime.authentication.AuthenticationManager;
+import org.apache.isis.core.runtime.authorization.AuthorizationManager;
+import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
+import org.apache.isis.core.runtime.fixtures.FixturesInstallerFromConfiguration;
+import org.apache.isis.core.runtime.services.ServicesInstallerFromAnnotation;
+import org.apache.isis.core.runtime.system.DeploymentType;
+import org.apache.isis.core.runtime.system.IsisSystemException;
+import org.apache.isis.objectstore.jdo.service.RegisterEntities;
+
+import static org.apache.isis.core.commons.ensure.Ensure.ensureThatState;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+
+public abstract class IsisComponentProviderAbstract implements IsisComponentProvider {
+
+    protected final DeploymentType deploymentType;
+    /**
+     * may be null.
+     */
+    protected final GlobSpec globSpec;
+
+    /**
+     * populated by subclass, in its constructor.
+     */
+    protected IsisConfiguration configuration;
+    /**
+     * populated by subclass, in its constructor.
+     */
+    protected List<Object> services;
+    /**
+     * populated by subclass, in its constructor.
+     */
+    protected FixturesInstaller fixturesInstaller;
+    /**
+     * populated by subclass, in its constructor.
+     */
+    protected AuthenticationManager authenticationManager;
+    /**
+     * populated by subclass, in its constructor.
+     */
+    protected AuthorizationManager authorizationManager;
+
+    public IsisComponentProviderAbstract(
+            final DeploymentType deploymentType,
+            final GlobSpec globSpec) {
+
+        this.deploymentType = deploymentType;
+        this.globSpec = globSpec;
+    }
+
+    /**
+     * Provided for subclasses to call to ensure that they have correctly populated all fields.
+     */
+    protected void ensureInitialized() {
+        ensureThatState(authenticationManager, is(not(nullValue())));
+        ensureThatState(authorizationManager, is(not(nullValue())));
+        ensureThatState(services, is(not(nullValue())));
+        ensureThatState(fixturesInstaller, is(not(nullValue())));
+        ensureThatState(configuration, is(not(nullValue())), "fixtureInstaller could not be looked up");
+    }
+
+
+    //region > globSpec helpers
+    protected void specifyServicesAndRegisteredEntitiesUsing(final GlobSpec globSpec) {
+        final String packageNamesCsv = modulePackageNamesFrom(globSpec);
+
+        putConfigurationProperty(ServicesInstallerFromAnnotation.PACKAGE_PREFIX_KEY, packageNamesCsv);
+        putConfigurationProperty(RegisterEntities.PACKAGE_PREFIX_KEY, packageNamesCsv);
+    }
+
+    private String modulePackageNamesFrom(final GlobSpec globSpec) {
+        List<Class<?>> modules = globSpec.getModules();
+        if (modules == null || modules.isEmpty()) {
+            throw new IllegalArgumentException(
+                    "If a globSpec is provided then it must return a non-empty set of modules");
+        }
+
+        final Iterable<String> iter = Iterables.transform(modules, ClassUtil.Functions.packageNameOf());
+        return Joiner.on(',').join(iter);
+    }
+
+    protected void specifyFixtureScriptsUsing(final GlobSpec globSpec) {
+        List<Class<? extends FixtureScript>> fixtureClasses = globSpec.getFixtures();
+        final String fixtureClassNamesCsv = fixtureClassNamesFrom(fixtureClasses);
+        putConfigurationProperty(FixturesInstallerFromConfiguration.FIXTURES, fixtureClassNamesCsv);
+    }
+
+    private String fixtureClassNamesFrom(final List<Class<? extends FixtureScript>> fixtureClasses) {
+        if (fixtureClasses == null) {
+            return null;
+        }
+        final Iterable<String> iter = Iterables.transform(fixtureClasses, ClassUtil.Functions.nameOf());
+        return Joiner.on(',').join(iter);
+    }
+
+    protected void overrideConfigurationUsing(final GlobSpec globSpec) {
+        final Map<String, String> configurationProperties = globSpec.getConfigurationProperties();
+        if (configurationProperties != null) {
+            for (Map.Entry<String, String> configProp : configurationProperties.entrySet()) {
+                putConfigurationProperty(configProp.getKey(), configProp.getValue());
+            }
+        }
+    }
+
+    protected final void putConfigurationProperty(final String key, final String value) {
+        if(value == null) {
+            return;
+        }
+        doPutConfigurationProperty(key, value);
+    }
+
+
+    /**
+     * For subclasses to implement, to update their implementation of {@link IsisConfiguration}.
+     */
+    protected abstract void doPutConfigurationProperty(final String key, final String value);
+
+    //endregion
+
+    //region > API impl.
+    
+    @Override
+    public DeploymentType getDeploymentType() {
+        return deploymentType;
+    }
+
+    @Override
+    public IsisConfiguration getConfiguration() {
+        return configuration;
+    }
+
+    @Override
+    public AuthenticationManager provideAuthenticationManager(final DeploymentType deploymentType) {
+        return authenticationManager;
+    }
+
+    @Override
+    public  AuthorizationManager provideAuthorizationManager(final DeploymentType deploymentType) {
+        return authorizationManager;
+    }
+
+    @Override
+    public FixturesInstaller provideFixturesInstaller() throws IsisSystemException {
+        return fixturesInstaller;
+    }
+
+    @Override
+    public List<Object> provideServices() {
+        return services;
+    }
+    //endregion
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/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 c8ff7ac..3d9261a 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
@@ -20,22 +20,20 @@
 package org.apache.isis.core.runtime.systemusinginstallers;
 
 import java.util.Collection;
-import java.util.List;
 
-import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.applib.GlobSpec;
+import org.apache.isis.core.commons.factory.InstanceUtil;
 import org.apache.isis.core.metamodel.facetapi.MetaModelRefiner;
 import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
 import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
 import org.apache.isis.core.metamodel.specloader.ObjectReflectorInstaller;
-import org.apache.isis.core.runtime.authentication.AuthenticationManager;
 import org.apache.isis.core.runtime.authentication.AuthenticationManagerInstaller;
-import org.apache.isis.core.runtime.authorization.AuthorizationManager;
 import org.apache.isis.core.runtime.authorization.AuthorizationManagerInstaller;
-import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
 import org.apache.isis.core.runtime.installerregistry.InstallerLookup;
 import org.apache.isis.core.runtime.installerregistry.installerapi.PersistenceMechanismInstaller;
 import org.apache.isis.core.runtime.persistence.internal.RuntimeContextFromSession;
 import org.apache.isis.core.runtime.services.ServicesInstaller;
+import org.apache.isis.core.runtime.services.ServicesInstallerFromAnnotation;
 import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.core.runtime.system.IsisSystemException;
 import org.apache.isis.core.runtime.system.SystemConstants;
@@ -48,113 +46,142 @@ import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.not;
 import static org.hamcrest.CoreMatchers.nullValue;
 
-public class IsisComponentProviderUsingInstallers implements IsisComponentProvider {
+public class IsisComponentProviderUsingInstallers extends IsisComponentProviderAbstract {
 
-    private final DeploymentType deploymentType;
+    private final InstallerLookup installerLookup;
 
-    private AuthenticationManagerInstaller authenticationInstaller;
-    private AuthorizationManagerInstaller authorizationInstaller;
     private ObjectReflectorInstaller reflectorInstaller;
-    private ServicesInstaller servicesInstaller;
     private PersistenceMechanismInstaller persistenceMechanismInstaller;
-    private FixturesInstaller fixtureInstaller;
 
-    private final IsisConfiguration configuration;
 
     public IsisComponentProviderUsingInstallers(
             final DeploymentType deploymentType,
             final InstallerLookup installerLookup) {
+        super(deploymentType, globSpecIfAny(installerLookup));
 
-        this.deploymentType = deploymentType;
+        ensureThatArg(deploymentType, is(not(nullValue())));
         ensureThatArg(installerLookup, is(not(nullValue())));
 
-        // TODO: we check for isis.globSpec, and alter the bootstrapping accordingly...
+        this.installerLookup = installerLookup;
+
+        if(globSpec != null) {
+
+            specifyServicesAndRegisteredEntitiesUsing(globSpec);
+
+            // by using the annotations installer (as opposed to the configuration-and-annotations installer),
+            // any services defined with the "isis.services" key will be IGNORED.
+            putConfigurationProperty(SystemConstants.SERVICES_INSTALLER_KEY, ServicesInstallerFromAnnotation.NAME);
+
+            final String authenticationMechanism = globSpec.getAuthenticationMechanism();
+            putConfigurationProperty(SystemConstants.AUTHENTICATION_INSTALLER_KEY, authenticationMechanism);
+
+            final String authorizationMechanism = globSpec.getAuthorizationMechanism();
+            putConfigurationProperty(SystemConstants.AUTHORIZATION_INSTALLER_KEY, authorizationMechanism);
+
+            specifyFixtureScriptsUsing(globSpec);
+
+            overrideConfigurationUsing(globSpec);
+        }
 
         // loading installers causes the configuration to be appended to successively
-        this.authenticationInstaller = installerLookup.authenticationManagerInstaller(
-                installerLookup.getConfiguration().getString(SystemConstants.AUTHENTICATION_INSTALLER_KEY),
-                deploymentType);
+        AuthenticationManagerInstaller authenticationInstaller = this.installerLookup.authenticationManagerInstaller(
+                configProperty(SystemConstants.AUTHENTICATION_INSTALLER_KEY));
 
-        this.authorizationInstaller = installerLookup.authorizationManagerInstaller(
-                installerLookup.getConfiguration().getString(SystemConstants.AUTHORIZATION_INSTALLER_KEY), deploymentType);
+        AuthorizationManagerInstaller authorizationInstaller = this.installerLookup.authorizationManagerInstaller(
+                configProperty(SystemConstants.AUTHORIZATION_INSTALLER_KEY));
 
-        this.fixtureInstaller = installerLookup.fixturesInstaller(
-                installerLookup.getConfiguration().getString(SystemConstants.FIXTURES_INSTALLER_KEY));
+        this.fixturesInstaller = this.installerLookup.fixturesInstaller(
+                configProperty(SystemConstants.FIXTURES_INSTALLER_KEY));
+
+        ServicesInstaller servicesInstaller = this.installerLookup.servicesInstaller(null);
 
         // although there is only one implementation of PersistenceMechanismInstaller, we still do the lookup
         // because this will add the persistor_datanucleus.properties and persistor.properties to the set of
         // config files from which we read configuration properties.
-        persistenceMechanismInstaller = installerLookup.persistenceMechanismInstaller(
-                installerLookup.getConfiguration().getString(SystemConstants.OBJECT_PERSISTOR_INSTALLER_KEY),
-                deploymentType);
-
-        reflectorInstaller = installerLookup.reflectorInstaller(
-                installerLookup.getConfiguration().getString(SystemConstants.REFLECTOR_KEY));
+        persistenceMechanismInstaller = this.installerLookup.persistenceMechanismInstaller(
+                configProperty(SystemConstants.OBJECT_PERSISTOR_INSTALLER_KEY)
+        );
 
-        servicesInstaller = installerLookup.servicesInstaller(null);
+        reflectorInstaller = this.installerLookup.reflectorInstaller(
+                configProperty(SystemConstants.REFLECTOR_KEY));
 
         TransactionFacetDecoratorInstaller transactionFacetDecoratorInstaller =
-                installerLookup.getInstaller(TransactionFacetDecoratorInstaller.class);
+                this.installerLookup.getInstaller(TransactionFacetDecoratorInstaller.class);
+
+
+        // ensure we were able to load all components via InstallerLookup (fail fast)
+        ensureThatState(authenticationInstaller, is(not(nullValue())),
+                "authenticationInstaller could not be looked up");
+        ensureThatState(authorizationInstaller, is(not(nullValue())),
+                "authorizationInstaller could not be looked up");
+        ensureThatState(servicesInstaller, is(not(nullValue())),
+                "servicesInstaller could not be looked up");
+        ensureThatState(fixturesInstaller, is(not(nullValue())),
+                "fixtureInstaller could not be looked up");
+        ensureThatState(transactionFacetDecoratorInstaller, is(not(nullValue())),
+                "transactionFacetDecoratorInstaller could not be looked up");
+        ensureThatState(persistenceMechanismInstaller, is(not(nullValue())),
+                "persistenceMechanismInstaller could not be looked up");
+        ensureThatState(reflectorInstaller, is(not(nullValue())),
+                "reflectorInstaller could not be looked up");
 
-        ensureThatState(authenticationInstaller, is(not(nullValue())), "authenticationInstaller could not be looked up");
-        ensureThatState(authorizationInstaller, is(not(nullValue())), "authorizationInstaller could not be looked up");
-        ensureThatState(fixtureInstaller, is(not(nullValue())), "fixtureInstaller could not be looked up");
-        ensureThatState(persistenceMechanismInstaller, is(not(nullValue())), "persistenceMechanismInstaller could not be looked up");
-        ensureThatState(reflectorInstaller, is(not(nullValue())), "reflectorInstaller could not be looked up");
-        ensureThatState(transactionFacetDecoratorInstaller, is(not(nullValue())), "transactionFacetDecoratorInstaller could not be looked up");
-        ensureThatState(servicesInstaller, is(not(nullValue())), "servicesInstaller could not be looked up");
 
         // add in transaction support
         reflectorInstaller.addFacetDecoratorInstaller(transactionFacetDecoratorInstaller);
 
         // capture the final configuration once all components have been loaded
-        configuration = installerLookup.getConfiguration();
-    }
+        configuration = this.installerLookup.getConfiguration();
 
-    @Override
-    public DeploymentType getDeploymentType() {
-        return deploymentType;
-    }
+        // eagerly calculate
 
-    @Override
-    public IsisConfiguration getConfiguration() {
-        return configuration;
-    }
 
-    @Override
-    public AuthenticationManager provideAuthenticationManager(final DeploymentType deploymentType) {
-        return authenticationInstaller.createAuthenticationManager();
+        authenticationManager = authenticationInstaller.createAuthenticationManager();
+        authorizationManager = authorizationInstaller.createAuthorizationManager();
+        services = servicesInstaller.getServices();
+
+        ensureInitialized();
     }
 
-    @Override
-    public  AuthorizationManager provideAuthorizationManager(final DeploymentType deploymentType) {
-        return authorizationInstaller.createAuthorizationManager();
+    private static GlobSpec globSpecIfAny(final InstallerLookup installerLookup) {
+        final String globSpecIfAny = installerLookup.getConfiguration().getString(SystemConstants.GLOB_SPEC_KEY);
+        return globSpecIfAny != null? InstanceUtil.createInstance(globSpecIfAny, GlobSpec.class): null;
     }
 
-    @Override
-    public FixturesInstaller obtainFixturesInstaller() throws IsisSystemException {
-        return fixtureInstaller;
+    protected void doPutConfigurationProperty(final String key, final String value) {
+        this.installerLookup.putConfigurationProperty(key, value);
     }
+    //endregion
+
+
 
     @Override
     public SpecificationLoaderSpi provideSpecificationLoaderSpi(
-            final DeploymentType deploymentType,
             final Collection<MetaModelRefiner> metaModelRefiners) throws IsisSystemException {
         return reflectorInstaller.createReflector(metaModelRefiners);
     }
 
-    @Override
-    public List<Object> obtainServices() {
-        return servicesInstaller.getServices(getDeploymentType());
-    }
 
     @Override
     public PersistenceSessionFactory providePersistenceSessionFactory(
             final DeploymentType deploymentType,
             final ServicesInjectorSpi servicesInjectorSpi,
             final RuntimeContextFromSession runtimeContext) throws IsisSystemException {
-        return persistenceMechanismInstaller.createPersistenceSessionFactory(deploymentType, servicesInjectorSpi, getConfiguration(),
+        return persistenceMechanismInstaller.createPersistenceSessionFactory(deploymentType, servicesInjectorSpi,
+                getConfiguration(),
                 runtimeContext);
     }
 
+    //region > helpers
+
+    /**
+     * Returns the current value of the configuration property.
+     *
+     * Note that this may change over time as new installers are loaded (= new config property files).
+     */
+    private String configProperty(final String key) {
+        return this.installerLookup.getConfiguration().getString(key);
+    }
+    //endregion
+
+
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/306002e5/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpec.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpec.java b/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpec.java
index 552cd32..7501d0c 100644
--- a/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpec.java
+++ b/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpec.java
@@ -48,12 +48,12 @@ public final class DomainAppGlobSpec implements GlobSpec {
     }
 
     @Override
-    public List<FixtureScript> getFixtures() {
+    public List<Class<? extends FixtureScript>> getFixtures() {
         return null;
     }
 
     @Override
-    public Map<String, String> getConfiguration() {
+    public Map<String, String> getConfigurationProperties() {
         return null;
     }
 


[12/17] isis git commit: ISIS-848: can now specify additional services also for AppManifest ... simpleapp and its integ tests now passing again.

Posted by da...@apache.org.
ISIS-848: can now specify additional services also for AppManifest ... simpleapp and its integ tests now passing again.

also:
- tolerate missing isis.services.ServicesAnnotation.packagePrefix key in isis.properties (even if isis.appManifest key is also missing).


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

Branch: refs/heads/master
Commit: 0778019e0286355e1e70e4e8b7f606f876d5b3c7
Parents: b134bda
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Aug 7 00:19:56 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Aug 7 00:19:56 2015 +0100

----------------------------------------------------------------------
 .../IsisComponentProviderDefault.java           | 19 ++++++-----
 .../integtestsupport/IsisSystemForTest.java     | 19 +++++------
 .../ServicesInstallerFromAnnotation.java        |  8 ++---
 .../ServicesInstallerFromConfiguration.java     | 10 ++++--
 .../core/runtime/system/SystemConstants.java    |  4 +--
 .../IsisComponentProviderAbstract.java          | 24 ++++++++++----
 .../IsisComponentProviderUsingInstallers.java   | 16 ++++-----
 .../jdo/service/RegisterEntities.java           | 15 +++++----
 .../java/domainapp/home/SimpleAppManifest.java  |  2 +-
 .../domainapp/home/SimpleAppManifestBypass.java | 35 --------------------
 .../home/SimpleAppManifestBypassSecurity.java   | 35 ++++++++++++++++++++
 .../src/main/webapp/WEB-INF/isis.properties     |  6 ++--
 .../WEB-INF/persistor_datanucleus.properties    |  3 --
 13 files changed, 103 insertions(+), 93 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/0778019e/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
index da0ec2e..343306e 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
@@ -49,10 +49,11 @@ import org.apache.isis.core.runtime.authorization.standard.AuthorizationManagerS
 import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
 import org.apache.isis.core.runtime.fixtures.FixturesInstallerFromConfiguration;
 import org.apache.isis.core.runtime.persistence.internal.RuntimeContextFromSession;
-import org.apache.isis.core.runtime.services.ServicesInstallerFromAnnotation;
 import org.apache.isis.core.runtime.services.ServicesInstallerFromConfiguration;
+import org.apache.isis.core.runtime.services.ServicesInstallerFromConfigurationAndAnnotation;
 import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.core.runtime.system.IsisSystemException;
+import org.apache.isis.core.runtime.system.SystemConstants;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
 import org.apache.isis.core.runtime.systemusinginstallers.IsisComponentProviderAbstract;
 import org.apache.isis.core.runtime.transaction.facetdecorator.standard.StandardTransactionFacetDecorator;
@@ -87,18 +88,18 @@ public class IsisComponentProviderDefault extends IsisComponentProviderAbstract
             // if it can't find any @PersistenceCapable entities in a module
             // that contains only services.
             putConfigurationProperty(
-                    "isis.globSpec", appManifestIfAny.getClass().getName()
+                    SystemConstants.APP_MANIFEST_KEY, appManifestIfAny.getClass().getName()
             );
 
             List<Class<? extends FixtureScript>> fixtureClasses = appManifest.getFixtures();
-            fixtureClassNamesCsv = fixtureClassNamesFrom(fixtureClasses);
+            fixtureClassNamesCsv = classNamesFrom(fixtureClasses);
 
             overrideConfigurationUsing(appManifest);
 
             this.services = createServices(configuration);
 
         } else {
-            fixtureClassNamesCsv = fixtureClassNamesFrom(fixturesOverride);
+            fixtureClassNamesCsv = classNamesFrom(fixturesOverride);
 
             this.services = elseDefault(servicesOverride, configuration);
         }
@@ -106,7 +107,7 @@ public class IsisComponentProviderDefault extends IsisComponentProviderAbstract
         putConfigurationProperty(FixturesInstallerFromConfiguration.FIXTURES, fixtureClassNamesCsv);
         this.fixturesInstaller = createFixturesInstaller(configuration);
 
-        // integration tests ignore globSpec for authentication and authorization.
+        // integration tests ignore appManifest for authentication and authorization.
         this.authenticationManager = createAuthenticationManager(configuration);
         this.authorizationManager = createAuthorizationManager(configuration);
 
@@ -117,11 +118,11 @@ public class IsisComponentProviderDefault extends IsisComponentProviderAbstract
 
 
 
-    //region > globSpec
+    //region > appManifest
 
-    private List<Object> createServices(
-            final IsisConfiguration configuration) {
-        final ServicesInstallerFromAnnotation servicesInstaller = new ServicesInstallerFromAnnotation();
+    private List<Object> createServices(final IsisConfiguration configuration) {
+        final ServicesInstallerFromConfigurationAndAnnotation servicesInstaller =
+                new ServicesInstallerFromConfigurationAndAnnotation();
         servicesInstaller.setConfiguration(configuration);
         return servicesInstaller.getServices();
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/0778019e/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
index 6c7d6d8..ab70be2 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
@@ -179,7 +179,6 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
         private AuthenticationRequest authenticationRequest = new AuthenticationRequestNameOnly("tester");
         
         private IsisConfigurationDefault configuration = new IsisConfigurationDefault();
-        private final IsisConfigurationDefault configurationAsPerGlobSpec = new IsisConfigurationDefault();
 
         private AppManifest appManifestIfAny;
 
@@ -228,7 +227,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
 
         public Builder withServicesIn(String... packagePrefixes ) {
             if(appManifestIfAny != null) {
-                throw new IllegalStateException("A globSpec has already been provided");
+                throw new IllegalStateException("An appManifest has already been provided; instead use AppManifest#getAdditionalServices()");
             }
             if(packagePrefixes.length == 0) {
                 throw new IllegalArgumentException("Specify packagePrefixes to search for @DomainService-annotated services");
@@ -250,7 +249,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
 
         public Builder withServices(Object... services) {
             if(appManifestIfAny != null) {
-                throw new IllegalStateException("A globSpec has already been provided");
+                throw new IllegalStateException("An appManifest has already been provided");
             }
             this.services.addAll(Arrays.asList(services));
             return this;
@@ -262,7 +261,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
         @Deprecated
         public Builder withFixtures(InstallableFixture... fixtures) {
             if(appManifestIfAny != null) {
-                throw new IllegalStateException("A globSpec has already been provided");
+                throw new IllegalStateException("An appManifest has already been provided");
             }
             this.fixtures.addAll(Arrays.asList(fixtures));
             return this;
@@ -278,11 +277,9 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
                     new IsisSystemForTest(
                             appManifestIfAny,
                             configuration,
-                            programmingModelOverride,
+                            services, fixtures, programmingModelOverride,
                             metaModelValidatorOverride,
                             authenticationRequest,
-                            services,
-                            fixtures,
                             listeners);
             if(level != null) {
                 isisSystem.setLevel(level);
@@ -334,19 +331,19 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
     private IsisSystemForTest(
             final AppManifest appManifestIfAny,
             final IsisConfiguration configurationOverride,
+            final List<Object> servicesIfAny,
+            final List<InstallableFixture> fixturesIfAny,
             final ProgrammingModel programmingModelOverride,
             final MetaModelValidator metaModelValidatorOverride,
             final AuthenticationRequest authenticationRequest,
-            final List<Object> servicesIfAny,
-            final List<InstallableFixture> fixtures,
             final List<Listener> listeners) {
         this.appManifestForComponentProvider = appManifestIfAny;
         this.configurationForComponentProvider = configurationOverride;
+        this.servicesForComponentProvider = servicesIfAny;
+        this.fixturesForComponentProvider = fixturesIfAny;
         this.programmingModelForComponentProvider = programmingModelOverride;
         this.metaModelValidatorForComponentProvider = metaModelValidatorOverride;
         this.authenticationRequestIfAny = authenticationRequest;
-        this.servicesForComponentProvider = servicesIfAny;
-        this.fixturesForComponentProvider = fixtures;
         this.listeners = listeners;
     }
 

http://git-wip-us.apache.org/repos/asf/isis/blob/0778019e/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromAnnotation.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromAnnotation.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromAnnotation.java
index fce5ebb..d049d96 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromAnnotation.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromAnnotation.java
@@ -129,12 +129,12 @@ public class ServicesInstallerFromAnnotation extends ServicesInstallerAbstract {
             serviceInstantiator.setConfiguration(getConfiguration());
 
             if(packagePrefixes == null) {
-                this.packagePrefixes = getConfiguration().getString(PACKAGE_PREFIX_KEY);
-                if(Strings.isNullOrEmpty(packagePrefixes)) {
-                    throw new IllegalStateException("Could not locate '" + PACKAGE_PREFIX_KEY + "' key in property files - aborting");
+                this.packagePrefixes = PACKAGE_PREFIX_STANDARD;
+                String packagePrefixes = getConfiguration().getString(PACKAGE_PREFIX_KEY);
+                if(!Strings.isNullOrEmpty(packagePrefixes)) {
+                    this.packagePrefixes = this.packagePrefixes + "," + packagePrefixes;
                 }
             }
-            this.packagePrefixes = PACKAGE_PREFIX_STANDARD + "," + this.packagePrefixes;
 
         } finally {
             initialized = true;

http://git-wip-us.apache.org/repos/asf/isis/blob/0778019e/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfiguration.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfiguration.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfiguration.java
index 514aae1..e58d90e 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfiguration.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfiguration.java
@@ -45,6 +45,7 @@ public class ServicesInstallerFromConfiguration extends ServicesInstallerAbstrac
     public static final String NAME = "configuration";
 
     private static final String SERVICES = "services";
+    public static final String SERVICES_KEY = ConfigurationConstants.ROOT + SERVICES;
 
     /**
      * @deprecated
@@ -57,6 +58,11 @@ public class ServicesInstallerFromConfiguration extends ServicesInstallerAbstrac
      */
     @Deprecated
     private static final String SERVICES_PREFIX = "services.prefix";
+    /**
+     * @deprecated
+     */
+    @Deprecated
+    private static final String SERVICES_PREFIX_KEY = ConfigurationConstants.ROOT + SERVICES_PREFIX;
 
     private final static Pattern POSITIONED_SERVICE_REGEX = Pattern.compile("((\\d+):)(.*)");
 
@@ -134,8 +140,8 @@ public class ServicesInstallerFromConfiguration extends ServicesInstallerAbstrac
     private void appendConfiguredServices(
             final SortedMap<String, SortedSet<String>> positionedServices) {
 
-        String servicePrefix = getConfiguration().getString(ConfigurationConstants.ROOT + SERVICES_PREFIX);
-        final String configuredServices = getConfiguration().getString(ConfigurationConstants.ROOT + SERVICES);
+        String servicePrefix = getConfiguration().getString(SERVICES_PREFIX_KEY);
+        final String configuredServices = getConfiguration().getString(SERVICES_KEY);
         if (configuredServices == null) {
             return;
         }

http://git-wip-us.apache.org/repos/asf/isis/blob/0778019e/core/runtime/src/main/java/org/apache/isis/core/runtime/system/SystemConstants.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/SystemConstants.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/SystemConstants.java
index 619d9cb..b64b746 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/SystemConstants.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/SystemConstants.java
@@ -71,7 +71,7 @@ public final class SystemConstants {
     /**
      * Key used to lookup {@link AppManifest} (if any) from the {@link IsisConfiguration}.
      */
-    public static final String GLOB_SPEC_KEY = ConfigurationConstants.ROOT + "globSpec";
+    public static final String APP_MANIFEST_KEY = ConfigurationConstants.ROOT + "appManifest";
 
     /**
      * Key used to lookup {@link AuthenticationManager authentication manager}
@@ -106,7 +106,7 @@ public final class SystemConstants {
     /**
      * Default for {@link #SERVICES_INSTALLER_KEY}
      */
-    public static final String SERVICES_INSTALLER_DEFAULT = "configuration";
+    public static final String SERVICES_INSTALLER_DEFAULT = "configuration-and-annotation";
 
     /**
      * Key used to lookup {@link FixturesInstaller fixtures installer} in

http://git-wip-us.apache.org/repos/asf/isis/blob/0778019e/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 3030a94..a662371 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
@@ -35,6 +35,7 @@ import org.apache.isis.core.runtime.authentication.AuthenticationManager;
 import org.apache.isis.core.runtime.authorization.AuthorizationManager;
 import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
 import org.apache.isis.core.runtime.services.ServicesInstallerFromAnnotation;
+import org.apache.isis.core.runtime.services.ServicesInstallerFromConfiguration;
 import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.objectstore.jdo.service.RegisterEntities;
 
@@ -92,38 +93,47 @@ public abstract class IsisComponentProviderAbstract implements IsisComponentProv
     }
 
 
-    //region > globSpec helpers
+    //region > appManifest helpers
     protected void specifyServicesAndRegisteredEntitiesUsing(final AppManifest appManifest) {
         final String packageNamesCsv = modulePackageNamesFrom(appManifest);
 
         putConfigurationProperty(ServicesInstallerFromAnnotation.PACKAGE_PREFIX_KEY, packageNamesCsv);
         putConfigurationProperty(RegisterEntities.PACKAGE_PREFIX_KEY, packageNamesCsv);
+
+        final List<Class<?>> additionalServices = appManifest.getAdditionalServices();
+        if(additionalServices != null) {
+            putConfigurationProperty(ServicesInstallerFromConfiguration.SERVICES_KEY, classNamesFrom(additionalServices));
+        }
     }
 
+
     private String modulePackageNamesFrom(final AppManifest appManifest) {
         List<Class<?>> modules = appManifest.getModules();
         if (modules == null || modules.isEmpty()) {
             throw new IllegalArgumentException(
-                    "If a globSpec is provided then it must return a non-empty set of modules");
+                    "If an appManifest is provided then it must return a non-empty set of modules");
         }
 
         final Iterable<String> iter = Iterables.transform(modules, ClassUtil.Functions.packageNameOf());
         return Joiner.on(',').join(iter);
     }
 
-    protected String fixtureClassNamesFrom(final List<?> fixtures) {
-        if (fixtures == null) {
+    protected String classNamesFrom(final List<?> objectsOrClasses) {
+        if (objectsOrClasses == null) {
             return null;
         }
-        final Iterable<String> fixtureClassNames = Iterables.transform(fixtures, classNameOf());
+        final Iterable<String> fixtureClassNames = Iterables.transform(objectsOrClasses, classNameOf());
         return Joiner.on(',').join(fixtureClassNames);
     }
 
-    private Function<Object, String> classNameOf() {
+    private static Function<Object, String> classNameOf() {
         return new Function<Object, String>() {
                         @Nullable @Override
                         public String apply(final Object input) {
-                            Class<?> aClass = input instanceof Class ? (Class<?>)input: input.getClass();
+                            Class<?> aClass =
+                                    input instanceof Class
+                                        ? (Class<?>)input
+                                        : input.getClass();
                             return aClass.getName();
                         }
                     };

http://git-wip-us.apache.org/repos/asf/isis/blob/0778019e/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 80576f8..e0fd90e 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
@@ -36,7 +36,7 @@ import org.apache.isis.core.runtime.installerregistry.InstallerLookup;
 import org.apache.isis.core.runtime.installerregistry.installerapi.PersistenceMechanismInstaller;
 import org.apache.isis.core.runtime.persistence.internal.RuntimeContextFromSession;
 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.SystemConstants;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
@@ -58,7 +58,7 @@ public class IsisComponentProviderUsingInstallers extends IsisComponentProviderA
     public IsisComponentProviderUsingInstallers(
             final DeploymentType deploymentType,
             final InstallerLookup installerLookup) {
-        super(deploymentType, globSpecIfAny(installerLookup));
+        super(deploymentType, appManifestIfAny(installerLookup));
 
         ensureThatArg(deploymentType, is(not(nullValue())));
         ensureThatArg(installerLookup, is(not(nullValue())));
@@ -69,9 +69,7 @@ public class IsisComponentProviderUsingInstallers extends IsisComponentProviderA
 
             specifyServicesAndRegisteredEntitiesUsing(appManifest);
 
-            // by using the annotations installer (as opposed to the configuration-and-annotations installer),
-            // any services defined with the "isis.services" key will be IGNORED.
-            putConfigurationProperty(SystemConstants.SERVICES_INSTALLER_KEY, ServicesInstallerFromAnnotation.NAME);
+            putConfigurationProperty(SystemConstants.SERVICES_INSTALLER_KEY, ServicesInstallerFromConfigurationAndAnnotation.NAME);
 
             final String authenticationMechanism = appManifest.getAuthenticationMechanism();
             putConfigurationProperty(SystemConstants.AUTHENTICATION_INSTALLER_KEY, authenticationMechanism);
@@ -80,7 +78,7 @@ public class IsisComponentProviderUsingInstallers extends IsisComponentProviderA
             putConfigurationProperty(SystemConstants.AUTHORIZATION_INSTALLER_KEY, authorizationMechanism);
 
             List<Class<? extends FixtureScript>> fixtureClasses = appManifest.getFixtures();
-            final String fixtureClassNamesCsv = fixtureClassNamesFrom(fixtureClasses);
+            final String fixtureClassNamesCsv = classNamesFrom(fixtureClasses);
             putConfigurationProperty(FixturesInstallerFromConfiguration.FIXTURES, fixtureClassNamesCsv);
 
             overrideConfigurationUsing(appManifest);
@@ -143,9 +141,9 @@ public class IsisComponentProviderUsingInstallers extends IsisComponentProviderA
         ensureInitialized();
     }
 
-    private static AppManifest globSpecIfAny(final InstallerLookup installerLookup) {
-        final String globSpecIfAny = installerLookup.getConfiguration().getString(SystemConstants.GLOB_SPEC_KEY);
-        return globSpecIfAny != null? InstanceUtil.createInstance(globSpecIfAny, AppManifest.class): null;
+    private static AppManifest appManifestIfAny(final InstallerLookup installerLookup) {
+        final String appManifestIfAny = installerLookup.getConfiguration().getString(SystemConstants.APP_MANIFEST_KEY);
+        return appManifestIfAny != null? InstanceUtil.createInstance(appManifestIfAny, AppManifest.class): null;
     }
 
     protected void doPutConfigurationProperty(final String key, final String value) {

http://git-wip-us.apache.org/repos/asf/isis/blob/0778019e/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/service/RegisterEntities.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/service/RegisterEntities.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/service/RegisterEntities.java
index e8540ce..8dc6039 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/service/RegisterEntities.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/service/RegisterEntities.java
@@ -38,6 +38,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
+import org.apache.isis.core.runtime.system.SystemConstants;
 import org.apache.isis.core.runtime.system.context.IsisContext;
 
 public class RegisterEntities {
@@ -50,9 +51,9 @@ public class RegisterEntities {
     // //////////////////////////////////////
 
     // determines how to handle missing entities in a package
-    // if globSpec is in use, just log it (because we use packages also to indicate presence of services);
-    // if globSpec NOT in use, then treat this as an error.
-    private final boolean globSpecSpecified;
+    // if appManifest is in use, just log it (because we use packages also to indicate presence of services);
+    // if appManifest is NOT in use, then treat this as an error.
+    private final boolean appManifestSpecified;
 
     //region > domPackages
     private final List<String> domPackages;
@@ -78,16 +79,16 @@ public class RegisterEntities {
                     PACKAGE_PREFIX_KEY));
         }
         domPackages = parseDomPackages(packagePrefixes);
-        this.globSpecSpecified = configuration.get("isis.globSpec") != null;
+        this.appManifestSpecified = configuration.get(SystemConstants.APP_MANIFEST_KEY) != null;
 
-        this.entityTypes = scanForEntityTypesIn(this.domPackages, this.globSpecSpecified);
+        this.entityTypes = scanForEntityTypesIn(this.domPackages, this.appManifestSpecified);
     }
 
     private static List<String> parseDomPackages(String packagePrefixes) {
         return Collections.unmodifiableList(Lists.newArrayList(Iterables.transform(Splitter.on(",").split(packagePrefixes), trim())));
     }
 
-    private static Set<String> scanForEntityTypesIn(final List<String> domPackages, final boolean globSpecSpecified) {
+    private static Set<String> scanForEntityTypesIn(final List<String> domPackages, final boolean appManifestSpecified) {
         final Set<String> entityTypes = Sets.newLinkedHashSet();
         for (final String packageName : domPackages) {
             Reflections reflections = new Reflections(packageName);
@@ -97,7 +98,7 @@ public class RegisterEntities {
 
             if(!entitiesIn(entityTypesInPackage)) {
 
-                if(globSpecSpecified) {
+                if(appManifestSpecified) {
                     if(LOG.isDebugEnabled()) {
                         LOG.debug("Could not locate any @PersistenceCapable entities in module '%s'; ignoring\n", packageName);
                     }

http://git-wip-us.apache.org/repos/asf/isis/blob/0778019e/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifest.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifest.java b/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifest.java
index f821bc0..357ab39 100644
--- a/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifest.java
+++ b/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifest.java
@@ -45,7 +45,7 @@ public class SimpleAppManifest implements AppManifest {
         return Arrays.asList(
                 DomainAppDomainModule.class,  // domain (entities and repositories)
                 DomainAppFixtureModule.class, // fixtures
-                SimpleAppManifest.class  // home page service
+                SimpleAppManifest.class       // home page service
         );
     }
 

http://git-wip-us.apache.org/repos/asf/isis/blob/0778019e/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestBypass.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestBypass.java b/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestBypass.java
deleted file mode 100644
index 97298a3..0000000
--- a/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestBypass.java
+++ /dev/null
@@ -1,35 +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 domainapp.home;
-
-/**
- * Bypasses security, meaning any user/password combination can be used to login.
- */
-public class SimpleAppManifestBypass extends SimpleAppManifest {
-
-    @Override
-    public String getAuthenticationMechanism() {
-        return "bypass";
-    }
-
-    @Override
-    public String getAuthorizationMechanism() {
-        return "bypass";
-    }
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/0778019e/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestBypassSecurity.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestBypassSecurity.java b/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestBypassSecurity.java
new file mode 100644
index 0000000..9373739
--- /dev/null
+++ b/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestBypassSecurity.java
@@ -0,0 +1,35 @@
+/*
+ *  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.home;
+
+/**
+ * Bypasses security, meaning any user/password combination can be used to login.
+ */
+public class SimpleAppManifestBypassSecurity extends SimpleAppManifest {
+
+    @Override
+    public String getAuthenticationMechanism() {
+        return "bypass";
+    }
+
+    @Override
+    public String getAuthorizationMechanism() {
+        return "bypass";
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0778019e/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
index 825ed7d..4184589 100644
--- a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
+++ b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -23,9 +23,9 @@
 #################################################################################
 
 
-isis.globSpec=domainapp.home.SimpleAppManifest
-#isis.globSpec=domainapp.home.SimpleAppAppManifestBypass
-#isis.globSpec=domainapp.home.SimpleAppManifestNoFixtures
+isis.appManifest=domainapp.home.SimpleAppManifest
+#isis.appManifest=domainapp.home.SimpleAppManifestBypassSecurity
+#isis.appManifest=domainapp.home.SimpleAppManifestNoFixtures
 
 
 

http://git-wip-us.apache.org/repos/asf/isis/blob/0778019e/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
index f27533c..165dcaf 100644
--- a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
+++ b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
@@ -19,9 +19,6 @@
 # configuration file for the JDO/DataNucleus objectstore
 #
 
-# identifies @PersistenceCapable entities to be eagerly registered
-# if move class to other package (eg com.mycompany.myapp.dom) then update 
-isis.persistor.datanucleus.RegisterEntities.packagePrefix=domainapp.dom
 
 #
 # hook to perform additional initialization when JDO class metadata is loaded


[17/17] isis git commit: Merge branch 'ISIS-848'

Posted by da...@apache.org.
Merge branch 'ISIS-848'


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

Branch: refs/heads/master
Commit: cd84e55a6ae863575842e2f77e478b4f272da985
Parents: 1ed4eef 10b93a7
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Aug 7 11:10:45 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Aug 7 11:10:45 2015 +0100

----------------------------------------------------------------------
 .../asciidoc/guides/_cg_isis-maven-plugin.adoc  |   1 +
 ..._ug_getting-started_simpleapp-archetype.adoc |   3 +
 .../org/apache/isis/applib/AppManifest.java     | 161 +++++++++++++
 .../IsisComponentProviderDefault.java           | 238 +++++++++++--------
 .../integtestsupport/IsisSystemForTest.java     | 174 ++++++++------
 .../isis/tool/mavenplugin/IsisMojoAbstract.java |   5 +-
 .../config/IsisConfigurationBuilder.java        |   8 +
 ...IsisConfigurationBuilderResourceStreams.java |  11 +-
 .../isis/core/commons/lang/ClassUtil.java       |  32 +++
 .../FixturesInstallerFromConfiguration.java     |   3 +-
 .../installerregistry/InstallerLookup.java      | 123 +++++-----
 .../core/runtime/runner/IsisInjectModule.java   |  10 +-
 .../runtime/services/ServicesInstaller.java     |   3 +-
 .../services/ServicesInstallerAbstract.java     |  35 ---
 .../ServicesInstallerFromAnnotation.java        |  37 ++-
 .../ServicesInstallerFromConfiguration.java     |  74 +++---
 ...InstallerFromConfigurationAndAnnotation.java |  24 +-
 .../isis/core/runtime/system/IsisSystem.java    |   6 +-
 .../core/runtime/system/IsisSystemFactory.java  |   5 +-
 .../core/runtime/system/SystemConstants.java    |  27 +--
 .../IsisComponentProvider.java                  |  23 +-
 .../IsisComponentProviderAbstract.java          | 213 +++++++++++++++++
 .../IsisComponentProviderUsingInstallers.java   | 176 ++++++++------
 .../IsisSystemThatUsesInstallersFactory.java    |  45 +++-
 .../jdo/service/RegisterEntities.java           |  27 ++-
 .../viewer/wicket/viewer/IsisWicketModule.java  |  10 +-
 example/application/simpleapp/app/pom.xml       |  68 ++++++
 .../java/domainapp/home/SimpleAppManifest.java  | 100 ++++++++
 .../home/SimpleAppManifestBypassSecurity.java   |  35 +++
 .../home/SimpleAppManifestNoFixtures.java       |  36 +++
 .../home/services/homepage/HomePageService.java |  51 ++++
 .../services/homepage/HomePageViewModel.java    |  50 ++++
 .../homepage/HomePageViewModel.layout.json      |  43 ++++
 .../services/homepage/HomePageViewModel.png     | Bin 0 -> 456 bytes
 .../domainapp/dom/DomainAppDomainModule.java    |  24 ++
 .../dom/app/homepage/HomePageService.java       |  51 ----
 .../dom/app/homepage/HomePageViewModel.java     |  50 ----
 .../app/homepage/HomePageViewModel.layout.json  |  43 ----
 .../dom/app/homepage/HomePageViewModel.png      | Bin 456 -> 0 bytes
 .../dom/modules/simple/SimpleObject.java        | 149 ------------
 .../dom/modules/simple/SimpleObject.layout.json |  56 -----
 .../dom/modules/simple/SimpleObject.png         | Bin 653 -> 0 bytes
 .../dom/modules/simple/SimpleObjects.java       | 107 ---------
 .../java/domainapp/dom/simple/SimpleObject.java | 149 ++++++++++++
 .../dom/simple/SimpleObject.layout.json         |  56 +++++
 .../java/domainapp/dom/simple/SimpleObject.png  | Bin 0 -> 653 bytes
 .../domainapp/dom/simple/SimpleObjects.java     | 107 +++++++++
 .../dom/modules/simple/SimpleObjectTest.java    |  49 ----
 .../dom/modules/simple/SimpleObjectsTest.java   | 104 --------
 .../domainapp/dom/simple/SimpleObjectTest.java  |  49 ++++
 .../domainapp/dom/simple/SimpleObjectsTest.java | 104 ++++++++
 example/application/simpleapp/fixture/pom.xml   |   7 +
 .../fixture/DomainAppFixtureModule.java         |  24 ++
 ...nAppFixtureScriptsSpecificationProvider.java |  44 ++++
 .../fixture/DomainAppFixturesProvider.java      |  44 ----
 .../fixture/dom/simple/SimpleObjectCreate.java  |  71 ++++++
 .../dom/simple/SimpleObjectsTearDown.java       |  36 +++
 .../modules/simple/SimpleObjectCreate.java      |  71 ------
 .../modules/simple/SimpleObjectsTearDown.java   |  36 ---
 .../scenarios/RecreateSimpleObjects.java        |   6 +-
 .../application/simpleapp/integtests/pom.xml    |  12 +-
 .../bootstrap/SimpleAppSystemInitializer.java   |  29 +--
 .../modules/simple/SimpleObjectGlue.java        |   4 +-
 .../modules/simple/SimpleObjectIntegTest.java   |   2 +-
 .../modules/simple/SimpleObjectsIntegTest.java  |   6 +-
 example/application/simpleapp/pom.xml           |   6 +
 example/application/simpleapp/webapp/pom.xml    |  31 +--
 .../domainapp/webapp/SimpleApplication.java     |  60 +----
 .../src/main/webapp/WEB-INF/isis.properties     | 128 +++-------
 .../WEB-INF/persistor_datanucleus.properties    |   3 -
 .../META-INF/maven/archetype-metadata.xml       |  17 ++
 .../resources/archetype-resources/app/pom.xml   |  65 +++++
 .../java/domainapp/home/SimpleAppManifest.java  | 103 ++++++++
 .../home/SimpleAppManifestBypassSecurity.java   |  38 +++
 .../home/SimpleAppManifestNoFixtures.java       |  39 +++
 .../home/services/homepage/HomePageService.java |  54 +++++
 .../services/homepage/HomePageViewModel.java    |  53 +++++
 .../homepage/HomePageViewModel.layout.json      |  43 ++++
 .../services/homepage/HomePageViewModel.png     | Bin 0 -> 456 bytes
 .../domainapp/dom/DomainAppDomainModule.java    |  27 +++
 .../dom/app/homepage/HomePageService.java       |  54 -----
 .../dom/app/homepage/HomePageViewModel.java     |  53 -----
 .../app/homepage/HomePageViewModel.layout.json  |  43 ----
 .../dom/app/homepage/HomePageViewModel.png      | Bin 456 -> 0 bytes
 .../dom/modules/simple/SimpleObject.java        | 152 ------------
 .../dom/modules/simple/SimpleObject.layout.json |  56 -----
 .../dom/modules/simple/SimpleObject.png         | Bin 653 -> 0 bytes
 .../dom/modules/simple/SimpleObjects.java       | 110 ---------
 .../java/domainapp/dom/simple/SimpleObject.java | 152 ++++++++++++
 .../dom/simple/SimpleObject.layout.json         |  56 +++++
 .../java/domainapp/dom/simple/SimpleObject.png  | Bin 0 -> 653 bytes
 .../domainapp/dom/simple/SimpleObjects.java     | 110 +++++++++
 .../dom/modules/simple/SimpleObjectTest.java    |  52 ----
 .../dom/modules/simple/SimpleObjectsTest.java   | 107 ---------
 .../domainapp/dom/simple/SimpleObjectTest.java  |  52 ++++
 .../domainapp/dom/simple/SimpleObjectsTest.java | 107 +++++++++
 .../archetype-resources/fixture/pom.xml         |   7 +
 .../fixture/DomainAppFixtureModule.java         |  27 +++
 ...nAppFixtureScriptsSpecificationProvider.java |  47 ++++
 .../fixture/DomainAppFixturesProvider.java      |  47 ----
 .../fixture/dom/simple/SimpleObjectCreate.java  |  74 ++++++
 .../dom/simple/SimpleObjectsTearDown.java       |  39 +++
 .../modules/simple/SimpleObjectCreate.java      |  74 ------
 .../modules/simple/SimpleObjectsTearDown.java   |  39 ---
 .../scenarios/RecreateSimpleObjects.java        |   6 +-
 .../archetype-resources/integtests/pom.xml      |  12 +-
 .../bootstrap/SimpleAppSystemInitializer.java   |  29 +--
 .../modules/simple/SimpleObjectGlue.java        |   4 +-
 .../modules/simple/SimpleObjectIntegTest.java   |   2 +-
 .../modules/simple/SimpleObjectsIntegTest.java  |   6 +-
 .../main/resources/archetype-resources/pom.xml  |   5 +
 .../archetype-resources/webapp/pom.xml          |  31 +--
 .../domainapp/webapp/SimpleApplication.java     |  60 +----
 .../src/main/webapp/WEB-INF/isis.properties     | 128 +++-------
 .../WEB-INF/persistor_datanucleus.properties    |   3 -
 .../projects/basic/archetype.properties         |   2 +-
 116 files changed, 3310 insertions(+), 2450 deletions(-)
----------------------------------------------------------------------



[10/17] isis git commit: ISIS-848: sorting out GlobSpecs with integration tests

Posted by da...@apache.org.
ISIS-848: sorting out GlobSpecs with integration tests

- updated the simpleapp:
  - bootstrapping of IntegTests (simplified)
  - isis.properties file
  - example DomainAppGlobSpecs
- RegisterEntities checks if GlobSpec is in use, and if so then only logs as debug a message if can't find any @PersistenceCapable's in any given package (ie not an error condition)
- cleaned up IsisSystemForTest so that the components created by IsisComponentProvider are used subsequently for installing fixtures and looking up services (rather than it using its own local copy which might be invalid if a globspec was provided)
- fixes to IsisComponentProviderDefault to ensure that RegisterEntities doesn't throw exception if a globSpec was provided, also to handle fixture overrides correctly otherwise


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

Branch: refs/heads/master
Commit: 34912499af7dd75aa4dc269af8a4239b3e62a196
Parents: 306002e
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Thu Aug 6 15:27:00 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Thu Aug 6 15:27:00 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/isis/applib/GlobSpec.java   |  3 +-
 .../IsisComponentProviderDefault.java           | 24 +++++-
 .../integtestsupport/IsisSystemForTest.java     | 90 ++++++++++++--------
 .../IsisComponentProvider.java                  |  6 +-
 .../IsisComponentProviderAbstract.java          | 32 ++++---
 .../IsisComponentProviderUsingInstallers.java   | 15 ++--
 .../jdo/service/RegisterEntities.java           | 26 ++++--
 .../java/domainapp/glob/DomainAppGlobSpec.java  | 43 ++++++++--
 .../domainapp/glob/DomainAppGlobSpecBypass.java | 35 ++++++++
 .../glob/DomainAppGlobSpecNoFixtures.java       | 36 ++++++++
 .../bootstrap/SimpleAppSystemInitializer.java   | 29 ++-----
 .../src/main/webapp/WEB-INF/isis.properties     | 66 ++------------
 12 files changed, 245 insertions(+), 160 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/34912499/core/applib/src/main/java/org/apache/isis/applib/GlobSpec.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/GlobSpec.java b/core/applib/src/main/java/org/apache/isis/applib/GlobSpec.java
index c3939e3..ef245e2 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/GlobSpec.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/GlobSpec.java
@@ -112,7 +112,8 @@ public interface GlobSpec {
     public List<Class<?>> getModules();
 
     /**
-     * If non-null, overrides the value of <tt>isis.authentication</tt> configuration property.
+     * If non-null, overrides the value of <tt>isis.authentication</tt> configuration property to specify the
+     * authentication mechanism.
      *
      * <p>
      *     Ignored for integration tests (which always uses the 'bypass' mechanism).

http://git-wip-us.apache.org/repos/asf/isis/blob/34912499/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
index 36420c7..8fc168d 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
@@ -27,6 +27,8 @@ import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 
 import org.apache.isis.applib.GlobSpec;
+import org.apache.isis.applib.fixtures.InstallableFixture;
+import org.apache.isis.applib.fixturescripts.FixtureScript;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.config.IsisConfigurationDefault;
 import org.apache.isis.core.commons.resource.ResourceStreamSourceContextLoaderClassPath;
@@ -68,6 +70,7 @@ public class IsisComponentProviderDefault extends IsisComponentProviderAbstract
             final DeploymentType deploymentType,
             final GlobSpec globSpecIfAny,
             final List<Object> servicesOverride,
+            final List<InstallableFixture> fixturesOverride,
             final IsisConfiguration configurationOverride,
             final ProgrammingModel programmingModelOverride,
             final MetaModelValidator metaModelValidatorOverride) {
@@ -75,19 +78,32 @@ public class IsisComponentProviderDefault extends IsisComponentProviderAbstract
 
         this.configuration = elseDefault(configurationOverride);
 
+        final String fixtureClassNamesCsv;
         if(globSpec != null) {
 
             specifyServicesAndRegisteredEntitiesUsing(globSpec);
 
-            specifyFixtureScriptsUsing(globSpec);
+            // required to prevent RegisterEntities validation from complaining
+            // if it can't find any @PersistenceCapable entities in a module
+            // that contains only services.
+            putConfigurationProperty(
+                    "isis.globSpec", globSpecIfAny.getClass().getName()
+            );
+
+            List<Class<? extends FixtureScript>> fixtureClasses = globSpec.getFixtures();
+            fixtureClassNamesCsv = fixtureClassNamesFrom(fixtureClasses);
+
             overrideConfigurationUsing(globSpec);
 
             this.services = createServices(configuration);
 
         } else {
+            fixtureClassNamesCsv = fixtureClassNamesFrom(fixturesOverride);
+
             this.services = elseDefault(servicesOverride, configuration);
         }
 
+        putConfigurationProperty(FixturesInstallerFromConfiguration.FIXTURES, fixtureClassNamesCsv);
         this.fixturesInstaller = createFixturesInstaller(configuration);
 
         // integration tests ignore globSpec for authentication and authorization.
@@ -99,6 +115,8 @@ public class IsisComponentProviderDefault extends IsisComponentProviderAbstract
 
     }
 
+
+
     //region > globSpec
 
     private List<Object> createServices(
@@ -205,7 +223,7 @@ public class IsisComponentProviderDefault extends IsisComponentProviderAbstract
     }
 
     @Override
-    public FixturesInstaller provideFixturesInstaller() throws IsisSystemException {
+    public FixturesInstaller provideFixturesInstaller()  {
         return fixturesInstaller;
     }
 
@@ -241,7 +259,7 @@ public class IsisComponentProviderDefault extends IsisComponentProviderAbstract
     public PersistenceSessionFactory providePersistenceSessionFactory(
             DeploymentType deploymentType,
             final ServicesInjectorSpi servicesInjectorSpi,
-            final RuntimeContextFromSession runtimeContext) throws IsisSystemException {
+            final RuntimeContextFromSession runtimeContext) {
         DataNucleusPersistenceMechanismInstaller installer = new DataNucleusPersistenceMechanismInstaller();
         return installer.createPersistenceSessionFactory(deploymentType, servicesInjectorSpi, getConfiguration(), runtimeContext);
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/34912499/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
index c3a38a8..673f509 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
@@ -49,10 +49,12 @@ import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidator;
 import org.apache.isis.core.runtime.authentication.AuthenticationManager;
 import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
+import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
 import org.apache.isis.core.runtime.fixtures.FixturesInstallerDelegate;
 import org.apache.isis.core.runtime.installerregistry.installerapi.PersistenceMechanismInstaller;
 import org.apache.isis.core.runtime.logging.IsisLoggingConfigurer;
 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;
@@ -147,25 +149,27 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
 
     // //////////////////////////////////////
 
+    private org.apache.log4j.Level level = org.apache.log4j.Level.INFO;
+
+
+    // these fields 'xxxForComponentProvider' are used to initialize the IsisComponentProvider, but shouldn't be used thereafter.
+    private final GlobSpec globSpecForComponentProvider;
+    private final IsisConfiguration configurationForComponentProvider;
+    private final List<Object> servicesForComponentProvider;
+    private final List<InstallableFixture> fixturesForComponentProvider;
+    private final MetaModelValidator metaModelValidatorForComponentProvider;
+    private final ProgrammingModel programmingModelForComponentProvider;
+
+    // populated at #setupSystem
+    private IsisComponentProvider componentProvider;
 
     private IsisSystem isisSystem;
+
+    private final AuthenticationRequest authenticationRequestIfAny;
     private AuthenticationSession authenticationSession;
 
-    private final GlobSpec globSpecIfAny;
-    private final IsisConfiguration configurationOverride;
-    private final AuthenticationRequest authenticationRequest;
-    private final List<Object> servicesIfAny;
-    private final List<InstallableFixture> fixtures;
     private List <Listener> listeners;
-    
-    private org.apache.log4j.Level level = org.apache.log4j.Level.INFO;
-    
-    private final MetaModelValidator metaModelValidatorOverride;
-    private final ProgrammingModel programmingModelOverride;
-    
-    private DomainObjectContainer container;
 
-    
     ////////////////////////////////////////////////////////////
     // constructor
     ////////////////////////////////////////////////////////////
@@ -174,7 +178,9 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
 
         private AuthenticationRequest authenticationRequest = new AuthenticationRequestNameOnly("tester");
         
-        private IsisConfigurationDefault configuration;
+        private IsisConfigurationDefault configuration = new IsisConfigurationDefault();
+        private final IsisConfigurationDefault configurationAsPerGlobSpec = new IsisConfigurationDefault();
+
         private GlobSpec globSpecIfAny;
 
         private MetaModelValidator metaModelValidatorOverride;
@@ -229,7 +235,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
             }
 
             configuration.put(
-                    "isis.services.ServicesInstallerFromAnnotation.packagePrefix",
+                    ServicesInstallerFromAnnotation.PACKAGE_PREFIX_KEY,
                     Joiner.on(",").join(packagePrefixes)
             );
 
@@ -255,6 +261,9 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
          */
         @Deprecated
         public Builder withFixtures(InstallableFixture... fixtures) {
+            if(globSpecIfAny != null) {
+                throw new IllegalStateException("A globSpec has already been provided");
+            }
             this.fixtures.addAll(Arrays.asList(fixtures));
             return this;
         }
@@ -331,13 +340,13 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
             final List<Object> servicesIfAny,
             final List<InstallableFixture> fixtures,
             final List<Listener> listeners) {
-        this.globSpecIfAny = globSpecIfAny;
-        this.configurationOverride = configurationOverride;
-        this.programmingModelOverride = programmingModelOverride;
-        this.metaModelValidatorOverride = metaModelValidatorOverride;
-        this.authenticationRequest = authenticationRequest;
-        this.servicesIfAny = servicesIfAny;
-        this.fixtures = fixtures;
+        this.globSpecForComponentProvider = globSpecIfAny;
+        this.configurationForComponentProvider = configurationOverride;
+        this.programmingModelForComponentProvider = programmingModelOverride;
+        this.metaModelValidatorForComponentProvider = metaModelValidatorOverride;
+        this.authenticationRequestIfAny = authenticationRequest;
+        this.servicesForComponentProvider = servicesIfAny;
+        this.fixturesForComponentProvider = fixtures;
         this.listeners = listeners;
     }
 
@@ -382,19 +391,21 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
         
         if(firstTime) {
             IsisLoggingConfigurer isisLoggingConfigurer = new IsisLoggingConfigurer(getLevel());
-            isisLoggingConfigurer.configureLogging(".", new String[]{});
+            isisLoggingConfigurer.configureLogging(".", new String[] {});
 
-            IsisComponentProvider componentProvider = new IsisComponentProviderDefault(
+            componentProvider = new IsisComponentProviderDefault(
                     DeploymentType.UNIT_TESTING,
-                    globSpecIfAny,
-                    servicesIfAny,
-                    this.configurationOverride,
-                    this.programmingModelOverride,
-                    this.metaModelValidatorOverride
+                    globSpecForComponentProvider,
+                    servicesForComponentProvider,
+                    fixturesForComponentProvider,
+                    configurationForComponentProvider,
+                    programmingModelForComponentProvider,
+                    metaModelValidatorForComponentProvider
             );
 
             isisSystem = new IsisSystem(componentProvider);
 
+
             // ensures that a FixtureClock is installed as the singleton underpinning the ClockService
             FixtureClock.initialize();
 
@@ -403,7 +414,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
         }
 
         final AuthenticationManager authenticationManager = isisSystem.getSessionFactory().getAuthenticationManager();
-        authenticationSession = authenticationManager.authenticate(authenticationRequest);
+        authenticationSession = authenticationManager.authenticate(authenticationRequestIfAny);
 
         setContainer(getContainer());
 
@@ -417,9 +428,8 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
 
 
     private void wireAndInstallFixtures() {
-        FixturesInstallerDelegate fid = new FixturesInstallerDelegate(getPersistenceSession());
-        fid.addFixture(fixtures);
-        fid.installFixtures();
+        FixturesInstaller fixturesInstaller = componentProvider.provideFixturesInstaller();
+        fixturesInstaller.installFixtures();
     }
 
     private enum FireListeners {
@@ -431,7 +441,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
     }
 
     public DomainObjectContainer getContainer() {
-        for (Object service : servicesIfAny) {
+        for (Object service : isisSystem.getSessionFactory().getServices()) {
             if(service instanceof DomainObjectContainer) {
                 return (DomainObjectContainer) service;
             }
@@ -487,7 +497,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
     private void fireInitAndPreSetupSystem(boolean firstTime) throws Exception {
         if(firstTime) {
             for(Listener listener: listeners) {
-                listener.init(configurationOverride);
+                listener.init(componentProvider.getConfiguration());
             }
         }
         for(Listener listener: listeners) {
@@ -799,7 +809,10 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
     // (for each test, rather than at bootstrap)
     ////////////////////////////////////////////////////////////
 
-    
+    /**
+     * @deprecated - use {@link org.apache.isis.applib.fixturescripts.FixtureScripts} domain service instead.
+     */
+    @Deprecated
     public void installFixtures(final InstallableFixture... fixtures) {
         final FixturesInstallerDelegate fid = new FixturesInstallerDelegate(getPersistenceSession());
         for (InstallableFixture fixture : fixtures) {
@@ -845,9 +858,12 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
 
     /**
      * @param container the container to set
+     *
+     * @deprecated
      */
+    @Deprecated
     public void setContainer(DomainObjectContainer container) {
-        this.container = container;
+        // no-op
     }
 
     

http://git-wip-us.apache.org/repos/asf/isis/blob/34912499/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 de394b5..6699119 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
@@ -43,12 +43,12 @@ public interface IsisComponentProvider {
 
     IsisConfiguration getConfiguration();
 
-    AuthenticationManager provideAuthenticationManager(DeploymentType deploymentType) throws IsisSystemException;
+    AuthenticationManager provideAuthenticationManager(DeploymentType deploymentType);
     AuthorizationManager provideAuthorizationManager(final DeploymentType deploymentType);
 
     List<Object> provideServices();
 
-    FixturesInstaller provideFixturesInstaller() throws IsisSystemException;
+    FixturesInstaller provideFixturesInstaller();
 
     SpecificationLoaderSpi provideSpecificationLoaderSpi(Collection<MetaModelRefiner> metaModelRefiners)
             throws IsisSystemException;
@@ -56,6 +56,6 @@ public interface IsisComponentProvider {
     PersistenceSessionFactory providePersistenceSessionFactory(
             final DeploymentType deploymentType,
             final ServicesInjectorSpi servicesInjectorSpi,
-            final RuntimeContextFromSession runtimeContext) throws IsisSystemException;
+            final RuntimeContextFromSession runtimeContext);
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/34912499/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 0d57f61..9db01cc 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
@@ -22,20 +22,20 @@ package org.apache.isis.core.runtime.systemusinginstallers;
 import java.util.List;
 import java.util.Map;
 
+import javax.annotation.Nullable;
+
+import com.google.common.base.Function;
 import com.google.common.base.Joiner;
 import com.google.common.collect.Iterables;
 
 import org.apache.isis.applib.GlobSpec;
-import org.apache.isis.applib.fixturescripts.FixtureScript;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.lang.ClassUtil;
 import org.apache.isis.core.runtime.authentication.AuthenticationManager;
 import org.apache.isis.core.runtime.authorization.AuthorizationManager;
 import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
-import org.apache.isis.core.runtime.fixtures.FixturesInstallerFromConfiguration;
 import org.apache.isis.core.runtime.services.ServicesInstallerFromAnnotation;
 import org.apache.isis.core.runtime.system.DeploymentType;
-import org.apache.isis.core.runtime.system.IsisSystemException;
 import org.apache.isis.objectstore.jdo.service.RegisterEntities;
 
 import static org.apache.isis.core.commons.ensure.Ensure.ensureThatState;
@@ -111,18 +111,22 @@ public abstract class IsisComponentProviderAbstract implements IsisComponentProv
         return Joiner.on(',').join(iter);
     }
 
-    protected void specifyFixtureScriptsUsing(final GlobSpec globSpec) {
-        List<Class<? extends FixtureScript>> fixtureClasses = globSpec.getFixtures();
-        final String fixtureClassNamesCsv = fixtureClassNamesFrom(fixtureClasses);
-        putConfigurationProperty(FixturesInstallerFromConfiguration.FIXTURES, fixtureClassNamesCsv);
-    }
-
-    private String fixtureClassNamesFrom(final List<Class<? extends FixtureScript>> fixtureClasses) {
-        if (fixtureClasses == null) {
+    protected String fixtureClassNamesFrom(final List<?> fixtures) {
+        if (fixtures == null) {
             return null;
         }
-        final Iterable<String> iter = Iterables.transform(fixtureClasses, ClassUtil.Functions.nameOf());
-        return Joiner.on(',').join(iter);
+        final Iterable<String> fixtureClassNames = Iterables.transform(fixtures, classNameOf());
+        return Joiner.on(',').join(fixtureClassNames);
+    }
+
+    private Function<Object, String> classNameOf() {
+        return new Function<Object, String>() {
+                        @Nullable @Override
+                        public String apply(final Object input) {
+                            Class<?> aClass = input instanceof Class ? (Class<?>)input: input.getClass();
+                            return aClass.getName();
+                        }
+                    };
     }
 
     protected void overrideConfigurationUsing(final GlobSpec globSpec) {
@@ -172,7 +176,7 @@ public abstract class IsisComponentProviderAbstract implements IsisComponentProv
     }
 
     @Override
-    public FixturesInstaller provideFixturesInstaller() throws IsisSystemException {
+    public FixturesInstaller provideFixturesInstaller() {
         return fixturesInstaller;
     }
 

http://git-wip-us.apache.org/repos/asf/isis/blob/34912499/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 3d9261a..fc9ef58 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
@@ -20,8 +20,10 @@
 package org.apache.isis.core.runtime.systemusinginstallers;
 
 import java.util.Collection;
+import java.util.List;
 
 import org.apache.isis.applib.GlobSpec;
+import org.apache.isis.applib.fixturescripts.FixtureScript;
 import org.apache.isis.core.commons.factory.InstanceUtil;
 import org.apache.isis.core.metamodel.facetapi.MetaModelRefiner;
 import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
@@ -29,13 +31,13 @@ import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
 import org.apache.isis.core.metamodel.specloader.ObjectReflectorInstaller;
 import org.apache.isis.core.runtime.authentication.AuthenticationManagerInstaller;
 import org.apache.isis.core.runtime.authorization.AuthorizationManagerInstaller;
+import org.apache.isis.core.runtime.fixtures.FixturesInstallerFromConfiguration;
 import org.apache.isis.core.runtime.installerregistry.InstallerLookup;
 import org.apache.isis.core.runtime.installerregistry.installerapi.PersistenceMechanismInstaller;
 import org.apache.isis.core.runtime.persistence.internal.RuntimeContextFromSession;
 import org.apache.isis.core.runtime.services.ServicesInstaller;
 import org.apache.isis.core.runtime.services.ServicesInstallerFromAnnotation;
 import org.apache.isis.core.runtime.system.DeploymentType;
-import org.apache.isis.core.runtime.system.IsisSystemException;
 import org.apache.isis.core.runtime.system.SystemConstants;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
 import org.apache.isis.core.runtime.transaction.facetdecorator.standard.TransactionFacetDecoratorInstaller;
@@ -53,7 +55,6 @@ public class IsisComponentProviderUsingInstallers extends IsisComponentProviderA
     private ObjectReflectorInstaller reflectorInstaller;
     private PersistenceMechanismInstaller persistenceMechanismInstaller;
 
-
     public IsisComponentProviderUsingInstallers(
             final DeploymentType deploymentType,
             final InstallerLookup installerLookup) {
@@ -78,7 +79,9 @@ public class IsisComponentProviderUsingInstallers extends IsisComponentProviderA
             final String authorizationMechanism = globSpec.getAuthorizationMechanism();
             putConfigurationProperty(SystemConstants.AUTHORIZATION_INSTALLER_KEY, authorizationMechanism);
 
-            specifyFixtureScriptsUsing(globSpec);
+            List<Class<? extends FixtureScript>> fixtureClasses = globSpec.getFixtures();
+            final String fixtureClassNamesCsv = fixtureClassNamesFrom(fixtureClasses);
+            putConfigurationProperty(FixturesInstallerFromConfiguration.FIXTURES, fixtureClassNamesCsv);
 
             overrideConfigurationUsing(globSpec);
         }
@@ -133,8 +136,6 @@ public class IsisComponentProviderUsingInstallers extends IsisComponentProviderA
         configuration = this.installerLookup.getConfiguration();
 
         // eagerly calculate
-
-
         authenticationManager = authenticationInstaller.createAuthenticationManager();
         authorizationManager = authorizationInstaller.createAuthorizationManager();
         services = servicesInstaller.getServices();
@@ -156,7 +157,7 @@ public class IsisComponentProviderUsingInstallers extends IsisComponentProviderA
 
     @Override
     public SpecificationLoaderSpi provideSpecificationLoaderSpi(
-            final Collection<MetaModelRefiner> metaModelRefiners) throws IsisSystemException {
+            final Collection<MetaModelRefiner> metaModelRefiners) {
         return reflectorInstaller.createReflector(metaModelRefiners);
     }
 
@@ -165,7 +166,7 @@ public class IsisComponentProviderUsingInstallers extends IsisComponentProviderA
     public PersistenceSessionFactory providePersistenceSessionFactory(
             final DeploymentType deploymentType,
             final ServicesInjectorSpi servicesInjectorSpi,
-            final RuntimeContextFromSession runtimeContext) throws IsisSystemException {
+            final RuntimeContextFromSession runtimeContext) {
         return persistenceMechanismInstaller.createPersistenceSessionFactory(deploymentType, servicesInjectorSpi,
                 getConfiguration(),
                 runtimeContext);

http://git-wip-us.apache.org/repos/asf/isis/blob/34912499/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/service/RegisterEntities.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/service/RegisterEntities.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/service/RegisterEntities.java
index c772bea..e8540ce 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/service/RegisterEntities.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/service/RegisterEntities.java
@@ -49,6 +49,10 @@ public class RegisterEntities {
 
     // //////////////////////////////////////
 
+    // determines how to handle missing entities in a package
+    // if globSpec is in use, just log it (because we use packages also to indicate presence of services);
+    // if globSpec NOT in use, then treat this as an error.
+    private final boolean globSpecSpecified;
 
     //region > domPackages
     private final List<String> domPackages;
@@ -74,15 +78,16 @@ public class RegisterEntities {
                     PACKAGE_PREFIX_KEY));
         }
         domPackages = parseDomPackages(packagePrefixes);
+        this.globSpecSpecified = configuration.get("isis.globSpec") != null;
 
-        this.entityTypes = scanForEntityTypesIn(this.domPackages);
+        this.entityTypes = scanForEntityTypesIn(this.domPackages, this.globSpecSpecified);
     }
 
     private static List<String> parseDomPackages(String packagePrefixes) {
         return Collections.unmodifiableList(Lists.newArrayList(Iterables.transform(Splitter.on(",").split(packagePrefixes), trim())));
     }
 
-    private static Set<String> scanForEntityTypesIn(final List<String> domPackages) {
+    private static Set<String> scanForEntityTypesIn(final List<String> domPackages, final boolean globSpecSpecified) {
         final Set<String> entityTypes = Sets.newLinkedHashSet();
         for (final String packageName : domPackages) {
             Reflections reflections = new Reflections(packageName);
@@ -91,11 +96,18 @@ public class RegisterEntities {
                     reflections.getTypesAnnotatedWith(PersistenceCapable.class);
 
             if(!entitiesIn(entityTypesInPackage)) {
-                throw new IllegalArgumentException(String.format(
-                        "Bad configuration.\n\nCould not locate any @PersistenceCapable entities in package '%s'\n" +
-                                "Check value of '%s' key in WEB-INF/*.properties\n",
-                        packageName,
-                        PACKAGE_PREFIX_KEY));
+
+                if(globSpecSpecified) {
+                    if(LOG.isDebugEnabled()) {
+                        LOG.debug("Could not locate any @PersistenceCapable entities in module '%s'; ignoring\n", packageName);
+                    }
+                } else {
+                    throw new IllegalArgumentException(String.format(
+                            "Bad configuration.\n\nCould not locate any @PersistenceCapable entities in package '%s'\n" +
+                                    "Check value of '%s' key in WEB-INF/*.properties\n",
+                            packageName,
+                            PACKAGE_PREFIX_KEY));
+                }
             }
             for (Class<?> entityType : entityTypesInPackage) {
                 if(ignore(entityType)) {

http://git-wip-us.apache.org/repos/asf/isis/blob/34912499/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpec.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpec.java b/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpec.java
index 7501d0c..14a6896 100644
--- a/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpec.java
+++ b/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpec.java
@@ -22,36 +22,67 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 
+import com.google.common.collect.Lists;
+
 import org.apache.isis.applib.GlobSpec;
 import org.apache.isis.applib.fixturescripts.FixtureScript;
 
 import domainapp.dom.DomainAppDomainModule;
+import domainapp.fixture.DomainAppFixturesProvider;
+import domainapp.fixture.scenarios.RecreateSimpleObjects;
 
-public final class DomainAppGlobSpec implements GlobSpec {
+/**
+ * Bootstrap the application.
+ */
+public class DomainAppGlobSpec implements GlobSpec {
 
+    /**
+     * Load all services and entities found in (the packages and subpackages within) these modules
+     */
     @Override
     public List<Class<?>> getModules() {
         return Arrays.asList(
-                DomainAppDomainModule.class,
-                DomainAppGlobSpec.class
+                DomainAppDomainModule.class, // entities and repositories
+                DomainAppFixturesProvider.class, // fixture configuration
+                DomainAppGlobSpec.class      // home page service
         );
     }
 
+    /**
+     * Use shiro for authentication.
+     *
+     * <p>
+     *     NB: this is ignored for integration tests, which always use "bypass".
+     * </p>
+     */
     @Override
     public String getAuthenticationMechanism() {
-        return null;
+        return "shiro";
     }
 
+    /**
+     * Use shiro for authorization.
+     *
+     * <p>
+     *     NB: this is ignored for integration tests, which always use "bypass".
+     * </p>
+     */
     @Override
     public String getAuthorizationMechanism() {
-        return null;
+        return "shiro";
     }
 
+    /**
+     * Run these fixtures.
+     */
     @Override
     public List<Class<? extends FixtureScript>> getFixtures() {
-        return null;
+        return Lists.newArrayList(RecreateSimpleObjects.class);
     }
 
+    /**
+     * No additional overrides
+     */
     @Override
     public Map<String, String> getConfigurationProperties() {
         return null;

http://git-wip-us.apache.org/repos/asf/isis/blob/34912499/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpecBypass.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpecBypass.java b/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpecBypass.java
new file mode 100644
index 0000000..9e3fe00
--- /dev/null
+++ b/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpecBypass.java
@@ -0,0 +1,35 @@
+/*
+ *  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.glob;
+
+/**
+ * Bypasses security, meaning any user/password combination can be used to login.
+ */
+public class DomainAppGlobSpecBypass extends DomainAppGlobSpec {
+
+    @Override
+    public String getAuthenticationMechanism() {
+        return "bypass";
+    }
+
+    @Override
+    public String getAuthorizationMechanism() {
+        return "bypass";
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/34912499/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpecNoFixtures.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpecNoFixtures.java b/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpecNoFixtures.java
new file mode 100644
index 0000000..24f221a
--- /dev/null
+++ b/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpecNoFixtures.java
@@ -0,0 +1,36 @@
+/*
+ *  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.glob;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+/**
+ * Run the app but without setting up any fixtures.
+ */
+public class DomainAppGlobSpecNoFixtures extends DomainAppGlobSpec {
+
+    @Override
+    public List<Class<? extends FixtureScript>> getFixtures() {
+        return Collections.emptyList();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/34912499/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java b/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java
index 91244ec..85a92f7 100644
--- a/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java
+++ b/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java
@@ -18,37 +18,24 @@
  */
 package domainapp.integtests.bootstrap;
 
-import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.integtestsupport.IsisSystemForTest;
-import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
 import org.apache.isis.objectstore.jdo.datanucleus.IsisConfigurationForJdoIntegTests;
 
+import domainapp.glob.DomainAppGlobSpec;
+
 public class SimpleAppSystemInitializer {
 
     public static void initIsft() {
         IsisSystemForTest isft = IsisSystemForTest.getElseNull();
         if(isft == null) {
-            isft = new SimpleAppSystemBuilder().build().setUpSystem();
+            isft = new IsisSystemForTest.Builder()
+                    .withLoggingAt(org.apache.log4j.Level.INFO)
+                    .with(new DomainAppGlobSpec())
+                    .with(new IsisConfigurationForJdoIntegTests())
+                    .build()
+                    .setUpSystem();
             IsisSystemForTest.set(isft);
         }
     }
 
-    private static class SimpleAppSystemBuilder extends IsisSystemForTest.Builder {
-
-        public SimpleAppSystemBuilder() {
-            withLoggingAt(org.apache.log4j.Level.INFO);
-            with(testConfiguration());
-            with(new DataNucleusPersistenceMechanismInstaller());
-
-            // services annotated with @DomainService
-            withServicesIn( "domainapp" );
-        }
-
-        private static IsisConfiguration testConfiguration() {
-            final IsisConfigurationForJdoIntegTests testConfiguration = new IsisConfigurationForJdoIntegTests();
-
-            testConfiguration.addRegisterEntitiesPackagePrefix("domainapp.dom");
-            return testConfiguration;
-        }
-    }
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/34912499/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
index 0ec356a..330c5b1 100644
--- a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
+++ b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -18,47 +18,14 @@
 
 #################################################################################
 #
-# specify system components.
-#
-# The values correspond to the named components in the installer-registry.properties file
-# in the org.apache.isis.core:isis-core-runtime JAR (in the org.apache.isis.core.runtime package)
-#
-# Although all configuration could reside in isis.properties, the recommendation is
-# to split out into component specific files:
-# 
-#    xxx_yyy.properties files
-#
-# where
-#    * xxx is the component type, and
-#    * yyy is the component name.
-#
-# For example, viewer_wicket.properties holds configuration information specific to the Wicket viewer.
+# use GlobSpec to specify modules, system components and fixtures
 #
 #################################################################################
 
 
-#
-#
-#
-isis.globspec=domainapp.glob.DomainAppGlobSpec
-
-
-
-
-#
-# configure authentication mechanism to use (to logon to the system)
-#
- 
-#isis.authentication=bypass
-isis.authentication=shiro
-
-
-#
-# configure authorization mechanism to use
-#
- 
-#isis.authorization=bypass
-isis.authorization=shiro
+isis.globSpec=domainapp.glob.DomainAppGlobSpec
+#isis.globSpec=domainapp.glob.DomainAppGlobSpecBypass
+#isis.globSpec=domainapp.glob.DomainAppGlobSpecNoFixtures
 
 
 
@@ -158,33 +125,10 @@ isis.value.format.date=dd-MM-yyyy
 
 #################################################################################
 #
-# Application Services and fixtures
+# Domain service Configuration
 #
 #################################################################################
 
-#
-# Specify the domain services.
-# 
-# These are the most important configuration properties in the system, as they define
-# the set of the classes for Isis to instantiate as domain service singletons.
-# From these domain service instances the rest of the metamodel is discovered, while the 
-# end-user gains access to other domain objects by invoking the actions of the domain services.
-#
-isis.services-installer=configuration-and-annotation
-isis.services.ServicesInstallerFromAnnotation.packagePrefix=domainapp
-
-# additional services/overriding default (@DomainService) implementations
-isis.services =
-
-
-
-# Specify the (optional) test fixtures
-#
-# Fixtures are used to seed the object store with an initial set of data.  For the 
-# in-memory object store, the fixtures are installed on every run.  For other
-# object stores, they are used only when the object store is first initialized.
-#
-isis.fixtures=domainapp.fixture.scenarios.RecreateSimpleObjects
 
 
 #


[04/17] isis git commit: ISIS-1188: IsisSessionFactory create OidMarshaller directly rather than passed in; pass ServicesInjectorSpi to PersistenceSessionFactory.

Posted by da...@apache.org.
ISIS-1188: IsisSessionFactory create OidMarshaller directly rather than passed in; pass ServicesInjectorSpi to PersistenceSessionFactory.


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

Branch: refs/heads/master
Commit: 78dbc9a73bd068d03e8e97288a16933aff493408
Parents: fd9a217
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Aug 5 18:16:36 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Aug 5 18:16:36 2015 +0100

----------------------------------------------------------------------
 .../IsisComponentProviderDefault.java           |  5 ++--
 .../PersistenceMechanismInstaller.java          |  7 ++---
 .../isis/core/runtime/system/IsisSystem.java    | 30 +++++++++-----------
 .../persistence/PersistenceSessionFactory.java  |  8 ++----
 .../system/session/IsisSessionFactory.java      |  7 ++---
 .../IsisComponentProvider.java                  |  5 ++--
 .../IsisComponentProviderUsingInstallers.java   |  6 ++--
 ...ataNucleusPersistenceMechanismInstaller.java |  5 ++--
 .../core/runtime/context/IsisContextTest.java   |  2 +-
 ...onFactoryAbstractTest_init_and_shutdown.java |  2 +-
 10 files changed, 37 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/78dbc9a7/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
index b710fe1..17f6f4b 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
@@ -35,6 +35,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.ServicesInjectorSpi;
 import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
 import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidator;
 import org.apache.isis.core.runtime.authentication.AuthenticationManager;
@@ -208,10 +209,10 @@ public class IsisComponentProviderDefault implements IsisComponentProvider {
     @Override
     public PersistenceSessionFactory providePersistenceSessionFactory(
             DeploymentType deploymentType,
-            final List<Object> services) throws IsisSystemException {
+            final ServicesInjectorSpi servicesInjectorSpi) throws IsisSystemException {
         PersistenceMechanismInstaller installer =
                 createPersistenceMechanismInstaller(getConfiguration());
-        return installer.createPersistenceSessionFactory(deploymentType, services);
+        return installer.createPersistenceSessionFactory(deploymentType, servicesInjectorSpi);
     }
 
     private PersistenceMechanismInstaller createPersistenceMechanismInstaller(IsisConfiguration configuration) throws IsisSystemException {

http://git-wip-us.apache.org/repos/asf/isis/blob/78dbc9a7/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/installerapi/PersistenceMechanismInstaller.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/installerapi/PersistenceMechanismInstaller.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/installerapi/PersistenceMechanismInstaller.java
index d18f351..6044b83 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/installerapi/PersistenceMechanismInstaller.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/installerapi/PersistenceMechanismInstaller.java
@@ -19,13 +19,12 @@
 
 package org.apache.isis.core.runtime.installerregistry.installerapi;
 
-import java.util.List;
-
 import org.apache.isis.core.commons.components.Installer;
+import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
 import org.apache.isis.core.runtime.persistence.ObjectStoreFactory;
-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;
 
 /**
  * Installs a {@link PersistenceSession} during system start up.
@@ -34,6 +33,6 @@ public interface PersistenceMechanismInstaller extends Installer, ObjectStoreFac
 
     static String TYPE = "persistor";
 
-    PersistenceSessionFactory createPersistenceSessionFactory(DeploymentType deploymentType, final List<Object> services);
+    PersistenceSessionFactory createPersistenceSessionFactory(DeploymentType deploymentType, final ServicesInjectorSpi services);
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/78dbc9a7/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 f6c25ea..4baa3fb 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
@@ -36,8 +36,8 @@ import org.apache.isis.core.commons.components.Noop;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.debug.DebuggableWithTitle;
 import org.apache.isis.core.commons.lang.ListExtensions;
-import org.apache.isis.core.metamodel.adapter.oid.OidMarshaller;
 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.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
@@ -153,24 +153,25 @@ public class IsisSystem implements DebugSelection, ApplicationScopedComponent {
     private IsisSessionFactory createSessionFactory(final DeploymentType deploymentType) throws IsisSystemException {
 
         final List<Object> services = isisComponentProvider.obtainServices();
+
+        ServicesInjectorSpi servicesInjectorSpi = new ServicesInjectorDefault(services);
+        servicesInjectorSpi.addFallbackIfRequired(FixtureScripts.class, new FixtureScriptsDefault());
+        servicesInjectorSpi.validateServices();
+
         final PersistenceSessionFactory persistenceSessionFactory =
-                isisComponentProvider.providePersistenceSessionFactory(deploymentType, services);
+                isisComponentProvider.providePersistenceSessionFactory(deploymentType, servicesInjectorSpi);
 
         final IsisConfiguration configuration = getConfiguration();
-        final AuthenticationManager authenticationManager = isisComponentProvider
-                .provideAuthenticationManager(deploymentType);
-        final AuthorizationManager authorizationManager = isisComponentProvider
-                .provideAuthorizationManager(deploymentType);
-        final OidMarshaller oidMarshaller = createOidMarshaller();
+        final AuthenticationManager authenticationManager =
+                isisComponentProvider.provideAuthenticationManager(deploymentType);
+        final AuthorizationManager authorizationManager =
+                isisComponentProvider.provideAuthorizationManager(deploymentType);
 
         final Collection<MetaModelRefiner> metaModelRefiners =
                 refiners(authenticationManager, authorizationManager, persistenceSessionFactory);
-        final SpecificationLoaderSpi reflector = isisComponentProvider
-                .provideSpecificationLoaderSpi(deploymentType, metaModelRefiners);
+        final SpecificationLoaderSpi reflector =
+                isisComponentProvider.provideSpecificationLoaderSpi(deploymentType, metaModelRefiners);
 
-        ServicesInjectorSpi servicesInjector = persistenceSessionFactory.getServicesInjector();
-        servicesInjector.addFallbackIfRequired(FixtureScripts.class, new FixtureScriptsDefault());
-        servicesInjector.validateServices();
 
         // bind metamodel to the (runtime) framework
         final RuntimeContextFromSession runtimeContext = createRuntimeContextFromSession();
@@ -179,7 +180,7 @@ public class IsisSystem implements DebugSelection, ApplicationScopedComponent {
         return new IsisSessionFactory (
                 deploymentType, configuration, reflector,
                 authenticationManager, authorizationManager,
-                persistenceSessionFactory, oidMarshaller);
+                persistenceSessionFactory);
     }
 
     private static Collection<MetaModelRefiner> refiners(Object... possibleRefiners ) {
@@ -288,9 +289,6 @@ public class IsisSystem implements DebugSelection, ApplicationScopedComponent {
         return IsisContext.getSpecificationLoader().allSpecifications();
     }
 
-    private OidMarshaller createOidMarshaller() {
-        return new OidMarshaller();
-    }
 
     private RuntimeContextFromSession createRuntimeContextFromSession() {
         return new RuntimeContextFromSession();

http://git-wip-us.apache.org/repos/asf/isis/blob/78dbc9a7/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
index fe989cb..7f32d69 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
@@ -19,7 +19,6 @@
 
 package org.apache.isis.core.runtime.system.persistence;
 
-import java.util.List;
 import java.util.Properties;
 
 import org.slf4j.Logger;
@@ -32,7 +31,6 @@ import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facetapi.MetaModelRefiner;
 import org.apache.isis.core.metamodel.progmodel.ProgrammingModel;
 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.spec.SpecificationLoaderSpi;
 import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorComposite;
@@ -68,16 +66,16 @@ public class PersistenceSessionFactory implements MetaModelRefiner, ApplicationS
 
     public PersistenceSessionFactory(
             final DeploymentType deploymentType,
-            final List<Object> serviceList,
+            final ServicesInjectorSpi servicesInjector,
             final IsisConfiguration isisConfiguration,
             final ObjectStoreFactory objectStoreFactory) {
 
-        ensureThatState(serviceList, is(notNullValue()));
+        ensureThatState(servicesInjector, is(notNullValue()));
 
         this.deploymentType = deploymentType;
         this.configuration = isisConfiguration;
         this.objectStoreFactory = objectStoreFactory;
-        servicesInjector = new ServicesInjectorDefault(serviceList);
+        this.servicesInjector = servicesInjector;
     }
 
     public DeploymentType getDeploymentType() {

http://git-wip-us.apache.org/repos/asf/isis/blob/78dbc9a7/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 1af2136..cc9124a 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
@@ -73,14 +73,13 @@ public class IsisSessionFactory implements ApplicationScopedComponent {
     private final PersistenceSessionFactory persistenceSessionFactory;
     private final OidMarshaller oidMarshaller;
 
-    public IsisSessionFactory (
+    public IsisSessionFactory(
             final DeploymentType deploymentType,
             final IsisConfiguration configuration,
             final SpecificationLoaderSpi specificationLoader,
             final AuthenticationManager authenticationManager,
             final AuthorizationManager authorizationManager,
-            final PersistenceSessionFactory persistenceSessionFactory,
-            final OidMarshaller oidMarshaller) {
+            final PersistenceSessionFactory persistenceSessionFactory) {
 
         ensureThatArg(deploymentType, is(not(nullValue())));
         ensureThatArg(configuration, is(not(nullValue())));
@@ -95,7 +94,7 @@ public class IsisSessionFactory implements ApplicationScopedComponent {
         this.authenticationManager = authenticationManager;
         this.authorizationManager = authorizationManager;
         this.persistenceSessionFactory = persistenceSessionFactory;
-        this.oidMarshaller = oidMarshaller;
+        this.oidMarshaller = new OidMarshaller();;
     }
 
 

http://git-wip-us.apache.org/repos/asf/isis/blob/78dbc9a7/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 8194a6c..77a904e 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
@@ -24,6 +24,7 @@ import java.util.List;
 
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facetapi.MetaModelRefiner;
+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;
@@ -47,8 +48,8 @@ public interface IsisComponentProvider {
             IsisSystemException;
 
     PersistenceSessionFactory providePersistenceSessionFactory(
-            DeploymentType deploymentType,
-            final List<Object> services) throws IsisSystemException;
+            final DeploymentType deploymentType,
+            final ServicesInjectorSpi servicesInjectorSpi) throws IsisSystemException;
 
     AuthenticationManager provideAuthenticationManager(DeploymentType deploymentType) throws IsisSystemException;
 

http://git-wip-us.apache.org/repos/asf/isis/blob/78dbc9a7/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 561d54c..a28dea3 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
@@ -24,6 +24,7 @@ import java.util.List;
 
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facetapi.MetaModelRefiner;
+import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
 import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
 import org.apache.isis.core.metamodel.specloader.ObjectReflectorInstaller;
 import org.apache.isis.core.runtime.authentication.AuthenticationManager;
@@ -147,7 +148,6 @@ public class IsisComponentProviderUsingInstallers implements IsisComponentProvid
             final DeploymentType deploymentType,
             final Collection<MetaModelRefiner> metaModelRefiners) throws IsisSystemException {
 
-
         return reflectorInstaller.createReflector(metaModelRefiners);
     }
 
@@ -160,8 +160,8 @@ public class IsisComponentProviderUsingInstallers implements IsisComponentProvid
     @Override
     public PersistenceSessionFactory providePersistenceSessionFactory(
             final DeploymentType deploymentType,
-            final List<Object> services) throws IsisSystemException {
-        return persistenceMechanismInstaller.createPersistenceSessionFactory(deploymentType, services);
+            final ServicesInjectorSpi servicesInjectorSpi) throws IsisSystemException {
+        return persistenceMechanismInstaller.createPersistenceSessionFactory(deploymentType, servicesInjectorSpi);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/78dbc9a7/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusPersistenceMechanismInstaller.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusPersistenceMechanismInstaller.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusPersistenceMechanismInstaller.java
index 7aeb633..f5a6f7c 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusPersistenceMechanismInstaller.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusPersistenceMechanismInstaller.java
@@ -31,6 +31,7 @@ import org.apache.isis.core.commons.components.Installer;
 import org.apache.isis.core.commons.config.InstallerAbstract;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 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.validator.MetaModelValidatorComposite;
 import org.apache.isis.core.runtime.installerregistry.installerapi.PersistenceMechanismInstaller;
@@ -90,8 +91,8 @@ public class DataNucleusPersistenceMechanismInstaller extends InstallerAbstract
     //region > createPersistenceSessionFactory
     @Override
     public PersistenceSessionFactory createPersistenceSessionFactory(
-            final DeploymentType deploymentType, final List<Object> services) {
-        return new PersistenceSessionFactory(deploymentType, services, getConfiguration(), this);
+            final DeploymentType deploymentType, final ServicesInjectorSpi servicesInjector) {
+        return new PersistenceSessionFactory(deploymentType, servicesInjector, getConfiguration(), this);
     }
     //endregion
 

http://git-wip-us.apache.org/repos/asf/isis/blob/78dbc9a7/core/runtime/src/test/java/org/apache/isis/core/runtime/context/IsisContextTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/isis/core/runtime/context/IsisContextTest.java b/core/runtime/src/test/java/org/apache/isis/core/runtime/context/IsisContextTest.java
index 6b01e83..920d67d 100644
--- a/core/runtime/src/test/java/org/apache/isis/core/runtime/context/IsisContextTest.java
+++ b/core/runtime/src/test/java/org/apache/isis/core/runtime/context/IsisContextTest.java
@@ -101,7 +101,7 @@ public class IsisContextTest {
             }
         });
 
-        sessionFactory = new IsisSessionFactory(DeploymentType.UNIT_TESTING, configuration, mockSpecificationLoader, mockAuthenticationManager, mockAuthorizationManager, mockPersistenceSessionFactory, oidMarshaller);
+        sessionFactory = new IsisSessionFactory(DeploymentType.UNIT_TESTING, configuration, mockSpecificationLoader, mockAuthenticationManager, mockAuthorizationManager, mockPersistenceSessionFactory);
         authSession = new SimpleSession("tester", Collections.<String>emptyList());
         
         IsisContext.setConfiguration(configuration);

http://git-wip-us.apache.org/repos/asf/isis/blob/78dbc9a7/core/runtime/src/test/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryAbstractTest_init_and_shutdown.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryAbstractTest_init_and_shutdown.java b/core/runtime/src/test/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryAbstractTest_init_and_shutdown.java
index ec8e1e0..b2435aa 100644
--- a/core/runtime/src/test/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryAbstractTest_init_and_shutdown.java
+++ b/core/runtime/src/test/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryAbstractTest_init_and_shutdown.java
@@ -84,7 +84,7 @@ public class IsisSessionFactoryAbstractTest_init_and_shutdown {
     public void validate_DomainServicesWithDuplicateIds() {
         serviceList.add(new DomainServiceWithSomeId());
         serviceList.add(new DomainServiceWithDuplicateId());
-        isf = new IsisSessionFactory(mockDeploymentType, configuration, mockSpecificationLoader, mockAuthenticationManager, mockAuthorizationManager, mockPersistenceSessionFactory, mockOidMarshaller) {
+        isf = new IsisSessionFactory(mockDeploymentType, configuration, mockSpecificationLoader, mockAuthenticationManager, mockAuthorizationManager, mockPersistenceSessionFactory) {
         };
     }
 }


[14/17] isis git commit: ISIS-848: moving simpleapp-home to simpleapp-app. Also fixing issue with nullable AppManifests in guice module (use a NOOP as a placeholder)

Posted by da...@apache.org.
ISIS-848: moving simpleapp-home to simpleapp-app.  Also fixing issue with nullable AppManifests in guice module (use a NOOP as a placeholder)


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

Branch: refs/heads/master
Commit: a997de0a4e7a4294273c7328ae2eeab17af2ecea
Parents: b286e57
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Aug 7 11:07:13 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Aug 7 11:07:13 2015 +0100

----------------------------------------------------------------------
 ..._ug_getting-started_simpleapp-archetype.adoc |   8 +-
 .../core/runtime/runner/IsisInjectModule.java   |   4 +-
 .../core/runtime/system/IsisSystemFactory.java  |   4 +-
 .../IsisSystemThatUsesInstallersFactory.java    |  42 +++++++-
 .../viewer/wicket/viewer/IsisWicketModule.java  |   6 +-
 example/application/simpleapp/app/pom.xml       |  68 +++++++++++++
 .../java/domainapp/home/SimpleAppManifest.java  | 100 +++++++++++++++++++
 .../home/SimpleAppManifestBypassSecurity.java   |  35 +++++++
 .../home/SimpleAppManifestNoFixtures.java       |  36 +++++++
 .../home/services/homepage/HomePageService.java |  51 ++++++++++
 .../services/homepage/HomePageViewModel.java    |  50 ++++++++++
 .../homepage/HomePageViewModel.layout.json      |  43 ++++++++
 .../services/homepage/HomePageViewModel.png     | Bin 0 -> 456 bytes
 example/application/simpleapp/home/pom.xml      |  68 -------------
 .../java/domainapp/home/SimpleAppManifest.java  | 100 -------------------
 .../home/SimpleAppManifestBypassSecurity.java   |  35 -------
 .../home/SimpleAppManifestNoFixtures.java       |  36 -------
 .../home/services/homepage/HomePageService.java |  51 ----------
 .../services/homepage/HomePageViewModel.java    |  50 ----------
 .../homepage/HomePageViewModel.layout.json      |  43 --------
 .../services/homepage/HomePageViewModel.png     | Bin 456 -> 0 bytes
 .../application/simpleapp/integtests/pom.xml    |   2 +-
 example/application/simpleapp/pom.xml           |   8 +-
 example/application/simpleapp/webapp/pom.xml    |   2 +-
 24 files changed, 442 insertions(+), 400 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/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 8b050e3..7595004 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
@@ -282,17 +282,15 @@ As noted above, the generated app is a very simple application consisting of a s
 |`myapp`
 |The parent (aggregator) module
 
+|`myapp-app`
+|(1.9.0) The "app" module, containing the (optional) app manifest and any application-level services.
+
 |`myapp-dom`
 |The domain object model, consisting of `SimpleObject` and `SimpleObjects` (repository) domain service.
 
 |`myapp-fixture`
 |Domain object fixtures used for initializing the system when being demo'ed or for unit testing.
 
-|`myapp-home`
-|(1.9.0) The "home" module, containing the (optional) app manifest and any application-level services. +
-
-The app manifest partially replaces the
-
 |`myapp-integtests`
 |End-to-end xref:ug.adoc#_ug_testing_integ-test-support[integration tests] that exercise from the UI through to the database
 

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/IsisInjectModule.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/IsisInjectModule.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/IsisInjectModule.java
index c963b91..64be243 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/IsisInjectModule.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/IsisInjectModule.java
@@ -21,8 +21,6 @@ package org.apache.isis.core.runtime.runner;
 
 import java.util.List;
 
-import javax.annotation.Nullable;
-
 import com.google.common.collect.Lists;
 import com.google.inject.AbstractModule;
 import com.google.inject.Inject;
@@ -136,7 +134,7 @@ public class IsisInjectModule extends AbstractModule {
     protected IsisSystem provideIsisSystem(
             final DeploymentType deploymentType,
             final IsisSystemFactory systemFactory,
-            @Nullable final AppManifest appManifestIfAny) {
+            final AppManifest appManifestIfAny) {
         final IsisSystem system = systemFactory.createSystem(deploymentType, appManifestIfAny);
         system.init();
         return system;

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemFactory.java
index cd39b87..47d2c93 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemFactory.java
@@ -19,6 +19,8 @@
 
 package org.apache.isis.core.runtime.system;
 
+import javax.annotation.Nullable;
+
 import org.apache.isis.applib.AppManifest;
 import org.apache.isis.core.commons.components.ApplicationScopedComponent;
 
@@ -27,6 +29,6 @@ import org.apache.isis.core.commons.components.ApplicationScopedComponent;
  */
 public interface IsisSystemFactory extends ApplicationScopedComponent {
 
-    IsisSystem createSystem(final DeploymentType deploymentType, final AppManifest appManifestIfAny);
+    IsisSystem createSystem(final DeploymentType deploymentType, @Nullable final AppManifest appManifestIfAny);
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java
index a668624..acdf50e 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java
@@ -19,9 +19,13 @@
 
 package org.apache.isis.core.runtime.systemusinginstallers;
 
+import java.util.List;
+import java.util.Map;
+
 import com.google.inject.Inject;
 
 import org.apache.isis.applib.AppManifest;
+import org.apache.isis.applib.fixturescripts.FixtureScript;
 import org.apache.isis.core.runtime.installerregistry.InstallerLookup;
 import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.core.runtime.system.IsisSystem;
@@ -33,6 +37,38 @@ import org.apache.isis.core.runtime.system.IsisSystemFactory;
  */
 public class IsisSystemThatUsesInstallersFactory implements IsisSystemFactory {
 
+    /**
+     * Placeholder for no {@link AppManifest}.
+     *
+     * <p>
+     *     This is bound in by default in <tt>IsisWicketModule</tt>, but is replaced with
+     *     null in {@link #createSystem(DeploymentType, AppManifest)}.
+     * </p>
+     */
+    public static final AppManifest NOOP = new AppManifest() {
+        @Override public List<Class<?>> getModules() {
+            return null;
+        }
+        @Override public List<Class<?>> getAdditionalServices() {
+            return null;
+        }
+
+        @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;
+        }
+    };
     private final InstallerLookup installerLookup;
 
     @Inject
@@ -55,7 +91,11 @@ public class IsisSystemThatUsesInstallersFactory implements IsisSystemFactory {
     @Override
     public IsisSystem createSystem(final DeploymentType deploymentType, final AppManifest appManifestIfAny) {
         IsisComponentProviderUsingInstallers componentProvider =
-                new IsisComponentProviderUsingInstallers(deploymentType, appManifestIfAny, installerLookup);
+                new IsisComponentProviderUsingInstallers(
+                        deploymentType,
+                        appManifestIfAny == NOOP
+                                ? null
+                                : appManifestIfAny, installerLookup);
         return new IsisSystem(componentProvider);
     }
 

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/core/viewer-wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java b/core/viewer-wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java
index 12ea8b6..219c379 100644
--- a/core/viewer-wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java
+++ b/core/viewer-wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java
@@ -23,10 +23,12 @@ import com.google.inject.AbstractModule;
 import com.google.inject.name.Names;
 import com.google.inject.util.Providers;
 
+import org.apache.isis.applib.AppManifest;
 import org.apache.isis.applib.services.email.EmailService;
 import org.apache.isis.applib.services.userreg.EmailNotificationService;
 import org.apache.isis.core.runtime.services.email.EmailServiceDefault;
 import org.apache.isis.core.runtime.services.userreg.EmailNotificationServiceDefault;
+import org.apache.isis.core.runtime.systemusinginstallers.IsisSystemThatUsesInstallersFactory;
 import org.apache.isis.viewer.wicket.model.isis.WicketViewerSettings;
 import org.apache.isis.viewer.wicket.model.models.ImageResourceCache;
 import org.apache.isis.viewer.wicket.ui.app.registry.ComponentFactoryRegistrar;
@@ -90,9 +92,11 @@ public class IsisWicketModule extends AbstractModule {
                 .to(EmailNotificationServiceDefault.class);
 
         bind(String.class).annotatedWith(Names.named("applicationName")).toInstance("Apache Isis Wicket Viewer");
-        bind(String.class).annotatedWith(Names.named("applicationCss")).toProvider(Providers.of((String)null));
+        bind(String.class).annotatedWith(Names.named("applicationCss")).toProvider(Providers.of((String) null));
         bind(String.class).annotatedWith(Names.named("applicationJs")).toProvider(Providers.of((String)null));
         bind(String.class).annotatedWith(Names.named("welcomeMessage")).toProvider(Providers.of((String)null));
         bind(String.class).annotatedWith(Names.named("aboutMessage")).toProvider(Providers.of((String)null));
+
+        bind(AppManifest.class).toInstance(IsisSystemThatUsesInstallersFactory.NOOP);
     }
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/example/application/simpleapp/app/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/app/pom.xml b/example/application/simpleapp/app/pom.xml
new file mode 100644
index 0000000..de2a35c
--- /dev/null
+++ b/example/application/simpleapp/app/pom.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<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/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.isis.example.application</groupId>
+        <artifactId>simpleapp</artifactId>
+        <version>1.9.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>simpleapp-app</artifactId>
+    <name>Simple App Application Services</name>
+
+    <build>
+        <resources>
+            <resource>
+                <filtering>false</filtering>
+                <directory>src/main/resources</directory>
+            </resource>
+            <resource>
+                <filtering>false</filtering>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**</include>
+                </includes>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </resource>
+        </resources>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>simpleapp-fixture</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.isis.core</groupId>
+            <artifactId>isis-core-wrapper</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.isis.core</groupId>
+            <artifactId>isis-core-runtime</artifactId>
+        </dependency>
+
+    </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/example/application/simpleapp/app/src/main/java/domainapp/home/SimpleAppManifest.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/app/src/main/java/domainapp/home/SimpleAppManifest.java b/example/application/simpleapp/app/src/main/java/domainapp/home/SimpleAppManifest.java
new file mode 100644
index 0000000..357ab39
--- /dev/null
+++ b/example/application/simpleapp/app/src/main/java/domainapp/home/SimpleAppManifest.java
@@ -0,0 +1,100 @@
+/*
+ *  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.home;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import com.google.common.collect.Lists;
+
+import org.apache.isis.applib.AppManifest;
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+import domainapp.dom.DomainAppDomainModule;
+import domainapp.fixture.DomainAppFixtureModule;
+import domainapp.fixture.scenarios.RecreateSimpleObjects;
+
+/**
+ * Bootstrap the application.
+ */
+public class SimpleAppManifest 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)
+                DomainAppFixtureModule.class, // fixtures
+                SimpleAppManifest.class       // home page service
+        );
+    }
+
+    /**
+     * 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";
+    }
+
+    /**
+     * Run these fixtures.
+     */
+    @Override
+    public List<Class<? extends FixtureScript>> getFixtures() {
+        return Lists.newArrayList(RecreateSimpleObjects.class);
+    }
+
+    /**
+     * No additional overrides
+     */
+    @Override
+    public Map<String, String> getConfigurationProperties() {
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/example/application/simpleapp/app/src/main/java/domainapp/home/SimpleAppManifestBypassSecurity.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/app/src/main/java/domainapp/home/SimpleAppManifestBypassSecurity.java b/example/application/simpleapp/app/src/main/java/domainapp/home/SimpleAppManifestBypassSecurity.java
new file mode 100644
index 0000000..9373739
--- /dev/null
+++ b/example/application/simpleapp/app/src/main/java/domainapp/home/SimpleAppManifestBypassSecurity.java
@@ -0,0 +1,35 @@
+/*
+ *  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.home;
+
+/**
+ * Bypasses security, meaning any user/password combination can be used to login.
+ */
+public class SimpleAppManifestBypassSecurity extends SimpleAppManifest {
+
+    @Override
+    public String getAuthenticationMechanism() {
+        return "bypass";
+    }
+
+    @Override
+    public String getAuthorizationMechanism() {
+        return "bypass";
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/example/application/simpleapp/app/src/main/java/domainapp/home/SimpleAppManifestNoFixtures.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/app/src/main/java/domainapp/home/SimpleAppManifestNoFixtures.java b/example/application/simpleapp/app/src/main/java/domainapp/home/SimpleAppManifestNoFixtures.java
new file mode 100644
index 0000000..b13c15d
--- /dev/null
+++ b/example/application/simpleapp/app/src/main/java/domainapp/home/SimpleAppManifestNoFixtures.java
@@ -0,0 +1,36 @@
+/*
+ *  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.home;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+/**
+ * Run the app but without setting up any fixtures.
+ */
+public class SimpleAppManifestNoFixtures extends SimpleAppManifest {
+
+    @Override
+    public List<Class<? extends FixtureScript>> getFixtures() {
+        return Collections.emptyList();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/example/application/simpleapp/app/src/main/java/domainapp/home/services/homepage/HomePageService.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/app/src/main/java/domainapp/home/services/homepage/HomePageService.java b/example/application/simpleapp/app/src/main/java/domainapp/home/services/homepage/HomePageService.java
new file mode 100644
index 0000000..17a9c79
--- /dev/null
+++ b/example/application/simpleapp/app/src/main/java/domainapp/home/services/homepage/HomePageService.java
@@ -0,0 +1,51 @@
+/*
+ *  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.home.services.homepage;
+
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.HomePage;
+import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+@DomainService(
+        nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY // trick to suppress the actions from the top-level menu
+)
+public class HomePageService {
+
+    //region > homePage (action)
+
+    @Action(
+            semantics = SemanticsOf.SAFE
+    )
+    @HomePage
+    public HomePageViewModel homePage() {
+        return container.injectServicesInto(new HomePageViewModel());
+    }
+
+    //endregion
+
+    //region > injected services
+
+    @javax.inject.Inject
+    DomainObjectContainer container;
+
+    //endregion
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/example/application/simpleapp/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.java b/example/application/simpleapp/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.java
new file mode 100644
index 0000000..d20c432
--- /dev/null
+++ b/example/application/simpleapp/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.java
@@ -0,0 +1,50 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by 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.home.services.homepage;
+
+import java.util.List;
+
+import org.apache.isis.applib.annotation.ViewModel;
+
+import domainapp.dom.simple.SimpleObject;
+import domainapp.dom.simple.SimpleObjects;
+
+@ViewModel
+public class HomePageViewModel {
+
+    //region > title
+    public String title() {
+        return getObjects().size() + " objects";
+    }
+    //endregion
+
+    //region > object (collection)
+    @org.apache.isis.applib.annotation.HomePage
+    public List<SimpleObject> getObjects() {
+        return simpleObjects.listAll();
+    }
+    //endregion
+
+    //region > injected services
+
+    @javax.inject.Inject
+    SimpleObjects simpleObjects;
+
+    //endregion
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/example/application/simpleapp/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.layout.json
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.layout.json b/example/application/simpleapp/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.layout.json
new file mode 100644
index 0000000..34f78e0
--- /dev/null
+++ b/example/application/simpleapp/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.layout.json
@@ -0,0 +1,43 @@
+/**
+ *  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.
+ */
+{
+    "columns": [
+        {
+            "span": 0,
+            "memberGroups": {}
+        },
+        {
+            "span": 0,
+            "memberGroups": {}
+        },
+        {
+            "span": 0,
+            "memberGroups": {}
+        },
+        {
+            "span": 12,
+            "collections": {
+                "objects": {
+                    "collectionLayout": {
+                        "render": "EAGERLY"
+                    }
+                }
+            }
+        }
+    ],
+    "actions": {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/example/application/simpleapp/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.png
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.png b/example/application/simpleapp/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.png
new file mode 100644
index 0000000..cb03785
Binary files /dev/null and b/example/application/simpleapp/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.png differ

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/example/application/simpleapp/home/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/home/pom.xml b/example/application/simpleapp/home/pom.xml
deleted file mode 100644
index f9bf5a2..0000000
--- a/example/application/simpleapp/home/pom.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.
--->
-<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/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.isis.example.application</groupId>
-        <artifactId>simpleapp</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>simpleapp-home</artifactId>
-    <name>Simple App Home</name>
-
-    <build>
-        <resources>
-            <resource>
-                <filtering>false</filtering>
-                <directory>src/main/resources</directory>
-            </resource>
-            <resource>
-                <filtering>false</filtering>
-                <directory>src/main/java</directory>
-                <includes>
-                    <include>**</include>
-                </includes>
-                <excludes>
-                    <exclude>**/*.java</exclude>
-                </excludes>
-            </resource>
-        </resources>
-    </build>
-
-    <dependencies>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>simpleapp-fixture</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.isis.core</groupId>
-            <artifactId>isis-core-wrapper</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.isis.core</groupId>
-            <artifactId>isis-core-runtime</artifactId>
-        </dependency>
-
-    </dependencies>
-
-</project>

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifest.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifest.java b/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifest.java
deleted file mode 100644
index 357ab39..0000000
--- a/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifest.java
+++ /dev/null
@@ -1,100 +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 domainapp.home;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import com.google.common.collect.Lists;
-
-import org.apache.isis.applib.AppManifest;
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-
-import domainapp.dom.DomainAppDomainModule;
-import domainapp.fixture.DomainAppFixtureModule;
-import domainapp.fixture.scenarios.RecreateSimpleObjects;
-
-/**
- * Bootstrap the application.
- */
-public class SimpleAppManifest 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)
-                DomainAppFixtureModule.class, // fixtures
-                SimpleAppManifest.class       // home page service
-        );
-    }
-
-    /**
-     * 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";
-    }
-
-    /**
-     * Run these fixtures.
-     */
-    @Override
-    public List<Class<? extends FixtureScript>> getFixtures() {
-        return Lists.newArrayList(RecreateSimpleObjects.class);
-    }
-
-    /**
-     * No additional overrides
-     */
-    @Override
-    public Map<String, String> getConfigurationProperties() {
-        return null;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestBypassSecurity.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestBypassSecurity.java b/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestBypassSecurity.java
deleted file mode 100644
index 9373739..0000000
--- a/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestBypassSecurity.java
+++ /dev/null
@@ -1,35 +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 domainapp.home;
-
-/**
- * Bypasses security, meaning any user/password combination can be used to login.
- */
-public class SimpleAppManifestBypassSecurity extends SimpleAppManifest {
-
-    @Override
-    public String getAuthenticationMechanism() {
-        return "bypass";
-    }
-
-    @Override
-    public String getAuthorizationMechanism() {
-        return "bypass";
-    }
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestNoFixtures.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestNoFixtures.java b/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestNoFixtures.java
deleted file mode 100644
index b13c15d..0000000
--- a/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestNoFixtures.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 domainapp.home;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-
-/**
- * Run the app but without setting up any fixtures.
- */
-public class SimpleAppManifestNoFixtures extends SimpleAppManifest {
-
-    @Override
-    public List<Class<? extends FixtureScript>> getFixtures() {
-        return Collections.emptyList();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageService.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageService.java b/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageService.java
deleted file mode 100644
index 17a9c79..0000000
--- a/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageService.java
+++ /dev/null
@@ -1,51 +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 domainapp.home.services.homepage;
-
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.HomePage;
-import org.apache.isis.applib.annotation.NatureOfService;
-import org.apache.isis.applib.annotation.SemanticsOf;
-
-@DomainService(
-        nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY // trick to suppress the actions from the top-level menu
-)
-public class HomePageService {
-
-    //region > homePage (action)
-
-    @Action(
-            semantics = SemanticsOf.SAFE
-    )
-    @HomePage
-    public HomePageViewModel homePage() {
-        return container.injectServicesInto(new HomePageViewModel());
-    }
-
-    //endregion
-
-    //region > injected services
-
-    @javax.inject.Inject
-    DomainObjectContainer container;
-
-    //endregion
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.java b/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.java
deleted file mode 100644
index d20c432..0000000
--- a/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.java
+++ /dev/null
@@ -1,50 +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 domainapp.home.services.homepage;
-
-import java.util.List;
-
-import org.apache.isis.applib.annotation.ViewModel;
-
-import domainapp.dom.simple.SimpleObject;
-import domainapp.dom.simple.SimpleObjects;
-
-@ViewModel
-public class HomePageViewModel {
-
-    //region > title
-    public String title() {
-        return getObjects().size() + " objects";
-    }
-    //endregion
-
-    //region > object (collection)
-    @org.apache.isis.applib.annotation.HomePage
-    public List<SimpleObject> getObjects() {
-        return simpleObjects.listAll();
-    }
-    //endregion
-
-    //region > injected services
-
-    @javax.inject.Inject
-    SimpleObjects simpleObjects;
-
-    //endregion
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.layout.json
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.layout.json b/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.layout.json
deleted file mode 100644
index 34f78e0..0000000
--- a/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.layout.json
+++ /dev/null
@@ -1,43 +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.
- */
-{
-    "columns": [
-        {
-            "span": 0,
-            "memberGroups": {}
-        },
-        {
-            "span": 0,
-            "memberGroups": {}
-        },
-        {
-            "span": 0,
-            "memberGroups": {}
-        },
-        {
-            "span": 12,
-            "collections": {
-                "objects": {
-                    "collectionLayout": {
-                        "render": "EAGERLY"
-                    }
-                }
-            }
-        }
-    ],
-    "actions": {}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.png
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.png b/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.png
deleted file mode 100644
index cb03785..0000000
Binary files a/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/example/application/simpleapp/integtests/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/integtests/pom.xml b/example/application/simpleapp/integtests/pom.xml
index dade0b3..3daa0ff 100644
--- a/example/application/simpleapp/integtests/pom.xml
+++ b/example/application/simpleapp/integtests/pom.xml
@@ -85,7 +85,7 @@
 
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>simpleapp-home</artifactId>
+            <artifactId>simpleapp-app</artifactId>
         </dependency>
 
         <dependency>

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/example/application/simpleapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/pom.xml b/example/application/simpleapp/pom.xml
index d62bd19..16cead4 100644
--- a/example/application/simpleapp/pom.xml
+++ b/example/application/simpleapp/pom.xml
@@ -332,9 +332,9 @@
     </build>
 
     <modules>
+        <module>app</module>
         <module>dom</module>
         <module>fixture</module>
-        <module>home</module>
         <module>integtests</module>
         <module>webapp</module>
     </modules>
@@ -368,17 +368,17 @@
             <!-- this project's own modules -->
             <dependency>
                 <groupId>${project.groupId}</groupId>
-                <artifactId>simpleapp-dom</artifactId>
+                <artifactId>simpleapp-app</artifactId>
                 <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
-                <artifactId>simpleapp-fixture</artifactId>
+                <artifactId>simpleapp-dom</artifactId>
                 <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
-                <artifactId>simpleapp-home</artifactId>
+                <artifactId>simpleapp-fixture</artifactId>
                 <version>${project.version}</version>
             </dependency>
             <dependency>

http://git-wip-us.apache.org/repos/asf/isis/blob/a997de0a/example/application/simpleapp/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/webapp/pom.xml b/example/application/simpleapp/webapp/pom.xml
index dcf16c9..4826684 100644
--- a/example/application/simpleapp/webapp/pom.xml
+++ b/example/application/simpleapp/webapp/pom.xml
@@ -145,7 +145,7 @@
     
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>simpleapp-home</artifactId>
+            <artifactId>simpleapp-app</artifactId>
         </dependency>
         
         <!-- other isis components -->


[08/17] isis git commit: ISIS-848: simplified design of IsisComponentProiderDefault; pass GlobSpec through to IsisSystemForTest.

Posted by da...@apache.org.
ISIS-848: simplified design of IsisComponentProiderDefault; pass GlobSpec through to IsisSystemForTest.

Added TODOs in the two IsisComponentProvider impls for optional support of GlobSpec.


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

Branch: refs/heads/master
Commit: d5f4482f84929349afb8d034a307ebf0c0d3b3b3
Parents: 6ccf96c
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Thu Aug 6 10:31:45 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Thu Aug 6 10:31:45 2015 +0100

----------------------------------------------------------------------
 .../IsisComponentProviderDefault.java           | 198 ++++++++++---------
 .../integtestsupport/IsisSystemForTest.java     | 113 ++++++-----
 .../IsisComponentProviderUsingInstallers.java   |  47 ++---
 .../fixture/dom/simple/SimpleObjectCreate.java  |  71 +++++++
 .../dom/simple/SimpleObjectsTearDown.java       |  36 ++++
 .../modules/simple/SimpleObjectCreate.java      |  71 -------
 .../modules/simple/SimpleObjectsTearDown.java   |  36 ----
 .../scenarios/RecreateSimpleObjects.java        |   4 +-
 .../bootstrap/SimpleAppSystemInitializer.java   |   2 +-
 .../modules/simple/SimpleObjectsIntegTest.java  |   2 +-
 10 files changed, 298 insertions(+), 282 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/d5f4482f/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
index a6e677c..2df42a0 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
@@ -26,6 +26,7 @@ import java.util.Set;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 
+import org.apache.isis.applib.GlobSpec;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.config.IsisConfigurationDefault;
 import org.apache.isis.core.commons.resource.ResourceStreamSourceContextLoaderClassPath;
@@ -60,146 +61,157 @@ import org.apache.isis.progmodels.dflt.ProgrammingModelFacetsJava5;
 public class IsisComponentProviderDefault implements IsisComponentProvider {
 
     private final DeploymentType deploymentType;
+    private final GlobSpec globSpecIfAny;
 
     private final IsisConfiguration configuration;
-    private final List<Object> servicesIfAny;
-    private final ProgrammingModel programmingModelOverride;
-    private final MetaModelValidator metaModelValidatorOverride;
+    private final List<Object> services;
+    private final ProgrammingModel programmingModel;
+    private final MetaModelValidator metaModelValidator;
+    private final FixturesInstaller fixturesInstaller;
+    private final AuthenticationManager authenticationManager;
+    private final AuthorizationManager authorizationManager;
 
     public IsisComponentProviderDefault(
             final DeploymentType deploymentType,
-            final List<Object> services,
-            final IsisConfiguration configuration,
+            final GlobSpec globSpecIfAny,
+            final List<Object> servicesOverride,
+            final IsisConfiguration configurationOverride,
             final ProgrammingModel programmingModelOverride,
             final MetaModelValidator metaModelValidatorOverride) {
+
         this.deploymentType = deploymentType;
-        this.configuration = configuration;
-        this.servicesIfAny = services;
-        this.programmingModelOverride = programmingModelOverride;
-        this.metaModelValidatorOverride = metaModelValidatorOverride;
-    }
+        this.globSpecIfAny = globSpecIfAny;
 
-    static IsisConfiguration defaultConfiguration() {
-        return new IsisConfigurationDefault(ResourceStreamSourceContextLoaderClassPath.create("config"));
-    }
+        // TODO: alter behaviour accordingly if a globSpec has been provided.
 
+        this.configuration = elseDefault(configurationOverride);
+        this.services = elseDefault(servicesOverride, deploymentType, configuration);
+        this.programmingModel = elseDefault(programmingModelOverride, configuration);
+        this.metaModelValidator = elseDefault(metaModelValidatorOverride);
 
-    @Override
-    public DeploymentType getDeploymentType() {
-        return deploymentType;
-    }
+        this.fixturesInstaller = createFixturesInstaller(configuration);
+        this.authenticationManager = createAuthenticationManager(configuration);
+        this.authorizationManager = createAuthorizationManager(configuration);
 
+    }
 
     /**
-     * Reads <tt>isis.properties</tt> (and other optional property files) from the &quot;config&quot; package on the current classpath.
+     * Default will read <tt>isis.properties</tt> (and other optional property files) from the &quot;config&quot;
+     * package on the current classpath.
      */
-    @Override
-    public IsisConfiguration getConfiguration() {
-        return configuration;
+    private static IsisConfiguration elseDefault(final IsisConfiguration configuration) {
+        return configuration != null
+                ? configuration
+                : new IsisConfigurationDefault(ResourceStreamSourceContextLoaderClassPath.create("config"));
     }
 
+    private static List<Object> elseDefault(final List<Object> servicesOverride, DeploymentType deploymentType, final IsisConfiguration configuration) {
+        return servicesOverride != null
+                ? servicesOverride
+                : createDefaultServices(deploymentType, configuration);
+    }
 
-    /**
-     * Either the services explicitly provided by a constructor, otherwise reads from the configuration.
-     */
-    @Override
-    public List<Object> obtainServices() {
-        if(servicesIfAny != null) {
-            return servicesIfAny;
-        }
-        // else
+    private static List<Object> createDefaultServices(
+            final DeploymentType deploymentType,
+            final IsisConfiguration configuration) {
         final ServicesInstallerFromConfiguration servicesInstaller = new ServicesInstallerFromConfiguration();
-        return servicesInstaller.getServices(getDeploymentType());
+        servicesInstaller.setConfiguration(configuration);
+        return servicesInstaller.getServices(deploymentType);
     }
 
-    /**
-     * Install fixtures from configuration.
-     */
-    @Override
-    public FixturesInstaller obtainFixturesInstaller() throws IsisSystemException {
-        final FixturesInstallerFromConfiguration fixturesInstallerFromConfiguration = new FixturesInstallerFromConfiguration();
-        fixturesInstallerFromConfiguration.setConfiguration(getConfiguration());
-        return fixturesInstallerFromConfiguration;
-    }
 
+    private static ProgrammingModel elseDefault(final ProgrammingModel programmingModel, final IsisConfiguration configuration) {
+        return programmingModel != null
+                ? programmingModel
+                : createDefaultProgrammingModel(configuration);
+    }
 
-    /**
-     * <p>
-     * Each of the subcomponents can be overridden if required.
-     *
-     * @see #obtainReflectorFacetDecoratorSet()
-     * @see #obtainReflectorMetaModelValidator()
-     * @see #obtainReflectorProgrammingModel()
-     */
-    @Override
-    public SpecificationLoaderSpi provideSpecificationLoaderSpi(
-            DeploymentType deploymentType,
-            Collection<MetaModelRefiner> metaModelRefiners) throws IsisSystemException {
+    // TODO: this is duplicating logic in JavaReflectorInstallerNoDecorators; need to unify.
+    private static ProgrammingModel createDefaultProgrammingModel(final IsisConfiguration configuration) {
+        final ProgrammingModelFacetsJava5 programmingModel = new ProgrammingModelFacetsJava5();
 
+        ProgrammingModel.Util.includeFacetFactories(configuration, programmingModel);
+        ProgrammingModel.Util.excludeFacetFactories(configuration, programmingModel);
+        return programmingModel;
+    }
 
-        final ProgrammingModel programmingModel = obtainReflectorProgrammingModel();
-        final Set<FacetDecorator> facetDecorators = obtainReflectorFacetDecoratorSet();
-        final MetaModelValidator mmv = obtainReflectorMetaModelValidator();
-        final List<LayoutMetadataReader> layoutMetadataReaders = obtainLayoutMetadataReaders();
-        return JavaReflectorHelper
-                .createObjectReflector(programmingModel, metaModelRefiners, facetDecorators, layoutMetadataReaders, mmv,
-                        getConfiguration());
+    private static MetaModelValidator elseDefault(final MetaModelValidator metaModelValidator) {
+        return metaModelValidator != null
+                ? metaModelValidator
+                : new MetaModelValidatorDefault();
     }
 
+    private static FixturesInstaller createFixturesInstaller(final IsisConfiguration configuration) {
+        final FixturesInstallerFromConfiguration fixturesInstallerFromConfiguration = new FixturesInstallerFromConfiguration();
+        fixturesInstallerFromConfiguration.setConfiguration(configuration);
+        return fixturesInstallerFromConfiguration;
+    }
 
-    private ProgrammingModel obtainReflectorProgrammingModel() {
+    /**
+     * The standard authentication manager, configured with the default authenticator (allows all requests through).
+     */
+    private static AuthenticationManager createAuthenticationManager(final IsisConfiguration configuration) {
+        final AuthenticationManagerStandard authenticationManager = new AuthenticationManagerStandard(configuration);
+        Authenticator authenticator = new AuthenticatorBypass(configuration);
+        authenticationManager.addAuthenticator(authenticator);
+        return authenticationManager;
+    }
 
-        if (programmingModelOverride != null) {
-            return programmingModelOverride;
-        }
+    /**
+     * The standard authorization manager, allowing all access.
+     */
+    private static AuthorizationManager createAuthorizationManager(final IsisConfiguration configuration) {
+        return new AuthorizationManagerStandard(configuration);
+    }
 
-        final ProgrammingModelFacetsJava5 programmingModel = new ProgrammingModelFacetsJava5();
 
-        // TODO: this is duplicating logic in JavaReflectorInstallerNoDecorators; need to unify.
+    @Override
+    public DeploymentType getDeploymentType() {
+        return deploymentType;
+    }
 
-        ProgrammingModel.Util.includeFacetFactories(getConfiguration(), programmingModel);
-        ProgrammingModel.Util.excludeFacetFactories(getConfiguration(), programmingModel);
-        return programmingModel;
+    @Override
+    public IsisConfiguration getConfiguration() {
+        return configuration;
     }
 
-    /**
-     * Optional hook method.
-     */
-    private Set<FacetDecorator> obtainReflectorFacetDecoratorSet() {
-        return Sets.newHashSet((FacetDecorator) new StandardTransactionFacetDecorator(getConfiguration()));
+    @Override
+    public List<Object> obtainServices() {
+        return services;
     }
 
-    /**
-     * Optional hook method.
-     */
-    protected MetaModelValidator obtainReflectorMetaModelValidator() {
-        if(metaModelValidatorOverride != null) {
-            return metaModelValidatorOverride;
-        }
-        return new MetaModelValidatorDefault();
+    @Override
+    public FixturesInstaller obtainFixturesInstaller() throws IsisSystemException {
+        return fixturesInstaller;
     }
 
-    protected List<LayoutMetadataReader> obtainLayoutMetadataReaders() {
-        return Lists.<LayoutMetadataReader>newArrayList(new LayoutMetadataReaderFromJson());
+    @Override
+    public SpecificationLoaderSpi provideSpecificationLoaderSpi(
+            DeploymentType deploymentType, // unused
+            Collection<MetaModelRefiner> metaModelRefiners) throws IsisSystemException {
+
+        final Set<FacetDecorator> facetDecorators = Sets
+                .newHashSet((FacetDecorator) new StandardTransactionFacetDecorator(getConfiguration()));
+        final List<LayoutMetadataReader> layoutMetadataReaders =
+                Lists.<LayoutMetadataReader>newArrayList(new LayoutMetadataReaderFromJson());
+
+        return JavaReflectorHelper
+                .createObjectReflector(
+                        programmingModel,
+                        metaModelRefiners,
+                        facetDecorators, layoutMetadataReaders,
+                        metaModelValidator,
+                        getConfiguration());
     }
 
-    /**
-     * The standard authentication manager, configured with the default authenticator (allows all requests through).
-     */
     @Override
     public AuthenticationManager provideAuthenticationManager(DeploymentType deploymentType) throws IsisSystemException {
-        final AuthenticationManagerStandard authenticationManager = new AuthenticationManagerStandard(getConfiguration());
-        Authenticator authenticator = new AuthenticatorBypass(configuration);
-        authenticationManager.addAuthenticator(authenticator);
         return authenticationManager;
     }
 
-    /**
-     * The standard authorization manager, allowing all access.
-     */
     @Override
     public AuthorizationManager provideAuthorizationManager(DeploymentType deploymentType) {
-        return new AuthorizationManagerStandard(getConfiguration());
+        return authorizationManager;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/isis/blob/d5f4482f/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
index 5743b4f..949df0d 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
@@ -32,6 +32,7 @@ import org.junit.runner.Description;
 import org.junit.runners.model.Statement;
 
 import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.GlobSpec;
 import org.apache.isis.applib.fixtures.FixtureClock;
 import org.apache.isis.applib.fixtures.InstallableFixture;
 import org.apache.isis.applib.services.command.Command;
@@ -64,7 +65,6 @@ import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;
 import org.apache.isis.core.runtime.systemusinginstallers.IsisComponentProvider;
 import org.apache.isis.core.security.authentication.AuthenticationRequestNameOnly;
 import org.apache.isis.core.specsupport.scenarios.DomainServiceProvider;
-import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
 
 /**
  * Wraps a plain {@link IsisSystem}, and provides a number of features to assist with testing.
@@ -151,17 +151,17 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
     private IsisSystem isisSystem;
     private AuthenticationSession authenticationSession;
 
-    private final IsisConfiguration configuration;
-    private final PersistenceMechanismInstaller persistenceMechanismInstaller;
+    private final GlobSpec globSpecIfAny;
+    private final IsisConfiguration configurationOverride;
     private final AuthenticationRequest authenticationRequest;
-    private final List<Object> services;
+    private final List<Object> servicesIfAny;
     private final List<InstallableFixture> fixtures;
     private List <Listener> listeners;
     
     private org.apache.log4j.Level level = org.apache.log4j.Level.INFO;
     
-    private final MetaModelValidator metaModelValidator;
-    private final ProgrammingModel programmingModel;
+    private final MetaModelValidator metaModelValidatorOverride;
+    private final ProgrammingModel programmingModelOverride;
     
     private DomainObjectContainer container;
 
@@ -175,9 +175,10 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
         private AuthenticationRequest authenticationRequest = new AuthenticationRequestNameOnly("tester");
         
         private IsisConfigurationDefault configuration;
-        private PersistenceMechanismInstaller persistenceMechanismInstaller = new DataNucleusPersistenceMechanismInstaller();
-        private MetaModelValidator metaModelValidator;
-        private ProgrammingModel programmingModel;
+        private GlobSpec globSpecIfAny;
+
+        private MetaModelValidator metaModelValidatorOverride;
+        private ProgrammingModel programmingModelOverride;
 
         private final List<Object> services = Lists.newArrayList();
         private final List<InstallableFixture> fixtures = Lists.newArrayList();
@@ -190,18 +191,39 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
             this.configuration = (IsisConfigurationDefault) configuration;
             return this;
         }
-        
+
+        /**
+         * @deprecated - this is now a no-op because there is now only a single implementation of {@link PersistenceMechanismInstaller}, so this is redundant.
+         */
+        @Deprecated
         public Builder with(PersistenceMechanismInstaller persistenceMechanismInstaller) {
-            this.persistenceMechanismInstaller = persistenceMechanismInstaller;
             return this;
         }
-        
+
+        public Builder with(MetaModelValidator metaModelValidator) {
+            this.metaModelValidatorOverride = metaModelValidator;
+            return this;
+        }
+
+        public Builder with(ProgrammingModel programmingModel) {
+            this.programmingModelOverride = programmingModel;
+            return this;
+        }
+
         public Builder with(AuthenticationRequest authenticationRequest) {
             this.authenticationRequest = authenticationRequest;
             return this;
         }
 
+        public Builder with(GlobSpec globSpec) {
+            this.globSpecIfAny = globSpec;
+            return this;
+        }
+
         public Builder withServicesIn(String... packagePrefixes ) {
+            if(globSpecIfAny != null) {
+                throw new IllegalStateException("A globSpec has already been provided");
+            }
             if(packagePrefixes.length == 0) {
                 throw new IllegalArgumentException("Specify packagePrefixes to search for @DomainService-annotated services");
             }
@@ -221,6 +243,9 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
         }
 
         public Builder withServices(Object... services) {
+            if(globSpecIfAny != null) {
+                throw new IllegalStateException("A globSpec has already been provided");
+            }
             this.services.addAll(Arrays.asList(services));
             return this;
         }
@@ -242,10 +267,10 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
         public IsisSystemForTest build() {
             final IsisSystemForTest isisSystem =
                     new IsisSystemForTest(
+                            globSpecIfAny,
                             configuration,
-                            programmingModel,
-                            metaModelValidator,
-                            persistenceMechanismInstaller,
+                            programmingModelOverride,
+                            metaModelValidatorOverride,
                             authenticationRequest,
                             services,
                             fixtures,
@@ -291,15 +316,6 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
             return this;
         }
 
-        public Builder with(MetaModelValidator metaModelValidator) {
-            this.metaModelValidator = metaModelValidator;
-            return this;
-        }
-
-        public Builder with(ProgrammingModel programmingModel) {
-            this.programmingModel = programmingModel;
-            return this;
-        }
     }
 
     public static Builder builder() {
@@ -307,20 +323,20 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
     }
 
     private IsisSystemForTest(
-            final IsisConfiguration configuration, 
-            final ProgrammingModel programmingModel, 
-            final MetaModelValidator metaModelValidator, 
-            final PersistenceMechanismInstaller persistenceMechanismInstaller, 
-            final AuthenticationRequest authenticationRequest, 
-            final List<Object> services, 
-            final List<InstallableFixture> fixtures, 
+            final GlobSpec globSpecIfAny,
+            final IsisConfiguration configurationOverride,
+            final ProgrammingModel programmingModelOverride,
+            final MetaModelValidator metaModelValidatorOverride,
+            final AuthenticationRequest authenticationRequest,
+            final List<Object> servicesIfAny,
+            final List<InstallableFixture> fixtures,
             final List<Listener> listeners) {
-        this.configuration = configuration;
-        this.programmingModel = programmingModel;
-        this.metaModelValidator = metaModelValidator;
-        this.persistenceMechanismInstaller = persistenceMechanismInstaller;
+        this.globSpecIfAny = globSpecIfAny;
+        this.configurationOverride = configurationOverride;
+        this.programmingModelOverride = programmingModelOverride;
+        this.metaModelValidatorOverride = metaModelValidatorOverride;
         this.authenticationRequest = authenticationRequest;
-        this.services = services;
+        this.servicesIfAny = servicesIfAny;
         this.fixtures = fixtures;
         this.listeners = listeners;
     }
@@ -369,10 +385,13 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
             isisLoggingConfigurer.configureLogging(".", new String[]{});
 
             IsisComponentProvider componentProvider = new IsisComponentProviderDefault(
-                    DeploymentType.UNIT_TESTING, services,
-                    getConfigurationElseDefault(),
-                    this.programmingModel,
-                    this.metaModelValidator);
+                    DeploymentType.UNIT_TESTING,
+                    globSpecIfAny,
+                    servicesIfAny,
+                    this.configurationOverride,
+                    this.programmingModelOverride,
+                    this.metaModelValidatorOverride
+            );
 
             isisSystem = new IsisSystem(componentProvider);
 
@@ -396,6 +415,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
         }
     }
 
+
     private void wireAndInstallFixtures() {
         FixturesInstallerDelegate fid = new FixturesInstallerDelegate(getPersistenceSession());
         fid.addFixture(fixtures);
@@ -411,7 +431,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
     }
 
     public DomainObjectContainer getContainer() {
-        for (Object service : services) {
+        for (Object service : servicesIfAny) {
             if(service instanceof DomainObjectContainer) {
                 return (DomainObjectContainer) service;
             }
@@ -460,12 +480,6 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
         IsisContext.closeSession();
     }
 
-    private IsisConfiguration getConfigurationElseDefault() {
-        return configuration != null
-                ? configuration
-                : IsisComponentProviderDefault.defaultConfiguration();
-    }
-
     ////////////////////////////////////////////////////////////
     // listeners
     ////////////////////////////////////////////////////////////
@@ -473,7 +487,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
     private void fireInitAndPreSetupSystem(boolean firstTime) throws Exception {
         if(firstTime) {
             for(Listener listener: listeners) {
-                listener.init(configuration);
+                listener.init(configurationOverride);
             }
         }
         for(Listener listener: listeners) {
@@ -518,9 +532,6 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
 
     /**
      * The {@link IsisSystem} created during {@link #setUpSystem()}.
-     *
-     * <p>
-     * Can fine-tune the actual implementation using the hook {@link #createIsisSystem(List)}.
      */
     public IsisSystem getIsisSystem() {
         return isisSystem;

http://git-wip-us.apache.org/repos/asf/isis/blob/d5f4482f/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 0b61357..c8ff7ac 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
@@ -51,7 +51,6 @@ import static org.hamcrest.CoreMatchers.nullValue;
 public class IsisComponentProviderUsingInstallers implements IsisComponentProvider {
 
     private final DeploymentType deploymentType;
-    private final InstallerLookup installerLookup;
 
     private AuthenticationManagerInstaller authenticationInstaller;
     private AuthorizationManagerInstaller authorizationInstaller;
@@ -60,34 +59,37 @@ public class IsisComponentProviderUsingInstallers implements IsisComponentProvid
     private PersistenceMechanismInstaller persistenceMechanismInstaller;
     private FixturesInstaller fixtureInstaller;
 
+    private final IsisConfiguration configuration;
+
     public IsisComponentProviderUsingInstallers(
             final DeploymentType deploymentType,
             final InstallerLookup installerLookup) {
+
         this.deploymentType = deploymentType;
         ensureThatArg(installerLookup, is(not(nullValue())));
-        this.installerLookup = installerLookup;
 
-        lookupAndSetInstallers(deploymentType);
-    }
-
-    private void lookupAndSetInstallers(final DeploymentType deploymentType) {
+        // TODO: we check for isis.globSpec, and alter the bootstrapping accordingly...
 
+        // loading installers causes the configuration to be appended to successively
         this.authenticationInstaller = installerLookup.authenticationManagerInstaller(
-                getConfiguration().getString(SystemConstants.AUTHENTICATION_INSTALLER_KEY),
+                installerLookup.getConfiguration().getString(SystemConstants.AUTHENTICATION_INSTALLER_KEY),
                 deploymentType);
 
         this.authorizationInstaller = installerLookup.authorizationManagerInstaller(
-                getConfiguration().getString(SystemConstants.AUTHORIZATION_INSTALLER_KEY), deploymentType);
+                installerLookup.getConfiguration().getString(SystemConstants.AUTHORIZATION_INSTALLER_KEY), deploymentType);
 
         this.fixtureInstaller = installerLookup.fixturesInstaller(
-                getConfiguration().getString(SystemConstants.FIXTURES_INSTALLER_KEY));
+                installerLookup.getConfiguration().getString(SystemConstants.FIXTURES_INSTALLER_KEY));
 
+        // although there is only one implementation of PersistenceMechanismInstaller, we still do the lookup
+        // because this will add the persistor_datanucleus.properties and persistor.properties to the set of
+        // config files from which we read configuration properties.
         persistenceMechanismInstaller = installerLookup.persistenceMechanismInstaller(
-                getConfiguration().getString(SystemConstants.OBJECT_PERSISTOR_INSTALLER_KEY),
+                installerLookup.getConfiguration().getString(SystemConstants.OBJECT_PERSISTOR_INSTALLER_KEY),
                 deploymentType);
 
         reflectorInstaller = installerLookup.reflectorInstaller(
-                getConfiguration().getString(SystemConstants.REFLECTOR_KEY));
+                installerLookup.getConfiguration().getString(SystemConstants.REFLECTOR_KEY));
 
         servicesInstaller = installerLookup.servicesInstaller(null);
 
@@ -104,31 +106,21 @@ public class IsisComponentProviderUsingInstallers implements IsisComponentProvid
 
         // add in transaction support
         reflectorInstaller.addFacetDecoratorInstaller(transactionFacetDecoratorInstaller);
-    }
 
-    //region > API
+        // capture the final configuration once all components have been loaded
+        configuration = installerLookup.getConfiguration();
+    }
 
+    @Override
     public DeploymentType getDeploymentType() {
         return deploymentType;
     }
 
-    /**
-     * Returns a <i>snapshot</i> of the {@link IsisConfiguration configuration}.
-     *
-     * <p>
-     *     ... as held by the internal {@link InstallerLookup}.
-     * </p>
-     *
-     * @see InstallerLookup#getConfiguration()
-     */
     @Override
     public IsisConfiguration getConfiguration() {
-        return installerLookup.getConfiguration();
+        return configuration;
     }
 
-    //endregion
-
-
     @Override
     public AuthenticationManager provideAuthenticationManager(final DeploymentType deploymentType) {
         return authenticationInstaller.createAuthenticationManager();
@@ -159,7 +151,8 @@ public class IsisComponentProviderUsingInstallers implements IsisComponentProvid
     @Override
     public PersistenceSessionFactory providePersistenceSessionFactory(
             final DeploymentType deploymentType,
-            final ServicesInjectorSpi servicesInjectorSpi, final RuntimeContextFromSession runtimeContext) throws IsisSystemException {
+            final ServicesInjectorSpi servicesInjectorSpi,
+            final RuntimeContextFromSession runtimeContext) throws IsisSystemException {
         return persistenceMechanismInstaller.createPersistenceSessionFactory(deploymentType, servicesInjectorSpi, getConfiguration(),
                 runtimeContext);
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/d5f4482f/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/dom/simple/SimpleObjectCreate.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/dom/simple/SimpleObjectCreate.java b/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/dom/simple/SimpleObjectCreate.java
new file mode 100644
index 0000000..8823dd9
--- /dev/null
+++ b/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/dom/simple/SimpleObjectCreate.java
@@ -0,0 +1,71 @@
+/*
+ *  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.fixture.dom.simple;
+
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+import domainapp.dom.simple.SimpleObject;
+import domainapp.dom.simple.SimpleObjects;
+
+public class SimpleObjectCreate extends FixtureScript {
+
+    //region > name (input)
+    private String name;
+    /**
+     * Name of the object (required)
+     */
+    public String getName() {
+        return name;
+    }
+
+    public SimpleObjectCreate setName(final String name) {
+        this.name = name;
+        return this;
+    }
+    //endregion
+
+
+    //region > simpleObject (output)
+    private SimpleObject simpleObject;
+
+    /**
+     * The created simple object (output).
+     * @return
+     */
+    public SimpleObject getSimpleObject() {
+        return simpleObject;
+    }
+    //endregion
+
+    @Override
+    protected void execute(final ExecutionContext ec) {
+
+        String name = checkParam("name", ec, String.class);
+
+        this.simpleObject = wrap(simpleObjects).create(name);
+
+        // also make available to UI
+        ec.addResult(this, simpleObject);
+    }
+
+    @javax.inject.Inject
+    private SimpleObjects simpleObjects;
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/d5f4482f/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/dom/simple/SimpleObjectsTearDown.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/dom/simple/SimpleObjectsTearDown.java b/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/dom/simple/SimpleObjectsTearDown.java
new file mode 100644
index 0000000..dd74086
--- /dev/null
+++ b/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/dom/simple/SimpleObjectsTearDown.java
@@ -0,0 +1,36 @@
+/*
+ *  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.fixture.dom.simple;
+
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+import org.apache.isis.applib.services.jdosupport.IsisJdoSupport;
+
+public class SimpleObjectsTearDown extends FixtureScript {
+
+    @Override
+    protected void execute(ExecutionContext executionContext) {
+        isisJdoSupport.executeUpdate("delete from \"simple\".\"SimpleObject\"");
+    }
+
+
+    @javax.inject.Inject
+    private IsisJdoSupport isisJdoSupport;
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/d5f4482f/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectCreate.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectCreate.java b/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectCreate.java
deleted file mode 100644
index b23f2be..0000000
--- a/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectCreate.java
+++ /dev/null
@@ -1,71 +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 domainapp.fixture.modules.simple;
-
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-
-import domainapp.dom.simple.SimpleObject;
-import domainapp.dom.simple.SimpleObjects;
-
-public class SimpleObjectCreate extends FixtureScript {
-
-    //region > name (input)
-    private String name;
-    /**
-     * Name of the object (required)
-     */
-    public String getName() {
-        return name;
-    }
-
-    public SimpleObjectCreate setName(final String name) {
-        this.name = name;
-        return this;
-    }
-    //endregion
-
-
-    //region > simpleObject (output)
-    private SimpleObject simpleObject;
-
-    /**
-     * The created simple object (output).
-     * @return
-     */
-    public SimpleObject getSimpleObject() {
-        return simpleObject;
-    }
-    //endregion
-
-    @Override
-    protected void execute(final ExecutionContext ec) {
-
-        String name = checkParam("name", ec, String.class);
-
-        this.simpleObject = wrap(simpleObjects).create(name);
-
-        // also make available to UI
-        ec.addResult(this, simpleObject);
-    }
-
-    @javax.inject.Inject
-    private SimpleObjects simpleObjects;
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/d5f4482f/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectsTearDown.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectsTearDown.java b/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectsTearDown.java
deleted file mode 100644
index cc06eb4..0000000
--- a/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectsTearDown.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 domainapp.fixture.modules.simple;
-
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-import org.apache.isis.applib.services.jdosupport.IsisJdoSupport;
-
-public class SimpleObjectsTearDown extends FixtureScript {
-
-    @Override
-    protected void execute(ExecutionContext executionContext) {
-        isisJdoSupport.executeUpdate("delete from \"simple\".\"SimpleObject\"");
-    }
-
-
-    @javax.inject.Inject
-    private IsisJdoSupport isisJdoSupport;
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/d5f4482f/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java b/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java
index 6b8943b..55b9045 100644
--- a/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java
+++ b/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java
@@ -28,8 +28,8 @@ import com.google.common.collect.Lists;
 import org.apache.isis.applib.fixturescripts.FixtureScript;
 
 import domainapp.dom.simple.SimpleObject;
-import domainapp.fixture.modules.simple.SimpleObjectCreate;
-import domainapp.fixture.modules.simple.SimpleObjectsTearDown;
+import domainapp.fixture.dom.simple.SimpleObjectCreate;
+import domainapp.fixture.dom.simple.SimpleObjectsTearDown;
 
 public class RecreateSimpleObjects extends FixtureScript {
 

http://git-wip-us.apache.org/repos/asf/isis/blob/d5f4482f/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java b/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java
index 28e9d37..91244ec 100644
--- a/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java
+++ b/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java
@@ -47,7 +47,7 @@ public class SimpleAppSystemInitializer {
         private static IsisConfiguration testConfiguration() {
             final IsisConfigurationForJdoIntegTests testConfiguration = new IsisConfigurationForJdoIntegTests();
 
-            testConfiguration.addRegisterEntitiesPackagePrefix("domainapp.dom.modules");
+            testConfiguration.addRegisterEntitiesPackagePrefix("domainapp.dom");
             return testConfiguration;
         }
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/d5f4482f/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java b/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java
index db6e3c1..2ada1fe 100644
--- a/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java
+++ b/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java
@@ -35,7 +35,7 @@ import org.apache.isis.applib.fixturescripts.FixtureScripts;
 
 import domainapp.dom.simple.SimpleObject;
 import domainapp.dom.simple.SimpleObjects;
-import domainapp.fixture.modules.simple.SimpleObjectsTearDown;
+import domainapp.fixture.dom.simple.SimpleObjectsTearDown;
 import domainapp.fixture.scenarios.RecreateSimpleObjects;
 import domainapp.integtests.tests.SimpleAppIntegTest;
 import static org.assertj.core.api.Assertions.assertThat;


[03/17] isis git commit: ISIS-1188: collapsed IsisSystem and IsisSystemDefault (removed IsisSystemAbstract); ditto for IsisSession and IsisSessionFactory.

Posted by da...@apache.org.
ISIS-1188: collapsed IsisSystem and IsisSystemDefault (removed IsisSystemAbstract); ditto for IsisSession and IsisSessionFactory.


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

Branch: refs/heads/master
Commit: fd9a217c7a2e86a8a594af39c59c53abb87a03ab
Parents: 8605117
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Aug 5 17:56:58 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Aug 5 17:56:58 2015 +0100

----------------------------------------------------------------------
 .../integtestsupport/IsisSystemForTest.java     |  24 +-
 .../isis/core/runtime/system/IsisSystem.java    | 358 ++++++++++++++++-
 .../runtime/system/session/IsisSession.java     | 250 ++++++++++--
 .../system/session/IsisSessionDefault.java      | 320 ---------------
 .../system/session/IsisSessionFactory.java      | 154 +++++++-
 .../session/IsisSessionFactoryDefault.java      | 197 ----------
 .../IsisSystemAbstract.java                     |  30 --
 .../IsisSystemThatUsesInstallersFactory.java    |  26 +-
 .../IsisSystemUsingComponentProvider.java       | 392 -------------------
 .../core/runtime/context/IsisContextTest.java   |   3 +-
 ...onFactoryAbstractTest_init_and_shutdown.java |   2 +-
 11 files changed, 728 insertions(+), 1028 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/fd9a217c/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
index 345305e..5743b4f 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
@@ -61,7 +61,7 @@ import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
 import org.apache.isis.core.runtime.system.transaction.IsisTransaction;
 import org.apache.isis.core.runtime.system.transaction.IsisTransaction.State;
 import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;
-import org.apache.isis.core.runtime.systemusinginstallers.IsisSystemUsingComponentProvider;
+import org.apache.isis.core.runtime.systemusinginstallers.IsisComponentProvider;
 import org.apache.isis.core.security.authentication.AuthenticationRequestNameOnly;
 import org.apache.isis.core.specsupport.scenarios.DomainServiceProvider;
 import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
@@ -368,7 +368,13 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
             IsisLoggingConfigurer isisLoggingConfigurer = new IsisLoggingConfigurer(getLevel());
             isisLoggingConfigurer.configureLogging(".", new String[]{});
 
-            isisSystem = createIsisSystem(services);
+            IsisComponentProvider componentProvider = new IsisComponentProviderDefault(
+                    DeploymentType.UNIT_TESTING, services,
+                    getConfigurationElseDefault(),
+                    this.programmingModel,
+                    this.metaModelValidator);
+
+            isisSystem = new IsisSystem(componentProvider);
 
             // ensures that a FixtureClock is installed as the singleton underpinning the ClockService
             FixtureClock.initialize();
@@ -460,20 +466,6 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
                 : IsisComponentProviderDefault.defaultConfiguration();
     }
 
-
-    private IsisSystem createIsisSystem(List<Object> services) {
-
-        IsisComponentProviderDefault componentProvider = new IsisComponentProviderDefault(
-                DeploymentType.UNIT_TESTING, services,
-                getConfigurationElseDefault(),
-                this.programmingModel,
-                this.metaModelValidator);
-
-        return new IsisSystemUsingComponentProvider(
-                componentProvider);
-    }
-
-
     ////////////////////////////////////////////////////////////
     // listeners
     ////////////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/isis/blob/fd9a217c/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 2904006..f6c25ea 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
@@ -19,27 +19,375 @@
 
 package org.apache.isis.core.runtime.system;
 
+import java.io.File;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.isis.applib.DomainObjectContainer;
 import org.apache.isis.applib.fixtures.LogonFixture;
+import org.apache.isis.applib.fixturescripts.FixtureScripts;
+import org.apache.isis.applib.services.fixturespec.FixtureScriptsDefault;
 import org.apache.isis.core.commons.components.ApplicationScopedComponent;
+import org.apache.isis.core.commons.components.Noop;
 import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.commons.debug.DebuggableWithTitle;
+import org.apache.isis.core.commons.lang.ListExtensions;
+import org.apache.isis.core.metamodel.adapter.oid.OidMarshaller;
+import org.apache.isis.core.metamodel.facetapi.MetaModelRefiner;
+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.ServiceInitializer;
+import org.apache.isis.core.runtime.authentication.AuthenticationManager;
+import org.apache.isis.core.runtime.authentication.exploration.ExplorationSession;
+import org.apache.isis.core.runtime.authorization.AuthorizationManager;
+import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
+import org.apache.isis.core.runtime.persistence.internal.RuntimeContextFromSession;
+import org.apache.isis.core.runtime.system.context.IsisContext;
+import org.apache.isis.core.runtime.system.internal.InitialisationSession;
+import org.apache.isis.core.runtime.system.internal.IsisLocaleInitializer;
+import org.apache.isis.core.runtime.system.internal.IsisTimeZoneInitializer;
+import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
+import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
 import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
+import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;
+import org.apache.isis.core.runtime.system.transaction.IsisTransactionManagerException;
+import org.apache.isis.core.runtime.systemusinginstallers.IsisComponentProvider;
+
+public class IsisSystem implements DebugSelection, ApplicationScopedComponent {
+
+    public static final Logger LOG = LoggerFactory.getLogger(IsisSystem.class);
+
+    private final IsisLocaleInitializer localeInitializer;
+    private final IsisTimeZoneInitializer timeZoneInitializer;
+    private final DeploymentType deploymentType;
+
+    private boolean initialized = false;
+
+    private ServiceInitializer serviceInitializer;
+    private FixturesInstaller fixtureInstaller;
+    private IsisSessionFactory sessionFactory;
+
+    //region > constructors
+
+    private final IsisComponentProvider isisComponentProvider;
+
+    public IsisSystem(IsisComponentProvider isisComponentProvider) {
+        this.deploymentType = isisComponentProvider.getDeploymentType();
+        this.localeInitializer = new IsisLocaleInitializer();
+        this.timeZoneInitializer = new IsisTimeZoneInitializer();
 
-public interface IsisSystem extends DebugSelection, ApplicationScopedComponent {
+        this.isisComponentProvider = isisComponentProvider;
+    }
 
-    DeploymentType getDeploymentType();
+    //endregion
 
-    LogonFixture getLogonFixture();
+    //region > deploymentType
+    public DeploymentType getDeploymentType() {
+        return deploymentType;
+    }
+    //endregion
+
+    //region > sessionFactory
 
     /**
      * Populated after {@link #init()}.
      */
-    public IsisSessionFactory getSessionFactory();
+    public IsisSessionFactory getSessionFactory() {
+        return sessionFactory;
+    }
+
+    //endregion
+
+    //region > init
+
+
+    @Override
+    public void init() {
+
+        if (initialized) {
+            throw new IllegalStateException("Already initialized");
+        } else {
+            initialized = true;
+        }
+
+        LOG.info("initialising Isis System");
+        LOG.info("working directory: " + new File(".").getAbsolutePath());
+        LOG.info("resource stream source: " + getConfiguration().getResourceStreamSource());
+
+        localeInitializer.initLocale(getConfiguration());
+        timeZoneInitializer.initTimeZone(getConfiguration());
+
+        try {
+            sessionFactory = createSessionFactory(deploymentType);
+
+            // temporarily make a configuration available
+            // REVIEW: would rather inject this, or perhaps even the
+            // ConfigurationBuilder
+            IsisContext.setConfiguration(getConfiguration());
+
+            initContext(sessionFactory);
+            sessionFactory.init();
+
+            // validate here after all entities have been registered in the persistence session factory
+            final SpecificationLoaderSpi specificationLoader = sessionFactory.getSpecificationLoader();
+            specificationLoader.validateAndAssert();
+
+            serviceInitializer = initializeServices();
+
+            installFixturesIfRequired();
+
+            translateServicesAndEnumConstants();
+
+        } catch (final IsisSystemException ex) {
+            LOG.error("failed to initialise", ex);
+            throw new RuntimeException(ex);
+        }
+    }
+
+
+    private IsisSessionFactory createSessionFactory(final DeploymentType deploymentType) throws IsisSystemException {
+
+        final List<Object> services = isisComponentProvider.obtainServices();
+        final PersistenceSessionFactory persistenceSessionFactory =
+                isisComponentProvider.providePersistenceSessionFactory(deploymentType, services);
+
+        final IsisConfiguration configuration = getConfiguration();
+        final AuthenticationManager authenticationManager = isisComponentProvider
+                .provideAuthenticationManager(deploymentType);
+        final AuthorizationManager authorizationManager = isisComponentProvider
+                .provideAuthorizationManager(deploymentType);
+        final OidMarshaller oidMarshaller = createOidMarshaller();
+
+        final Collection<MetaModelRefiner> metaModelRefiners =
+                refiners(authenticationManager, authorizationManager, persistenceSessionFactory);
+        final SpecificationLoaderSpi reflector = isisComponentProvider
+                .provideSpecificationLoaderSpi(deploymentType, metaModelRefiners);
+
+        ServicesInjectorSpi servicesInjector = persistenceSessionFactory.getServicesInjector();
+        servicesInjector.addFallbackIfRequired(FixtureScripts.class, new FixtureScriptsDefault());
+        servicesInjector.validateServices();
+
+        // bind metamodel to the (runtime) framework
+        final RuntimeContextFromSession runtimeContext = createRuntimeContextFromSession();
+        runtimeContext.injectInto(reflector);
+
+        return new IsisSessionFactory (
+                deploymentType, configuration, reflector,
+                authenticationManager, authorizationManager,
+                persistenceSessionFactory, oidMarshaller);
+    }
+
+    private static Collection<MetaModelRefiner> refiners(Object... possibleRefiners ) {
+        return ListExtensions.filtered(Arrays.asList(possibleRefiners), MetaModelRefiner.class);
+    }
+
+
+    private void initContext(final IsisSessionFactory sessionFactory) {
+        getDeploymentType().initContext(sessionFactory);
+    }
+
+    /**
+     * @see #shutdownServices(ServiceInitializer)
+     */
+    private ServiceInitializer initializeServices() {
+
+        final List<Object> services = sessionFactory.getServices();
+
+        // validate
+        final ServiceInitializer serviceInitializer = new ServiceInitializer();
+        serviceInitializer.validate(getConfiguration(), services);
+
+        // call @PostConstruct (in a session)
+        IsisContext.openSession(new InitialisationSession());
+        try {
+            getTransactionManager().startTransaction();
+            try {
+                serviceInitializer.postConstruct();
+
+                return serviceInitializer;
+            } catch(RuntimeException ex) {
+                getTransactionManager().getTransaction().setAbortCause(new IsisTransactionManagerException(ex));
+                return serviceInitializer;
+            } finally {
+                // will commit or abort
+                getTransactionManager().endTransaction();
+            }
+        } finally {
+            IsisContext.closeSession();
+        }
+    }
+
+    private void installFixturesIfRequired() throws IsisSystemException {
+
+        fixtureInstaller = isisComponentProvider.obtainFixturesInstaller();
+        if (isNoop(fixtureInstaller)) {
+            return;
+        }
+
+        IsisContext.openSession(new InitialisationSession());
+        fixtureInstaller.installFixtures();
+        try {
+
+            // only allow logon fixtures if not in production mode.
+            if (!getDeploymentType().isProduction()) {
+                logonFixture = fixtureInstaller.getLogonFixture();
+            }
+        } finally {
+            IsisContext.closeSession();
+        }
+    }
+
+    private boolean isNoop(final FixturesInstaller candidate) {
+        return candidate == null || (fixtureInstaller instanceof Noop);
+    }
+
+    /**
+     * The act of invoking titleOf(...) will cause translations to be requested.
+     */
+    private void translateServicesAndEnumConstants() {
+        IsisContext.openSession(new InitialisationSession());
+        try {
+            final List<Object> services = sessionFactory.getServices();
+            final DomainObjectContainer container = lookupService(DomainObjectContainer.class);
+            for (Object service : services) {
+                final String unused = container.titleOf(service);
+            }
+            for (final ObjectSpecification objSpec : allSpecifications()) {
+                final Class<?> correspondingClass = objSpec.getCorrespondingClass();
+                if(correspondingClass.isEnum()) {
+                    final Object[] enumConstants = correspondingClass.getEnumConstants();
+                    for (Object enumConstant : enumConstants) {
+                        final String unused = container.titleOf(enumConstant);
+                    }
+                }
+            }
+        } finally {
+            IsisContext.closeSession();
+        }
+
+    }
+
+    private <T> T lookupService(final Class<T> serviceClass) {
+        return getServicesInjector().lookupService(serviceClass);
+    }
+
+    private ServicesInjectorSpi getServicesInjector() {
+        return getPersistenceSession().getServicesInjector();
+    }
+
+    private PersistenceSession getPersistenceSession() {
+        return IsisContext.getPersistenceSession();
+    }
+
+    Collection<ObjectSpecification> allSpecifications() {
+        return IsisContext.getSpecificationLoader().allSpecifications();
+    }
+
+    private OidMarshaller createOidMarshaller() {
+        return new OidMarshaller();
+    }
+
+    private RuntimeContextFromSession createRuntimeContextFromSession() {
+        return new RuntimeContextFromSession();
+    }
+
+    //endregion
+
+    //region > shutdown
+
+    @Override
+    public void shutdown() {
+        LOG.info("shutting down system");
+
+        shutdownServices(this.serviceInitializer);
+
+        IsisContext.closeAllSessions();
+    }
+
+    /**
+     * @see #initializeServices()
+     */
+    private void shutdownServices(final ServiceInitializer serviceInitializer) {
+
+        // call @PostDestroy (in a session)
+        IsisContext.openSession(new InitialisationSession());
+        try {
+            getTransactionManager().startTransaction();
+            try {
+                serviceInitializer.preDestroy();
+
+            } catch(RuntimeException ex) {
+                getTransactionManager().getTransaction().setAbortCause(new IsisTransactionManagerException(ex));
+            } finally {
+                // will commit or abort
+                getTransactionManager().endTransaction();
+            }
+        } finally {
+            IsisContext.closeSession();
+        }
+    }
+
+    //endregion
+
+    //region > configuration
 
     /**
      * Returns a <i>snapshot</i> of the {@link IsisConfiguration configuration}
      * (although once the {@link IsisSystem} is completely initialized, will
      * effectively be immutable).
      */
-    IsisConfiguration getConfiguration();
+    public IsisConfiguration getConfiguration() {
+        return isisComponentProvider.getConfiguration();
+    }
+    //endregion
+
+    //region > logonFixture
+    private LogonFixture logonFixture;
+
+    /**
+     * The {@link LogonFixture}, if any, obtained by running fixtures.
+     *
+     * <p>
+     * Intended to be used when for {@link DeploymentType#SERVER_EXPLORATION
+     * exploration} (instead of an {@link ExplorationSession}) or
+     * {@link DeploymentType#SERVER_PROTOTYPE prototype} deployments (saves logging
+     * in). Should be <i>ignored</i> in other {@link DeploymentType}s.
+     */
+    public LogonFixture getLogonFixture() {
+        return logonFixture;
+    }
+    //endregion
+
+    //region > debugging
+
+    @Override
+    public DebuggableWithTitle debugSection(final String selectionName) {
+        // DebugInfo deb;
+        if (selectionName.equals("Configuration")) {
+            return getConfiguration();
+        }
+        return null;
+    }
+
+    @Override
+    public String[] debugSectionNames() {
+        final String[] general = new String[] { "Overview", "Authenticator", "Configuration", "Reflector", "Requests", "Contexts" };
+        final String[] contextIds = IsisContext.getInstance().allSessionIds();
+        final String[] combined = new String[general.length + contextIds.length];
+        System.arraycopy(general, 0, combined, 0, general.length);
+        System.arraycopy(contextIds, 0, combined, general.length, contextIds.length);
+        return combined;
+    }
+
+    IsisTransactionManager getTransactionManager() {
+        return IsisContext.getTransactionManager();
+    }
+
+    //endregion
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/fd9a217c/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSession.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSession.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSession.java
index 0f42039..9047d9c 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSession.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSession.java
@@ -19,12 +19,30 @@
 
 package org.apache.isis.core.runtime.system.session;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.commons.components.ApplicationScopedComponent;
 import org.apache.isis.core.commons.components.SessionScopedComponent;
+import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.debug.DebugBuilder;
+import org.apache.isis.core.commons.debug.DebugString;
+import org.apache.isis.core.commons.debug.DebuggableWithTitle;
+import org.apache.isis.core.commons.util.ToString;
+import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
+import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
 import org.apache.isis.core.runtime.system.transaction.IsisTransaction;
+import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;
+
+import static org.apache.isis.core.commons.ensure.Ensure.ensureThatArg;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
 
 /**
  * Analogous to (and in essence a wrapper for) a JDO <code>PersistenceManager</code>;
@@ -35,65 +53,239 @@ import org.apache.isis.core.runtime.system.transaction.IsisTransaction;
  * 
  * @see IsisSessionFactory
  */
-public interface IsisSession extends SessionScopedComponent {
+public class IsisSession implements SessionScopedComponent {
+
+    private static final Logger LOG = LoggerFactory.getLogger(IsisSession.class);
+
+    private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd/MM HH:mm:ss,SSS");
+    private static int nextId = 1;
+
+    private final IsisSessionFactory isisSessionFactory;
+
+    private final AuthenticationSession authenticationSession;
+    private PersistenceSession persistenceSession; // only non-final so can be
+    // replaced in tests.
+    private final int id;
+    private long accessTime;
+    private String debugSnapshot;
+
+    //region > constructor
+    public IsisSession(
+            final IsisSessionFactory sessionFactory,
+            final AuthenticationSession authenticationSession,
+            final PersistenceSession persistenceSession) {
+
+        // global context
+        ensureThatArg(sessionFactory, is(not(nullValue())), "execution context factory is required");
+
+        // session
+        ensureThatArg(authenticationSession, is(not(nullValue())), "authentication session is required");
+        ensureThatArg(persistenceSession, is(not(nullValue())), "persistence session is required");
+
+        this.isisSessionFactory = sessionFactory;
 
-    // //////////////////////////////////////////////////////
-    // closeAll
-    // //////////////////////////////////////////////////////
+        this.authenticationSession = authenticationSession;
+        this.persistenceSession = persistenceSession;
 
+        setSessionOpenTime(System.currentTimeMillis());
+
+        this.id = nextId++;
+
+    }
+    //endregion
+
+    //region > open, close
+    @Override
+    public void open() {
+        persistenceSession.open();
+    }
+
+    /**
+     * Closes session.
+     */
+    @Override
+    public void close() {
+        try {
+            takeSnapshot();
+        } catch(Throwable ex) {
+            LOG.error("Failed to takeSnapshot while closing the session; continuing to avoid memory leakage");
+        }
+
+        final PersistenceSession persistenceSession = getPersistenceSession();
+        if(persistenceSession != null) {
+            persistenceSession.close();
+        }
+    }
+
+    //endregion
+
+    //region > shutdown
     /**
+     * Shuts down all components.
+     *
      * Normal lifecycle is managed using callbacks in
      * {@link SessionScopedComponent}. This method is to allow the outer
      * {@link ApplicationScopedComponent}s to shutdown, closing any and all
      * running {@link IsisSession}s.
      */
-    void closeAll();
+    public void closeAll() {
+        close();
+
+        shutdownIfRequired(persistenceSession);
+    }
 
-    // //////////////////////////////////////////////////////
-    // Id
-    // //////////////////////////////////////////////////////
+    private void shutdownIfRequired(final Object o) {
+        if (o instanceof SessionScopedComponent) {
+            final SessionScopedComponent requiresSetup = (SessionScopedComponent) o;
+            requiresSetup.close();
+        }
+    }
+    //endregion
 
+    //region > convenience methods
     /**
-     * A descriptive identifier for this {@link IsisSession}.
+     * Convenience method.
+     */
+    public DeploymentType getDeploymentType() {
+        return isisSessionFactory.getDeploymentType();
+    }
+
+    /**
+     * Convenience method.
      */
-    String getId();
+    public IsisConfiguration getConfiguration() {
+        return isisSessionFactory.getConfiguration();
+    }
 
-    // //////////////////////////////////////////////////////
-    // Authentication Session
-    // //////////////////////////////////////////////////////
+    /**
+     * Convenience method.
+     */
+    public SpecificationLoaderSpi getSpecificationLoader() {
+        return isisSessionFactory.getSpecificationLoader();
+    }
+    //endregion
 
+    //region > AuthenticationSession
     /**
      * Returns the {@link AuthenticationSession} representing this user for this
      * {@link IsisSession}.
      */
-    AuthenticationSession getAuthenticationSession();
+    public AuthenticationSession getAuthenticationSession() {
+        return authenticationSession;
+    }
 
-    // //////////////////////////////////////////////////////
-    // Persistence Session
-    // //////////////////////////////////////////////////////
+    private String getSessionUserName() {
+        return getAuthenticationSession().getUserName();
+    }
+    //endregion
 
+    //region > id
+    /**
+     * A descriptive identifier for this {@link IsisSession}.
+     */
+    public String getId() {
+        return "#" + id + getSessionUserName();
+    }
+    //endregion
+
+    //region > Persistence Session
     /**
      * The {@link PersistenceSession} within this {@link IsisSession}.
      */
-    PersistenceSession getPersistenceSession();
+    public PersistenceSession getPersistenceSession() {
+        return persistenceSession;
+    }
+
+    //endregion
+
+    //region > sessionOpenTime
+    protected long getSessionOpenTime() {
+        return accessTime;
+    }
+
+    private void setSessionOpenTime(final long accessTime) {
+        this.accessTime = accessTime;
+    }
+    //endregion
+
+    //region > transaction
+
+    /**
+     * Convenience method that returns the {@link IsisTransaction} of the
+     * session, if any.
+     */
+    public IsisTransaction getCurrentTransaction() {
+        return getTransactionManager().getTransaction();
+    }
+
+    //endregion
+
+    //region > toString
+    @Override
+    public String toString() {
+        final ToString asString = new ToString(this);
+        asString.append("context", getId());
+        appendState(asString);
+        return asString.toString();
+    }
+    //endregion
+
+    //region > debugging
+
+    public void debug(final DebugBuilder debug) {
+        debug.appendAsHexln("hash", hashCode());
+        debug.appendln("context id", id);
+        debug.appendln("accessed", DATE_FORMAT.format(new Date(getSessionOpenTime())));
+        debugState(debug);
+    }
 
+    public void takeSnapshot() {
+        if (!LOG.isDebugEnabled()) {
+            return;
+        }
+        final DebugString debug = new DebugString();
+        debug(debug);
+        debug.indent();
+        debug.appendln();
 
-    
-    // //////////////////////////////////////////////////////
-    // Transaction (if in progress)
-    // //////////////////////////////////////////////////////
+        debug(debug, getPersistenceSession());
+        if (getCurrentTransaction() != null) {
+            debug(debug, getCurrentTransaction().getMessageBroker());
+        }
+        debugSnapshot = debug.toString();
 
-    IsisTransaction getCurrentTransaction();
+        LOG.debug(debugSnapshot);
+    }
 
-    // //////////////////////////////////////////////////////
-    // Debugging
-    // //////////////////////////////////////////////////////
+    private void debug(final DebugBuilder debug, final Object object) {
+        if (object instanceof DebuggableWithTitle) {
+            final DebuggableWithTitle d = (DebuggableWithTitle) object;
+            debug.startSection(d.debugTitle());
+            d.debugData(debug);
+            debug.endSection();
+        } else {
+            debug.appendln("no debug for " + object);
+        }
+    }
 
-    void debugAll(DebugBuilder debug);
+    public void appendState(final ToString asString) {
+        asString.append("authenticationSession", getAuthenticationSession());
+        asString.append("persistenceSession", getPersistenceSession());
+        asString.append("transaction", getCurrentTransaction());
+    }
 
-    void debug(DebugBuilder debug);
+    public void debugState(final DebugBuilder debug) {
+        debug.appendln("authenticationSession", getAuthenticationSession());
+        debug.appendln("persistenceSession", getPersistenceSession());
+        debug.appendln("transaction", getCurrentTransaction());
+    }
+    //endregion
 
-    void debugState(DebugBuilder debug);
+    //region > Dependencies (from constructor)
 
+    private IsisTransactionManager getTransactionManager() {
+        return getPersistenceSession().getTransactionManager();
+    }
+    //endregion
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/fd9a217c/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionDefault.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionDefault.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionDefault.java
deleted file mode 100644
index 4dcb7b3..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionDefault.java
+++ /dev/null
@@ -1,320 +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.session;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.isis.core.commons.authentication.AuthenticationSession;
-import org.apache.isis.core.commons.components.SessionScopedComponent;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.commons.debug.DebugBuilder;
-import org.apache.isis.core.commons.debug.DebugString;
-import org.apache.isis.core.commons.debug.DebuggableWithTitle;
-import org.apache.isis.core.commons.util.ToString;
-import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
-import org.apache.isis.core.runtime.system.DeploymentType;
-import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
-import org.apache.isis.core.runtime.system.transaction.IsisTransaction;
-import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;
-
-import static org.apache.isis.core.commons.ensure.Ensure.ensureThatArg;
-import static org.hamcrest.CoreMatchers.*;
-
-/**
- * Analogous to a Hibernate <tt>Session</tt>, holds the current set of
- * components for a specific execution context (such as on a thread).
- * 
- * <p>
- * The <tt>IsisContext</tt> class (in <tt>nof-core</tt>) is responsible for
- * locating the current execution context.
- * 
- * @see IsisSessionFactory
- */
-public class IsisSessionDefault implements IsisSession {
-
-    private static final Logger LOG = LoggerFactory.getLogger(IsisSessionDefault.class);
-
-    private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd/MM HH:mm:ss,SSS");
-    private static int nextId = 1;
-
-    private final IsisSessionFactory isisSessionFactory;
-
-    private final AuthenticationSession authenticationSession;
-    private PersistenceSession persistenceSession; // only non-final so can be
-                                                   // replaced in tests.
-    private final int id;
-    private long accessTime;
-    private String debugSnapshot;
-
-    public IsisSessionDefault(
-            final IsisSessionFactory sessionFactory,
-            final AuthenticationSession authenticationSession,
-            final PersistenceSession persistenceSession) {
-
-        // global context
-        ensureThatArg(sessionFactory, is(not(nullValue())), "execution context factory is required");
-
-        // session
-        ensureThatArg(authenticationSession, is(not(nullValue())), "authentication session is required");
-        ensureThatArg(persistenceSession, is(not(nullValue())), "persistence session is required");
-
-        this.isisSessionFactory = sessionFactory;
-
-        this.authenticationSession = authenticationSession;
-        this.persistenceSession = persistenceSession;
-
-        setSessionOpenTime(System.currentTimeMillis());
-
-        this.id = nextId++;
-        
-    }
-
-    // //////////////////////////////////////////////////////
-    // open, close
-    // //////////////////////////////////////////////////////
-
-    @Override
-    public void open() {
-        persistenceSession.open();
-    }
-
-    /**
-     * Closes session.
-     */
-    @Override
-    public void close() {
-        try {
-            takeSnapshot();
-        } catch(Throwable ex) {
-            LOG.error("Failed to takeSnapshot while closing the session; continuing to avoid memory leakage");
-        }
-
-        final PersistenceSession persistenceSession = getPersistenceSession();
-        if(persistenceSession != null) {
-            persistenceSession.close();
-        }
-    }
-
-    // //////////////////////////////////////////////////////
-    // shutdown
-    // //////////////////////////////////////////////////////
-
-    /**
-     * Shuts down all components.
-     */
-    @Override
-    public void closeAll() {
-        close();
-
-        shutdownIfRequired(persistenceSession);
-    }
-
-    private void shutdownIfRequired(final Object o) {
-        if (o instanceof SessionScopedComponent) {
-            final SessionScopedComponent requiresSetup = (SessionScopedComponent) o;
-            requiresSetup.close();
-        }
-    }
-
-    // //////////////////////////////////////////////////////
-    // ExecutionContextFactory
-    // //////////////////////////////////////////////////////
-
-    /**
-     * Convenience method.
-     */
-    public DeploymentType getDeploymentType() {
-        return isisSessionFactory.getDeploymentType();
-    }
-
-    /**
-     * Convenience method.
-     */
-    public IsisConfiguration getConfiguration() {
-        return isisSessionFactory.getConfiguration();
-    }
-
-    /**
-     * Convenience method.
-     */
-    public SpecificationLoaderSpi getSpecificationLoader() {
-        return isisSessionFactory.getSpecificationLoader();
-    }
-
-    // //////////////////////////////////////////////////////
-    // AuthenticationSession
-    // //////////////////////////////////////////////////////
-
-    /**
-     * Returns the security session representing this user for this execution
-     * context.
-     */
-    @Override
-    public AuthenticationSession getAuthenticationSession() {
-        return authenticationSession;
-    }
-
-    private String getSessionUserName() {
-        return getAuthenticationSession().getUserName();
-    }
-
-    // //////////////////////////////////////////////////////
-    // Id
-    // //////////////////////////////////////////////////////
-
-    /**
-     * Returns an descriptive identifier for this {@link IsisSessionDefault}.
-     */
-    @Override
-    public String getId() {
-        return "#" + id + getSessionUserName();
-    }
-
-    // //////////////////////////////////////////////////////
-    // Persistence Session
-    // //////////////////////////////////////////////////////
-
-    @Override
-    public PersistenceSession getPersistenceSession() {
-        return persistenceSession;
-    }
-
-
-    // //////////////////////////////////////////////////////
-    // Session Open Time
-    // //////////////////////////////////////////////////////
-
-    protected long getSessionOpenTime() {
-        return accessTime;
-    }
-
-    private void setSessionOpenTime(final long accessTime) {
-        this.accessTime = accessTime;
-    }
-
-    // //////////////////////////////////////////////////////
-    // Transaction
-    // //////////////////////////////////////////////////////
-
-    /**
-     * Convenience method that returns the {@link IsisTransaction} of the
-     * session, if any.
-     */
-    @Override
-    public IsisTransaction getCurrentTransaction() {
-        return getTransactionManager().getTransaction();
-    }
-
-    // //////////////////////////////////////////////////////
-    // testSetObjectPersistor
-    // //////////////////////////////////////////////////////
-
-    /**
-     * Should only be called in tests.
-     */
-    public void testSetObjectPersistor(final PersistenceSession objectPersistor) {
-        this.persistenceSession = objectPersistor;
-    }
-
-    // //////////////////////////////////////////////////////
-    // toString
-    // //////////////////////////////////////////////////////
-
-    @Override
-    public String toString() {
-        final ToString asString = new ToString(this);
-        asString.append("context", getId());
-        appendState(asString);
-        return asString.toString();
-    }
-
-    // //////////////////////////////////////////////////////
-    // Debugging
-    // //////////////////////////////////////////////////////
-
-    @Override
-    public void debugAll(final DebugBuilder debug) {
-        debug.startSection("Isis Context Snapshot");
-        debug.appendln(debugSnapshot);
-        debug.endSection();
-    }
-
-    @Override
-    public void debug(final DebugBuilder debug) {
-        debug.appendAsHexln("hash", hashCode());
-        debug.appendln("context id", id);
-        debug.appendln("accessed", DATE_FORMAT.format(new Date(getSessionOpenTime())));
-        debugState(debug);
-    }
-
-    public void takeSnapshot() {
-        if (!LOG.isDebugEnabled()) {
-            return;
-        }
-        final DebugString debug = new DebugString();
-        debug(debug);
-        debug.indent();
-        debug.appendln();
-
-        debug(debug, getPersistenceSession());
-        if (getCurrentTransaction() != null) {
-            debug(debug, getCurrentTransaction().getMessageBroker());
-        }
-        debugSnapshot = debug.toString();
-
-        LOG.debug(debugSnapshot);
-    }
-
-    private void debug(final DebugBuilder debug, final Object object) {
-        if (object instanceof DebuggableWithTitle) {
-            final DebuggableWithTitle d = (DebuggableWithTitle) object;
-            debug.startSection(d.debugTitle());
-            d.debugData(debug);
-            debug.endSection();
-        } else {
-            debug.appendln("no debug for " + object);
-        }
-    }
-
-    public void appendState(final ToString asString) {
-        asString.append("authenticationSession", getAuthenticationSession());
-        asString.append("persistenceSession", getPersistenceSession());
-        asString.append("transaction", getCurrentTransaction());
-    }
-
-    @Override
-    public void debugState(final DebugBuilder debug) {
-        debug.appendln("authenticationSession", getAuthenticationSession());
-        debug.appendln("persistenceSession", getPersistenceSession());
-        debug.appendln("transaction", getCurrentTransaction());
-    }
-
-    // /////////////////////////////////////////////////////
-    // Dependencies (from constructor)
-    // /////////////////////////////////////////////////////
-
-    private IsisTransactionManager getTransactionManager() {
-        return getPersistenceSession().getTransactionManager();
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/fd9a217c/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 e62ce4d..1af2136 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
@@ -20,47 +20,164 @@
 package org.apache.isis.core.runtime.system.session;
 
 import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 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.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 static org.apache.isis.core.commons.ensure.Ensure.ensureThatArg;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+
 /**
  * Analogous (and in essence a wrapper for) a JDO <code>PersistenceManagerFactory</code>
  * 
- * @see IsisSession
+ * Creates an implementation of
+ * {@link IsisSessionFactory#openSession(AuthenticationSession)} to create an
+ * {@link IsisSession}, but delegates to subclasses to actually obtain the
+ * components that make up that {@link IsisSession}.
+ *
+ * <p>
+ * The idea is that one subclass can use the {@link InstallerLookup} design to
+ * lookup installers for components (and hence create the components
+ * themselves), whereas another subclass might simply use Spring (or another DI
+ * container) to inject in the components according to some Spring-configured
+ * application context.
  */
-public interface IsisSessionFactory extends ApplicationScopedComponent {
+
+public class IsisSessionFactory implements ApplicationScopedComponent {
+
+
+    @SuppressWarnings("unused")
+    private final static Logger LOG = LoggerFactory.getLogger(IsisSessionFactory.class);
+
+    private final DeploymentType deploymentType;
+    private final IsisConfiguration configuration;
+    private final SpecificationLoaderSpi specificationLoaderSpi;
+    private final AuthenticationManager authenticationManager;
+    private final AuthorizationManager authorizationManager;
+    private final PersistenceSessionFactory persistenceSessionFactory;
+    private final OidMarshaller oidMarshaller;
+
+    public IsisSessionFactory (
+            final DeploymentType deploymentType,
+            final IsisConfiguration configuration,
+            final SpecificationLoaderSpi specificationLoader,
+            final AuthenticationManager authenticationManager,
+            final AuthorizationManager authorizationManager,
+            final PersistenceSessionFactory persistenceSessionFactory,
+            final OidMarshaller oidMarshaller) {
+
+        ensureThatArg(deploymentType, is(not(nullValue())));
+        ensureThatArg(configuration, is(not(nullValue())));
+        ensureThatArg(specificationLoader, is(not(nullValue())));
+        ensureThatArg(authenticationManager, is(not(nullValue())));
+        ensureThatArg(authorizationManager, is(not(nullValue())));
+        ensureThatArg(persistenceSessionFactory, is(not(nullValue())));
+
+        this.deploymentType = deploymentType;
+        this.configuration = configuration;
+        this.specificationLoaderSpi = specificationLoader;
+        this.authenticationManager = authenticationManager;
+        this.authorizationManager = authorizationManager;
+        this.persistenceSessionFactory = persistenceSessionFactory;
+        this.oidMarshaller = oidMarshaller;
+    }
+
+
+
+    // ///////////////////////////////////////////
+    // init, shutdown
+    // ///////////////////////////////////////////
+
+    /**
+     * Wires components as necessary, and then
+     * {@link ApplicationScopedComponent#init() init}ializes all.
+     */
+    @Override
+    public void init() {
+        final ServicesInjectorSpi servicesInjector = persistenceSessionFactory.getServicesInjector();
+        specificationLoaderSpi.setServiceInjector(servicesInjector);
+
+        specificationLoaderSpi.init();
+
+        // must come after init of spec loader.
+        specificationLoaderSpi.injectInto(persistenceSessionFactory);
+
+        authenticationManager.init();
+        authorizationManager.init();
+        persistenceSessionFactory.init();
+
+    }
+
+
+
+    @Override
+    public void shutdown() {
+
+        persistenceSessionFactory.shutdown();
+        authenticationManager.shutdown();
+        specificationLoaderSpi.shutdown();
+    }
+
 
     /**
      * Creates and {@link IsisSession#open() open}s the {@link IsisSession}.
      */
-    IsisSession openSession(final AuthenticationSession session);
+    public IsisSession openSession(final AuthenticationSession authenticationSession) {
+        final PersistenceSession persistenceSession = persistenceSessionFactory.createPersistenceSession();
+        ensureThatArg(persistenceSession, is(not(nullValue())));
+
+        // inject into persistenceSession any/all application-scoped components
+        // that it requires
+        getSpecificationLoader().injectInto(persistenceSession);
+
+        return newIsisSession(authenticationSession, persistenceSession);
+    }
+
+    protected IsisSession newIsisSession(
+            final AuthenticationSession authenticationSession,
+            final PersistenceSession persistenceSession) {
+        return new IsisSession(this, authenticationSession, persistenceSession);
+    }
 
     /**
      * The {@link ApplicationScopedComponent application-scoped}
-     * {@link DeploymentType}.
+     * {@link IsisConfiguration}.
      */
-    public DeploymentType getDeploymentType();
+    public IsisConfiguration getConfiguration() {
+        return configuration;
+    }
 
     /**
      * The {@link ApplicationScopedComponent application-scoped}
-     * {@link IsisConfiguration}.
+     * {@link DeploymentType}.
      */
-    public IsisConfiguration getConfiguration();
+    public DeploymentType getDeploymentType() {
+        return deploymentType;
+    }
 
     /**
      * The {@link ApplicationScopedComponent application-scoped}
      * {@link SpecificationLoaderSpi}.
      */
-    public SpecificationLoaderSpi getSpecificationLoader();
+    public SpecificationLoaderSpi getSpecificationLoader() {
+        return specificationLoaderSpi;
+    }
 
     /**
      * The {@link AuthenticationManager} that will be used to authenticate and
@@ -68,27 +185,38 @@ public interface IsisSessionFactory extends ApplicationScopedComponent {
      * {@link IsisSession#getAuthenticationSession() within} the
      * {@link IsisSession}.
      */
-    public AuthenticationManager getAuthenticationManager();
+    public AuthenticationManager getAuthenticationManager() {
+        return authenticationManager;
+    }
 
     /**
      * The {@link AuthorizationManager} that will be used to authorize access to
      * domain objects.
      */
-    public AuthorizationManager getAuthorizationManager();
+    public AuthorizationManager getAuthorizationManager() {
+        return authorizationManager;
+    }
 
     /**
      * The {@link org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory} that will be used to create
      * {@link PersistenceSession} {@link IsisSession#getPersistenceSession()
      * within} the {@link IsisSession}.
      */
-    public PersistenceSessionFactory getPersistenceSessionFactory();
+    public PersistenceSessionFactory getPersistenceSessionFactory() {
+        return persistenceSessionFactory;
+    }
 
-    public List<Object> getServices();
+    public List<Object> getServices() {
+        return getPersistenceSessionFactory().getServicesInjector().getRegisteredServices();
+    }
 
     /**
      * The {@link OidMarshaller} to use for marshalling and unmarshalling {@link Oid}s
      * into strings.
      */
-	public OidMarshaller getOidMarshaller();
+    public OidMarshaller getOidMarshaller() {
+        return oidMarshaller;
+    }
+
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/fd9a217c/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryDefault.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryDefault.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryDefault.java
deleted file mode 100644
index 1d38172..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryDefault.java
+++ /dev/null
@@ -1,197 +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.session;
-
-import java.lang.reflect.Method;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import com.google.common.collect.ArrayListMultimap;
-import com.google.common.collect.ListMultimap;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-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.OidMarshaller;
-import org.apache.isis.core.metamodel.services.ServiceUtil;
-import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
-import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
-import org.apache.isis.core.metamodel.specloader.ServiceInitializer;
-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 static org.apache.isis.core.commons.ensure.Ensure.ensureThatArg;
-import static org.hamcrest.CoreMatchers.*;
-
-/**
- * Creates an implementation of
- * {@link IsisSessionFactory#openSession(AuthenticationSession)} to create an
- * {@link IsisSession}, but delegates to subclasses to actually obtain the
- * components that make up that {@link IsisSession}.
- * 
- * <p>
- * The idea is that one subclass can use the {@link InstallerLookup} design to
- * lookup installers for components (and hence create the components
- * themselves), whereas another subclass might simply use Spring (or another DI
- * container) to inject in the components according to some Spring-configured
- * application context.
- */
-public class IsisSessionFactoryDefault implements IsisSessionFactory {
-
-    @SuppressWarnings("unused")
-    private final static Logger LOG = LoggerFactory.getLogger(IsisSessionFactoryDefault.class);
-    
-    private final DeploymentType deploymentType;
-    private final IsisConfiguration configuration;
-    private final SpecificationLoaderSpi specificationLoaderSpi;
-    private final AuthenticationManager authenticationManager;
-    private final AuthorizationManager authorizationManager;
-    private final PersistenceSessionFactory persistenceSessionFactory;
-    private final OidMarshaller oidMarshaller;
-
-    public IsisSessionFactoryDefault(
-            final DeploymentType deploymentType,
-            final IsisConfiguration configuration,
-            final SpecificationLoaderSpi specificationLoader,
-            final AuthenticationManager authenticationManager,
-            final AuthorizationManager authorizationManager,
-            final PersistenceSessionFactory persistenceSessionFactory,
-            final OidMarshaller oidMarshaller) {
-
-        ensureThatArg(deploymentType, is(not(nullValue())));
-        ensureThatArg(configuration, is(not(nullValue())));
-        ensureThatArg(specificationLoader, is(not(nullValue())));
-        ensureThatArg(authenticationManager, is(not(nullValue())));
-        ensureThatArg(authorizationManager, is(not(nullValue())));
-        ensureThatArg(persistenceSessionFactory, is(not(nullValue())));
-
-        this.deploymentType = deploymentType;
-        this.configuration = configuration;
-        this.specificationLoaderSpi = specificationLoader;
-        this.authenticationManager = authenticationManager;
-        this.authorizationManager = authorizationManager;
-        this.persistenceSessionFactory = persistenceSessionFactory;
-        this.oidMarshaller = oidMarshaller;
-    }
-
-
-
-    // ///////////////////////////////////////////
-    // init, shutdown
-    // ///////////////////////////////////////////
-
-    /**
-     * Wires components as necessary, and then
-     * {@link ApplicationScopedComponent#init() init}ializes all.
-     */
-    @Override
-    public void init() {
-        final ServicesInjectorSpi servicesInjector = persistenceSessionFactory.getServicesInjector();
-        specificationLoaderSpi.setServiceInjector(servicesInjector);
-
-        specificationLoaderSpi.init();
-
-        // must come after init of spec loader.
-        specificationLoaderSpi.injectInto(persistenceSessionFactory);
-
-        authenticationManager.init();
-        authorizationManager.init();
-        persistenceSessionFactory.init();
-        
-    }
-
-
-    
-    @Override
-    public void shutdown() {
-        
-        persistenceSessionFactory.shutdown();
-        authenticationManager.shutdown();
-        specificationLoaderSpi.shutdown();
-    }
-
-
-    @Override
-    public IsisSession openSession(final AuthenticationSession authenticationSession) {
-        final PersistenceSession persistenceSession = persistenceSessionFactory.createPersistenceSession();
-        ensureThatArg(persistenceSession, is(not(nullValue())));
-
-        // inject into persistenceSession any/all application-scoped components
-        // that it requires
-        getSpecificationLoader().injectInto(persistenceSession);
-
-        final IsisSessionDefault isisSessionDefault = newIsisSessionDefault(authenticationSession, persistenceSession);
-        return isisSessionDefault;
-    }
-
-    protected IsisSessionDefault newIsisSessionDefault(
-            final AuthenticationSession authenticationSession,
-            final PersistenceSession persistenceSession) {
-        return new IsisSessionDefault(this, authenticationSession, persistenceSession);
-    }
-
-    @Override
-    public IsisConfiguration getConfiguration() {
-        return configuration;
-    }
-
-    @Override
-    public DeploymentType getDeploymentType() {
-        return deploymentType;
-    }
-
-    @Override
-    public SpecificationLoaderSpi getSpecificationLoader() {
-        return specificationLoaderSpi;
-    }
-
-    @Override
-    public AuthenticationManager getAuthenticationManager() {
-        return authenticationManager;
-    }
-
-    @Override
-    public AuthorizationManager getAuthorizationManager() {
-        return authorizationManager;
-    }
-
-    @Override
-    public PersistenceSessionFactory getPersistenceSessionFactory() {
-        return persistenceSessionFactory;
-    }
-
-    @Override
-    public List<Object> getServices() {
-        return getPersistenceSessionFactory().getServicesInjector().getRegisteredServices();
-    }
-    
-    @Override
-    public OidMarshaller getOidMarshaller() {
-    	return oidMarshaller;
-    }
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/fd9a217c/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemAbstract.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemAbstract.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemAbstract.java
deleted file mode 100644
index 54436ee..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemAbstract.java
+++ /dev/null
@@ -1,30 +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.systemusinginstallers;
-
-import org.apache.isis.core.runtime.system.IsisSystem;
-
-/**
- * 
- */
-public abstract class IsisSystemAbstract implements IsisSystem {
-
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/fd9a217c/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java
index 057cbab..f0160ff 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java
@@ -25,7 +25,6 @@ import org.apache.isis.core.runtime.installerregistry.InstallerLookup;
 import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.core.runtime.system.IsisSystem;
 import org.apache.isis.core.runtime.system.IsisSystemFactory;
-import org.apache.isis.core.runtime.systemdependencyinjector.SystemDependencyInjector;
 
 /**
  * Implementation of {@link IsisSystemFactory} that uses {@link InstallerLookup}
@@ -35,19 +34,12 @@ public class IsisSystemThatUsesInstallersFactory implements IsisSystemFactory {
 
     private final InstallerLookup installerLookup;
 
-    // //////////////////////////////////////////////////////////
-    // constructor
-    // //////////////////////////////////////////////////////////
-
     @Inject
     public IsisSystemThatUsesInstallersFactory(final InstallerLookup installerLookup) {
         this.installerLookup = installerLookup;
     }
 
-    // //////////////////////////////////////////////////////////
-    // init, shutdown
-    // //////////////////////////////////////////////////////////
-
+    //region > init, shutdown
     @Override
     public void init() {
         // nothing to do
@@ -57,25 +49,13 @@ public class IsisSystemThatUsesInstallersFactory implements IsisSystemFactory {
     public void shutdown() {
         // nothing to do
     }
-
-    // //////////////////////////////////////////////////////////
-    // main API
-    // //////////////////////////////////////////////////////////
+    //endregion
 
     @Override
     public IsisSystem createSystem(final DeploymentType deploymentType) {
-
         IsisComponentProviderUsingInstallers componentProvider =
                 new IsisComponentProviderUsingInstallers(deploymentType, installerLookup);
-        return new IsisSystemUsingComponentProvider(componentProvider);
-    }
-
-    // //////////////////////////////////////////////////////////
-    // Dependencies (injected or defaulted in constructor)
-    // //////////////////////////////////////////////////////////
-
-    public SystemDependencyInjector getInstallerLookup() {
-        return installerLookup;
+        return new IsisSystem(componentProvider);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/fd9a217c/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemUsingComponentProvider.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemUsingComponentProvider.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemUsingComponentProvider.java
deleted file mode 100644
index 7c246aa..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemUsingComponentProvider.java
+++ /dev/null
@@ -1,392 +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.systemusinginstallers;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.fixtures.LogonFixture;
-import org.apache.isis.applib.fixturescripts.FixtureScripts;
-import org.apache.isis.applib.services.fixturespec.FixtureScriptsDefault;
-import org.apache.isis.core.commons.components.Noop;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.commons.debug.DebuggableWithTitle;
-import org.apache.isis.core.commons.lang.ListExtensions;
-import org.apache.isis.core.metamodel.adapter.oid.OidMarshaller;
-import org.apache.isis.core.metamodel.facetapi.MetaModelRefiner;
-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.ServiceInitializer;
-import org.apache.isis.core.runtime.authentication.AuthenticationManager;
-import org.apache.isis.core.runtime.authentication.exploration.ExplorationSession;
-import org.apache.isis.core.runtime.authorization.AuthorizationManager;
-import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
-import org.apache.isis.core.runtime.persistence.internal.RuntimeContextFromSession;
-import org.apache.isis.core.runtime.system.DeploymentType;
-import org.apache.isis.core.runtime.system.IsisSystem;
-import org.apache.isis.core.runtime.system.IsisSystemException;
-import org.apache.isis.core.runtime.system.context.IsisContext;
-import org.apache.isis.core.runtime.system.internal.InitialisationSession;
-import org.apache.isis.core.runtime.system.internal.IsisLocaleInitializer;
-import org.apache.isis.core.runtime.system.internal.IsisTimeZoneInitializer;
-import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
-import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
-import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
-import org.apache.isis.core.runtime.system.session.IsisSessionFactoryDefault;
-import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;
-import org.apache.isis.core.runtime.system.transaction.IsisTransactionManagerException;
-
-public class IsisSystemUsingComponentProvider implements IsisSystem {
-
-    public static final Logger LOG = LoggerFactory.getLogger(IsisSystemAbstract.class);
-
-    private final IsisLocaleInitializer localeInitializer;
-    private final IsisTimeZoneInitializer timeZoneInitializer;
-    private final DeploymentType deploymentType;
-
-    private boolean initialized = false;
-
-    private ServiceInitializer serviceInitializer;
-    private FixturesInstaller fixtureInstaller;
-    private IsisSessionFactory sessionFactory;
-
-    //region > constructors
-
-    private final IsisComponentProvider isisComponentProvider;
-
-    public IsisSystemUsingComponentProvider(IsisComponentProvider isisComponentProvider) {
-        this.deploymentType = isisComponentProvider.getDeploymentType();
-        this.localeInitializer = new IsisLocaleInitializer();
-        this.timeZoneInitializer = new IsisTimeZoneInitializer();
-
-        this.isisComponentProvider = isisComponentProvider;
-    }
-
-    //endregion
-
-    //region > deploymentType
-    @Override
-    public DeploymentType getDeploymentType() {
-        return deploymentType;
-    }
-    //endregion
-
-    //region > sessionFactory
-
-    /**
-     * Populated after {@link #init()}.
-     */
-    @Override
-    public IsisSessionFactory getSessionFactory() {
-        return sessionFactory;
-    }
-
-    //endregion
-
-    //region > init
-
-
-    @Override
-    public void init() {
-
-        if (initialized) {
-            throw new IllegalStateException("Already initialized");
-        } else {
-            initialized = true;
-        }
-
-        LOG.info("initialising Isis System");
-        LOG.info("working directory: " + new File(".").getAbsolutePath());
-        LOG.info("resource stream source: " + getConfiguration().getResourceStreamSource());
-
-        localeInitializer.initLocale(getConfiguration());
-        timeZoneInitializer.initTimeZone(getConfiguration());
-
-        try {
-            sessionFactory = createSessionFactory(deploymentType);
-
-            // temporarily make a configuration available
-            // REVIEW: would rather inject this, or perhaps even the
-            // ConfigurationBuilder
-            IsisContext.setConfiguration(getConfiguration());
-
-            initContext(sessionFactory);
-            sessionFactory.init();
-
-            // validate here after all entities have been registered in the persistence session factory
-            final SpecificationLoaderSpi specificationLoader = sessionFactory.getSpecificationLoader();
-            specificationLoader.validateAndAssert();
-
-            serviceInitializer = initializeServices();
-
-            installFixturesIfRequired();
-
-            translateServicesAndEnumConstants();
-
-        } catch (final IsisSystemException ex) {
-            LOG.error("failed to initialise", ex);
-            throw new RuntimeException(ex);
-        }
-    }
-
-
-    private IsisSessionFactory createSessionFactory(final DeploymentType deploymentType) throws IsisSystemException {
-
-        final List<Object> services = isisComponentProvider.obtainServices();
-        final PersistenceSessionFactory persistenceSessionFactory =
-                isisComponentProvider.providePersistenceSessionFactory(deploymentType, services);
-
-        final IsisConfiguration configuration = getConfiguration();
-        final AuthenticationManager authenticationManager = isisComponentProvider
-                .provideAuthenticationManager(deploymentType);
-        final AuthorizationManager authorizationManager = isisComponentProvider
-                .provideAuthorizationManager(deploymentType);
-        final OidMarshaller oidMarshaller = createOidMarshaller();
-
-        final Collection<MetaModelRefiner> metaModelRefiners =
-                refiners(authenticationManager, authorizationManager, persistenceSessionFactory);
-        final SpecificationLoaderSpi reflector = isisComponentProvider
-                .provideSpecificationLoaderSpi(deploymentType, metaModelRefiners);
-
-        ServicesInjectorSpi servicesInjector = persistenceSessionFactory.getServicesInjector();
-        servicesInjector.addFallbackIfRequired(FixtureScripts.class, new FixtureScriptsDefault());
-        servicesInjector.validateServices();
-
-        // bind metamodel to the (runtime) framework
-        final RuntimeContextFromSession runtimeContext = createRuntimeContextFromSession();
-        runtimeContext.injectInto(reflector);
-
-        return new IsisSessionFactoryDefault(
-                deploymentType, configuration, reflector,
-                authenticationManager, authorizationManager,
-                persistenceSessionFactory, oidMarshaller);
-    }
-
-    private static Collection<MetaModelRefiner> refiners(Object... possibleRefiners ) {
-        return ListExtensions.filtered(Arrays.asList(possibleRefiners), MetaModelRefiner.class);
-    }
-
-
-    private void initContext(final IsisSessionFactory sessionFactory) {
-        getDeploymentType().initContext(sessionFactory);
-    }
-
-    /**
-     * @see #shutdownServices(ServiceInitializer)
-     */
-    private ServiceInitializer initializeServices() {
-
-        final List<Object> services = sessionFactory.getServices();
-
-        // validate
-        final ServiceInitializer serviceInitializer = new ServiceInitializer();
-        serviceInitializer.validate(getConfiguration(), services);
-
-        // call @PostConstruct (in a session)
-        IsisContext.openSession(new InitialisationSession());
-        try {
-            getTransactionManager().startTransaction();
-            try {
-                serviceInitializer.postConstruct();
-
-                return serviceInitializer;
-            } catch(RuntimeException ex) {
-                getTransactionManager().getTransaction().setAbortCause(new IsisTransactionManagerException(ex));
-                return serviceInitializer;
-            } finally {
-                // will commit or abort
-                getTransactionManager().endTransaction();
-            }
-        } finally {
-            IsisContext.closeSession();
-        }
-    }
-
-    private void installFixturesIfRequired() throws IsisSystemException {
-
-        fixtureInstaller = isisComponentProvider.obtainFixturesInstaller();
-        if (isNoop(fixtureInstaller)) {
-            return;
-        }
-
-        IsisContext.openSession(new InitialisationSession());
-        fixtureInstaller.installFixtures();
-        try {
-
-            // only allow logon fixtures if not in production mode.
-            if (!getDeploymentType().isProduction()) {
-                logonFixture = fixtureInstaller.getLogonFixture();
-            }
-        } finally {
-            IsisContext.closeSession();
-        }
-    }
-
-    private boolean isNoop(final FixturesInstaller candidate) {
-        return candidate == null || (fixtureInstaller instanceof Noop);
-    }
-
-    /**
-     * The act of invoking titleOf(...) will cause translations to be requested.
-     */
-    private void translateServicesAndEnumConstants() {
-        IsisContext.openSession(new InitialisationSession());
-        try {
-            final List<Object> services = sessionFactory.getServices();
-            final DomainObjectContainer container = lookupService(DomainObjectContainer.class);
-            for (Object service : services) {
-                final String unused = container.titleOf(service);
-            }
-            for (final ObjectSpecification objSpec : allSpecifications()) {
-                final Class<?> correspondingClass = objSpec.getCorrespondingClass();
-                if(correspondingClass.isEnum()) {
-                    final Object[] enumConstants = correspondingClass.getEnumConstants();
-                    for (Object enumConstant : enumConstants) {
-                        final String unused = container.titleOf(enumConstant);
-                    }
-                }
-            }
-        } finally {
-            IsisContext.closeSession();
-        }
-
-    }
-
-    private <T> T lookupService(final Class<T> serviceClass) {
-        return getServicesInjector().lookupService(serviceClass);
-    }
-
-    private ServicesInjectorSpi getServicesInjector() {
-        return getPersistenceSession().getServicesInjector();
-    }
-
-    private PersistenceSession getPersistenceSession() {
-        return IsisContext.getPersistenceSession();
-    }
-
-    Collection<ObjectSpecification> allSpecifications() {
-        return IsisContext.getSpecificationLoader().allSpecifications();
-    }
-
-    private OidMarshaller createOidMarshaller() {
-        return new OidMarshaller();
-    }
-
-    private RuntimeContextFromSession createRuntimeContextFromSession() {
-        return new RuntimeContextFromSession();
-    }
-
-    //endregion
-
-    //region > shutdown
-
-    @Override
-    public void shutdown() {
-        LOG.info("shutting down system");
-
-        shutdownServices(this.serviceInitializer);
-
-        IsisContext.closeAllSessions();
-    }
-
-    /**
-     * @see #initializeServices()
-     */
-    private void shutdownServices(final ServiceInitializer serviceInitializer) {
-
-        // call @PostDestroy (in a session)
-        IsisContext.openSession(new InitialisationSession());
-        try {
-            getTransactionManager().startTransaction();
-            try {
-                serviceInitializer.preDestroy();
-
-            } catch(RuntimeException ex) {
-                getTransactionManager().getTransaction().setAbortCause(new IsisTransactionManagerException(ex));
-            } finally {
-                // will commit or abort
-                getTransactionManager().endTransaction();
-            }
-        } finally {
-            IsisContext.closeSession();
-        }
-    }
-
-    //endregion
-
-    //region > configuration
-    public IsisConfiguration getConfiguration() {
-        return isisComponentProvider.getConfiguration();
-    }
-    //endregion
-
-    //region > logonFixture
-    private LogonFixture logonFixture;
-
-    /**
-     * The {@link LogonFixture}, if any, obtained by running fixtures.
-     *
-     * <p>
-     * Intended to be used when for {@link DeploymentType#SERVER_EXPLORATION
-     * exploration} (instead of an {@link ExplorationSession}) or
-     * {@link DeploymentType#SERVER_PROTOTYPE prototype} deployments (saves logging
-     * in). Should be <i>ignored</i> in other {@link DeploymentType}s.
-     */
-    @Override
-    public LogonFixture getLogonFixture() {
-        return logonFixture;
-    }
-    //endregion
-
-    //region > debugging
-
-    @Override
-    public DebuggableWithTitle debugSection(final String selectionName) {
-        // DebugInfo deb;
-        if (selectionName.equals("Configuration")) {
-            return getConfiguration();
-        }
-        return null;
-    }
-
-    @Override
-    public String[] debugSectionNames() {
-        final String[] general = new String[] { "Overview", "Authenticator", "Configuration", "Reflector", "Requests", "Contexts" };
-        final String[] contextIds = IsisContext.getInstance().allSessionIds();
-        final String[] combined = new String[general.length + contextIds.length];
-        System.arraycopy(general, 0, combined, 0, general.length);
-        System.arraycopy(contextIds, 0, combined, general.length, contextIds.length);
-        return combined;
-    }
-
-    IsisTransactionManager getTransactionManager() {
-        return IsisContext.getTransactionManager();
-    }
-
-    //endregion
-
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/fd9a217c/core/runtime/src/test/java/org/apache/isis/core/runtime/context/IsisContextTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/isis/core/runtime/context/IsisContextTest.java b/core/runtime/src/test/java/org/apache/isis/core/runtime/context/IsisContextTest.java
index 5838ace..6b01e83 100644
--- a/core/runtime/src/test/java/org/apache/isis/core/runtime/context/IsisContextTest.java
+++ b/core/runtime/src/test/java/org/apache/isis/core/runtime/context/IsisContextTest.java
@@ -39,7 +39,6 @@ import org.apache.isis.core.runtime.system.context.IsisContext;
 import org.apache.isis.core.runtime.system.context.IsisContextStatic;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
 import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
-import org.apache.isis.core.runtime.system.session.IsisSessionFactoryDefault;
 import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
 import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
 
@@ -102,7 +101,7 @@ public class IsisContextTest {
             }
         });
 
-        sessionFactory = new IsisSessionFactoryDefault(DeploymentType.UNIT_TESTING, configuration, mockSpecificationLoader, mockAuthenticationManager, mockAuthorizationManager, mockPersistenceSessionFactory, oidMarshaller);
+        sessionFactory = new IsisSessionFactory(DeploymentType.UNIT_TESTING, configuration, mockSpecificationLoader, mockAuthenticationManager, mockAuthorizationManager, mockPersistenceSessionFactory, oidMarshaller);
         authSession = new SimpleSession("tester", Collections.<String>emptyList());
         
         IsisContext.setConfiguration(configuration);

http://git-wip-us.apache.org/repos/asf/isis/blob/fd9a217c/core/runtime/src/test/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryAbstractTest_init_and_shutdown.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryAbstractTest_init_and_shutdown.java b/core/runtime/src/test/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryAbstractTest_init_and_shutdown.java
index 77af285..ec8e1e0 100644
--- a/core/runtime/src/test/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryAbstractTest_init_and_shutdown.java
+++ b/core/runtime/src/test/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryAbstractTest_init_and_shutdown.java
@@ -84,7 +84,7 @@ public class IsisSessionFactoryAbstractTest_init_and_shutdown {
     public void validate_DomainServicesWithDuplicateIds() {
         serviceList.add(new DomainServiceWithSomeId());
         serviceList.add(new DomainServiceWithDuplicateId());
-        isf = new IsisSessionFactoryDefault(mockDeploymentType, configuration, mockSpecificationLoader, mockAuthenticationManager, mockAuthorizationManager, mockPersistenceSessionFactory, mockOidMarshaller) {
+        isf = new IsisSessionFactory(mockDeploymentType, configuration, mockSpecificationLoader, mockAuthenticationManager, mockAuthorizationManager, mockPersistenceSessionFactory, mockOidMarshaller) {
         };
     }
 }


[07/17] isis git commit: ISIS-848: defined GlobSpec interface in applib, also started reworking simpleapp.

Posted by da...@apache.org.
ISIS-848: defined GlobSpec interface in applib, also started reworking simpleapp.


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

Branch: refs/heads/master
Commit: 6ccf96c9addba9175b08ca99c4f80da8a8440c41
Parents: 1ed4eef
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Aug 5 06:42:47 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Aug 5 22:34:50 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/isis/applib/GlobSpec.java   | 134 +++++++++++++++++
 .../domainapp/dom/DomainAppDomainModule.java    |  24 +++
 .../dom/app/homepage/HomePageService.java       |  51 -------
 .../dom/app/homepage/HomePageViewModel.java     |  50 -------
 .../app/homepage/HomePageViewModel.layout.json  |  43 ------
 .../dom/app/homepage/HomePageViewModel.png      | Bin 456 -> 0 bytes
 .../dom/modules/simple/SimpleObject.java        | 149 -------------------
 .../dom/modules/simple/SimpleObject.layout.json |  56 -------
 .../dom/modules/simple/SimpleObject.png         | Bin 653 -> 0 bytes
 .../dom/modules/simple/SimpleObjects.java       | 107 -------------
 .../java/domainapp/dom/simple/SimpleObject.java | 149 +++++++++++++++++++
 .../dom/simple/SimpleObject.layout.json         |  56 +++++++
 .../java/domainapp/dom/simple/SimpleObject.png  | Bin 0 -> 653 bytes
 .../domainapp/dom/simple/SimpleObjects.java     | 107 +++++++++++++
 .../dom/modules/simple/SimpleObjectTest.java    |  49 ------
 .../dom/modules/simple/SimpleObjectsTest.java   | 104 -------------
 .../domainapp/dom/simple/SimpleObjectTest.java  |  49 ++++++
 .../domainapp/dom/simple/SimpleObjectsTest.java | 104 +++++++++++++
 .../modules/simple/SimpleObjectCreate.java      |   4 +-
 .../scenarios/RecreateSimpleObjects.java        |   2 +-
 example/application/simpleapp/glob/pom.xml      |  77 ++++++++++
 .../java/domainapp/glob/DomainAppGlobSpec.java  |  60 ++++++++
 .../glob/app/homepage/HomePageService.java      |  51 +++++++
 .../glob/app/homepage/HomePageViewModel.java    |  50 +++++++
 .../app/homepage/HomePageViewModel.layout.json  |  43 ++++++
 .../glob/app/homepage/HomePageViewModel.png     | Bin 0 -> 456 bytes
 .../application/simpleapp/integtests/pom.xml    |   3 +-
 .../modules/simple/SimpleObjectGlue.java        |   4 +-
 .../modules/simple/SimpleObjectIntegTest.java   |   2 +-
 .../modules/simple/SimpleObjectsIntegTest.java  |   4 +-
 example/application/simpleapp/pom.xml           |   6 +
 example/application/simpleapp/webapp/pom.xml    |  21 +--
 .../src/main/webapp/WEB-INF/isis.properties     |   5 +-
 .../WEB-INF/persistor_datanucleus.properties    |   2 +-
 34 files changed, 923 insertions(+), 643 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/core/applib/src/main/java/org/apache/isis/applib/GlobSpec.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/GlobSpec.java b/core/applib/src/main/java/org/apache/isis/applib/GlobSpec.java
new file mode 100644
index 0000000..c5ede73
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/GlobSpec.java
@@ -0,0 +1,134 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.applib;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+/**
+ * Specifies the "glob", in other words the set of modules (containing domain services and possibly entities), that
+ * together make up the running application.
+ *
+ * <p>
+ * To use, implement this interface and then define as the <tt>isis.globspec</tt> key within the
+ * <tt>isis.properties</tt> configuration file, or programmatically.
+ * </p>
+ *
+ * <p>
+ * The intention is to centralize, so far as possible, the configuration that previously has been duplicated between
+ * the <tt>xxx-integtests</tt> (Maven) module and the <tt>xxx-webapp</tt> integtests.
+ * </p>
+ *
+ * <p>
+ * There are a number of subsidiary goals:
+ * <ul>
+ *     <li>
+ *         <p>
+ *             by having multiple classes implementing this interface, it allows separate "profiles" of the application
+ *             to be run.
+ *         </p>
+ *         <p>For example, a developer could define a globspec that</p>
+ *         <ul>
+ *             <li>uses the <tt>bypass</tt> security rather than the full-blown Shiro security</li>
+ *             <li>excludes some or all addon modules, eg auditing and security</li>
+ *             <li>for a large app whose domain has been broken out into multiple <tt>dom-xxx</tt> (Maven) modules, to
+ *                 run subsets of the application</li>
+ *         </ul>
+ *         <p>This applies to both running the main app and also the integration tests.</p>
+ *    </li>
+ *    <li>
+ *        <p>Allow different integration tests to run with different globspecs.  Normally the running application is
+ *           shared (on a thread-local) between integration tests.  What the framework could do is to be intelligent
+ *           enough to keep track of the globspec used for each integration test and tear down
+ *           the shared state if the "next" test uses a different globspec</p>
+ *    </li>
+ *    <li>
+ *        Speed up bootstrapping by only scanning for classes annotated by
+ *        {@link org.apache.isis.applib.annotation.DomainService} and {@link javax.jdo.annotations.PersistenceCapable}
+ *        once.
+ *    </li>
+ *    <li>
+ *        Provide a programmatic way to contribute elements of `web.xml`.  This is not yet implemented.
+ *    </li>
+ *    <li>
+ *        Provide a programmatic way to configure Shiro security.  This is not yet implemented.
+ *    </li>
+ *    <li>
+ *        <p>Anticipate the module changes forthcoming in Java 9.  Eventually we see that the globspec class will
+ *        become an application manifest, while the list of modules will become Java 9 modules each advertising the
+ *        types that they export.</p>
+ *    </li>
+ * </ul>
+ * </p>
+ * <p>
+ *     <b>Note:</b> at this time the integration tests do not keep track of different globspecs; rather the
+ *     globspec used for the first test is used for all subsequent tests.
+ * </p>
+ */
+public interface GlobSpec {
+
+    /**
+     * A list of classes, each of which representing the root of one of the modules containing services and possibly
+     * entities, which together makes up the running application.
+     *
+     * <p>
+     *     The package of each such class is used as the basis for searching for domain services and registered
+     *     entities.  As such it replaces and overrides both the
+     *     <tt>isis.services.ServicesInstallerFromAnnotation.packagePrefix</tt> key (usually found in the
+     *     <tt>isis.properties</tt> file) and the
+     *     <tt>isis.persistor.datanucleus.RegisterEntities.packagePrefix</tt> key (usually found in the
+     *     <tt>persistor_datanucleus.properties</tt> file).
+     * </p>
+     *
+     * <p>
+     *     If a globspec has been provided then the value of <tt>isis.services-installer</tt> configuration property
+     *     will be ignored and the <tt>isis.services</tt> configuration property will also be ignored.
+     * </p>
+     *
+     * <p>
+     *     Note: the class implementing this interface will typically include itself in the list of classes, so that any
+     *     "global" services (for example an application home page) are also picked up.
+     * </p>
+     */
+    public List<Class<?>> getModules();
+
+    /**
+     * If non-null, overrides the value of <tt>isis.authentication</tt> configuration property.
+     */
+    public String getAuthenticationMechanism();
+
+    /**
+     * If non-null, overrides the value of <tt>isis.authorization</tt> configuration property.
+     */
+    public String getAuthorizationMechanism();
+
+    /**
+     * If non-null, overrides the value of <tt>isis.fixtures</tt> configuration property.
+     */
+    public List<FixtureScript> getFixtures();
+
+    /**
+     * Overrides for any other configuration properties.
+     */
+    public Map<String,String> getConfiguration();
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/dom/src/main/java/domainapp/dom/DomainAppDomainModule.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/DomainAppDomainModule.java b/example/application/simpleapp/dom/src/main/java/domainapp/dom/DomainAppDomainModule.java
new file mode 100644
index 0000000..1818053
--- /dev/null
+++ b/example/application/simpleapp/dom/src/main/java/domainapp/dom/DomainAppDomainModule.java
@@ -0,0 +1,24 @@
+/*
+ *  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;
+
+public final class DomainAppDomainModule {
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/dom/src/main/java/domainapp/dom/app/homepage/HomePageService.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/app/homepage/HomePageService.java b/example/application/simpleapp/dom/src/main/java/domainapp/dom/app/homepage/HomePageService.java
deleted file mode 100644
index 641c39a..0000000
--- a/example/application/simpleapp/dom/src/main/java/domainapp/dom/app/homepage/HomePageService.java
+++ /dev/null
@@ -1,51 +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 domainapp.dom.app.homepage;
-
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.HomePage;
-import org.apache.isis.applib.annotation.NatureOfService;
-import org.apache.isis.applib.annotation.SemanticsOf;
-
-@DomainService(
-        nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY // trick to suppress the actions from the top-level menu
-)
-public class HomePageService {
-
-    //region > homePage (action)
-
-    @Action(
-            semantics = SemanticsOf.SAFE
-    )
-    @HomePage
-    public HomePageViewModel homePage() {
-        return container.injectServicesInto(new HomePageViewModel());
-    }
-
-    //endregion
-
-    //region > injected services
-
-    @javax.inject.Inject
-    DomainObjectContainer container;
-
-    //endregion
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java b/example/application/simpleapp/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java
deleted file mode 100644
index 83015d0..0000000
--- a/example/application/simpleapp/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java
+++ /dev/null
@@ -1,50 +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 domainapp.dom.app.homepage;
-
-import java.util.List;
-
-import org.apache.isis.applib.annotation.ViewModel;
-
-import domainapp.dom.modules.simple.SimpleObject;
-import domainapp.dom.modules.simple.SimpleObjects;
-
-@ViewModel
-public class HomePageViewModel {
-
-    //region > title
-    public String title() {
-        return getObjects().size() + " objects";
-    }
-    //endregion
-
-    //region > object (collection)
-    @org.apache.isis.applib.annotation.HomePage
-    public List<SimpleObject> getObjects() {
-        return simpleObjects.listAll();
-    }
-    //endregion
-
-    //region > injected services
-
-    @javax.inject.Inject
-    SimpleObjects simpleObjects;
-
-    //endregion
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.layout.json
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.layout.json b/example/application/simpleapp/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.layout.json
deleted file mode 100644
index 34f78e0..0000000
--- a/example/application/simpleapp/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.layout.json
+++ /dev/null
@@ -1,43 +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.
- */
-{
-    "columns": [
-        {
-            "span": 0,
-            "memberGroups": {}
-        },
-        {
-            "span": 0,
-            "memberGroups": {}
-        },
-        {
-            "span": 0,
-            "memberGroups": {}
-        },
-        {
-            "span": 12,
-            "collections": {
-                "objects": {
-                    "collectionLayout": {
-                        "render": "EAGERLY"
-                    }
-                }
-            }
-        }
-    ],
-    "actions": {}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.png
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.png b/example/application/simpleapp/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.png
deleted file mode 100644
index cb03785..0000000
Binary files a/example/application/simpleapp/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.java b/example/application/simpleapp/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.java
deleted file mode 100644
index a4fba6d..0000000
--- a/example/application/simpleapp/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.java
+++ /dev/null
@@ -1,149 +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 domainapp.dom.modules.simple;
-
-import javax.jdo.JDOHelper;
-import javax.jdo.annotations.IdentityType;
-import javax.jdo.annotations.VersionStrategy;
-
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.Identifier;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.BookmarkPolicy;
-import org.apache.isis.applib.annotation.DomainObject;
-import org.apache.isis.applib.annotation.DomainObjectLayout;
-import org.apache.isis.applib.annotation.Editing;
-import org.apache.isis.applib.annotation.Parameter;
-import org.apache.isis.applib.annotation.ParameterLayout;
-import org.apache.isis.applib.annotation.Property;
-import org.apache.isis.applib.annotation.Title;
-import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
-import org.apache.isis.applib.services.i18n.TranslatableString;
-import org.apache.isis.applib.util.ObjectContracts;
-
-@javax.jdo.annotations.PersistenceCapable(
-        identityType=IdentityType.DATASTORE,
-        schema = "simple",
-        table = "SimpleObject"
-)
-@javax.jdo.annotations.DatastoreIdentity(
-        strategy=javax.jdo.annotations.IdGeneratorStrategy.IDENTITY,
-         column="id")
-@javax.jdo.annotations.Version(
-        strategy=VersionStrategy.VERSION_NUMBER, 
-        column="version")
-@javax.jdo.annotations.Queries({
-        @javax.jdo.annotations.Query(
-                name = "find", language = "JDOQL",
-                value = "SELECT "
-                        + "FROM domainapp.dom.modules.simple.SimpleObject "),
-        @javax.jdo.annotations.Query(
-                name = "findByName", language = "JDOQL",
-                value = "SELECT "
-                        + "FROM domainapp.dom.modules.simple.SimpleObject "
-                        + "WHERE name.indexOf(:name) >= 0 ")
-})
-@javax.jdo.annotations.Unique(name="SimpleObject_name_UNQ", members = {"name"})
-@DomainObject
-@DomainObjectLayout(
-        bookmarking = BookmarkPolicy.AS_ROOT,
-        cssClassFa = "fa-flag"
-)
-public class SimpleObject implements Comparable<SimpleObject> {
-
-
-    //region > identificatiom
-    public TranslatableString title() {
-        return TranslatableString.tr("Object: {name}", "name", getName());
-    }
-    //endregion
-
-    //region > name (property)
-
-    private String name;
-
-    @javax.jdo.annotations.Column(allowsNull="false", length = 40)
-    @Title(sequence="1")
-    @Property(
-            editing = Editing.DISABLED
-    )
-    public String getName() {
-        return name;
-    }
-
-    public void setName(final String name) {
-        this.name = name;
-    }
-
-    // endregion
-
-    //region > updateName (action)
-
-    public static class UpdateNameDomainEvent extends ActionDomainEvent<SimpleObject> {
-        public UpdateNameDomainEvent(final SimpleObject source, final Identifier identifier, final Object... arguments) {
-            super(source, identifier, arguments);
-        }
-    }
-
-    @Action(
-            domainEvent = UpdateNameDomainEvent.class
-    )
-    public SimpleObject updateName(
-            @Parameter(maxLength = 40)
-            @ParameterLayout(named = "New name")
-            final String name) {
-        setName(name);
-        return this;
-    }
-
-    public String default0UpdateName() {
-        return getName();
-    }
-
-    public TranslatableString validateUpdateName(final String name) {
-        return name.contains("!")? TranslatableString.tr("Exclamation mark is not allowed"): null;
-    }
-
-    //endregion
-
-    //region > version (derived property)
-    public Long getVersionSequence() {
-        return (Long) JDOHelper.getVersion(this);
-    }
-    //endregion
-
-    //region > compareTo
-
-    @Override
-    public int compareTo(final SimpleObject other) {
-        return ObjectContracts.compare(this, other, "name");
-    }
-
-    //endregion
-
-    //region > injected services
-
-    @javax.inject.Inject
-    @SuppressWarnings("unused")
-    private DomainObjectContainer container;
-
-    //endregion
-
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.layout.json
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.layout.json b/example/application/simpleapp/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.layout.json
deleted file mode 100644
index 3d5e23f..0000000
--- a/example/application/simpleapp/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.layout.json
+++ /dev/null
@@ -1,56 +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.
- */
-{
-    "columns": [
-        {
-            "span": 6,
-            "memberGroups": {
-                "General": {
-                    "members": {
-                        "name": {
-                            "actions": {
-                                "updateName": {
-                                    "actionLayout": {
-                                        "position": "BOTTOM"
-                                    }
-                                }
-                            }
-                        },
-                        "versionSequence": {
-                            "propertyLayout": {
-                                "name": "version"
-                            }
-                        }
-                    }
-                }
-            }
-        },
-        {
-            "span": 0,
-            "memberGroups": {}
-        },
-        {
-            "span": 0,
-            "memberGroups": {}
-        },
-        {
-            "span": 6,
-            "collections": {}
-        }
-    ],
-    "actions": {}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.png
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.png b/example/application/simpleapp/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.png
deleted file mode 100644
index 0bd6f57..0000000
Binary files a/example/application/simpleapp/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/dom/src/main/java/domainapp/dom/modules/simple/SimpleObjects.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/modules/simple/SimpleObjects.java b/example/application/simpleapp/dom/src/main/java/domainapp/dom/modules/simple/SimpleObjects.java
deleted file mode 100644
index 0634dd1..0000000
--- a/example/application/simpleapp/dom/src/main/java/domainapp/dom/modules/simple/SimpleObjects.java
+++ /dev/null
@@ -1,107 +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 domainapp.dom.modules.simple;
-
-import java.util.List;
-
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.Identifier;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.BookmarkPolicy;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.DomainServiceLayout;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.ParameterLayout;
-import org.apache.isis.applib.annotation.SemanticsOf;
-import org.apache.isis.applib.query.QueryDefault;
-import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
-import org.apache.isis.applib.services.i18n.TranslatableString;
-
-@DomainService(repositoryFor = SimpleObject.class)
-@DomainServiceLayout(menuOrder = "10")
-public class SimpleObjects {
-
-    //region > title
-    public TranslatableString title() {
-        return TranslatableString.tr("Simple Objects");
-    }
-    //endregion
-
-    //region > listAll (action)
-    @Action(
-            semantics = SemanticsOf.SAFE
-    )
-    @ActionLayout(
-            bookmarking = BookmarkPolicy.AS_ROOT
-    )
-    @MemberOrder(sequence = "1")
-    public List<SimpleObject> listAll() {
-        return container.allInstances(SimpleObject.class);
-    }
-    //endregion
-
-    //region > findByName (action)
-    @Action(
-            semantics = SemanticsOf.SAFE
-    )
-    @ActionLayout(
-            bookmarking = BookmarkPolicy.AS_ROOT
-    )
-    @MemberOrder(sequence = "2")
-    public List<SimpleObject> findByName(
-            @ParameterLayout(named="Name")
-            final String name
-    ) {
-        return container.allMatches(
-                new QueryDefault<>(
-                        SimpleObject.class,
-                        "findByName",
-                        "name", name));
-    }
-    //endregion
-
-    //region > create (action)
-    public static class CreateDomainEvent extends ActionDomainEvent<SimpleObjects> {
-        public CreateDomainEvent(final SimpleObjects source, final Identifier identifier, final Object... arguments) {
-            super(source, identifier, arguments);
-        }
-    }
-
-    @Action(
-            domainEvent = CreateDomainEvent.class
-    )
-    @MemberOrder(sequence = "3")
-    public SimpleObject create(
-            final @ParameterLayout(named="Name") String name) {
-        final SimpleObject obj = container.newTransientInstance(SimpleObject.class);
-        obj.setName(name);
-        container.persistIfNotAlready(obj);
-        return obj;
-    }
-
-    //endregion
-
-    //region > injected services
-
-    @javax.inject.Inject 
-    DomainObjectContainer container;
-
-    //endregion
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/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
new file mode 100644
index 0000000..1bd9c35
--- /dev/null
+++ b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
@@ -0,0 +1,149 @@
+/*
+ *  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.simple;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.annotations.IdentityType;
+import javax.jdo.annotations.VersionStrategy;
+
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.Identifier;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.BookmarkPolicy;
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.DomainObjectLayout;
+import org.apache.isis.applib.annotation.Editing;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.Title;
+import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
+import org.apache.isis.applib.services.i18n.TranslatableString;
+import org.apache.isis.applib.util.ObjectContracts;
+
+@javax.jdo.annotations.PersistenceCapable(
+        identityType=IdentityType.DATASTORE,
+        schema = "simple",
+        table = "SimpleObject"
+)
+@javax.jdo.annotations.DatastoreIdentity(
+        strategy=javax.jdo.annotations.IdGeneratorStrategy.IDENTITY,
+         column="id")
+@javax.jdo.annotations.Version(
+        strategy=VersionStrategy.VERSION_NUMBER, 
+        column="version")
+@javax.jdo.annotations.Queries({
+        @javax.jdo.annotations.Query(
+                name = "find", language = "JDOQL",
+                value = "SELECT "
+                        + "FROM domainapp.dom.modules.simple.SimpleObject "),
+        @javax.jdo.annotations.Query(
+                name = "findByName", language = "JDOQL",
+                value = "SELECT "
+                        + "FROM domainapp.dom.modules.simple.SimpleObject "
+                        + "WHERE name.indexOf(:name) >= 0 ")
+})
+@javax.jdo.annotations.Unique(name="SimpleObject_name_UNQ", members = {"name"})
+@DomainObject
+@DomainObjectLayout(
+        bookmarking = BookmarkPolicy.AS_ROOT,
+        cssClassFa = "fa-flag"
+)
+public class SimpleObject implements Comparable<SimpleObject> {
+
+
+    //region > identificatiom
+    public TranslatableString title() {
+        return TranslatableString.tr("Object: {name}", "name", getName());
+    }
+    //endregion
+
+    //region > name (property)
+
+    private String name;
+
+    @javax.jdo.annotations.Column(allowsNull="false", length = 40)
+    @Title(sequence="1")
+    @Property(
+            editing = Editing.DISABLED
+    )
+    public String getName() {
+        return name;
+    }
+
+    public void setName(final String name) {
+        this.name = name;
+    }
+
+    // endregion
+
+    //region > updateName (action)
+
+    public static class UpdateNameDomainEvent extends ActionDomainEvent<SimpleObject> {
+        public UpdateNameDomainEvent(final SimpleObject source, final Identifier identifier, final Object... arguments) {
+            super(source, identifier, arguments);
+        }
+    }
+
+    @Action(
+            domainEvent = UpdateNameDomainEvent.class
+    )
+    public SimpleObject updateName(
+            @Parameter(maxLength = 40)
+            @ParameterLayout(named = "New name")
+            final String name) {
+        setName(name);
+        return this;
+    }
+
+    public String default0UpdateName() {
+        return getName();
+    }
+
+    public TranslatableString validateUpdateName(final String name) {
+        return name.contains("!")? TranslatableString.tr("Exclamation mark is not allowed"): null;
+    }
+
+    //endregion
+
+    //region > version (derived property)
+    public Long getVersionSequence() {
+        return (Long) JDOHelper.getVersion(this);
+    }
+    //endregion
+
+    //region > compareTo
+
+    @Override
+    public int compareTo(final SimpleObject other) {
+        return ObjectContracts.compare(this, other, "name");
+    }
+
+    //endregion
+
+    //region > injected services
+
+    @javax.inject.Inject
+    @SuppressWarnings("unused")
+    private DomainObjectContainer container;
+
+    //endregion
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.json
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.json b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.json
new file mode 100644
index 0000000..3d5e23f
--- /dev/null
+++ b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.json
@@ -0,0 +1,56 @@
+/**
+ *  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.
+ */
+{
+    "columns": [
+        {
+            "span": 6,
+            "memberGroups": {
+                "General": {
+                    "members": {
+                        "name": {
+                            "actions": {
+                                "updateName": {
+                                    "actionLayout": {
+                                        "position": "BOTTOM"
+                                    }
+                                }
+                            }
+                        },
+                        "versionSequence": {
+                            "propertyLayout": {
+                                "name": "version"
+                            }
+                        }
+                    }
+                }
+            }
+        },
+        {
+            "span": 0,
+            "memberGroups": {}
+        },
+        {
+            "span": 0,
+            "memberGroups": {}
+        },
+        {
+            "span": 6,
+            "collections": {}
+        }
+    ],
+    "actions": {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.png
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.png b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.png
new file mode 100644
index 0000000..0bd6f57
Binary files /dev/null and b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.png differ

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObjects.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObjects.java b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObjects.java
new file mode 100644
index 0000000..ea629d5
--- /dev/null
+++ b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObjects.java
@@ -0,0 +1,107 @@
+/*
+ *  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.simple;
+
+import java.util.List;
+
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.Identifier;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.BookmarkPolicy;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.DomainServiceLayout;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.query.QueryDefault;
+import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
+import org.apache.isis.applib.services.i18n.TranslatableString;
+
+@DomainService(repositoryFor = SimpleObject.class)
+@DomainServiceLayout(menuOrder = "10")
+public class SimpleObjects {
+
+    //region > title
+    public TranslatableString title() {
+        return TranslatableString.tr("Simple Objects");
+    }
+    //endregion
+
+    //region > listAll (action)
+    @Action(
+            semantics = SemanticsOf.SAFE
+    )
+    @ActionLayout(
+            bookmarking = BookmarkPolicy.AS_ROOT
+    )
+    @MemberOrder(sequence = "1")
+    public List<SimpleObject> listAll() {
+        return container.allInstances(SimpleObject.class);
+    }
+    //endregion
+
+    //region > findByName (action)
+    @Action(
+            semantics = SemanticsOf.SAFE
+    )
+    @ActionLayout(
+            bookmarking = BookmarkPolicy.AS_ROOT
+    )
+    @MemberOrder(sequence = "2")
+    public List<SimpleObject> findByName(
+            @ParameterLayout(named="Name")
+            final String name
+    ) {
+        return container.allMatches(
+                new QueryDefault<>(
+                        SimpleObject.class,
+                        "findByName",
+                        "name", name));
+    }
+    //endregion
+
+    //region > create (action)
+    public static class CreateDomainEvent extends ActionDomainEvent<SimpleObjects> {
+        public CreateDomainEvent(final SimpleObjects source, final Identifier identifier, final Object... arguments) {
+            super(source, identifier, arguments);
+        }
+    }
+
+    @Action(
+            domainEvent = CreateDomainEvent.class
+    )
+    @MemberOrder(sequence = "3")
+    public SimpleObject create(
+            final @ParameterLayout(named="Name") String name) {
+        final SimpleObject obj = container.newTransientInstance(SimpleObject.class);
+        obj.setName(name);
+        container.persistIfNotAlready(obj);
+        return obj;
+    }
+
+    //endregion
+
+    //region > injected services
+
+    @javax.inject.Inject 
+    DomainObjectContainer container;
+
+    //endregion
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectTest.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectTest.java b/example/application/simpleapp/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectTest.java
deleted file mode 100644
index e29b3f2..0000000
--- a/example/application/simpleapp/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectTest.java
+++ /dev/null
@@ -1,49 +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 domainapp.dom.modules.simple;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class SimpleObjectTest {
-
-    SimpleObject simpleObject;
-
-    @Before
-    public void setUp() throws Exception {
-        simpleObject = new SimpleObject();
-    }
-
-    public static class Name extends SimpleObjectTest {
-
-        @Test
-        public void happyCase() throws Exception {
-            // given
-            String name = "Foobar";
-            assertThat(simpleObject.getName()).isNull();
-
-            // when
-            simpleObject.setName(name);
-
-            // then
-            assertThat(simpleObject.getName()).isEqualTo(name);
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectsTest.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectsTest.java b/example/application/simpleapp/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectsTest.java
deleted file mode 100644
index a41d25a..0000000
--- a/example/application/simpleapp/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectsTest.java
+++ /dev/null
@@ -1,104 +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 domainapp.dom.modules.simple;
-
-import java.util.List;
-
-import com.google.common.collect.Lists;
-
-import org.jmock.Expectations;
-import org.jmock.Sequence;
-import org.jmock.auto.Mock;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class SimpleObjectsTest {
-
-    @Rule
-    public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
-
-    @Mock
-    DomainObjectContainer mockContainer;
-    
-    SimpleObjects simpleObjects;
-
-    @Before
-    public void setUp() throws Exception {
-        simpleObjects = new SimpleObjects();
-        simpleObjects.container = mockContainer;
-    }
-
-    public static class Create extends SimpleObjectsTest {
-
-        @Test
-        public void happyCase() throws Exception {
-
-            // given
-            final SimpleObject simpleObject = new SimpleObject();
-
-            final Sequence seq = context.sequence("create");
-            context.checking(new Expectations() {
-                {
-                    oneOf(mockContainer).newTransientInstance(SimpleObject.class);
-                    inSequence(seq);
-                    will(returnValue(simpleObject));
-
-                    oneOf(mockContainer).persistIfNotAlready(simpleObject);
-                    inSequence(seq);
-                }
-            });
-
-            // when
-            final SimpleObject obj = simpleObjects.create("Foobar");
-
-            // then
-            assertThat(obj).isEqualTo(simpleObject);
-            assertThat(obj.getName()).isEqualTo("Foobar");
-        }
-
-    }
-
-    public static class ListAll extends SimpleObjectsTest {
-
-        @Test
-        public void happyCase() throws Exception {
-
-            // given
-            final List<SimpleObject> all = Lists.newArrayList();
-
-            context.checking(new Expectations() {
-                {
-                    oneOf(mockContainer).allInstances(SimpleObject.class);
-                    will(returnValue(all));
-                }
-            });
-
-            // when
-            final List<SimpleObject> list = simpleObjects.listAll();
-
-            // then
-            assertThat(list).isEqualTo(all);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/dom/src/test/java/domainapp/dom/simple/SimpleObjectTest.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/test/java/domainapp/dom/simple/SimpleObjectTest.java b/example/application/simpleapp/dom/src/test/java/domainapp/dom/simple/SimpleObjectTest.java
new file mode 100644
index 0000000..b9dbcb4
--- /dev/null
+++ b/example/application/simpleapp/dom/src/test/java/domainapp/dom/simple/SimpleObjectTest.java
@@ -0,0 +1,49 @@
+/**
+ *  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.simple;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class SimpleObjectTest {
+
+    SimpleObject simpleObject;
+
+    @Before
+    public void setUp() throws Exception {
+        simpleObject = new SimpleObject();
+    }
+
+    public static class Name extends SimpleObjectTest {
+
+        @Test
+        public void happyCase() throws Exception {
+            // given
+            String name = "Foobar";
+            assertThat(simpleObject.getName()).isNull();
+
+            // when
+            simpleObject.setName(name);
+
+            // then
+            assertThat(simpleObject.getName()).isEqualTo(name);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/dom/src/test/java/domainapp/dom/simple/SimpleObjectsTest.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/test/java/domainapp/dom/simple/SimpleObjectsTest.java b/example/application/simpleapp/dom/src/test/java/domainapp/dom/simple/SimpleObjectsTest.java
new file mode 100644
index 0000000..13dce0b
--- /dev/null
+++ b/example/application/simpleapp/dom/src/test/java/domainapp/dom/simple/SimpleObjectsTest.java
@@ -0,0 +1,104 @@
+/**
+ *  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.simple;
+
+import java.util.List;
+
+import com.google.common.collect.Lists;
+
+import org.jmock.Expectations;
+import org.jmock.Sequence;
+import org.jmock.auto.Mock;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
+import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class SimpleObjectsTest {
+
+    @Rule
+    public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
+
+    @Mock
+    DomainObjectContainer mockContainer;
+    
+    SimpleObjects simpleObjects;
+
+    @Before
+    public void setUp() throws Exception {
+        simpleObjects = new SimpleObjects();
+        simpleObjects.container = mockContainer;
+    }
+
+    public static class Create extends SimpleObjectsTest {
+
+        @Test
+        public void happyCase() throws Exception {
+
+            // given
+            final SimpleObject simpleObject = new SimpleObject();
+
+            final Sequence seq = context.sequence("create");
+            context.checking(new Expectations() {
+                {
+                    oneOf(mockContainer).newTransientInstance(SimpleObject.class);
+                    inSequence(seq);
+                    will(returnValue(simpleObject));
+
+                    oneOf(mockContainer).persistIfNotAlready(simpleObject);
+                    inSequence(seq);
+                }
+            });
+
+            // when
+            final SimpleObject obj = simpleObjects.create("Foobar");
+
+            // then
+            assertThat(obj).isEqualTo(simpleObject);
+            assertThat(obj.getName()).isEqualTo("Foobar");
+        }
+
+    }
+
+    public static class ListAll extends SimpleObjectsTest {
+
+        @Test
+        public void happyCase() throws Exception {
+
+            // given
+            final List<SimpleObject> all = Lists.newArrayList();
+
+            context.checking(new Expectations() {
+                {
+                    oneOf(mockContainer).allInstances(SimpleObject.class);
+                    will(returnValue(all));
+                }
+            });
+
+            // when
+            final List<SimpleObject> list = simpleObjects.listAll();
+
+            // then
+            assertThat(list).isEqualTo(all);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectCreate.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectCreate.java b/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectCreate.java
index 926217d..b23f2be 100644
--- a/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectCreate.java
+++ b/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectCreate.java
@@ -21,8 +21,8 @@ package domainapp.fixture.modules.simple;
 
 import org.apache.isis.applib.fixturescripts.FixtureScript;
 
-import domainapp.dom.modules.simple.SimpleObject;
-import domainapp.dom.modules.simple.SimpleObjects;
+import domainapp.dom.simple.SimpleObject;
+import domainapp.dom.simple.SimpleObjects;
 
 public class SimpleObjectCreate extends FixtureScript {
 

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java b/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java
index 072769e..6b8943b 100644
--- a/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java
+++ b/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java
@@ -27,7 +27,7 @@ import com.google.common.collect.Lists;
 
 import org.apache.isis.applib.fixturescripts.FixtureScript;
 
-import domainapp.dom.modules.simple.SimpleObject;
+import domainapp.dom.simple.SimpleObject;
 import domainapp.fixture.modules.simple.SimpleObjectCreate;
 import domainapp.fixture.modules.simple.SimpleObjectsTearDown;
 

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/glob/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/glob/pom.xml b/example/application/simpleapp/glob/pom.xml
new file mode 100644
index 0000000..0281d43
--- /dev/null
+++ b/example/application/simpleapp/glob/pom.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<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/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.isis.example.application</groupId>
+        <artifactId>simpleapp</artifactId>
+        <version>1.9.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>simpleapp-glob</artifactId>
+    <name>Simple App Glob</name>
+
+    <build>
+        <resources>
+            <resource>
+                <filtering>false</filtering>
+                <directory>src/main/resources</directory>
+            </resource>
+            <resource>
+                <filtering>false</filtering>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**</include>
+                </includes>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </resource>
+        </resources>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>simpleapp-dom</artifactId>
+            <exclusions>
+                <exclusion>
+                    <!-- so don't pick up transitive dependency to asm 4.0.0 -->
+                    <groupId>org.datanucleus</groupId>
+                    <artifactId>datanucleus-enhancer</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>simpleapp-fixture</artifactId>
+            <exclusions>
+                <exclusion>
+                    <!-- so don't pick up transitive dependency to asm 4.0.0 -->
+                    <groupId>org.datanucleus</groupId>
+                    <artifactId>datanucleus-enhancer</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+    </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpec.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpec.java b/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpec.java
new file mode 100644
index 0000000..552cd32
--- /dev/null
+++ b/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpec.java
@@ -0,0 +1,60 @@
+/*
+ *  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.glob;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.isis.applib.GlobSpec;
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+import domainapp.dom.DomainAppDomainModule;
+
+public final class DomainAppGlobSpec implements GlobSpec {
+
+    @Override
+    public List<Class<?>> getModules() {
+        return Arrays.asList(
+                DomainAppDomainModule.class,
+                DomainAppGlobSpec.class
+        );
+    }
+
+    @Override
+    public String getAuthenticationMechanism() {
+        return null;
+    }
+
+    @Override
+    public String getAuthorizationMechanism() {
+        return null;
+    }
+
+    @Override
+    public List<FixtureScript> getFixtures() {
+        return null;
+    }
+
+    @Override
+    public Map<String, String> getConfiguration() {
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageService.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageService.java b/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageService.java
new file mode 100644
index 0000000..3870c27
--- /dev/null
+++ b/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageService.java
@@ -0,0 +1,51 @@
+/*
+ *  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.glob.app.homepage;
+
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.HomePage;
+import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+@DomainService(
+        nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY // trick to suppress the actions from the top-level menu
+)
+public class HomePageService {
+
+    //region > homePage (action)
+
+    @Action(
+            semantics = SemanticsOf.SAFE
+    )
+    @HomePage
+    public HomePageViewModel homePage() {
+        return container.injectServicesInto(new HomePageViewModel());
+    }
+
+    //endregion
+
+    //region > injected services
+
+    @javax.inject.Inject
+    DomainObjectContainer container;
+
+    //endregion
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.java b/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.java
new file mode 100644
index 0000000..c7c584c
--- /dev/null
+++ b/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.java
@@ -0,0 +1,50 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by 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.glob.app.homepage;
+
+import java.util.List;
+
+import org.apache.isis.applib.annotation.ViewModel;
+
+import domainapp.dom.simple.SimpleObject;
+import domainapp.dom.simple.SimpleObjects;
+
+@ViewModel
+public class HomePageViewModel {
+
+    //region > title
+    public String title() {
+        return getObjects().size() + " objects";
+    }
+    //endregion
+
+    //region > object (collection)
+    @org.apache.isis.applib.annotation.HomePage
+    public List<SimpleObject> getObjects() {
+        return simpleObjects.listAll();
+    }
+    //endregion
+
+    //region > injected services
+
+    @javax.inject.Inject
+    SimpleObjects simpleObjects;
+
+    //endregion
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.layout.json
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.layout.json b/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.layout.json
new file mode 100644
index 0000000..34f78e0
--- /dev/null
+++ b/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.layout.json
@@ -0,0 +1,43 @@
+/**
+ *  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.
+ */
+{
+    "columns": [
+        {
+            "span": 0,
+            "memberGroups": {}
+        },
+        {
+            "span": 0,
+            "memberGroups": {}
+        },
+        {
+            "span": 0,
+            "memberGroups": {}
+        },
+        {
+            "span": 12,
+            "collections": {
+                "objects": {
+                    "collectionLayout": {
+                        "render": "EAGERLY"
+                    }
+                }
+            }
+        }
+    ],
+    "actions": {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.png
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.png b/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.png
new file mode 100644
index 0000000..cb03785
Binary files /dev/null and b/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.png differ

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/integtests/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/integtests/pom.xml b/example/application/simpleapp/integtests/pom.xml
index cc7ad71..d40db1d 100644
--- a/example/application/simpleapp/integtests/pom.xml
+++ b/example/application/simpleapp/integtests/pom.xml
@@ -83,10 +83,9 @@
     </build>
     <dependencies>
 
-        <!-- other modules in this project -->
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>simpleapp-fixture</artifactId>
+            <artifactId>simpleapp-glob</artifactId>
         </dependency>
 
         <dependency>

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/specglue/modules/simple/SimpleObjectGlue.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/specglue/modules/simple/SimpleObjectGlue.java b/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/specglue/modules/simple/SimpleObjectGlue.java
index 63d96bd..8263915 100644
--- a/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/specglue/modules/simple/SimpleObjectGlue.java
+++ b/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/specglue/modules/simple/SimpleObjectGlue.java
@@ -23,8 +23,8 @@ import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
 
 import cucumber.api.java.en.Given;
 import cucumber.api.java.en.When;
-import domainapp.dom.modules.simple.SimpleObject;
-import domainapp.dom.modules.simple.SimpleObjects;
+import domainapp.dom.simple.SimpleObject;
+import domainapp.dom.simple.SimpleObjects;
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
 

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectIntegTest.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectIntegTest.java b/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectIntegTest.java
index 610136b..5abc8cd 100644
--- a/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectIntegTest.java
+++ b/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectIntegTest.java
@@ -28,7 +28,7 @@ import org.apache.isis.applib.fixturescripts.FixtureScripts;
 import org.apache.isis.applib.services.wrapper.DisabledException;
 import org.apache.isis.applib.services.wrapper.InvalidException;
 
-import domainapp.dom.modules.simple.SimpleObject;
+import domainapp.dom.simple.SimpleObject;
 import domainapp.fixture.scenarios.RecreateSimpleObjects;
 import domainapp.integtests.tests.SimpleAppIntegTest;
 import static org.assertj.core.api.Assertions.assertThat;

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java b/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java
index fd3b0ff..db6e3c1 100644
--- a/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java
+++ b/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java
@@ -33,8 +33,8 @@ import org.junit.Test;
 import org.apache.isis.applib.fixturescripts.FixtureScript;
 import org.apache.isis.applib.fixturescripts.FixtureScripts;
 
-import domainapp.dom.modules.simple.SimpleObject;
-import domainapp.dom.modules.simple.SimpleObjects;
+import domainapp.dom.simple.SimpleObject;
+import domainapp.dom.simple.SimpleObjects;
 import domainapp.fixture.modules.simple.SimpleObjectsTearDown;
 import domainapp.fixture.scenarios.RecreateSimpleObjects;
 import domainapp.integtests.tests.SimpleAppIntegTest;

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/pom.xml b/example/application/simpleapp/pom.xml
index 9c2442d..9ac4077 100644
--- a/example/application/simpleapp/pom.xml
+++ b/example/application/simpleapp/pom.xml
@@ -334,6 +334,7 @@
     <modules>
         <module>dom</module>
         <module>fixture</module>
+        <module>glob</module>
         <module>integtests</module>
         <module>webapp</module>
     </modules>
@@ -377,6 +378,11 @@
             </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
+                <artifactId>simpleapp-glob</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>${project.groupId}</groupId>
                 <artifactId>simpleapp-webapp</artifactId>
                 <version>${project.version}</version>
             </dependency>

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/webapp/pom.xml b/example/application/simpleapp/webapp/pom.xml
index 1112924..006583c 100644
--- a/example/application/simpleapp/webapp/pom.xml
+++ b/example/application/simpleapp/webapp/pom.xml
@@ -143,28 +143,9 @@
 
     <dependencies>
     
-        <!-- other modules in this project -->
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>simpleapp-dom</artifactId>
-            <exclusions>
-                <exclusion>
-                    <!-- so don't pick up transitive dependency to asm 4.0.0 -->
-                    <groupId>org.datanucleus</groupId>
-                    <artifactId>datanucleus-enhancer</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>simpleapp-fixture</artifactId>
-            <exclusions>
-                <exclusion>
-                    <!-- so don't pick up transitive dependency to asm 4.0.0 -->
-                    <groupId>org.datanucleus</groupId>
-                    <artifactId>datanucleus-enhancer</artifactId>
-                </exclusion>
-            </exclusions>
+            <artifactId>simpleapp-glob</artifactId>
         </dependency>
         
         <!-- other isis components -->

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
index 929d177..0ec356a 100644
--- a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
+++ b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -38,11 +38,10 @@
 
 
 #
-# configure the persistor (object store) to use
 #
+#
+isis.globspec=domainapp.glob.DomainAppGlobSpec
 
-# JDO/DataNucleus objectstore
-isis.persistor=datanucleus
 
 
 

http://git-wip-us.apache.org/repos/asf/isis/blob/6ccf96c9/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
index 675ced3..f27533c 100644
--- a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
+++ b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
@@ -21,7 +21,7 @@
 
 # identifies @PersistenceCapable entities to be eagerly registered
 # if move class to other package (eg com.mycompany.myapp.dom) then update 
-isis.persistor.datanucleus.RegisterEntities.packagePrefix=domainapp.dom.modules
+isis.persistor.datanucleus.RegisterEntities.packagePrefix=domainapp.dom
 
 #
 # hook to perform additional initialization when JDO class metadata is loaded


[05/17] isis git commit: ISIS-1188: pass runtimeContext into PersistenceSessionFactory, perform some basic wiring in constructor.

Posted by da...@apache.org.
ISIS-1188: pass runtimeContext into PersistenceSessionFactory, perform some basic wiring in constructor.


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

Branch: refs/heads/master
Commit: d3eb90a7ac7e90a521b13e8cc93a5483e0eba526
Parents: 78dbc9a
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Aug 5 18:47:46 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Aug 5 18:47:46 2015 +0100

----------------------------------------------------------------------
 .../IsisComponentProviderDefault.java           | 15 +----
 .../JavaReflectorInstallerNoDecorators.java     |  2 +-
 .../PersistenceMechanismInstaller.java          |  6 +-
 .../persistence/PersistenceSessionFactory.java  | 58 ++++++++------------
 .../IsisComponentProviderUsingInstallers.java   |  4 +-
 ...ataNucleusPersistenceMechanismInstaller.java |  9 ++-
 6 files changed, 38 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/d3eb90a7/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
index 17f6f4b..7290190 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
@@ -45,7 +45,6 @@ import org.apache.isis.core.runtime.authorization.AuthorizationManager;
 import org.apache.isis.core.runtime.authorization.standard.AuthorizationManagerStandard;
 import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
 import org.apache.isis.core.runtime.fixtures.FixturesInstallerFromConfiguration;
-import org.apache.isis.core.runtime.installerregistry.installerapi.PersistenceMechanismInstaller;
 import org.apache.isis.core.runtime.services.ServicesInstallerFromConfiguration;
 import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.core.runtime.system.IsisSystemException;
@@ -179,14 +178,10 @@ public class IsisComponentProviderDefault implements IsisComponentProvider {
         return new MetaModelValidatorDefault();
     }
 
-    /**
-     * Optional hook method.
-     */
     protected List<LayoutMetadataReader> obtainLayoutMetadataReaders() {
         return Lists.<LayoutMetadataReader>newArrayList(new LayoutMetadataReaderFromJson());
     }
 
-
     /**
      * The standard authentication manager, configured with the default authenticator (allows all requests through).
      */
@@ -210,16 +205,8 @@ public class IsisComponentProviderDefault implements IsisComponentProvider {
     public PersistenceSessionFactory providePersistenceSessionFactory(
             DeploymentType deploymentType,
             final ServicesInjectorSpi servicesInjectorSpi) throws IsisSystemException {
-        PersistenceMechanismInstaller installer =
-                createPersistenceMechanismInstaller(getConfiguration());
-        return installer.createPersistenceSessionFactory(deploymentType, servicesInjectorSpi);
-    }
-
-    private PersistenceMechanismInstaller createPersistenceMechanismInstaller(IsisConfiguration configuration) throws IsisSystemException {
         DataNucleusPersistenceMechanismInstaller installer = new DataNucleusPersistenceMechanismInstaller();
-        installer.setConfiguration(configuration);
-        return installer;
+        return installer.createPersistenceSessionFactory(deploymentType, servicesInjectorSpi, getConfiguration());
     }
 
-
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/d3eb90a7/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 3841e4d..ba36810 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
@@ -45,7 +45,7 @@ import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidator;
 
 /**
  * An implementation of {@link ObjectReflectorInstaller} without support for {@link FacetDecoratorInstaller}
- * being looked up (since this functionality is only available from <tt>runtimes.dflt</tt>).
+ * being looked up (since this functionality is only available from <tt>core.runtime</tt>).
  */
 public class JavaReflectorInstallerNoDecorators extends InstallerAbstract implements ObjectReflectorInstaller {
 

http://git-wip-us.apache.org/repos/asf/isis/blob/d3eb90a7/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/installerapi/PersistenceMechanismInstaller.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/installerapi/PersistenceMechanismInstaller.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/installerapi/PersistenceMechanismInstaller.java
index 6044b83..2626acd 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/installerapi/PersistenceMechanismInstaller.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/installerapi/PersistenceMechanismInstaller.java
@@ -20,6 +20,7 @@
 package org.apache.isis.core.runtime.installerregistry.installerapi;
 
 import org.apache.isis.core.commons.components.Installer;
+import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
 import org.apache.isis.core.runtime.persistence.ObjectStoreFactory;
 import org.apache.isis.core.runtime.system.DeploymentType;
@@ -33,6 +34,9 @@ public interface PersistenceMechanismInstaller extends Installer, ObjectStoreFac
 
     static String TYPE = "persistor";
 
-    PersistenceSessionFactory createPersistenceSessionFactory(DeploymentType deploymentType, final ServicesInjectorSpi services);
+    PersistenceSessionFactory createPersistenceSessionFactory(
+            DeploymentType deploymentType,
+            final ServicesInjectorSpi services,
+            final IsisConfiguration configuration);
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/d3eb90a7/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
index 7f32d69..606cae0 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
@@ -30,7 +30,6 @@ import org.apache.isis.core.commons.components.ApplicationScopedComponent;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facetapi.MetaModelRefiner;
 import org.apache.isis.core.metamodel.progmodel.ProgrammingModel;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
 import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
 import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
 import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorComposite;
@@ -62,20 +61,40 @@ public class PersistenceSessionFactory implements MetaModelRefiner, ApplicationS
     private Boolean fixturesInstalled;
 
     private final ServicesInjectorSpi servicesInjector;
-    private RuntimeContext runtimeContext;
+    private RuntimeContextFromSession runtimeContext;
 
     public PersistenceSessionFactory(
             final DeploymentType deploymentType,
             final ServicesInjectorSpi servicesInjector,
             final IsisConfiguration isisConfiguration,
-            final ObjectStoreFactory objectStoreFactory) {
+            final ObjectStoreFactory objectStoreFactory,
+            final RuntimeContextFromSession runtimeContext) {
 
+        ensureThatState(deploymentType, is(notNullValue()));
         ensureThatState(servicesInjector, is(notNullValue()));
+        ensureThatState(isisConfiguration, is(not(nullValue())));
+        ensureThatState(objectStoreFactory, is(not(nullValue())));
+        ensureThatState(runtimeContext, is(not(nullValue())));
 
         this.deploymentType = deploymentType;
         this.configuration = isisConfiguration;
         this.objectStoreFactory = objectStoreFactory;
         this.servicesInjector = servicesInjector;
+        this.runtimeContext = runtimeContext;
+
+        final Properties properties = applicationPropertiesFrom(getConfiguration());
+        runtimeContext.setProperties(properties);
+    }
+
+    private static Properties applicationPropertiesFrom(final IsisConfiguration configuration) {
+        final Properties properties = new Properties();
+        final IsisConfiguration applicationConfiguration = configuration.getProperties("application");
+        for (final String key : applicationConfiguration) {
+            final String value = applicationConfiguration.getString(key);
+            final String newKey = key.substring("application.".length());
+            properties.setProperty(newKey, value);
+        }
+        return properties;
     }
 
     public DeploymentType getDeploymentType() {
@@ -88,12 +107,6 @@ public class PersistenceSessionFactory implements MetaModelRefiner, ApplicationS
 
     public PersistenceSession createPersistenceSession() {
 
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("installing " + this.getClass().getName());
-        }
-
-        ServicesInjectorSpi servicesInjector = getServicesInjector();
-
         final ObjectStore objectStore = objectStoreFactory.createObjectStore(getConfiguration());
         ensureThatArg(objectStore, is(not(nullValue())));
 
@@ -113,12 +126,8 @@ public class PersistenceSessionFactory implements MetaModelRefiner, ApplicationS
             FixtureClock.initialize();
         }
 
-        runtimeContext = createRuntimeContext(getConfiguration());
-        ensureThatState(runtimeContext, is(not(nullValue())));
-
-        // inject the specification loader etc.
         runtimeContext.injectInto(servicesInjector);
-        
+
         // wire up components
         getSpecificationLoader().injectInto(runtimeContext);
 
@@ -129,23 +138,6 @@ public class PersistenceSessionFactory implements MetaModelRefiner, ApplicationS
         servicesInjector.init();
     }
 
-    private RuntimeContext createRuntimeContext(final IsisConfiguration configuration) {
-        final RuntimeContextFromSession runtimeContext = new RuntimeContextFromSession();
-        final Properties properties = applicationPropertiesFrom(configuration);
-        runtimeContext.setProperties(properties);
-        return runtimeContext;
-    }
-
-    private static Properties applicationPropertiesFrom(final IsisConfiguration configuration) {
-        final Properties properties = new Properties();
-        final IsisConfiguration applicationConfiguration = configuration.getProperties("application");
-        for (final String key : applicationConfiguration) {
-            final String value = applicationConfiguration.getString(key);
-            final String newKey = key.substring("application.".length());
-            properties.setProperty(newKey, value);
-        }
-        return properties;
-    }
 
 
 
@@ -203,10 +195,6 @@ public class PersistenceSessionFactory implements MetaModelRefiner, ApplicationS
     }
     
     // //////////////////////////////////////////////////////
-    // Dependencies (injected via setters)
-    // //////////////////////////////////////////////////////
-
-    // //////////////////////////////////////////////////////
     // Dependencies (from context)
     // //////////////////////////////////////////////////////
 

http://git-wip-us.apache.org/repos/asf/isis/blob/d3eb90a7/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 a28dea3..7294c7f 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
@@ -147,13 +147,11 @@ public class IsisComponentProviderUsingInstallers implements IsisComponentProvid
     public SpecificationLoaderSpi provideSpecificationLoaderSpi(
             final DeploymentType deploymentType,
             final Collection<MetaModelRefiner> metaModelRefiners) throws IsisSystemException {
-
         return reflectorInstaller.createReflector(metaModelRefiners);
     }
 
     @Override
     public List<Object> obtainServices() {
-
         return servicesInstaller.getServices(getDeploymentType());
     }
 
@@ -161,7 +159,7 @@ public class IsisComponentProviderUsingInstallers implements IsisComponentProvid
     public PersistenceSessionFactory providePersistenceSessionFactory(
             final DeploymentType deploymentType,
             final ServicesInjectorSpi servicesInjectorSpi) throws IsisSystemException {
-        return persistenceMechanismInstaller.createPersistenceSessionFactory(deploymentType, servicesInjectorSpi);
+        return persistenceMechanismInstaller.createPersistenceSessionFactory(deploymentType, servicesInjectorSpi, getConfiguration());
     }
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/d3eb90a7/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusPersistenceMechanismInstaller.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusPersistenceMechanismInstaller.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusPersistenceMechanismInstaller.java
index f5a6f7c..042bc5e 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusPersistenceMechanismInstaller.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusPersistenceMechanismInstaller.java
@@ -35,6 +35,7 @@ import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
 import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
 import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorComposite;
 import org.apache.isis.core.runtime.installerregistry.installerapi.PersistenceMechanismInstaller;
+import org.apache.isis.core.runtime.persistence.internal.RuntimeContextFromSession;
 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.ObjectStore;
@@ -91,8 +92,12 @@ public class DataNucleusPersistenceMechanismInstaller extends InstallerAbstract
     //region > createPersistenceSessionFactory
     @Override
     public PersistenceSessionFactory createPersistenceSessionFactory(
-            final DeploymentType deploymentType, final ServicesInjectorSpi servicesInjector) {
-        return new PersistenceSessionFactory(deploymentType, servicesInjector, getConfiguration(), this);
+            final DeploymentType deploymentType,
+            final ServicesInjectorSpi servicesInjector,
+            final IsisConfiguration configuration) {
+        final RuntimeContextFromSession runtimeContext = new RuntimeContextFromSession();
+        DataNucleusPersistenceMechanismInstaller objectStoreFactory = this;
+        return new PersistenceSessionFactory(deploymentType, servicesInjector, configuration, objectStoreFactory, runtimeContext);
     }
     //endregion
 


[06/17] isis git commit: ISIS-1188: where how RuntimeContextFromSession is instantiated (and in particular, instantiate it only once, passing it from IsisSystem through to PersistenceMechanismInstaller and thence PersistenceSessionFactory).

Posted by da...@apache.org.
ISIS-1188: where how RuntimeContextFromSession is instantiated (and in particular, instantiate it only once, passing it from IsisSystem through to PersistenceMechanismInstaller and thence PersistenceSessionFactory).


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

Branch: refs/heads/master
Commit: 1ed4eef484f491491657d0d4142fee005de76b9f
Parents: d3eb90a
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Aug 5 19:34:25 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Aug 5 19:34:25 2015 +0100

----------------------------------------------------------------------
 .../IsisComponentProviderDefault.java           |  6 ++++--
 .../runtimecontext/RuntimeContextAbstract.java  |  2 +-
 .../PersistenceMechanismInstaller.java          | 12 +++++++----
 .../internal/RuntimeContextFromSession.java     | 22 +++++++++++++++++++-
 .../isis/core/runtime/system/IsisSystem.java    | 13 ++++--------
 .../persistence/PersistenceSessionFactory.java  | 15 -------------
 .../IsisComponentProvider.java                  |  4 +++-
 .../IsisComponentProviderUsingInstallers.java   |  6 ++++--
 ...ataNucleusPersistenceMechanismInstaller.java |  6 ++++--
 .../persistence/PersistenceSessionTest.java     |  2 +-
 10 files changed, 50 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/1ed4eef4/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
index 7290190..a6e677c 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
@@ -45,6 +45,7 @@ import org.apache.isis.core.runtime.authorization.AuthorizationManager;
 import org.apache.isis.core.runtime.authorization.standard.AuthorizationManagerStandard;
 import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
 import org.apache.isis.core.runtime.fixtures.FixturesInstallerFromConfiguration;
+import org.apache.isis.core.runtime.persistence.internal.RuntimeContextFromSession;
 import org.apache.isis.core.runtime.services.ServicesInstallerFromConfiguration;
 import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.core.runtime.system.IsisSystemException;
@@ -204,9 +205,10 @@ public class IsisComponentProviderDefault implements IsisComponentProvider {
     @Override
     public PersistenceSessionFactory providePersistenceSessionFactory(
             DeploymentType deploymentType,
-            final ServicesInjectorSpi servicesInjectorSpi) throws IsisSystemException {
+            final ServicesInjectorSpi servicesInjectorSpi,
+            final RuntimeContextFromSession runtimeContext) throws IsisSystemException {
         DataNucleusPersistenceMechanismInstaller installer = new DataNucleusPersistenceMechanismInstaller();
-        return installer.createPersistenceSessionFactory(deploymentType, servicesInjectorSpi, getConfiguration());
+        return installer.createPersistenceSessionFactory(deploymentType, servicesInjectorSpi, getConfiguration(), runtimeContext);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/1ed4eef4/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/RuntimeContextAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/RuntimeContextAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/RuntimeContextAbstract.java
index ea13704..a77be38 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/RuntimeContextAbstract.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/RuntimeContextAbstract.java
@@ -156,7 +156,7 @@ public abstract class RuntimeContextAbstract implements RuntimeContext, Specific
         });
     }
 
-    public void setProperties(final Properties properties) {
+    protected void setProperties(final Properties properties) {
         this.properties = properties;
     }
 

http://git-wip-us.apache.org/repos/asf/isis/blob/1ed4eef4/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/installerapi/PersistenceMechanismInstaller.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/installerapi/PersistenceMechanismInstaller.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/installerapi/PersistenceMechanismInstaller.java
index 2626acd..5cea3f5 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/installerapi/PersistenceMechanismInstaller.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/installerapi/PersistenceMechanismInstaller.java
@@ -21,8 +21,11 @@ package org.apache.isis.core.runtime.installerregistry.installerapi;
 
 import org.apache.isis.core.commons.components.Installer;
 import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.commons.config.IsisConfigurationBuilderAware;
+import org.apache.isis.core.metamodel.facetapi.MetaModelRefiner;
 import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
 import org.apache.isis.core.runtime.persistence.ObjectStoreFactory;
+import org.apache.isis.core.runtime.persistence.internal.RuntimeContextFromSession;
 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;
@@ -30,13 +33,14 @@ import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory
 /**
  * Installs a {@link PersistenceSession} during system start up.
  */
-public interface PersistenceMechanismInstaller extends Installer, ObjectStoreFactory {
+public interface PersistenceMechanismInstaller extends Installer, ObjectStoreFactory, IsisConfigurationBuilderAware,
+        MetaModelRefiner {
 
     static String TYPE = "persistor";
 
     PersistenceSessionFactory createPersistenceSessionFactory(
-            DeploymentType deploymentType,
-            final ServicesInjectorSpi services,
-            final IsisConfiguration configuration);
+            final DeploymentType deploymentType,
+            final ServicesInjectorSpi servicesInjector,
+            final IsisConfiguration configuration, final RuntimeContextFromSession runtimeContext);
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/1ed4eef4/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/internal/RuntimeContextFromSession.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/internal/RuntimeContextFromSession.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/internal/RuntimeContextFromSession.java
index a9c1495..06e97bd 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/internal/RuntimeContextFromSession.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/internal/RuntimeContextFromSession.java
@@ -20,6 +20,8 @@
 package org.apache.isis.core.runtime.persistence.internal;
 
 import java.util.List;
+import java.util.Properties;
+
 import org.apache.isis.applib.RecoverableException;
 import org.apache.isis.applib.profiles.Localization;
 import org.apache.isis.applib.query.Query;
@@ -28,6 +30,7 @@ import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.commons.authentication.AuthenticationSessionProvider;
 import org.apache.isis.core.commons.authentication.AuthenticationSessionProviderAbstract;
 import org.apache.isis.core.commons.authentication.MessageBroker;
+import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.adapter.DomainObjectServices;
 import org.apache.isis.core.metamodel.adapter.DomainObjectServicesAbstract;
 import org.apache.isis.core.metamodel.adapter.LocalizationProviderAbstract;
@@ -82,7 +85,12 @@ public class RuntimeContextFromSession extends RuntimeContextAbstract {
     // Constructor
     // //////////////////////////////////////////////////////////////////
 
-    public RuntimeContextFromSession() {
+
+    public RuntimeContextFromSession(final IsisConfiguration configuration) {
+
+        final Properties properties = applicationPropertiesFrom(configuration);
+        setProperties(properties);
+
         this.authenticationSessionProvider = new AuthenticationSessionProviderAbstract() {
 
             @Override
@@ -308,6 +316,18 @@ public class RuntimeContextFromSession extends RuntimeContextAbstract {
         };
     }
 
+    private static Properties applicationPropertiesFrom(final IsisConfiguration configuration) {
+        final Properties properties = new Properties();
+        final IsisConfiguration applicationConfiguration = configuration.getProperties("application");
+        for (final String key : applicationConfiguration) {
+            final String value = applicationConfiguration.getString(key);
+            final String newKey = key.substring("application.".length());
+            properties.setProperty(newKey, value);
+        }
+        return properties;
+    }
+
+
     // //////////////////////////////////////////////////////////////////
     // Components
     // //////////////////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/isis/blob/1ed4eef4/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 4baa3fb..ed595ff 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
@@ -152,16 +152,18 @@ public class IsisSystem implements DebugSelection, ApplicationScopedComponent {
 
     private IsisSessionFactory createSessionFactory(final DeploymentType deploymentType) throws IsisSystemException {
 
+        final IsisConfiguration configuration = isisComponentProvider.getConfiguration();
         final List<Object> services = isisComponentProvider.obtainServices();
 
         ServicesInjectorSpi servicesInjectorSpi = new ServicesInjectorDefault(services);
         servicesInjectorSpi.addFallbackIfRequired(FixtureScripts.class, new FixtureScriptsDefault());
         servicesInjectorSpi.validateServices();
 
+        final RuntimeContextFromSession runtimeContext = new RuntimeContextFromSession(configuration);
+
         final PersistenceSessionFactory persistenceSessionFactory =
-                isisComponentProvider.providePersistenceSessionFactory(deploymentType, servicesInjectorSpi);
+                isisComponentProvider.providePersistenceSessionFactory(deploymentType, servicesInjectorSpi, runtimeContext);
 
-        final IsisConfiguration configuration = getConfiguration();
         final AuthenticationManager authenticationManager =
                 isisComponentProvider.provideAuthenticationManager(deploymentType);
         final AuthorizationManager authorizationManager =
@@ -172,9 +174,7 @@ public class IsisSystem implements DebugSelection, ApplicationScopedComponent {
         final SpecificationLoaderSpi reflector =
                 isisComponentProvider.provideSpecificationLoaderSpi(deploymentType, metaModelRefiners);
 
-
         // bind metamodel to the (runtime) framework
-        final RuntimeContextFromSession runtimeContext = createRuntimeContextFromSession();
         runtimeContext.injectInto(reflector);
 
         return new IsisSessionFactory (
@@ -289,11 +289,6 @@ public class IsisSystem implements DebugSelection, ApplicationScopedComponent {
         return IsisContext.getSpecificationLoader().allSpecifications();
     }
 
-
-    private RuntimeContextFromSession createRuntimeContextFromSession() {
-        return new RuntimeContextFromSession();
-    }
-
     //endregion
 
     //region > shutdown

http://git-wip-us.apache.org/repos/asf/isis/blob/1ed4eef4/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
index 606cae0..387dc90 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
@@ -19,8 +19,6 @@
 
 package org.apache.isis.core.runtime.system.persistence;
 
-import java.util.Properties;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -82,19 +80,6 @@ public class PersistenceSessionFactory implements MetaModelRefiner, ApplicationS
         this.servicesInjector = servicesInjector;
         this.runtimeContext = runtimeContext;
 
-        final Properties properties = applicationPropertiesFrom(getConfiguration());
-        runtimeContext.setProperties(properties);
-    }
-
-    private static Properties applicationPropertiesFrom(final IsisConfiguration configuration) {
-        final Properties properties = new Properties();
-        final IsisConfiguration applicationConfiguration = configuration.getProperties("application");
-        for (final String key : applicationConfiguration) {
-            final String value = applicationConfiguration.getString(key);
-            final String newKey = key.substring("application.".length());
-            properties.setProperty(newKey, value);
-        }
-        return properties;
     }
 
     public DeploymentType getDeploymentType() {

http://git-wip-us.apache.org/repos/asf/isis/blob/1ed4eef4/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 77a904e..a14aa80 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisComponentProvider.java
@@ -29,6 +29,7 @@ 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.fixtures.FixturesInstaller;
+import org.apache.isis.core.runtime.persistence.internal.RuntimeContextFromSession;
 import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.core.runtime.system.IsisSystemException;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
@@ -49,7 +50,8 @@ public interface IsisComponentProvider {
 
     PersistenceSessionFactory providePersistenceSessionFactory(
             final DeploymentType deploymentType,
-            final ServicesInjectorSpi servicesInjectorSpi) throws IsisSystemException;
+            final ServicesInjectorSpi servicesInjectorSpi,
+            final RuntimeContextFromSession runtimeContext) throws IsisSystemException;
 
     AuthenticationManager provideAuthenticationManager(DeploymentType deploymentType) throws IsisSystemException;
 

http://git-wip-us.apache.org/repos/asf/isis/blob/1ed4eef4/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 7294c7f..0b61357 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
@@ -34,6 +34,7 @@ import org.apache.isis.core.runtime.authorization.AuthorizationManagerInstaller;
 import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
 import org.apache.isis.core.runtime.installerregistry.InstallerLookup;
 import org.apache.isis.core.runtime.installerregistry.installerapi.PersistenceMechanismInstaller;
+import org.apache.isis.core.runtime.persistence.internal.RuntimeContextFromSession;
 import org.apache.isis.core.runtime.services.ServicesInstaller;
 import org.apache.isis.core.runtime.system.DeploymentType;
 import org.apache.isis.core.runtime.system.IsisSystemException;
@@ -158,8 +159,9 @@ public class IsisComponentProviderUsingInstallers implements IsisComponentProvid
     @Override
     public PersistenceSessionFactory providePersistenceSessionFactory(
             final DeploymentType deploymentType,
-            final ServicesInjectorSpi servicesInjectorSpi) throws IsisSystemException {
-        return persistenceMechanismInstaller.createPersistenceSessionFactory(deploymentType, servicesInjectorSpi, getConfiguration());
+            final ServicesInjectorSpi servicesInjectorSpi, final RuntimeContextFromSession runtimeContext) throws IsisSystemException {
+        return persistenceMechanismInstaller.createPersistenceSessionFactory(deploymentType, servicesInjectorSpi, getConfiguration(),
+                runtimeContext);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/1ed4eef4/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusPersistenceMechanismInstaller.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusPersistenceMechanismInstaller.java b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusPersistenceMechanismInstaller.java
index 042bc5e..a5b8786 100644
--- a/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusPersistenceMechanismInstaller.java
+++ b/core/runtime/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/DataNucleusPersistenceMechanismInstaller.java
@@ -94,13 +94,15 @@ public class DataNucleusPersistenceMechanismInstaller extends InstallerAbstract
     public PersistenceSessionFactory createPersistenceSessionFactory(
             final DeploymentType deploymentType,
             final ServicesInjectorSpi servicesInjector,
-            final IsisConfiguration configuration) {
-        final RuntimeContextFromSession runtimeContext = new RuntimeContextFromSession();
+            final IsisConfiguration configuration,
+            final RuntimeContextFromSession runtimeContext) {
+
         DataNucleusPersistenceMechanismInstaller objectStoreFactory = this;
         return new PersistenceSessionFactory(deploymentType, servicesInjector, configuration, objectStoreFactory, runtimeContext);
     }
     //endregion
 
+
     //region > createObjectStore
 
     @Override

http://git-wip-us.apache.org/repos/asf/isis/blob/1ed4eef4/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
index 87408d4..91674db 100644
--- 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
@@ -142,7 +142,7 @@ public class PersistenceSessionTest {
             }
         });
 
-        final RuntimeContextFromSession runtimeContext = new RuntimeContextFromSession();
+        final RuntimeContextFromSession runtimeContext = new RuntimeContextFromSession(mockConfiguration);
         final DomainObjectContainerDefault container = new DomainObjectContainerDefault();
 
         runtimeContext.injectInto(container);


[15/17] isis git commit: ISIS-1052: recreating simpleapp archetype

Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectCreate.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectCreate.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectCreate.java
deleted file mode 100644
index d7fa90e..0000000
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectCreate.java
+++ /dev/null
@@ -1,74 +0,0 @@
-#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.fixture.modules.simple;
-
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-
-import domainapp.dom.modules.simple.SimpleObject;
-import domainapp.dom.modules.simple.SimpleObjects;
-
-public class SimpleObjectCreate extends FixtureScript {
-
-    //region > name (input)
-    private String name;
-    /**
-     * Name of the object (required)
-     */
-    public String getName() {
-        return name;
-    }
-
-    public SimpleObjectCreate setName(final String name) {
-        this.name = name;
-        return this;
-    }
-    //endregion
-
-
-    //region > simpleObject (output)
-    private SimpleObject simpleObject;
-
-    /**
-     * The created simple object (output).
-     * @return
-     */
-    public SimpleObject getSimpleObject() {
-        return simpleObject;
-    }
-    //endregion
-
-    @Override
-    protected void execute(final ExecutionContext ec) {
-
-        String name = checkParam("name", ec, String.class);
-
-        this.simpleObject = wrap(simpleObjects).create(name);
-
-        // also make available to UI
-        ec.addResult(this, simpleObject);
-    }
-
-    @javax.inject.Inject
-    private SimpleObjects simpleObjects;
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectsTearDown.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectsTearDown.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectsTearDown.java
deleted file mode 100644
index 4db93d1..0000000
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectsTearDown.java
+++ /dev/null
@@ -1,39 +0,0 @@
-#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.fixture.modules.simple;
-
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-import org.apache.isis.applib.services.jdosupport.IsisJdoSupport;
-
-public class SimpleObjectsTearDown extends FixtureScript {
-
-    @Override
-    protected void execute(ExecutionContext executionContext) {
-        isisJdoSupport.executeUpdate("delete from ${symbol_escape}"simple${symbol_escape}".${symbol_escape}"SimpleObject${symbol_escape}"");
-    }
-
-
-    @javax.inject.Inject
-    private IsisJdoSupport isisJdoSupport;
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java
index 07f1eee..f653a0d 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java
@@ -30,9 +30,9 @@ import com.google.common.collect.Lists;
 
 import org.apache.isis.applib.fixturescripts.FixtureScript;
 
-import domainapp.dom.modules.simple.SimpleObject;
-import domainapp.fixture.modules.simple.SimpleObjectCreate;
-import domainapp.fixture.modules.simple.SimpleObjectsTearDown;
+import domainapp.dom.simple.SimpleObject;
+import domainapp.fixture.dom.simple.SimpleObjectCreate;
+import domainapp.fixture.dom.simple.SimpleObjectsTearDown;
 
 public class RecreateSimpleObjects extends FixtureScript {
 

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/pom.xml b/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/pom.xml
index 6e413aa..7a66a4f 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/pom.xml
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/pom.xml
@@ -46,10 +46,9 @@
     </build>
     <dependencies>
 
-        <!-- other modules in this project -->
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>${rootArtifactId}-fixture</artifactId>
+            <artifactId>${rootArtifactId}-app</artifactId>
         </dependency>
 
         <dependency>
@@ -72,15 +71,6 @@
         </dependency>
 
         <dependency>
-            <groupId>org.apache.isis.core</groupId>
-            <artifactId>isis-core-wrapper</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.isis.core</groupId>
-            <artifactId>isis-core-runtime</artifactId>
-        </dependency>
-
-        <dependency>
             <groupId>org.assertj</groupId>
             <artifactId>assertj-core</artifactId>
             <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java
index 0d3b7dd..6108930 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java
@@ -21,37 +21,24 @@
  */
 package domainapp.integtests.bootstrap;
 
-import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.integtestsupport.IsisSystemForTest;
-import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
 import org.apache.isis.objectstore.jdo.datanucleus.IsisConfigurationForJdoIntegTests;
 
+import domainapp.home.SimpleAppManifest;
+
 public class SimpleAppSystemInitializer {
 
     public static void initIsft() {
         IsisSystemForTest isft = IsisSystemForTest.getElseNull();
         if(isft == null) {
-            isft = new SimpleAppSystemBuilder().build().setUpSystem();
+            isft = new IsisSystemForTest.Builder()
+                    .withLoggingAt(org.apache.log4j.Level.INFO)
+                    .with(new SimpleAppManifest())
+                    .with(new IsisConfigurationForJdoIntegTests())
+                    .build()
+                    .setUpSystem();
             IsisSystemForTest.set(isft);
         }
     }
 
-    private static class SimpleAppSystemBuilder extends IsisSystemForTest.Builder {
-
-        public SimpleAppSystemBuilder() {
-            withLoggingAt(org.apache.log4j.Level.INFO);
-            with(testConfiguration());
-            with(new DataNucleusPersistenceMechanismInstaller());
-
-            // services annotated with @DomainService
-            withServicesIn( "domainapp" );
-        }
-
-        private static IsisConfiguration testConfiguration() {
-            final IsisConfigurationForJdoIntegTests testConfiguration = new IsisConfigurationForJdoIntegTests();
-
-            testConfiguration.addRegisterEntitiesPackagePrefix("domainapp.dom.modules");
-            return testConfiguration;
-        }
-    }
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/domainapp/integtests/specglue/modules/simple/SimpleObjectGlue.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/domainapp/integtests/specglue/modules/simple/SimpleObjectGlue.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/domainapp/integtests/specglue/modules/simple/SimpleObjectGlue.java
index 791d856..0e8afa4 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/domainapp/integtests/specglue/modules/simple/SimpleObjectGlue.java
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/domainapp/integtests/specglue/modules/simple/SimpleObjectGlue.java
@@ -26,8 +26,8 @@ import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
 
 import cucumber.api.java.en.Given;
 import cucumber.api.java.en.When;
-import domainapp.dom.modules.simple.SimpleObject;
-import domainapp.dom.modules.simple.SimpleObjects;
+import domainapp.dom.simple.SimpleObject;
+import domainapp.dom.simple.SimpleObjects;
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
 

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectIntegTest.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectIntegTest.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectIntegTest.java
index 773b421..4b23b37 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectIntegTest.java
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectIntegTest.java
@@ -31,7 +31,7 @@ import org.apache.isis.applib.fixturescripts.FixtureScripts;
 import org.apache.isis.applib.services.wrapper.DisabledException;
 import org.apache.isis.applib.services.wrapper.InvalidException;
 
-import domainapp.dom.modules.simple.SimpleObject;
+import domainapp.dom.simple.SimpleObject;
 import domainapp.fixture.scenarios.RecreateSimpleObjects;
 import domainapp.integtests.tests.SimpleAppIntegTest;
 import static org.assertj.core.api.Assertions.assertThat;

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java
index 4e0925d..ea4199a 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java
@@ -36,9 +36,9 @@ import org.junit.Test;
 import org.apache.isis.applib.fixturescripts.FixtureScript;
 import org.apache.isis.applib.fixturescripts.FixtureScripts;
 
-import domainapp.dom.modules.simple.SimpleObject;
-import domainapp.dom.modules.simple.SimpleObjects;
-import domainapp.fixture.modules.simple.SimpleObjectsTearDown;
+import domainapp.dom.simple.SimpleObject;
+import domainapp.dom.simple.SimpleObjects;
+import domainapp.fixture.dom.simple.SimpleObjectsTearDown;
 import domainapp.fixture.scenarios.RecreateSimpleObjects;
 import domainapp.integtests.tests.SimpleAppIntegTest;
 import static org.assertj.core.api.Assertions.assertThat;

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/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 284f169..7b122fc 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/pom.xml
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/pom.xml
@@ -354,6 +354,11 @@
             <!-- this project's own modules -->
             <dependency>
                 <groupId>${project.groupId}</groupId>
+                <artifactId>${rootArtifactId}-app</artifactId>
+                <version>${version}</version>
+            </dependency>
+            <dependency>
+                <groupId>${project.groupId}</groupId>
                 <artifactId>${rootArtifactId}-dom</artifactId>
                 <version>${version}</version>
             </dependency>

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/pom.xml b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/pom.xml
index da107f7..b265693 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/pom.xml
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/pom.xml
@@ -134,28 +134,9 @@
 
     <dependencies>
     
-        <!-- other modules in this project -->
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>${rootArtifactId}-dom</artifactId>
-            <exclusions>
-                <exclusion>
-                    <!-- so don't pick up transitive dependency to asm 4.0.0 -->
-                    <groupId>org.datanucleus</groupId>
-                    <artifactId>datanucleus-enhancer</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>${rootArtifactId}-fixture</artifactId>
-            <exclusions>
-                <exclusion>
-                    <!-- so don't pick up transitive dependency to asm 4.0.0 -->
-                    <groupId>org.datanucleus</groupId>
-                    <artifactId>datanucleus-enhancer</artifactId>
-                </exclusion>
-            </exclusions>
+            <artifactId>${rootArtifactId}-app</artifactId>
         </dependency>
         
         <!-- other isis components -->
@@ -172,22 +153,12 @@
             <artifactId>isis-core-security-shiro</artifactId>
         </dependency>
 
-
         <!-- isis core -->
         <dependency>
             <groupId>org.apache.isis.core</groupId>
-            <artifactId>isis-core-runtime</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.isis.core</groupId>
-            <artifactId>isis-core-wrapper</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.isis.core</groupId>
             <artifactId>isis-core-security</artifactId>
         </dependency>
 
-
         <!-- to run using WebServer (optional) -->
         <dependency>
             <groupId>org.apache.isis.core</groupId>

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/java/domainapp/webapp/SimpleApplication.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/java/domainapp/webapp/SimpleApplication.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/java/domainapp/webapp/SimpleApplication.java
index ae67547..a8b088d 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/java/domainapp/webapp/SimpleApplication.java
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/java/domainapp/webapp/SimpleApplication.java
@@ -26,8 +26,6 @@ import java.io.InputStream;
 import java.nio.charset.Charset;
 import java.util.List;
 
-import javax.servlet.http.HttpServletRequest;
-
 import com.google.common.base.Joiner;
 import com.google.common.io.Resources;
 import com.google.inject.AbstractModule;
@@ -36,20 +34,14 @@ import com.google.inject.name.Names;
 import com.google.inject.util.Modules;
 import com.google.inject.util.Providers;
 
-import org.apache.wicket.Session;
-import org.apache.wicket.request.IRequestParameters;
-import org.apache.wicket.request.Request;
-import org.apache.wicket.request.Response;
-import org.apache.wicket.request.http.WebRequest;
-
+import org.apache.isis.applib.AppManifest;
 import org.apache.isis.viewer.wicket.viewer.IsisWicketApplication;
-import org.apache.isis.viewer.wicket.viewer.integration.wicket.AuthenticatedWebSessionForIsis;
 
 import de.agilecoders.wicket.core.Bootstrap;
 import de.agilecoders.wicket.core.settings.IBootstrapSettings;
 import de.agilecoders.wicket.themes.markup.html.bootswatch.BootswatchTheme;
 import de.agilecoders.wicket.themes.markup.html.bootswatch.BootswatchThemeProvider;
-
+import domainapp.home.SimpleAppManifest;
 
 /**
  * As specified in <tt>web.xml</tt>.
@@ -72,16 +64,6 @@ public class SimpleApplication extends IsisWicketApplication {
 
     private static final long serialVersionUID = 1L;
 
-    /**
-     * uncomment for a (slightly hacky) way of allowing logins using query args, eg:
-     * 
-     * <tt>?user=sven&pass=pass</tt>
-     * 
-     * <p>
-     * for demos only, obvious.
-     */
-    private final static boolean DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS = false;
-
 
     @Override
     protected void init() {
@@ -92,39 +74,6 @@ public class SimpleApplication extends IsisWicketApplication {
     }
 
     @Override
-    public Session newSession(final Request request, final Response response) {
-        if(!DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS) {
-            return super.newSession(request, response);
-        } 
-        
-        // else demo mode
-        final AuthenticatedWebSessionForIsis s = (AuthenticatedWebSessionForIsis) super.newSession(request, response);
-        IRequestParameters requestParameters = request.getRequestParameters();
-        final org.apache.wicket.util.string.StringValue user = requestParameters.getParameterValue("user");
-        final org.apache.wicket.util.string.StringValue password = requestParameters.getParameterValue("pass");
-        s.signIn(user.toString(), password.toString());
-        return s;
-    }
-
-    @Override
-    public WebRequest newWebRequest(HttpServletRequest servletRequest, String filterPath) {
-        if(!DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS) {
-            return super.newWebRequest(servletRequest, filterPath);
-        } 
-
-        // else demo mode
-        try {
-            String uname = servletRequest.getParameter("user");
-            if (uname != null) {
-                servletRequest.getSession().invalidate();
-            }
-        } catch (Exception e) {
-        }
-        WebRequest request = super.newWebRequest(servletRequest, filterPath);
-        return request;
-    }
-    
-    @Override
     protected Module newIsisWicketModule() {
         final Module isisDefaults = super.newIsisWicketModule();
         
@@ -136,7 +85,10 @@ public class SimpleApplication extends IsisWicketApplication {
                 bind(String.class).annotatedWith(Names.named("applicationJs")).toInstance("scripts/application.js");
                 bind(String.class).annotatedWith(Names.named("welcomeMessage")).toInstance(readLines(getClass(), "welcome.html"));
                 bind(String.class).annotatedWith(Names.named("aboutMessage")).toInstance("Simple App");
-                bind(InputStream.class).annotatedWith(Names.named("metaInfManifest")).toProvider(Providers.of(getServletContext().getResourceAsStream("/META-INF/MANIFEST.MF")));
+                bind(InputStream.class).annotatedWith(Names.named("metaInfManifest")).toProvider(
+                        Providers.of(getServletContext().getResourceAsStream("/META-INF/MANIFEST.MF")));
+                // if uncommented, then overrides isis.appManifest in config file.
+                // bind(AppManifest.class).toInstance(new SimpleAppManifest());
             }
         };
 

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
index 2073a3c..bc384f2 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -21,50 +21,21 @@ ${symbol_pound}  under the License.
 
 ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
 l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
 ${symbol_pound}
-${symbol_pound} specify system components.
-${symbol_pound}
-${symbol_pound} The values correspond to the named components in the installer-registry.properties file
-${symbol_pound} in the org.apache.isis.core:isis-core-runtime JAR (in the org.apache.isis.core.runtime package)
-${symbol_pound}
-${symbol_pound} Although all configuration could reside in isis.properties, the recommendation is
-${symbol_pound} to split out into component specific files:
-${symbol_pound} 
-${symbol_pound}    xxx_yyy.properties files
-${symbol_pound}
-${symbol_pound} where
-${symbol_pound}    * xxx is the component type, and
-${symbol_pound}    * yyy is the component name.
-${symbol_pound}
-${symbol_pound} For example, viewer_wicket.properties holds configuration information specific to the Wicket viewer.
+${symbol_pound} use GlobSpec to specify modules, system components and fixtures
 ${symbol_pound}
 ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
 l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
 
-
 ${symbol_pound}
-${symbol_pound} configure the persistor (object store) to use
+${symbol_pound} Specify the modules (= entities + services) and other components that make up
+${symbol_pound} this application.
 ${symbol_pound}
-
-${symbol_pound} JDO/DataNucleus objectstore
-isis.persistor=datanucleus
-
-
-
+${symbol_pound} alternatively, can provide the AppManifest programmatically by overriding
+${symbol_pound} IsisWicketApplication${symbol_pound}newIsisWicketModule()
 ${symbol_pound}
-${symbol_pound} configure authentication mechanism to use (to logon to the system)
-${symbol_pound}
- 
-${symbol_pound}isis.authentication=bypass
-isis.authentication=shiro
-
-
-${symbol_pound}
-${symbol_pound} configure authorization mechanism to use
-${symbol_pound}
- 
-${symbol_pound}isis.authorization=bypass
-isis.authorization=shiro
-
 
+isis.appManifest=domainapp.home.SimpleAppManifest
+${symbol_pound}isis.appManifest=domainapp.home.SimpleAppManifestBypassSecurity
+${symbol_pound}isis.appManifest=domainapp.home.SimpleAppManifestNoFixtures
 
 
 
@@ -103,14 +74,13 @@ ${symbol_pound}
 isis.reflector.validator.allowDeprecated=false
 
 
-
 ${symbol_pound}
-${symbol_pound} Implementation to use for reading dynamic layout.  Default implementation reads Xxx.layout.json files from classpath.
+${symbol_pound} Implementation to use for reading dynamic layout.
+${symbol_pound} Default implementation reads Xxx.layout.json files from classpath.
 ${symbol_pound}
 ${symbol_pound}isis.reflector.layoutMetadataReaders=org.apache.isis.core.metamodel.layoutmetadata.json.LayoutMetadataReaderFromJson
 
 
-
 ${symbol_pound}
 ${symbol_pound} patterns for applying CssClassFa facet (font-awesome icons), matching on action names
 ${symbol_pound}
@@ -149,47 +119,9 @@ isis.reflector.facet.cssClass.patterns=${symbol_escape}
 
 ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
 l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
 ${symbol_pound}
-${symbol_pound} Value facet defaults
+${symbol_pound} Domain Service configuration
 ${symbol_pound}
-${symbol_pound} (see also viewer-specific config files, eg viewer_wicket.properties)
-${symbol_pound}
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
 l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-
-${symbol_pound} as used by @Title of a date
-isis.value.format.date=dd-MM-yyyy
-
-
-
 ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
 l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-${symbol_pound}
-${symbol_pound} Application Services and fixtures
-${symbol_pound}
-${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
 l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
-
-${symbol_pound}
-${symbol_pound} Specify the domain services.
-${symbol_pound} 
-${symbol_pound} These are the most important configuration properties in the system, as they define
-${symbol_pound} the set of the classes for Isis to instantiate as domain service singletons.
-${symbol_pound} From these domain service instances the rest of the metamodel is discovered, while the 
-${symbol_pound} end-user gains access to other domain objects by invoking the actions of the domain services.
-${symbol_pound}
-isis.services-installer=configuration-and-annotation
-isis.services.ServicesInstallerFromAnnotation.packagePrefix=domainapp
-
-${symbol_pound} additional services/overriding default (@DomainService) implementations
-isis.services =
-
-
-
-${symbol_pound} Specify the (optional) test fixtures
-${symbol_pound}
-${symbol_pound} Fixtures are used to seed the object store with an initial set of data.  For the 
-${symbol_pound} in-memory object store, the fixtures are installed on every run.  For other
-${symbol_pound} object stores, they are used only when the object store is first initialized.
-${symbol_pound}
-isis.fixtures=domainapp.fixture.scenarios.RecreateSimpleObjects
-
 
 ${symbol_pound}
 ${symbol_pound} required by EmailServiceDefault
@@ -198,7 +130,6 @@ ${symbol_pound}isis.service.email.sender.address=some.valid@email.address
 ${symbol_pound}isis.service.email.sender.password=the.password.for-isis.notification.email.sender.address
 
 
-
 ${symbol_pound}
 ${symbol_pound} whether ExceptionRecognizers should also log any recognized exceptions
 ${symbol_pound} (default false; enable for diagnostics/debugging)
@@ -217,7 +148,7 @@ ${symbol_pound}isis.services.ExceptionRecognizerCompositeForJdoObjectStore.disab
 
 ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
 l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
 ${symbol_pound}
-${symbol_pound} Auditing, Publishing, Command
+${symbol_pound} Auditing, Commands, Publishing
 ${symbol_pound}
 ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
 l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
 
@@ -228,6 +159,7 @@ ${symbol_pound} - if set to "all", can explicitly disable using @Object(auditing
 ${symbol_pound}
 ${symbol_pound}isis.services.audit.objects=all|none
 
+
 ${symbol_pound}
 ${symbol_pound} Whether changes to objects should be published; if not set, defaults to "none"
 ${symbol_pound} - if not set or set to "none", can explicitly enable using @DomainObject(publishing=Publishing.ENABLED)
@@ -235,22 +167,21 @@ ${symbol_pound} - if set to "all", can explicitly disable using @Object(publishi
 ${symbol_pound}
 ${symbol_pound}isis.services.publish.objects=all|none
 
-${symbol_pound}
-${symbol_pound} Whether all (or all non-query only) actions should be published; if not set, defaults to "none"
-${symbol_pound} - if not set or set to "none", can explicitly enable using @Action(publishing=Publishing.ENABLED)
-${symbol_pound} - if set to "all", can explicitly disable using @Action(publishing=Publishing.DISABLED)
-${symbol_pound}
-${symbol_pound}isis.services.publish.actions=all|none|ignoreQueryOnly
-
 
 ${symbol_pound}
 ${symbol_pound} Whether all (or all non-query only) actions should be reified as commands; if not set, defaults to "none"
 ${symbol_pound} - if not set or set to "none", can explicitly enable using @Action(command=CommandReification.ENABLED)
 ${symbol_pound} - if set to "all", can explicitly disable using @Action(command=CommandReification.DISABLED)
 ${symbol_pound}
-${symbol_pound}isis.services.command.actions=all|none|ignoreQueryOnly
+${symbol_pound}isis.services.command.actions=all|none|ignoreSafe
 
 
+${symbol_pound}
+${symbol_pound} Whether all (or all non-query only) actions should be published; if not set, defaults to "none"
+${symbol_pound} - if not set or set to "none", can explicitly enable using @Action(publishing=Publishing.ENABLED)
+${symbol_pound} - if set to "all", can explicitly disable using @Action(publishing=Publishing.DISABLED)
+${symbol_pound}
+${symbol_pound}isis.services.publish.actions=all|none|ignoreSafe
 
 
 
@@ -269,8 +200,6 @@ ${symbol_pound}isis.objects.editing=true|false
 
 
 
-
-
 ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
 l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
 ${symbol_pound}
 ${symbol_pound} i18n
@@ -284,8 +213,6 @@ ${symbol_pound}isis.services.translation.po.mode=read
 
 
 
-
-
 ${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
 l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
 ${symbol_pound}
 ${symbol_pound} Viewer defaults
@@ -301,3 +228,18 @@ ${symbol_pound}isis.viewers.paged.parented=10
 
 ${symbol_pound}isis.viewers.propertyLayout.labelPosition=LEFT
 ${symbol_pound}isis.viewers.parameterLayout.labelPosition=LEFT
+
+
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
 l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+${symbol_pound}
+${symbol_pound} Value facet defaults
+${symbol_pound}
+${symbol_pound} (see also viewer-specific config files, eg viewer_wicket.properties)
+${symbol_pound}
+${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
 l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
+
+${symbol_pound} as used by @Title of a date
+isis.value.format.date=dd-MM-yyyy
+
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
index c19892c..6d6da23 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties
@@ -22,9 +22,6 @@ ${symbol_pound}
 ${symbol_pound} configuration file for the JDO/DataNucleus objectstore
 ${symbol_pound}
 
-${symbol_pound} identifies @PersistenceCapable entities to be eagerly registered
-${symbol_pound} if move class to other package (eg com.mycompany.myapp.dom) then update 
-isis.persistor.datanucleus.RegisterEntities.packagePrefix=domainapp.dom.modules
 
 ${symbol_pound}
 ${symbol_pound} hook to perform additional initialization when JDO class metadata is loaded

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/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 12f4b7b..85a9264 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 @@
-#Tue Aug 04 07:04:28 BST 2015
+#Fri Aug 07 11:07:40 BST 2015
 package=it.pkg
 version=0.1-SNAPSHOT
 groupId=archetype.it


[16/17] isis git commit: ISIS-1052: recreating simpleapp archetype

Posted by da...@apache.org.
ISIS-1052: 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/10b93a7a
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/10b93a7a
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/10b93a7a

Branch: refs/heads/master
Commit: 10b93a7a0c0d76fd4d958fb123452d8c456dc380
Parents: a997de0
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Aug 7 11:07:50 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Aug 7 11:07:50 2015 +0100

----------------------------------------------------------------------
 .../META-INF/maven/archetype-metadata.xml       |  17 +++
 .../resources/archetype-resources/app/pom.xml   |  65 ++++++++
 .../java/domainapp/home/SimpleAppManifest.java  | 103 +++++++++++++
 .../home/SimpleAppManifestBypassSecurity.java   |  38 +++++
 .../home/SimpleAppManifestNoFixtures.java       |  39 +++++
 .../home/services/homepage/HomePageService.java |  54 +++++++
 .../services/homepage/HomePageViewModel.java    |  53 +++++++
 .../homepage/HomePageViewModel.layout.json      |  43 ++++++
 .../services/homepage/HomePageViewModel.png     | Bin 0 -> 456 bytes
 .../domainapp/dom/DomainAppDomainModule.java    |  27 ++++
 .../dom/app/homepage/HomePageService.java       |  54 -------
 .../dom/app/homepage/HomePageViewModel.java     |  53 -------
 .../app/homepage/HomePageViewModel.layout.json  |  43 ------
 .../dom/app/homepage/HomePageViewModel.png      | Bin 456 -> 0 bytes
 .../dom/modules/simple/SimpleObject.java        | 152 -------------------
 .../dom/modules/simple/SimpleObject.layout.json |  56 -------
 .../dom/modules/simple/SimpleObject.png         | Bin 653 -> 0 bytes
 .../dom/modules/simple/SimpleObjects.java       | 110 --------------
 .../java/domainapp/dom/simple/SimpleObject.java | 152 +++++++++++++++++++
 .../dom/simple/SimpleObject.layout.json         |  56 +++++++
 .../java/domainapp/dom/simple/SimpleObject.png  | Bin 0 -> 653 bytes
 .../domainapp/dom/simple/SimpleObjects.java     | 110 ++++++++++++++
 .../dom/modules/simple/SimpleObjectTest.java    |  52 -------
 .../dom/modules/simple/SimpleObjectsTest.java   | 107 -------------
 .../domainapp/dom/simple/SimpleObjectTest.java  |  52 +++++++
 .../domainapp/dom/simple/SimpleObjectsTest.java | 107 +++++++++++++
 .../archetype-resources/fixture/pom.xml         |   7 +
 .../fixture/DomainAppFixtureModule.java         |  27 ++++
 ...nAppFixtureScriptsSpecificationProvider.java |  47 ++++++
 .../fixture/DomainAppFixturesProvider.java      |  47 ------
 .../fixture/dom/simple/SimpleObjectCreate.java  |  74 +++++++++
 .../dom/simple/SimpleObjectsTearDown.java       |  39 +++++
 .../modules/simple/SimpleObjectCreate.java      |  74 ---------
 .../modules/simple/SimpleObjectsTearDown.java   |  39 -----
 .../scenarios/RecreateSimpleObjects.java        |   6 +-
 .../archetype-resources/integtests/pom.xml      |  12 +-
 .../bootstrap/SimpleAppSystemInitializer.java   |  29 +---
 .../modules/simple/SimpleObjectGlue.java        |   4 +-
 .../modules/simple/SimpleObjectIntegTest.java   |   2 +-
 .../modules/simple/SimpleObjectsIntegTest.java  |   6 +-
 .../main/resources/archetype-resources/pom.xml  |   5 +
 .../archetype-resources/webapp/pom.xml          |  31 +---
 .../domainapp/webapp/SimpleApplication.java     |  60 +-------
 .../src/main/webapp/WEB-INF/isis.properties     | 128 +++++-----------
 .../WEB-INF/persistor_datanucleus.properties    |   3 -
 .../projects/basic/archetype.properties         |   2 +-
 46 files changed, 1176 insertions(+), 1009 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/META-INF/maven/archetype-metadata.xml b/example/archetype/simpleapp/src/main/resources/META-INF/maven/archetype-metadata.xml
index 5870c4f..e9e1727 100644
--- a/example/archetype/simpleapp/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/example/archetype/simpleapp/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -28,6 +28,23 @@
         </fileSet>
     </fileSets>
     <modules>
+        <module name="${rootArtifactId}-app" id="${rootArtifactId}-app" dir="app">
+            <fileSets>
+                <fileSet filtered="true" encoding="UTF-8">
+                    <directory>src/main/java</directory>
+                    <includes>
+                        <include>**/*.java</include>
+                    </includes>
+                </fileSet>
+                <fileSet encoding="UTF-8">
+                    <directory>src/main/java</directory>
+                    <includes>
+                        <include>**/*.png</include>
+                        <include>**/*.json</include>
+                    </includes>
+                </fileSet>
+            </fileSets>
+        </module>
         <module name="${rootArtifactId}-dom" id="${rootArtifactId}-dom" dir="dom">
             <fileSets>
                 <fileSet filtered="true" encoding="UTF-8">

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/app/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/app/pom.xml b/example/archetype/simpleapp/src/main/resources/archetype-resources/app/pom.xml
new file mode 100644
index 0000000..ed788d9
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/app/pom.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+--><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/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>${groupId}</groupId>
+        <artifactId>${rootArtifactId}</artifactId>
+        <version>${version}</version>
+    </parent>
+
+    <artifactId>${artifactId}</artifactId>
+    <name>Simple App Application Services</name>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+            <resource>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**</include>
+                </includes>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </resource>
+        </resources>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>${rootArtifactId}-fixture</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.isis.core</groupId>
+            <artifactId>isis-core-wrapper</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.isis.core</groupId>
+            <artifactId>isis-core-runtime</artifactId>
+        </dependency>
+
+    </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/SimpleAppManifest.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/SimpleAppManifest.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/SimpleAppManifest.java
new file mode 100644
index 0000000..213e84e
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/SimpleAppManifest.java
@@ -0,0 +1,103 @@
+#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.home;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import com.google.common.collect.Lists;
+
+import org.apache.isis.applib.AppManifest;
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+import domainapp.dom.DomainAppDomainModule;
+import domainapp.fixture.DomainAppFixtureModule;
+import domainapp.fixture.scenarios.RecreateSimpleObjects;
+
+/**
+ * Bootstrap the application.
+ */
+public class SimpleAppManifest 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)
+                DomainAppFixtureModule.class, // fixtures
+                SimpleAppManifest.class       // home page service
+        );
+    }
+
+    /**
+     * 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";
+    }
+
+    /**
+     * Run these fixtures.
+     */
+    @Override
+    public List<Class<? extends FixtureScript>> getFixtures() {
+        return Lists.newArrayList(RecreateSimpleObjects.class);
+    }
+
+    /**
+     * No additional overrides
+     */
+    @Override
+    public Map<String, String> getConfigurationProperties() {
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/SimpleAppManifestBypassSecurity.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/SimpleAppManifestBypassSecurity.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/SimpleAppManifestBypassSecurity.java
new file mode 100644
index 0000000..a643738
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/SimpleAppManifestBypassSecurity.java
@@ -0,0 +1,38 @@
+#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.home;
+
+/**
+ * Bypasses security, meaning any user/password combination can be used to login.
+ */
+public class SimpleAppManifestBypassSecurity extends SimpleAppManifest {
+
+    @Override
+    public String getAuthenticationMechanism() {
+        return "bypass";
+    }
+
+    @Override
+    public String getAuthorizationMechanism() {
+        return "bypass";
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/SimpleAppManifestNoFixtures.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/SimpleAppManifestNoFixtures.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/SimpleAppManifestNoFixtures.java
new file mode 100644
index 0000000..f8c8bee
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/SimpleAppManifestNoFixtures.java
@@ -0,0 +1,39 @@
+#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.home;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+/**
+ * Run the app but without setting up any fixtures.
+ */
+public class SimpleAppManifestNoFixtures extends SimpleAppManifest {
+
+    @Override
+    public List<Class<? extends FixtureScript>> getFixtures() {
+        return Collections.emptyList();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/services/homepage/HomePageService.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/services/homepage/HomePageService.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/services/homepage/HomePageService.java
new file mode 100644
index 0000000..6c20fdc
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/services/homepage/HomePageService.java
@@ -0,0 +1,54 @@
+#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.home.services.homepage;
+
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.HomePage;
+import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+@DomainService(
+        nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY // trick to suppress the actions from the top-level menu
+)
+public class HomePageService {
+
+    //region > homePage (action)
+
+    @Action(
+            semantics = SemanticsOf.SAFE
+    )
+    @HomePage
+    public HomePageViewModel homePage() {
+        return container.injectServicesInto(new HomePageViewModel());
+    }
+
+    //endregion
+
+    //region > injected services
+
+    @javax.inject.Inject
+    DomainObjectContainer container;
+
+    //endregion
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.java
new file mode 100644
index 0000000..e13de70
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.java
@@ -0,0 +1,53 @@
+#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.home.services.homepage;
+
+import java.util.List;
+
+import org.apache.isis.applib.annotation.ViewModel;
+
+import domainapp.dom.simple.SimpleObject;
+import domainapp.dom.simple.SimpleObjects;
+
+@ViewModel
+public class HomePageViewModel {
+
+    //region > title
+    public String title() {
+        return getObjects().size() + " objects";
+    }
+    //endregion
+
+    //region > object (collection)
+    @org.apache.isis.applib.annotation.HomePage
+    public List<SimpleObject> getObjects() {
+        return simpleObjects.listAll();
+    }
+    //endregion
+
+    //region > injected services
+
+    @javax.inject.Inject
+    SimpleObjects simpleObjects;
+
+    //endregion
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.layout.json
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.layout.json b/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.layout.json
new file mode 100644
index 0000000..34f78e0
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.layout.json
@@ -0,0 +1,43 @@
+/**
+ *  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.
+ */
+{
+    "columns": [
+        {
+            "span": 0,
+            "memberGroups": {}
+        },
+        {
+            "span": 0,
+            "memberGroups": {}
+        },
+        {
+            "span": 0,
+            "memberGroups": {}
+        },
+        {
+            "span": 12,
+            "collections": {
+                "objects": {
+                    "collectionLayout": {
+                        "render": "EAGERLY"
+                    }
+                }
+            }
+        }
+    ],
+    "actions": {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.png
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.png b/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.png
new file mode 100644
index 0000000..cb03785
Binary files /dev/null and b/example/archetype/simpleapp/src/main/resources/archetype-resources/app/src/main/java/domainapp/home/services/homepage/HomePageViewModel.png differ

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/DomainAppDomainModule.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/DomainAppDomainModule.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/DomainAppDomainModule.java
new file mode 100644
index 0000000..bd14058
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/DomainAppDomainModule.java
@@ -0,0 +1,27 @@
+#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;
+
+public final class DomainAppDomainModule {
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/app/homepage/HomePageService.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/app/homepage/HomePageService.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/app/homepage/HomePageService.java
deleted file mode 100644
index 094b901..0000000
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/app/homepage/HomePageService.java
+++ /dev/null
@@ -1,54 +0,0 @@
-#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.app.homepage;
-
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.HomePage;
-import org.apache.isis.applib.annotation.NatureOfService;
-import org.apache.isis.applib.annotation.SemanticsOf;
-
-@DomainService(
-        nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY // trick to suppress the actions from the top-level menu
-)
-public class HomePageService {
-
-    //region > homePage (action)
-
-    @Action(
-            semantics = SemanticsOf.SAFE
-    )
-    @HomePage
-    public HomePageViewModel homePage() {
-        return container.injectServicesInto(new HomePageViewModel());
-    }
-
-    //endregion
-
-    //region > injected services
-
-    @javax.inject.Inject
-    DomainObjectContainer container;
-
-    //endregion
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java
deleted file mode 100644
index 53ab48b..0000000
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java
+++ /dev/null
@@ -1,53 +0,0 @@
-#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.app.homepage;
-
-import java.util.List;
-
-import org.apache.isis.applib.annotation.ViewModel;
-
-import domainapp.dom.modules.simple.SimpleObject;
-import domainapp.dom.modules.simple.SimpleObjects;
-
-@ViewModel
-public class HomePageViewModel {
-
-    //region > title
-    public String title() {
-        return getObjects().size() + " objects";
-    }
-    //endregion
-
-    //region > object (collection)
-    @org.apache.isis.applib.annotation.HomePage
-    public List<SimpleObject> getObjects() {
-        return simpleObjects.listAll();
-    }
-    //endregion
-
-    //region > injected services
-
-    @javax.inject.Inject
-    SimpleObjects simpleObjects;
-
-    //endregion
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.layout.json
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.layout.json b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.layout.json
deleted file mode 100644
index 34f78e0..0000000
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.layout.json
+++ /dev/null
@@ -1,43 +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.
- */
-{
-    "columns": [
-        {
-            "span": 0,
-            "memberGroups": {}
-        },
-        {
-            "span": 0,
-            "memberGroups": {}
-        },
-        {
-            "span": 0,
-            "memberGroups": {}
-        },
-        {
-            "span": 12,
-            "collections": {
-                "objects": {
-                    "collectionLayout": {
-                        "render": "EAGERLY"
-                    }
-                }
-            }
-        }
-    ],
-    "actions": {}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.png
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.png b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.png
deleted file mode 100644
index cb03785..0000000
Binary files a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.java
deleted file mode 100644
index d7502a9..0000000
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.java
+++ /dev/null
@@ -1,152 +0,0 @@
-#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.modules.simple;
-
-import javax.jdo.JDOHelper;
-import javax.jdo.annotations.IdentityType;
-import javax.jdo.annotations.VersionStrategy;
-
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.Identifier;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.BookmarkPolicy;
-import org.apache.isis.applib.annotation.DomainObject;
-import org.apache.isis.applib.annotation.DomainObjectLayout;
-import org.apache.isis.applib.annotation.Editing;
-import org.apache.isis.applib.annotation.Parameter;
-import org.apache.isis.applib.annotation.ParameterLayout;
-import org.apache.isis.applib.annotation.Property;
-import org.apache.isis.applib.annotation.Title;
-import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
-import org.apache.isis.applib.services.i18n.TranslatableString;
-import org.apache.isis.applib.util.ObjectContracts;
-
-@javax.jdo.annotations.PersistenceCapable(
-        identityType=IdentityType.DATASTORE,
-        schema = "simple",
-        table = "SimpleObject"
-)
-@javax.jdo.annotations.DatastoreIdentity(
-        strategy=javax.jdo.annotations.IdGeneratorStrategy.IDENTITY,
-         column="id")
-@javax.jdo.annotations.Version(
-        strategy=VersionStrategy.VERSION_NUMBER, 
-        column="version")
-@javax.jdo.annotations.Queries({
-        @javax.jdo.annotations.Query(
-                name = "find", language = "JDOQL",
-                value = "SELECT "
-                        + "FROM domainapp.dom.modules.simple.SimpleObject "),
-        @javax.jdo.annotations.Query(
-                name = "findByName", language = "JDOQL",
-                value = "SELECT "
-                        + "FROM domainapp.dom.modules.simple.SimpleObject "
-                        + "WHERE name.indexOf(:name) >= 0 ")
-})
-@javax.jdo.annotations.Unique(name="SimpleObject_name_UNQ", members = {"name"})
-@DomainObject
-@DomainObjectLayout(
-        bookmarking = BookmarkPolicy.AS_ROOT,
-        cssClassFa = "fa-flag"
-)
-public class SimpleObject implements Comparable<SimpleObject> {
-
-
-    //region > identificatiom
-    public TranslatableString title() {
-        return TranslatableString.tr("Object: {name}", "name", getName());
-    }
-    //endregion
-
-    //region > name (property)
-
-    private String name;
-
-    @javax.jdo.annotations.Column(allowsNull="false", length = 40)
-    @Title(sequence="1")
-    @Property(
-            editing = Editing.DISABLED
-    )
-    public String getName() {
-        return name;
-    }
-
-    public void setName(final String name) {
-        this.name = name;
-    }
-
-    // endregion
-
-    //region > updateName (action)
-
-    public static class UpdateNameDomainEvent extends ActionDomainEvent<SimpleObject> {
-        public UpdateNameDomainEvent(final SimpleObject source, final Identifier identifier, final Object... arguments) {
-            super(source, identifier, arguments);
-        }
-    }
-
-    @Action(
-            domainEvent = UpdateNameDomainEvent.class
-    )
-    public SimpleObject updateName(
-            @Parameter(maxLength = 40)
-            @ParameterLayout(named = "New name")
-            final String name) {
-        setName(name);
-        return this;
-    }
-
-    public String default0UpdateName() {
-        return getName();
-    }
-
-    public TranslatableString validateUpdateName(final String name) {
-        return name.contains("!")? TranslatableString.tr("Exclamation mark is not allowed"): null;
-    }
-
-    //endregion
-
-    //region > version (derived property)
-    public Long getVersionSequence() {
-        return (Long) JDOHelper.getVersion(this);
-    }
-    //endregion
-
-    //region > compareTo
-
-    @Override
-    public int compareTo(final SimpleObject other) {
-        return ObjectContracts.compare(this, other, "name");
-    }
-
-    //endregion
-
-    //region > injected services
-
-    @javax.inject.Inject
-    @SuppressWarnings("unused")
-    private DomainObjectContainer container;
-
-    //endregion
-
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.layout.json
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.layout.json b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.layout.json
deleted file mode 100644
index 3d5e23f..0000000
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.layout.json
+++ /dev/null
@@ -1,56 +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.
- */
-{
-    "columns": [
-        {
-            "span": 6,
-            "memberGroups": {
-                "General": {
-                    "members": {
-                        "name": {
-                            "actions": {
-                                "updateName": {
-                                    "actionLayout": {
-                                        "position": "BOTTOM"
-                                    }
-                                }
-                            }
-                        },
-                        "versionSequence": {
-                            "propertyLayout": {
-                                "name": "version"
-                            }
-                        }
-                    }
-                }
-            }
-        },
-        {
-            "span": 0,
-            "memberGroups": {}
-        },
-        {
-            "span": 0,
-            "memberGroups": {}
-        },
-        {
-            "span": 6,
-            "collections": {}
-        }
-    ],
-    "actions": {}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.png
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.png b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.png
deleted file mode 100644
index 0bd6f57..0000000
Binary files a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/modules/simple/SimpleObjects.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/modules/simple/SimpleObjects.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/modules/simple/SimpleObjects.java
deleted file mode 100644
index 741cce0..0000000
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/modules/simple/SimpleObjects.java
+++ /dev/null
@@ -1,110 +0,0 @@
-#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.modules.simple;
-
-import java.util.List;
-
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.Identifier;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.BookmarkPolicy;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.DomainServiceLayout;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.ParameterLayout;
-import org.apache.isis.applib.annotation.SemanticsOf;
-import org.apache.isis.applib.query.QueryDefault;
-import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
-import org.apache.isis.applib.services.i18n.TranslatableString;
-
-@DomainService(repositoryFor = SimpleObject.class)
-@DomainServiceLayout(menuOrder = "10")
-public class SimpleObjects {
-
-    //region > title
-    public TranslatableString title() {
-        return TranslatableString.tr("Simple Objects");
-    }
-    //endregion
-
-    //region > listAll (action)
-    @Action(
-            semantics = SemanticsOf.SAFE
-    )
-    @ActionLayout(
-            bookmarking = BookmarkPolicy.AS_ROOT
-    )
-    @MemberOrder(sequence = "1")
-    public List<SimpleObject> listAll() {
-        return container.allInstances(SimpleObject.class);
-    }
-    //endregion
-
-    //region > findByName (action)
-    @Action(
-            semantics = SemanticsOf.SAFE
-    )
-    @ActionLayout(
-            bookmarking = BookmarkPolicy.AS_ROOT
-    )
-    @MemberOrder(sequence = "2")
-    public List<SimpleObject> findByName(
-            @ParameterLayout(named="Name")
-            final String name
-    ) {
-        return container.allMatches(
-                new QueryDefault<>(
-                        SimpleObject.class,
-                        "findByName",
-                        "name", name));
-    }
-    //endregion
-
-    //region > create (action)
-    public static class CreateDomainEvent extends ActionDomainEvent<SimpleObjects> {
-        public CreateDomainEvent(final SimpleObjects source, final Identifier identifier, final Object... arguments) {
-            super(source, identifier, arguments);
-        }
-    }
-
-    @Action(
-            domainEvent = CreateDomainEvent.class
-    )
-    @MemberOrder(sequence = "3")
-    public SimpleObject create(
-            final @ParameterLayout(named="Name") String name) {
-        final SimpleObject obj = container.newTransientInstance(SimpleObject.class);
-        obj.setName(name);
-        container.persistIfNotAlready(obj);
-        return obj;
-    }
-
-    //endregion
-
-    //region > injected services
-
-    @javax.inject.Inject 
-    DomainObjectContainer container;
-
-    //endregion
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/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
new file mode 100644
index 0000000..954cfe8
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
@@ -0,0 +1,152 @@
+#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.simple;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.annotations.IdentityType;
+import javax.jdo.annotations.VersionStrategy;
+
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.Identifier;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.BookmarkPolicy;
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.DomainObjectLayout;
+import org.apache.isis.applib.annotation.Editing;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.Title;
+import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
+import org.apache.isis.applib.services.i18n.TranslatableString;
+import org.apache.isis.applib.util.ObjectContracts;
+
+@javax.jdo.annotations.PersistenceCapable(
+        identityType=IdentityType.DATASTORE,
+        schema = "simple",
+        table = "SimpleObject"
+)
+@javax.jdo.annotations.DatastoreIdentity(
+        strategy=javax.jdo.annotations.IdGeneratorStrategy.IDENTITY,
+         column="id")
+@javax.jdo.annotations.Version(
+        strategy=VersionStrategy.VERSION_NUMBER, 
+        column="version")
+@javax.jdo.annotations.Queries({
+        @javax.jdo.annotations.Query(
+                name = "find", language = "JDOQL",
+                value = "SELECT "
+                        + "FROM domainapp.dom.modules.simple.SimpleObject "),
+        @javax.jdo.annotations.Query(
+                name = "findByName", language = "JDOQL",
+                value = "SELECT "
+                        + "FROM domainapp.dom.modules.simple.SimpleObject "
+                        + "WHERE name.indexOf(:name) >= 0 ")
+})
+@javax.jdo.annotations.Unique(name="SimpleObject_name_UNQ", members = {"name"})
+@DomainObject
+@DomainObjectLayout(
+        bookmarking = BookmarkPolicy.AS_ROOT,
+        cssClassFa = "fa-flag"
+)
+public class SimpleObject implements Comparable<SimpleObject> {
+
+
+    //region > identificatiom
+    public TranslatableString title() {
+        return TranslatableString.tr("Object: {name}", "name", getName());
+    }
+    //endregion
+
+    //region > name (property)
+
+    private String name;
+
+    @javax.jdo.annotations.Column(allowsNull="false", length = 40)
+    @Title(sequence="1")
+    @Property(
+            editing = Editing.DISABLED
+    )
+    public String getName() {
+        return name;
+    }
+
+    public void setName(final String name) {
+        this.name = name;
+    }
+
+    // endregion
+
+    //region > updateName (action)
+
+    public static class UpdateNameDomainEvent extends ActionDomainEvent<SimpleObject> {
+        public UpdateNameDomainEvent(final SimpleObject source, final Identifier identifier, final Object... arguments) {
+            super(source, identifier, arguments);
+        }
+    }
+
+    @Action(
+            domainEvent = UpdateNameDomainEvent.class
+    )
+    public SimpleObject updateName(
+            @Parameter(maxLength = 40)
+            @ParameterLayout(named = "New name")
+            final String name) {
+        setName(name);
+        return this;
+    }
+
+    public String default0UpdateName() {
+        return getName();
+    }
+
+    public TranslatableString validateUpdateName(final String name) {
+        return name.contains("!")? TranslatableString.tr("Exclamation mark is not allowed"): null;
+    }
+
+    //endregion
+
+    //region > version (derived property)
+    public Long getVersionSequence() {
+        return (Long) JDOHelper.getVersion(this);
+    }
+    //endregion
+
+    //region > compareTo
+
+    @Override
+    public int compareTo(final SimpleObject other) {
+        return ObjectContracts.compare(this, other, "name");
+    }
+
+    //endregion
+
+    //region > injected services
+
+    @javax.inject.Inject
+    @SuppressWarnings("unused")
+    private DomainObjectContainer container;
+
+    //endregion
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.json
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.json b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.json
new file mode 100644
index 0000000..3d5e23f
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.json
@@ -0,0 +1,56 @@
+/**
+ *  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.
+ */
+{
+    "columns": [
+        {
+            "span": 6,
+            "memberGroups": {
+                "General": {
+                    "members": {
+                        "name": {
+                            "actions": {
+                                "updateName": {
+                                    "actionLayout": {
+                                        "position": "BOTTOM"
+                                    }
+                                }
+                            }
+                        },
+                        "versionSequence": {
+                            "propertyLayout": {
+                                "name": "version"
+                            }
+                        }
+                    }
+                }
+            }
+        },
+        {
+            "span": 0,
+            "memberGroups": {}
+        },
+        {
+            "span": 0,
+            "memberGroups": {}
+        },
+        {
+            "span": 6,
+            "collections": {}
+        }
+    ],
+    "actions": {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObject.png
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObject.png b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObject.png
new file mode 100644
index 0000000..0bd6f57
Binary files /dev/null and b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObject.png differ

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObjects.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObjects.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObjects.java
new file mode 100644
index 0000000..1468b27
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/domainapp/dom/simple/SimpleObjects.java
@@ -0,0 +1,110 @@
+#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.simple;
+
+import java.util.List;
+
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.Identifier;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.BookmarkPolicy;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.DomainServiceLayout;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.query.QueryDefault;
+import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
+import org.apache.isis.applib.services.i18n.TranslatableString;
+
+@DomainService(repositoryFor = SimpleObject.class)
+@DomainServiceLayout(menuOrder = "10")
+public class SimpleObjects {
+
+    //region > title
+    public TranslatableString title() {
+        return TranslatableString.tr("Simple Objects");
+    }
+    //endregion
+
+    //region > listAll (action)
+    @Action(
+            semantics = SemanticsOf.SAFE
+    )
+    @ActionLayout(
+            bookmarking = BookmarkPolicy.AS_ROOT
+    )
+    @MemberOrder(sequence = "1")
+    public List<SimpleObject> listAll() {
+        return container.allInstances(SimpleObject.class);
+    }
+    //endregion
+
+    //region > findByName (action)
+    @Action(
+            semantics = SemanticsOf.SAFE
+    )
+    @ActionLayout(
+            bookmarking = BookmarkPolicy.AS_ROOT
+    )
+    @MemberOrder(sequence = "2")
+    public List<SimpleObject> findByName(
+            @ParameterLayout(named="Name")
+            final String name
+    ) {
+        return container.allMatches(
+                new QueryDefault<>(
+                        SimpleObject.class,
+                        "findByName",
+                        "name", name));
+    }
+    //endregion
+
+    //region > create (action)
+    public static class CreateDomainEvent extends ActionDomainEvent<SimpleObjects> {
+        public CreateDomainEvent(final SimpleObjects source, final Identifier identifier, final Object... arguments) {
+            super(source, identifier, arguments);
+        }
+    }
+
+    @Action(
+            domainEvent = CreateDomainEvent.class
+    )
+    @MemberOrder(sequence = "3")
+    public SimpleObject create(
+            final @ParameterLayout(named="Name") String name) {
+        final SimpleObject obj = container.newTransientInstance(SimpleObject.class);
+        obj.setName(name);
+        container.persistIfNotAlready(obj);
+        return obj;
+    }
+
+    //endregion
+
+    //region > injected services
+
+    @javax.inject.Inject 
+    DomainObjectContainer container;
+
+    //endregion
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectTest.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectTest.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectTest.java
deleted file mode 100644
index d211eec..0000000
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-#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.modules.simple;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class SimpleObjectTest {
-
-    SimpleObject simpleObject;
-
-    @Before
-    public void setUp() throws Exception {
-        simpleObject = new SimpleObject();
-    }
-
-    public static class Name extends SimpleObjectTest {
-
-        @Test
-        public void happyCase() throws Exception {
-            // given
-            String name = "Foobar";
-            assertThat(simpleObject.getName()).isNull();
-
-            // when
-            simpleObject.setName(name);
-
-            // then
-            assertThat(simpleObject.getName()).isEqualTo(name);
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectsTest.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectsTest.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectsTest.java
deleted file mode 100644
index a9d4c65..0000000
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectsTest.java
+++ /dev/null
@@ -1,107 +0,0 @@
-#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.modules.simple;
-
-import java.util.List;
-
-import com.google.common.collect.Lists;
-
-import org.jmock.Expectations;
-import org.jmock.Sequence;
-import org.jmock.auto.Mock;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class SimpleObjectsTest {
-
-    @Rule
-    public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
-
-    @Mock
-    DomainObjectContainer mockContainer;
-    
-    SimpleObjects simpleObjects;
-
-    @Before
-    public void setUp() throws Exception {
-        simpleObjects = new SimpleObjects();
-        simpleObjects.container = mockContainer;
-    }
-
-    public static class Create extends SimpleObjectsTest {
-
-        @Test
-        public void happyCase() throws Exception {
-
-            // given
-            final SimpleObject simpleObject = new SimpleObject();
-
-            final Sequence seq = context.sequence("create");
-            context.checking(new Expectations() {
-                {
-                    oneOf(mockContainer).newTransientInstance(SimpleObject.class);
-                    inSequence(seq);
-                    will(returnValue(simpleObject));
-
-                    oneOf(mockContainer).persistIfNotAlready(simpleObject);
-                    inSequence(seq);
-                }
-            });
-
-            // when
-            final SimpleObject obj = simpleObjects.create("Foobar");
-
-            // then
-            assertThat(obj).isEqualTo(simpleObject);
-            assertThat(obj.getName()).isEqualTo("Foobar");
-        }
-
-    }
-
-    public static class ListAll extends SimpleObjectsTest {
-
-        @Test
-        public void happyCase() throws Exception {
-
-            // given
-            final List<SimpleObject> all = Lists.newArrayList();
-
-            context.checking(new Expectations() {
-                {
-                    oneOf(mockContainer).allInstances(SimpleObject.class);
-                    will(returnValue(all));
-                }
-            });
-
-            // when
-            final List<SimpleObject> list = simpleObjects.listAll();
-
-            // then
-            assertThat(list).isEqualTo(all);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/test/java/domainapp/dom/simple/SimpleObjectTest.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/test/java/domainapp/dom/simple/SimpleObjectTest.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/test/java/domainapp/dom/simple/SimpleObjectTest.java
new file mode 100644
index 0000000..c620db1
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/test/java/domainapp/dom/simple/SimpleObjectTest.java
@@ -0,0 +1,52 @@
+#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.simple;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class SimpleObjectTest {
+
+    SimpleObject simpleObject;
+
+    @Before
+    public void setUp() throws Exception {
+        simpleObject = new SimpleObject();
+    }
+
+    public static class Name extends SimpleObjectTest {
+
+        @Test
+        public void happyCase() throws Exception {
+            // given
+            String name = "Foobar";
+            assertThat(simpleObject.getName()).isNull();
+
+            // when
+            simpleObject.setName(name);
+
+            // then
+            assertThat(simpleObject.getName()).isEqualTo(name);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/test/java/domainapp/dom/simple/SimpleObjectsTest.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/test/java/domainapp/dom/simple/SimpleObjectsTest.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/test/java/domainapp/dom/simple/SimpleObjectsTest.java
new file mode 100644
index 0000000..318a8c4
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/test/java/domainapp/dom/simple/SimpleObjectsTest.java
@@ -0,0 +1,107 @@
+#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.simple;
+
+import java.util.List;
+
+import com.google.common.collect.Lists;
+
+import org.jmock.Expectations;
+import org.jmock.Sequence;
+import org.jmock.auto.Mock;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
+import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class SimpleObjectsTest {
+
+    @Rule
+    public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
+
+    @Mock
+    DomainObjectContainer mockContainer;
+    
+    SimpleObjects simpleObjects;
+
+    @Before
+    public void setUp() throws Exception {
+        simpleObjects = new SimpleObjects();
+        simpleObjects.container = mockContainer;
+    }
+
+    public static class Create extends SimpleObjectsTest {
+
+        @Test
+        public void happyCase() throws Exception {
+
+            // given
+            final SimpleObject simpleObject = new SimpleObject();
+
+            final Sequence seq = context.sequence("create");
+            context.checking(new Expectations() {
+                {
+                    oneOf(mockContainer).newTransientInstance(SimpleObject.class);
+                    inSequence(seq);
+                    will(returnValue(simpleObject));
+
+                    oneOf(mockContainer).persistIfNotAlready(simpleObject);
+                    inSequence(seq);
+                }
+            });
+
+            // when
+            final SimpleObject obj = simpleObjects.create("Foobar");
+
+            // then
+            assertThat(obj).isEqualTo(simpleObject);
+            assertThat(obj.getName()).isEqualTo("Foobar");
+        }
+
+    }
+
+    public static class ListAll extends SimpleObjectsTest {
+
+        @Test
+        public void happyCase() throws Exception {
+
+            // given
+            final List<SimpleObject> all = Lists.newArrayList();
+
+            context.checking(new Expectations() {
+                {
+                    oneOf(mockContainer).allInstances(SimpleObject.class);
+                    will(returnValue(all));
+                }
+            });
+
+            // when
+            final List<SimpleObject> list = simpleObjects.listAll();
+
+            // then
+            assertThat(list).isEqualTo(all);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/pom.xml b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/pom.xml
index 7ff38b4..f8d93d1 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/pom.xml
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/pom.xml
@@ -32,6 +32,13 @@
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>${rootArtifactId}-dom</artifactId>
+            <exclusions>
+                <exclusion>
+                    <!-- so don't pick up transitive dependency to asm 4.0.0 -->
+                    <groupId>org.datanucleus</groupId>
+                    <artifactId>datanucleus-enhancer</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
     </dependencies>
 

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/DomainAppFixtureModule.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/DomainAppFixtureModule.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/DomainAppFixtureModule.java
new file mode 100644
index 0000000..f5195a0
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/DomainAppFixtureModule.java
@@ -0,0 +1,27 @@
+#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.fixture;
+
+public final class DomainAppFixtureModule {
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/DomainAppFixtureScriptsSpecificationProvider.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/DomainAppFixtureScriptsSpecificationProvider.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/DomainAppFixtureScriptsSpecificationProvider.java
new file mode 100644
index 0000000..0024e71
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/DomainAppFixtureScriptsSpecificationProvider.java
@@ -0,0 +1,47 @@
+#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.fixture;
+
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.fixturescripts.FixtureScripts;
+import org.apache.isis.applib.services.fixturespec.FixtureScriptsSpecification;
+import org.apache.isis.applib.services.fixturespec.FixtureScriptsSpecificationProvider;
+
+import domainapp.fixture.scenarios.RecreateSimpleObjects;
+
+/**
+ * Specifies where to find fixtures, and other settings.
+ */
+@DomainService(nature = NatureOfService.DOMAIN)
+public class DomainAppFixtureScriptsSpecificationProvider implements FixtureScriptsSpecificationProvider {
+    @Override
+    public FixtureScriptsSpecification getSpecification() {
+        return FixtureScriptsSpecification
+                .builder(DomainAppFixtureScriptsSpecificationProvider.class)
+                .with(FixtureScripts.MultipleExecutionStrategy.EXECUTE)
+                .withRunScriptDefault(RecreateSimpleObjects.class)
+                .withRunScriptDropDown(FixtureScriptsSpecification.DropDownPolicy.CHOICES)
+                .withRecreate(RecreateSimpleObjects.class)
+                .build();
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/DomainAppFixturesProvider.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/DomainAppFixturesProvider.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/DomainAppFixturesProvider.java
deleted file mode 100644
index f3e1f5f..0000000
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/DomainAppFixturesProvider.java
+++ /dev/null
@@ -1,47 +0,0 @@
-#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.fixture;
-
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.NatureOfService;
-import org.apache.isis.applib.fixturescripts.FixtureScripts;
-import org.apache.isis.applib.services.fixturespec.FixtureScriptsSpecification;
-import org.apache.isis.applib.services.fixturespec.FixtureScriptsSpecificationProvider;
-
-import domainapp.fixture.scenarios.RecreateSimpleObjects;
-
-/**
- * Specifies where to find fixtures, and other settings.
- */
-@DomainService(nature = NatureOfService.DOMAIN)
-public class DomainAppFixturesProvider implements FixtureScriptsSpecificationProvider {
-    @Override
-    public FixtureScriptsSpecification getSpecification() {
-        return FixtureScriptsSpecification
-                .builder(DomainAppFixturesProvider.class)
-                .with(FixtureScripts.MultipleExecutionStrategy.EXECUTE)
-                .withRunScriptDefault(RecreateSimpleObjects.class)
-                .withRunScriptDropDown(FixtureScriptsSpecification.DropDownPolicy.CHOICES)
-                .withRecreate(RecreateSimpleObjects.class)
-                .build();
-    }
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/dom/simple/SimpleObjectCreate.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/dom/simple/SimpleObjectCreate.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/dom/simple/SimpleObjectCreate.java
new file mode 100644
index 0000000..7db9a63
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/dom/simple/SimpleObjectCreate.java
@@ -0,0 +1,74 @@
+#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.fixture.dom.simple;
+
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+import domainapp.dom.simple.SimpleObject;
+import domainapp.dom.simple.SimpleObjects;
+
+public class SimpleObjectCreate extends FixtureScript {
+
+    //region > name (input)
+    private String name;
+    /**
+     * Name of the object (required)
+     */
+    public String getName() {
+        return name;
+    }
+
+    public SimpleObjectCreate setName(final String name) {
+        this.name = name;
+        return this;
+    }
+    //endregion
+
+
+    //region > simpleObject (output)
+    private SimpleObject simpleObject;
+
+    /**
+     * The created simple object (output).
+     * @return
+     */
+    public SimpleObject getSimpleObject() {
+        return simpleObject;
+    }
+    //endregion
+
+    @Override
+    protected void execute(final ExecutionContext ec) {
+
+        String name = checkParam("name", ec, String.class);
+
+        this.simpleObject = wrap(simpleObjects).create(name);
+
+        // also make available to UI
+        ec.addResult(this, simpleObject);
+    }
+
+    @javax.inject.Inject
+    private SimpleObjects simpleObjects;
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/10b93a7a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/dom/simple/SimpleObjectsTearDown.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/dom/simple/SimpleObjectsTearDown.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/dom/simple/SimpleObjectsTearDown.java
new file mode 100644
index 0000000..cf6dea1
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/domainapp/fixture/dom/simple/SimpleObjectsTearDown.java
@@ -0,0 +1,39 @@
+#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.fixture.dom.simple;
+
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+import org.apache.isis.applib.services.jdosupport.IsisJdoSupport;
+
+public class SimpleObjectsTearDown extends FixtureScript {
+
+    @Override
+    protected void execute(ExecutionContext executionContext) {
+        isisJdoSupport.executeUpdate("delete from ${symbol_escape}"simple${symbol_escape}".${symbol_escape}"SimpleObject${symbol_escape}"");
+    }
+
+
+    @javax.inject.Inject
+    private IsisJdoSupport isisJdoSupport;
+
+}


[11/17] isis git commit: ISIS-848: renaming GlobSpec to AppManifest.

Posted by da...@apache.org.
ISIS-848: renaming GlobSpec to AppManifest.

nb: incomplete at this point, need to handle AppManifest#getServices() ... pushing to back up work.


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

Branch: refs/heads/master
Commit: b134bdad6a3ccd27dd6bb7f35abe2b485473a1c9
Parents: 3491249
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Thu Aug 6 18:01:40 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Thu Aug 6 18:01:40 2015 +0100

----------------------------------------------------------------------
 ..._ug_getting-started_simpleapp-archetype.adoc |   5 +
 .../org/apache/isis/applib/AppManifest.java     | 161 +++++++++++++++++++
 .../java/org/apache/isis/applib/GlobSpec.java   | 143 ----------------
 .../IsisComponentProviderDefault.java           |  16 +-
 .../integtestsupport/IsisSystemForTest.java     |  24 +--
 .../core/runtime/system/SystemConstants.java    |   3 +-
 .../IsisComponentProviderAbstract.java          |  20 +--
 .../IsisComponentProviderUsingInstallers.java   |  18 +--
 example/application/simpleapp/fixture/pom.xml   |   7 +
 .../fixture/DomainAppFixtureModule.java         |  24 +++
 ...nAppFixtureScriptsSpecificationProvider.java |  44 +++++
 .../fixture/DomainAppFixturesProvider.java      |  44 -----
 example/application/simpleapp/glob/pom.xml      |  77 ---------
 .../java/domainapp/glob/DomainAppGlobSpec.java  |  91 -----------
 .../domainapp/glob/DomainAppGlobSpecBypass.java |  35 ----
 .../glob/DomainAppGlobSpecNoFixtures.java       |  36 -----
 .../glob/app/homepage/HomePageService.java      |  51 ------
 .../glob/app/homepage/HomePageViewModel.java    |  50 ------
 .../app/homepage/HomePageViewModel.layout.json  |  43 -----
 .../glob/app/homepage/HomePageViewModel.png     | Bin 456 -> 0 bytes
 example/application/simpleapp/home/pom.xml      |  68 ++++++++
 .../java/domainapp/home/SimpleAppManifest.java  | 100 ++++++++++++
 .../domainapp/home/SimpleAppManifestBypass.java |  35 ++++
 .../home/SimpleAppManifestNoFixtures.java       |  36 +++++
 .../home/services/homepage/HomePageService.java |  51 ++++++
 .../services/homepage/HomePageViewModel.java    |  50 ++++++
 .../homepage/HomePageViewModel.layout.json      |  43 +++++
 .../services/homepage/HomePageViewModel.png     | Bin 0 -> 456 bytes
 .../application/simpleapp/integtests/pom.xml    |  11 +-
 .../bootstrap/SimpleAppSystemInitializer.java   |   4 +-
 example/application/simpleapp/pom.xml           |   4 +-
 example/application/simpleapp/webapp/pom.xml    |  12 +-
 .../src/main/webapp/WEB-INF/isis.properties     |   6 +-
 33 files changed, 674 insertions(+), 638 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/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 00378ee..8b050e3 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
@@ -288,6 +288,11 @@ As noted above, the generated app is a very simple application consisting of a s
 |`myapp-fixture`
 |Domain object fixtures used for initializing the system when being demo'ed or for unit testing.
 
+|`myapp-home`
+|(1.9.0) The "home" module, containing the (optional) app manifest and any application-level services. +
+
+The app manifest partially replaces the
+
 |`myapp-integtests`
 |End-to-end xref:ug.adoc#_ug_testing_integ-test-support[integration tests] that exercise from the UI through to the database
 

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/core/applib/src/main/java/org/apache/isis/applib/AppManifest.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/AppManifest.java b/core/applib/src/main/java/org/apache/isis/applib/AppManifest.java
new file mode 100644
index 0000000..1f39e01
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/AppManifest.java
@@ -0,0 +1,161 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.applib;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.jdo.annotations.PersistenceCapable;
+
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+/**
+ * Programmatic specification of the constituent parts of an application, most specifically the modules that contain
+ * domain services and possibly entities.
+ *
+ * <p>
+ * The modules are specified as classes; the framework uses the packages of these classes as the locations on the
+ * classpath to search for domain services (annotated with {@link org.apache.isis.applib.annotation.DomainService})
+ * and entities (annotated with {@link PersistenceCapable}).
+ * </p>
+ *
+ * <p>
+ * The interface also allows certain other aspects of the runtime to be specified:
+ * <ul>
+ *     <li>which authentication and/or authorization mechanism to be used (useful to disable security when developing/demoing)</li>
+ *     <li>which fixtures to run by default</li>
+ *     <li>overriding of arbitrary other configuration properties</li>
+ *     <li>which modules to load (useful when developing, to reduce startup times; just load the modules required)</li>
+ * </ul>
+ * </p>
+ *
+ * <p>
+ * To use, implement this interface and then define as the <tt>isis.appManifest</tt> key within the
+ * <tt>isis.properties</tt> configuration file, or specify programmatically when running integration tests.
+ * </p>
+ *
+ * <p>
+ * By convention the class implementing this interface reside in a <tt>xxx-home</tt> Maven module.  This
+ * can be referenced by both the <tt>xxx-integtests</tt> (Maven) module and the <tt>xxx-webapp</tt> (Maven) module,
+ * allowing configuration to be centralized.
+ * </p>
+ *
+ * <p>
+ * There are a number of subsidiary goals (not yet implemented):
+ * <ul>
+ *    <li>
+ *        <p>Allow different integration tests to run with different manifests.  Normally the running application is
+ *           shared (on a thread-local) between integration tests.  What the framework could do is to be intelligent
+ *           enough to keep track of the manifest in use for each integration test and tear down
+ *           the shared state if the "next" test uses a different manifest</p>
+ *    </li>
+ *    <li>
+ *        Speed up bootstrapping by only scanning for classes annotated by
+ *        {@link org.apache.isis.applib.annotation.DomainService} and {@link javax.jdo.annotations.PersistenceCapable}
+ *        once.
+ *    </li>
+ *    <li>
+ *        Provide a programmatic way to contribute elements of `web.xml`.
+ *    </li>
+ *    <li>
+ *        Provide a programmatic way to configure Shiro security.
+ *    </li>
+ *    <li>
+ *        <p>Anticipate the module changes forthcoming in Java 9.  Eventually we see that the AppManifest class acting
+ *        as an "aggregator", with the list of modules will become Java 9 modules each advertising the types that they
+ *        export.  It might even be possible for AppManifests to be switched on and off dynamically (eg if Java9 is
+ *        compatible with OSGi, being one of the design goals).</p>
+ *    </li>
+ * </ul>
+ * </p>
+ */
+public interface AppManifest {
+
+    /**
+     * A list of classes, each of which representing the root of one of the modules containing services and possibly
+     * entities, which together makes up the running application.
+     *
+     * <p>
+     *     The package of each such class is used as the basis for searching for domain services and registered
+     *     entities.  As such it replaces and overrides both the
+     *     <tt>isis.services.ServicesInstallerFromAnnotation.packagePrefix</tt> key (usually found in the
+     *     <tt>isis.properties</tt> file) and the
+     *     <tt>isis.persistor.datanucleus.RegisterEntities.packagePrefix</tt> key (usually found in the
+     *     <tt>persistor_datanucleus.properties</tt> file).
+     * </p>
+     *
+     * <p>
+     *     If a manifest has been provided then the value of <tt>isis.services-installer</tt> configuration property
+     *     will be ignored and the <tt>isis.services.ServicesInstallerFromAnnotation.packagePrefix</tt>
+     *     configuration property will be ignored.
+     * </p>
+     *
+     * <p>
+     *     Note: the class implementing this interface will typically include itself in the list of classes, so that any
+     *     "global" services (for example an application home page) are also picked up.
+     * </p>
+     */
+    public List<Class<?>> getModules();
+
+    /**
+     * If non-null, overrides the value of <tt>isis.services</tt> configuration property to specify a list of
+     * additional classes to be instantiated as domain services (over and above the {@link DomainService}-annotated
+     * services defined via {@link #getModules()}.
+     *
+     * <p>
+     *     Normally we recommend services are defined exclusively through {@link #getModules()}, and that this metho
+     *     should return an empty list.  However, this method exists to support those use cases where either the
+     *     service required does not have a {@link DomainService} annotation, or where it does have the annotation
+     *     but its containing module cannot (for whatever reason) be listed under {@link #getModules()}.
+     * </p>
+     */
+    public List<Class<?>> getAdditionalServices();
+
+    /**
+     * If non-null, overrides the value of <tt>isis.authentication</tt> configuration property to specify the
+     * authentication mechanism.
+     *
+     * <p>
+     *     Ignored for integration tests (which always uses the 'bypass' mechanism).
+     * </p>
+     */
+    public String getAuthenticationMechanism();
+
+    /**
+     * If non-null, overrides the value of <tt>isis.authorization</tt> configuration property.
+     *
+     * <p>
+     *     Ignored for integration tests (which always uses the 'bypass' mechanism).
+     * </p>
+     */
+    public String getAuthorizationMechanism();
+
+    /**
+     * If non-null, overrides the value of <tt>isis.fixtures</tt> configuration property.
+     */
+    public List<Class<? extends FixtureScript>> getFixtures();
+
+    /**
+     * Overrides for any other configuration properties.
+     */
+    public Map<String,String> getConfigurationProperties();
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/core/applib/src/main/java/org/apache/isis/applib/GlobSpec.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/GlobSpec.java b/core/applib/src/main/java/org/apache/isis/applib/GlobSpec.java
deleted file mode 100644
index ef245e2..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/GlobSpec.java
+++ /dev/null
@@ -1,143 +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.applib;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-
-/**
- * Specifies the "glob", in other words the set of modules (containing domain services and possibly entities), that
- * together make up the running application.
- *
- * <p>
- * To use, implement this interface and then define as the <tt>isis.globspec</tt> key within the
- * <tt>isis.properties</tt> configuration file, or programmatically.
- * </p>
- *
- * <p>
- * The intention is to centralize, so far as possible, the configuration that previously has been duplicated between
- * the <tt>xxx-integtests</tt> (Maven) module and the <tt>xxx-webapp</tt> integtests.
- * </p>
- *
- * <p>
- * There are a number of subsidiary goals:
- * <ul>
- *     <li>
- *         <p>
- *             by having multiple classes implementing this interface, it allows separate "profiles" of the application
- *             to be run.
- *         </p>
- *         <p>For example, a developer could define a globspec that</p>
- *         <ul>
- *             <li>uses the <tt>bypass</tt> security rather than the full-blown Shiro security</li>
- *             <li>excludes some or all addon modules, eg auditing and security</li>
- *             <li>for a large app whose domain has been broken out into multiple <tt>dom-xxx</tt> (Maven) modules, to
- *                 run subsets of the application</li>
- *         </ul>
- *         <p>This applies to both running the main app and also the integration tests.</p>
- *    </li>
- *    <li>
- *        <p>Allow different integration tests to run with different globspecs.  Normally the running application is
- *           shared (on a thread-local) between integration tests.  What the framework could do is to be intelligent
- *           enough to keep track of the globspec used for each integration test and tear down
- *           the shared state if the "next" test uses a different globspec</p>
- *    </li>
- *    <li>
- *        Speed up bootstrapping by only scanning for classes annotated by
- *        {@link org.apache.isis.applib.annotation.DomainService} and {@link javax.jdo.annotations.PersistenceCapable}
- *        once.
- *    </li>
- *    <li>
- *        Provide a programmatic way to contribute elements of `web.xml`.  This is not yet implemented.
- *    </li>
- *    <li>
- *        Provide a programmatic way to configure Shiro security.  This is not yet implemented.
- *    </li>
- *    <li>
- *        <p>Anticipate the module changes forthcoming in Java 9.  Eventually we see that the globspec class will
- *        become an application manifest, while the list of modules will become Java 9 modules each advertising the
- *        types that they export.</p>
- *    </li>
- * </ul>
- * </p>
- * <p>
- *     <b>Note:</b> at this time the integration tests do not keep track of different globspecs; rather the
- *     globspec used for the first test is used for all subsequent tests.
- * </p>
- */
-public interface GlobSpec {
-
-    /**
-     * A list of classes, each of which representing the root of one of the modules containing services and possibly
-     * entities, which together makes up the running application.
-     *
-     * <p>
-     *     The package of each such class is used as the basis for searching for domain services and registered
-     *     entities.  As such it replaces and overrides both the
-     *     <tt>isis.services.ServicesInstallerFromAnnotation.packagePrefix</tt> key (usually found in the
-     *     <tt>isis.properties</tt> file) and the
-     *     <tt>isis.persistor.datanucleus.RegisterEntities.packagePrefix</tt> key (usually found in the
-     *     <tt>persistor_datanucleus.properties</tt> file).
-     * </p>
-     *
-     * <p>
-     *     If a globspec has been provided then the value of <tt>isis.services-installer</tt> configuration property
-     *     will be ignored and the <tt>isis.services</tt> configuration property will also be ignored.
-     * </p>
-     *
-     * <p>
-     *     Note: the class implementing this interface will typically include itself in the list of classes, so that any
-     *     "global" services (for example an application home page) are also picked up.
-     * </p>
-     */
-    public List<Class<?>> getModules();
-
-    /**
-     * If non-null, overrides the value of <tt>isis.authentication</tt> configuration property to specify the
-     * authentication mechanism.
-     *
-     * <p>
-     *     Ignored for integration tests (which always uses the 'bypass' mechanism).
-     * </p>
-     */
-    public String getAuthenticationMechanism();
-
-    /**
-     * If non-null, overrides the value of <tt>isis.authorization</tt> configuration property.
-     *
-     * <p>
-     *     Ignored for integration tests (which always uses the 'bypass' mechanism).
-     * </p>
-     */
-    public String getAuthorizationMechanism();
-
-    /**
-     * If non-null, overrides the value of <tt>isis.fixtures</tt> configuration property.
-     */
-    public List<Class<? extends FixtureScript>> getFixtures();
-
-    /**
-     * Overrides for any other configuration properties.
-     */
-    public Map<String,String> getConfigurationProperties();
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
index 8fc168d..da0ec2e 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisComponentProviderDefault.java
@@ -26,7 +26,7 @@ import java.util.Set;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 
-import org.apache.isis.applib.GlobSpec;
+import org.apache.isis.applib.AppManifest;
 import org.apache.isis.applib.fixtures.InstallableFixture;
 import org.apache.isis.applib.fixturescripts.FixtureScript;
 import org.apache.isis.core.commons.config.IsisConfiguration;
@@ -68,32 +68,32 @@ public class IsisComponentProviderDefault extends IsisComponentProviderAbstract
 
     public IsisComponentProviderDefault(
             final DeploymentType deploymentType,
-            final GlobSpec globSpecIfAny,
+            final AppManifest appManifestIfAny,
             final List<Object> servicesOverride,
             final List<InstallableFixture> fixturesOverride,
             final IsisConfiguration configurationOverride,
             final ProgrammingModel programmingModelOverride,
             final MetaModelValidator metaModelValidatorOverride) {
-        super(deploymentType, globSpecIfAny);
+        super(deploymentType, appManifestIfAny);
 
         this.configuration = elseDefault(configurationOverride);
 
         final String fixtureClassNamesCsv;
-        if(globSpec != null) {
+        if(appManifest != null) {
 
-            specifyServicesAndRegisteredEntitiesUsing(globSpec);
+            specifyServicesAndRegisteredEntitiesUsing(appManifest);
 
             // required to prevent RegisterEntities validation from complaining
             // if it can't find any @PersistenceCapable entities in a module
             // that contains only services.
             putConfigurationProperty(
-                    "isis.globSpec", globSpecIfAny.getClass().getName()
+                    "isis.globSpec", appManifestIfAny.getClass().getName()
             );
 
-            List<Class<? extends FixtureScript>> fixtureClasses = globSpec.getFixtures();
+            List<Class<? extends FixtureScript>> fixtureClasses = appManifest.getFixtures();
             fixtureClassNamesCsv = fixtureClassNamesFrom(fixtureClasses);
 
-            overrideConfigurationUsing(globSpec);
+            overrideConfigurationUsing(appManifest);
 
             this.services = createServices(configuration);
 

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
----------------------------------------------------------------------
diff --git a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
index 673f509..6c7d6d8 100644
--- a/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
+++ b/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/IsisSystemForTest.java
@@ -32,7 +32,7 @@ import org.junit.runner.Description;
 import org.junit.runners.model.Statement;
 
 import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.GlobSpec;
+import org.apache.isis.applib.AppManifest;
 import org.apache.isis.applib.fixtures.FixtureClock;
 import org.apache.isis.applib.fixtures.InstallableFixture;
 import org.apache.isis.applib.services.command.Command;
@@ -153,7 +153,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
 
 
     // these fields 'xxxForComponentProvider' are used to initialize the IsisComponentProvider, but shouldn't be used thereafter.
-    private final GlobSpec globSpecForComponentProvider;
+    private final AppManifest appManifestForComponentProvider;
     private final IsisConfiguration configurationForComponentProvider;
     private final List<Object> servicesForComponentProvider;
     private final List<InstallableFixture> fixturesForComponentProvider;
@@ -181,7 +181,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
         private IsisConfigurationDefault configuration = new IsisConfigurationDefault();
         private final IsisConfigurationDefault configurationAsPerGlobSpec = new IsisConfigurationDefault();
 
-        private GlobSpec globSpecIfAny;
+        private AppManifest appManifestIfAny;
 
         private MetaModelValidator metaModelValidatorOverride;
         private ProgrammingModel programmingModelOverride;
@@ -221,13 +221,13 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
             return this;
         }
 
-        public Builder with(GlobSpec globSpec) {
-            this.globSpecIfAny = globSpec;
+        public Builder with(AppManifest appManifest) {
+            this.appManifestIfAny = appManifest;
             return this;
         }
 
         public Builder withServicesIn(String... packagePrefixes ) {
-            if(globSpecIfAny != null) {
+            if(appManifestIfAny != null) {
                 throw new IllegalStateException("A globSpec has already been provided");
             }
             if(packagePrefixes.length == 0) {
@@ -249,7 +249,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
         }
 
         public Builder withServices(Object... services) {
-            if(globSpecIfAny != null) {
+            if(appManifestIfAny != null) {
                 throw new IllegalStateException("A globSpec has already been provided");
             }
             this.services.addAll(Arrays.asList(services));
@@ -261,7 +261,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
          */
         @Deprecated
         public Builder withFixtures(InstallableFixture... fixtures) {
-            if(globSpecIfAny != null) {
+            if(appManifestIfAny != null) {
                 throw new IllegalStateException("A globSpec has already been provided");
             }
             this.fixtures.addAll(Arrays.asList(fixtures));
@@ -276,7 +276,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
         public IsisSystemForTest build() {
             final IsisSystemForTest isisSystem =
                     new IsisSystemForTest(
-                            globSpecIfAny,
+                            appManifestIfAny,
                             configuration,
                             programmingModelOverride,
                             metaModelValidatorOverride,
@@ -332,7 +332,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
     }
 
     private IsisSystemForTest(
-            final GlobSpec globSpecIfAny,
+            final AppManifest appManifestIfAny,
             final IsisConfiguration configurationOverride,
             final ProgrammingModel programmingModelOverride,
             final MetaModelValidator metaModelValidatorOverride,
@@ -340,7 +340,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
             final List<Object> servicesIfAny,
             final List<InstallableFixture> fixtures,
             final List<Listener> listeners) {
-        this.globSpecForComponentProvider = globSpecIfAny;
+        this.appManifestForComponentProvider = appManifestIfAny;
         this.configurationForComponentProvider = configurationOverride;
         this.programmingModelForComponentProvider = programmingModelOverride;
         this.metaModelValidatorForComponentProvider = metaModelValidatorOverride;
@@ -395,7 +395,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
 
             componentProvider = new IsisComponentProviderDefault(
                     DeploymentType.UNIT_TESTING,
-                    globSpecForComponentProvider,
+                    appManifestForComponentProvider,
                     servicesForComponentProvider,
                     fixturesForComponentProvider,
                     configurationForComponentProvider,

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/core/runtime/src/main/java/org/apache/isis/core/runtime/system/SystemConstants.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/SystemConstants.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/SystemConstants.java
index ce36840..619d9cb 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/SystemConstants.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/SystemConstants.java
@@ -19,6 +19,7 @@
 
 package org.apache.isis.core.runtime.system;
 
+import org.apache.isis.applib.AppManifest;
 import org.apache.isis.core.commons.config.ConfigurationConstants;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
@@ -68,7 +69,7 @@ public final class SystemConstants {
 
 
     /**
-     * Key used to lookup {@link org.apache.isis.applib.GlobSpec} (if any) from the {@link IsisConfiguration}.
+     * Key used to lookup {@link AppManifest} (if any) from the {@link IsisConfiguration}.
      */
     public static final String GLOB_SPEC_KEY = ConfigurationConstants.ROOT + "globSpec";
 

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/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 9db01cc..3030a94 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
@@ -28,7 +28,7 @@ import com.google.common.base.Function;
 import com.google.common.base.Joiner;
 import com.google.common.collect.Iterables;
 
-import org.apache.isis.applib.GlobSpec;
+import org.apache.isis.applib.AppManifest;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.lang.ClassUtil;
 import org.apache.isis.core.runtime.authentication.AuthenticationManager;
@@ -49,7 +49,7 @@ public abstract class IsisComponentProviderAbstract implements IsisComponentProv
     /**
      * may be null.
      */
-    protected final GlobSpec globSpec;
+    protected final AppManifest appManifest;
 
     /**
      * populated by subclass, in its constructor.
@@ -74,10 +74,10 @@ public abstract class IsisComponentProviderAbstract implements IsisComponentProv
 
     public IsisComponentProviderAbstract(
             final DeploymentType deploymentType,
-            final GlobSpec globSpec) {
+            final AppManifest appManifest) {
 
         this.deploymentType = deploymentType;
-        this.globSpec = globSpec;
+        this.appManifest = appManifest;
     }
 
     /**
@@ -93,15 +93,15 @@ public abstract class IsisComponentProviderAbstract implements IsisComponentProv
 
 
     //region > globSpec helpers
-    protected void specifyServicesAndRegisteredEntitiesUsing(final GlobSpec globSpec) {
-        final String packageNamesCsv = modulePackageNamesFrom(globSpec);
+    protected void specifyServicesAndRegisteredEntitiesUsing(final AppManifest appManifest) {
+        final String packageNamesCsv = modulePackageNamesFrom(appManifest);
 
         putConfigurationProperty(ServicesInstallerFromAnnotation.PACKAGE_PREFIX_KEY, packageNamesCsv);
         putConfigurationProperty(RegisterEntities.PACKAGE_PREFIX_KEY, packageNamesCsv);
     }
 
-    private String modulePackageNamesFrom(final GlobSpec globSpec) {
-        List<Class<?>> modules = globSpec.getModules();
+    private String modulePackageNamesFrom(final AppManifest appManifest) {
+        List<Class<?>> modules = appManifest.getModules();
         if (modules == null || modules.isEmpty()) {
             throw new IllegalArgumentException(
                     "If a globSpec is provided then it must return a non-empty set of modules");
@@ -129,8 +129,8 @@ public abstract class IsisComponentProviderAbstract implements IsisComponentProv
                     };
     }
 
-    protected void overrideConfigurationUsing(final GlobSpec globSpec) {
-        final Map<String, String> configurationProperties = globSpec.getConfigurationProperties();
+    protected void overrideConfigurationUsing(final AppManifest appManifest) {
+        final Map<String, String> configurationProperties = appManifest.getConfigurationProperties();
         if (configurationProperties != null) {
             for (Map.Entry<String, String> configProp : configurationProperties.entrySet()) {
                 putConfigurationProperty(configProp.getKey(), configProp.getValue());

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/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 fc9ef58..80576f8 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
@@ -22,7 +22,7 @@ package org.apache.isis.core.runtime.systemusinginstallers;
 import java.util.Collection;
 import java.util.List;
 
-import org.apache.isis.applib.GlobSpec;
+import org.apache.isis.applib.AppManifest;
 import org.apache.isis.applib.fixturescripts.FixtureScript;
 import org.apache.isis.core.commons.factory.InstanceUtil;
 import org.apache.isis.core.metamodel.facetapi.MetaModelRefiner;
@@ -65,25 +65,25 @@ public class IsisComponentProviderUsingInstallers extends IsisComponentProviderA
 
         this.installerLookup = installerLookup;
 
-        if(globSpec != null) {
+        if(appManifest != null) {
 
-            specifyServicesAndRegisteredEntitiesUsing(globSpec);
+            specifyServicesAndRegisteredEntitiesUsing(appManifest);
 
             // by using the annotations installer (as opposed to the configuration-and-annotations installer),
             // any services defined with the "isis.services" key will be IGNORED.
             putConfigurationProperty(SystemConstants.SERVICES_INSTALLER_KEY, ServicesInstallerFromAnnotation.NAME);
 
-            final String authenticationMechanism = globSpec.getAuthenticationMechanism();
+            final String authenticationMechanism = appManifest.getAuthenticationMechanism();
             putConfigurationProperty(SystemConstants.AUTHENTICATION_INSTALLER_KEY, authenticationMechanism);
 
-            final String authorizationMechanism = globSpec.getAuthorizationMechanism();
+            final String authorizationMechanism = appManifest.getAuthorizationMechanism();
             putConfigurationProperty(SystemConstants.AUTHORIZATION_INSTALLER_KEY, authorizationMechanism);
 
-            List<Class<? extends FixtureScript>> fixtureClasses = globSpec.getFixtures();
+            List<Class<? extends FixtureScript>> fixtureClasses = appManifest.getFixtures();
             final String fixtureClassNamesCsv = fixtureClassNamesFrom(fixtureClasses);
             putConfigurationProperty(FixturesInstallerFromConfiguration.FIXTURES, fixtureClassNamesCsv);
 
-            overrideConfigurationUsing(globSpec);
+            overrideConfigurationUsing(appManifest);
         }
 
         // loading installers causes the configuration to be appended to successively
@@ -143,9 +143,9 @@ public class IsisComponentProviderUsingInstallers extends IsisComponentProviderA
         ensureInitialized();
     }
 
-    private static GlobSpec globSpecIfAny(final InstallerLookup installerLookup) {
+    private static AppManifest globSpecIfAny(final InstallerLookup installerLookup) {
         final String globSpecIfAny = installerLookup.getConfiguration().getString(SystemConstants.GLOB_SPEC_KEY);
-        return globSpecIfAny != null? InstanceUtil.createInstance(globSpecIfAny, GlobSpec.class): null;
+        return globSpecIfAny != null? InstanceUtil.createInstance(globSpecIfAny, AppManifest.class): null;
     }
 
     protected void doPutConfigurationProperty(final String key, final String value) {

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/fixture/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/fixture/pom.xml b/example/application/simpleapp/fixture/pom.xml
index b1435ed..664b98e 100644
--- a/example/application/simpleapp/fixture/pom.xml
+++ b/example/application/simpleapp/fixture/pom.xml
@@ -34,6 +34,13 @@
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>simpleapp-dom</artifactId>
+            <exclusions>
+                <exclusion>
+                    <!-- so don't pick up transitive dependency to asm 4.0.0 -->
+                    <groupId>org.datanucleus</groupId>
+                    <artifactId>datanucleus-enhancer</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
     </dependencies>
 

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/DomainAppFixtureModule.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/DomainAppFixtureModule.java b/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/DomainAppFixtureModule.java
new file mode 100644
index 0000000..8a707e6
--- /dev/null
+++ b/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/DomainAppFixtureModule.java
@@ -0,0 +1,24 @@
+/*
+ *  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.fixture;
+
+public final class DomainAppFixtureModule {
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/DomainAppFixtureScriptsSpecificationProvider.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/DomainAppFixtureScriptsSpecificationProvider.java b/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/DomainAppFixtureScriptsSpecificationProvider.java
new file mode 100644
index 0000000..92f56cd
--- /dev/null
+++ b/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/DomainAppFixtureScriptsSpecificationProvider.java
@@ -0,0 +1,44 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package domainapp.fixture;
+
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.fixturescripts.FixtureScripts;
+import org.apache.isis.applib.services.fixturespec.FixtureScriptsSpecification;
+import org.apache.isis.applib.services.fixturespec.FixtureScriptsSpecificationProvider;
+
+import domainapp.fixture.scenarios.RecreateSimpleObjects;
+
+/**
+ * Specifies where to find fixtures, and other settings.
+ */
+@DomainService(nature = NatureOfService.DOMAIN)
+public class DomainAppFixtureScriptsSpecificationProvider implements FixtureScriptsSpecificationProvider {
+    @Override
+    public FixtureScriptsSpecification getSpecification() {
+        return FixtureScriptsSpecification
+                .builder(DomainAppFixtureScriptsSpecificationProvider.class)
+                .with(FixtureScripts.MultipleExecutionStrategy.EXECUTE)
+                .withRunScriptDefault(RecreateSimpleObjects.class)
+                .withRunScriptDropDown(FixtureScriptsSpecification.DropDownPolicy.CHOICES)
+                .withRecreate(RecreateSimpleObjects.class)
+                .build();
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/DomainAppFixturesProvider.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/DomainAppFixturesProvider.java b/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/DomainAppFixturesProvider.java
deleted file mode 100644
index ab6b6b4..0000000
--- a/example/application/simpleapp/fixture/src/main/java/domainapp/fixture/DomainAppFixturesProvider.java
+++ /dev/null
@@ -1,44 +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 domainapp.fixture;
-
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.NatureOfService;
-import org.apache.isis.applib.fixturescripts.FixtureScripts;
-import org.apache.isis.applib.services.fixturespec.FixtureScriptsSpecification;
-import org.apache.isis.applib.services.fixturespec.FixtureScriptsSpecificationProvider;
-
-import domainapp.fixture.scenarios.RecreateSimpleObjects;
-
-/**
- * Specifies where to find fixtures, and other settings.
- */
-@DomainService(nature = NatureOfService.DOMAIN)
-public class DomainAppFixturesProvider implements FixtureScriptsSpecificationProvider {
-    @Override
-    public FixtureScriptsSpecification getSpecification() {
-        return FixtureScriptsSpecification
-                .builder(DomainAppFixturesProvider.class)
-                .with(FixtureScripts.MultipleExecutionStrategy.EXECUTE)
-                .withRunScriptDefault(RecreateSimpleObjects.class)
-                .withRunScriptDropDown(FixtureScriptsSpecification.DropDownPolicy.CHOICES)
-                .withRecreate(RecreateSimpleObjects.class)
-                .build();
-    }
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/glob/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/glob/pom.xml b/example/application/simpleapp/glob/pom.xml
deleted file mode 100644
index 0281d43..0000000
--- a/example/application/simpleapp/glob/pom.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.
--->
-<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/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.isis.example.application</groupId>
-        <artifactId>simpleapp</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>simpleapp-glob</artifactId>
-    <name>Simple App Glob</name>
-
-    <build>
-        <resources>
-            <resource>
-                <filtering>false</filtering>
-                <directory>src/main/resources</directory>
-            </resource>
-            <resource>
-                <filtering>false</filtering>
-                <directory>src/main/java</directory>
-                <includes>
-                    <include>**</include>
-                </includes>
-                <excludes>
-                    <exclude>**/*.java</exclude>
-                </excludes>
-            </resource>
-        </resources>
-    </build>
-
-    <dependencies>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>simpleapp-dom</artifactId>
-            <exclusions>
-                <exclusion>
-                    <!-- so don't pick up transitive dependency to asm 4.0.0 -->
-                    <groupId>org.datanucleus</groupId>
-                    <artifactId>datanucleus-enhancer</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>simpleapp-fixture</artifactId>
-            <exclusions>
-                <exclusion>
-                    <!-- so don't pick up transitive dependency to asm 4.0.0 -->
-                    <groupId>org.datanucleus</groupId>
-                    <artifactId>datanucleus-enhancer</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-
-    </dependencies>
-
-</project>

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpec.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpec.java b/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpec.java
deleted file mode 100644
index 14a6896..0000000
--- a/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpec.java
+++ /dev/null
@@ -1,91 +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 domainapp.glob;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-import com.google.common.collect.Lists;
-
-import org.apache.isis.applib.GlobSpec;
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-
-import domainapp.dom.DomainAppDomainModule;
-import domainapp.fixture.DomainAppFixturesProvider;
-import domainapp.fixture.scenarios.RecreateSimpleObjects;
-
-/**
- * Bootstrap the application.
- */
-public class DomainAppGlobSpec implements GlobSpec {
-
-    /**
-     * Load all services and entities found in (the packages and subpackages within) these modules
-     */
-    @Override
-    public List<Class<?>> getModules() {
-        return Arrays.asList(
-                DomainAppDomainModule.class, // entities and repositories
-                DomainAppFixturesProvider.class, // fixture configuration
-                DomainAppGlobSpec.class      // home page service
-        );
-    }
-
-    /**
-     * 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";
-    }
-
-    /**
-     * Run these fixtures.
-     */
-    @Override
-    public List<Class<? extends FixtureScript>> getFixtures() {
-        return Lists.newArrayList(RecreateSimpleObjects.class);
-    }
-
-    /**
-     * No additional overrides
-     */
-    @Override
-    public Map<String, String> getConfigurationProperties() {
-        return null;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpecBypass.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpecBypass.java b/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpecBypass.java
deleted file mode 100644
index 9e3fe00..0000000
--- a/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpecBypass.java
+++ /dev/null
@@ -1,35 +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 domainapp.glob;
-
-/**
- * Bypasses security, meaning any user/password combination can be used to login.
- */
-public class DomainAppGlobSpecBypass extends DomainAppGlobSpec {
-
-    @Override
-    public String getAuthenticationMechanism() {
-        return "bypass";
-    }
-
-    @Override
-    public String getAuthorizationMechanism() {
-        return "bypass";
-    }
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpecNoFixtures.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpecNoFixtures.java b/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpecNoFixtures.java
deleted file mode 100644
index 24f221a..0000000
--- a/example/application/simpleapp/glob/src/main/java/domainapp/glob/DomainAppGlobSpecNoFixtures.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 domainapp.glob;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.isis.applib.fixturescripts.FixtureScript;
-
-/**
- * Run the app but without setting up any fixtures.
- */
-public class DomainAppGlobSpecNoFixtures extends DomainAppGlobSpec {
-
-    @Override
-    public List<Class<? extends FixtureScript>> getFixtures() {
-        return Collections.emptyList();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageService.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageService.java b/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageService.java
deleted file mode 100644
index 3870c27..0000000
--- a/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageService.java
+++ /dev/null
@@ -1,51 +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 domainapp.glob.app.homepage;
-
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.HomePage;
-import org.apache.isis.applib.annotation.NatureOfService;
-import org.apache.isis.applib.annotation.SemanticsOf;
-
-@DomainService(
-        nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY // trick to suppress the actions from the top-level menu
-)
-public class HomePageService {
-
-    //region > homePage (action)
-
-    @Action(
-            semantics = SemanticsOf.SAFE
-    )
-    @HomePage
-    public HomePageViewModel homePage() {
-        return container.injectServicesInto(new HomePageViewModel());
-    }
-
-    //endregion
-
-    //region > injected services
-
-    @javax.inject.Inject
-    DomainObjectContainer container;
-
-    //endregion
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.java b/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.java
deleted file mode 100644
index c7c584c..0000000
--- a/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.java
+++ /dev/null
@@ -1,50 +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 domainapp.glob.app.homepage;
-
-import java.util.List;
-
-import org.apache.isis.applib.annotation.ViewModel;
-
-import domainapp.dom.simple.SimpleObject;
-import domainapp.dom.simple.SimpleObjects;
-
-@ViewModel
-public class HomePageViewModel {
-
-    //region > title
-    public String title() {
-        return getObjects().size() + " objects";
-    }
-    //endregion
-
-    //region > object (collection)
-    @org.apache.isis.applib.annotation.HomePage
-    public List<SimpleObject> getObjects() {
-        return simpleObjects.listAll();
-    }
-    //endregion
-
-    //region > injected services
-
-    @javax.inject.Inject
-    SimpleObjects simpleObjects;
-
-    //endregion
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.layout.json
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.layout.json b/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.layout.json
deleted file mode 100644
index 34f78e0..0000000
--- a/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.layout.json
+++ /dev/null
@@ -1,43 +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.
- */
-{
-    "columns": [
-        {
-            "span": 0,
-            "memberGroups": {}
-        },
-        {
-            "span": 0,
-            "memberGroups": {}
-        },
-        {
-            "span": 0,
-            "memberGroups": {}
-        },
-        {
-            "span": 12,
-            "collections": {
-                "objects": {
-                    "collectionLayout": {
-                        "render": "EAGERLY"
-                    }
-                }
-            }
-        }
-    ],
-    "actions": {}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.png
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.png b/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.png
deleted file mode 100644
index cb03785..0000000
Binary files a/example/application/simpleapp/glob/src/main/java/domainapp/glob/app/homepage/HomePageViewModel.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/home/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/home/pom.xml b/example/application/simpleapp/home/pom.xml
new file mode 100644
index 0000000..f9bf5a2
--- /dev/null
+++ b/example/application/simpleapp/home/pom.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<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/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.isis.example.application</groupId>
+        <artifactId>simpleapp</artifactId>
+        <version>1.9.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>simpleapp-home</artifactId>
+    <name>Simple App Home</name>
+
+    <build>
+        <resources>
+            <resource>
+                <filtering>false</filtering>
+                <directory>src/main/resources</directory>
+            </resource>
+            <resource>
+                <filtering>false</filtering>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**</include>
+                </includes>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </resource>
+        </resources>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>simpleapp-fixture</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.isis.core</groupId>
+            <artifactId>isis-core-wrapper</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.isis.core</groupId>
+            <artifactId>isis-core-runtime</artifactId>
+        </dependency>
+
+    </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifest.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifest.java b/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifest.java
new file mode 100644
index 0000000..f821bc0
--- /dev/null
+++ b/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifest.java
@@ -0,0 +1,100 @@
+/*
+ *  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.home;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import com.google.common.collect.Lists;
+
+import org.apache.isis.applib.AppManifest;
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+import domainapp.dom.DomainAppDomainModule;
+import domainapp.fixture.DomainAppFixtureModule;
+import domainapp.fixture.scenarios.RecreateSimpleObjects;
+
+/**
+ * Bootstrap the application.
+ */
+public class SimpleAppManifest 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)
+                DomainAppFixtureModule.class, // fixtures
+                SimpleAppManifest.class  // home page service
+        );
+    }
+
+    /**
+     * 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";
+    }
+
+    /**
+     * Run these fixtures.
+     */
+    @Override
+    public List<Class<? extends FixtureScript>> getFixtures() {
+        return Lists.newArrayList(RecreateSimpleObjects.class);
+    }
+
+    /**
+     * No additional overrides
+     */
+    @Override
+    public Map<String, String> getConfigurationProperties() {
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestBypass.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestBypass.java b/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestBypass.java
new file mode 100644
index 0000000..97298a3
--- /dev/null
+++ b/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestBypass.java
@@ -0,0 +1,35 @@
+/*
+ *  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.home;
+
+/**
+ * Bypasses security, meaning any user/password combination can be used to login.
+ */
+public class SimpleAppManifestBypass extends SimpleAppManifest {
+
+    @Override
+    public String getAuthenticationMechanism() {
+        return "bypass";
+    }
+
+    @Override
+    public String getAuthorizationMechanism() {
+        return "bypass";
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestNoFixtures.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestNoFixtures.java b/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestNoFixtures.java
new file mode 100644
index 0000000..b13c15d
--- /dev/null
+++ b/example/application/simpleapp/home/src/main/java/domainapp/home/SimpleAppManifestNoFixtures.java
@@ -0,0 +1,36 @@
+/*
+ *  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.home;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+
+/**
+ * Run the app but without setting up any fixtures.
+ */
+public class SimpleAppManifestNoFixtures extends SimpleAppManifest {
+
+    @Override
+    public List<Class<? extends FixtureScript>> getFixtures() {
+        return Collections.emptyList();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageService.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageService.java b/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageService.java
new file mode 100644
index 0000000..17a9c79
--- /dev/null
+++ b/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageService.java
@@ -0,0 +1,51 @@
+/*
+ *  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.home.services.homepage;
+
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.HomePage;
+import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+@DomainService(
+        nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY // trick to suppress the actions from the top-level menu
+)
+public class HomePageService {
+
+    //region > homePage (action)
+
+    @Action(
+            semantics = SemanticsOf.SAFE
+    )
+    @HomePage
+    public HomePageViewModel homePage() {
+        return container.injectServicesInto(new HomePageViewModel());
+    }
+
+    //endregion
+
+    //region > injected services
+
+    @javax.inject.Inject
+    DomainObjectContainer container;
+
+    //endregion
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.java b/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.java
new file mode 100644
index 0000000..d20c432
--- /dev/null
+++ b/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.java
@@ -0,0 +1,50 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by 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.home.services.homepage;
+
+import java.util.List;
+
+import org.apache.isis.applib.annotation.ViewModel;
+
+import domainapp.dom.simple.SimpleObject;
+import domainapp.dom.simple.SimpleObjects;
+
+@ViewModel
+public class HomePageViewModel {
+
+    //region > title
+    public String title() {
+        return getObjects().size() + " objects";
+    }
+    //endregion
+
+    //region > object (collection)
+    @org.apache.isis.applib.annotation.HomePage
+    public List<SimpleObject> getObjects() {
+        return simpleObjects.listAll();
+    }
+    //endregion
+
+    //region > injected services
+
+    @javax.inject.Inject
+    SimpleObjects simpleObjects;
+
+    //endregion
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.layout.json
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.layout.json b/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.layout.json
new file mode 100644
index 0000000..34f78e0
--- /dev/null
+++ b/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.layout.json
@@ -0,0 +1,43 @@
+/**
+ *  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.
+ */
+{
+    "columns": [
+        {
+            "span": 0,
+            "memberGroups": {}
+        },
+        {
+            "span": 0,
+            "memberGroups": {}
+        },
+        {
+            "span": 0,
+            "memberGroups": {}
+        },
+        {
+            "span": 12,
+            "collections": {
+                "objects": {
+                    "collectionLayout": {
+                        "render": "EAGERLY"
+                    }
+                }
+            }
+        }
+    ],
+    "actions": {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.png
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.png b/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.png
new file mode 100644
index 0000000..cb03785
Binary files /dev/null and b/example/application/simpleapp/home/src/main/java/domainapp/home/services/homepage/HomePageViewModel.png differ

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/integtests/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/integtests/pom.xml b/example/application/simpleapp/integtests/pom.xml
index d40db1d..dade0b3 100644
--- a/example/application/simpleapp/integtests/pom.xml
+++ b/example/application/simpleapp/integtests/pom.xml
@@ -85,7 +85,7 @@
 
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>simpleapp-glob</artifactId>
+            <artifactId>simpleapp-home</artifactId>
         </dependency>
 
         <dependency>
@@ -108,15 +108,6 @@
         </dependency>
 
         <dependency>
-            <groupId>org.apache.isis.core</groupId>
-            <artifactId>isis-core-wrapper</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.isis.core</groupId>
-            <artifactId>isis-core-runtime</artifactId>
-        </dependency>
-
-        <dependency>
             <groupId>org.assertj</groupId>
             <artifactId>assertj-core</artifactId>
             <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java b/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java
index 85a92f7..135a71a 100644
--- a/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java
+++ b/example/application/simpleapp/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java
@@ -21,7 +21,7 @@ package domainapp.integtests.bootstrap;
 import org.apache.isis.core.integtestsupport.IsisSystemForTest;
 import org.apache.isis.objectstore.jdo.datanucleus.IsisConfigurationForJdoIntegTests;
 
-import domainapp.glob.DomainAppGlobSpec;
+import domainapp.home.SimpleAppManifest;
 
 public class SimpleAppSystemInitializer {
 
@@ -30,7 +30,7 @@ public class SimpleAppSystemInitializer {
         if(isft == null) {
             isft = new IsisSystemForTest.Builder()
                     .withLoggingAt(org.apache.log4j.Level.INFO)
-                    .with(new DomainAppGlobSpec())
+                    .with(new SimpleAppManifest())
                     .with(new IsisConfigurationForJdoIntegTests())
                     .build()
                     .setUpSystem();

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/pom.xml b/example/application/simpleapp/pom.xml
index 9ac4077..d62bd19 100644
--- a/example/application/simpleapp/pom.xml
+++ b/example/application/simpleapp/pom.xml
@@ -334,7 +334,7 @@
     <modules>
         <module>dom</module>
         <module>fixture</module>
-        <module>glob</module>
+        <module>home</module>
         <module>integtests</module>
         <module>webapp</module>
     </modules>
@@ -378,7 +378,7 @@
             </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
-                <artifactId>simpleapp-glob</artifactId>
+                <artifactId>simpleapp-home</artifactId>
                 <version>${project.version}</version>
             </dependency>
             <dependency>

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/webapp/pom.xml b/example/application/simpleapp/webapp/pom.xml
index 006583c..dcf16c9 100644
--- a/example/application/simpleapp/webapp/pom.xml
+++ b/example/application/simpleapp/webapp/pom.xml
@@ -145,7 +145,7 @@
     
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>simpleapp-glob</artifactId>
+            <artifactId>simpleapp-home</artifactId>
         </dependency>
         
         <!-- other isis components -->
@@ -162,22 +162,12 @@
             <artifactId>isis-core-security-shiro</artifactId>
         </dependency>
 
-
         <!-- isis core -->
         <dependency>
             <groupId>org.apache.isis.core</groupId>
-            <artifactId>isis-core-runtime</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.isis.core</groupId>
-            <artifactId>isis-core-wrapper</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.isis.core</groupId>
             <artifactId>isis-core-security</artifactId>
         </dependency>
 
-
         <!-- to run using WebServer (optional) -->
         <dependency>
             <groupId>org.apache.isis.core</groupId>

http://git-wip-us.apache.org/repos/asf/isis/blob/b134bdad/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
index 330c5b1..825ed7d 100644
--- a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
+++ b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -23,9 +23,9 @@
 #################################################################################
 
 
-isis.globSpec=domainapp.glob.DomainAppGlobSpec
-#isis.globSpec=domainapp.glob.DomainAppGlobSpecBypass
-#isis.globSpec=domainapp.glob.DomainAppGlobSpecNoFixtures
+isis.globSpec=domainapp.home.SimpleAppManifest
+#isis.globSpec=domainapp.home.SimpleAppAppManifestBypass
+#isis.globSpec=domainapp.home.SimpleAppManifestNoFixtures