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 2019/01/10 00:36:59 UTC

[isis] branch v2 updated: ISIS-2067: reinstated WebServer for testing.

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

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


The following commit(s) were added to refs/heads/v2 by this push:
     new 8ef9a72  ISIS-2067: reinstated WebServer for testing.
8ef9a72 is described below

commit 8ef9a72abd68018d621117fdb0577021c6cbf31c
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jan 10 01:30:34 2019 +0100

    ISIS-2067: reinstated WebServer for testing.
    
    Replaces commons-cli with jopt-simple
---
 .../guides/cgcom/_cgcom_cutting-a-release.adoc     |  10 ++
 .../guides/dg/_dg_hints-and-tips_enhance-only.adoc |   2 +-
 .../main/asciidoc/guides/dg/_dg_ide_intellij.adoc  |  12 +-
 .../_rgcms_classes_AppManifest-bootstrapping.adoc  |  16 ++-
 ...gbtb_deployment_externalized-configuration.adoc |   6 +
 ...ugfun_getting-started_helloworld-archetype.adoc |   8 +-
 ..._ugfun_getting-started_simpleapp-archetype.adoc |   8 +-
 .../config/builder/IsisConfigurationBuilder.java   |  22 ++--
 .../builder/IsisConfigurationBuilderDefault.java   |  36 ++++--
 core/metamodel/pom.xml                             |   5 -
 .../isis/core/metamodel/facetapi/FacetHolder.java  |   7 -
 .../core/metamodel/facetapi/FacetHolderImpl.java   |   7 +-
 .../isis/core/metamodel/facetapi/FacetUtil.java    |  20 ++-
 .../core/runtime/optionhandler/BootPrinter.java    |  57 --------
 .../core/runtime/optionhandler/OptionHandler.java  |  34 -----
 .../optionhandler/OptionHandlerAbstract.java       |  45 -------
 core/pom.xml                                       |  13 +-
 .../apache/isis/core/runtime/runner/Constants.java |  56 --------
 .../opts/OptionHandlerAdditionalProperty.java      |  75 -----------
 .../runner/opts/OptionHandlerAppManifest.java      |  78 -----------
 .../runner/opts/OptionHandlerConfiguration.java    |  65 ----------
 .../runtime/runner/opts/OptionHandlerFixture.java  |  61 ---------
 .../runner/opts/OptionHandlerFixtureAbstract.java  |  53 --------
 ...ptionHandlerFixtureFromEnvironmentVariable.java |  54 --------
 .../runtime/runner/opts/OptionHandlerHelp.java     |  60 ---------
 .../runner/opts/OptionHandlerInitParameters.java   |  89 -------------
 .../runtime/runner/opts/OptionHandlerPassword.java |  66 ----------
 .../runner/opts/OptionHandlerSystemProperties.java |  78 -----------
 .../runtime/runner/opts/OptionHandlerUser.java     |  67 ----------
 .../system/persistence/PersistenceSession.java     |   6 +-
 .../system/persistence/PersistenceSessionBase.java |   2 -
 core/webserver/pom.xml                             |   6 +
 .../src/main/java/org/apache/isis/WebServer.java}  |  23 ++--
 .../org/apache/isis/core/webserver/WebServer.java  | 144 +++++++++++++++++++++
 .../services/homepage/HomePageViewModel.layout.xml |   2 +-
 35 files changed, 270 insertions(+), 1023 deletions(-)

diff --git a/adocs/documentation/src/main/asciidoc/guides/cgcom/_cgcom_cutting-a-release.adoc b/adocs/documentation/src/main/asciidoc/guides/cgcom/_cgcom_cutting-a-release.adoc
index 2e5c63b..2cd88ec 100644
--- a/adocs/documentation/src/main/asciidoc/guides/cgcom/_cgcom_cutting-a-release.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/cgcom/_cgcom_cutting-a-release.adoc
@@ -351,6 +351,11 @@ Double check that the app:
 mvn clean install
 ----
 
+* can be run from an IDE
+** mainClass=`org.apache.isis.WebServer`
+** args=`-m domainapp.application.manifest.DomainAppAppManifestWithFixtures`
+** run before: `mvn -pl module-simple datanucleus:enhance -o` in the root module
+
 * can be run using the mvn jetty plugin:
 +
 [source,bash,subs="attributes+"]
@@ -599,6 +604,11 @@ Check that the app:
 mvn clean install
 ----
 
+* can be run from an IDE
+** mainClass=`org.apache.isis.WebServer`
+** args=`-m domainapp.application.HelloWorldAppManifest`
+** run before: `mvn datanucleus:enhance -o` in the root module
+
 * can be run using the mvn jetty plugin:
 +
 [source,bash]
diff --git a/adocs/documentation/src/main/asciidoc/guides/dg/_dg_hints-and-tips_enhance-only.adoc b/adocs/documentation/src/main/asciidoc/guides/dg/_dg_hints-and-tips_enhance-only.adoc
index 2431cad..aa6bff9 100644
--- a/adocs/documentation/src/main/asciidoc/guides/dg/_dg_hints-and-tips_enhance-only.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/dg/_dg_hints-and-tips_enhance-only.adoc
@@ -11,7 +11,7 @@ From the Apache Isis mailing list is:
 
 Yes, you can; here's one way:
 
-* Create Duplicate your run configuration for running the webapp
+* Duplicate your run configuration for running the webapp
 ** the one where the main class is `org.apache.isis.WebServer`
 ** there's a button for this on the run configurations dialog.
 * then, on your copy change the main class to `org.apache.isis.Dummy`
diff --git a/adocs/documentation/src/main/asciidoc/guides/dg/_dg_ide_intellij.adoc b/adocs/documentation/src/main/asciidoc/guides/dg/_dg_ide_intellij.adoc
index c623003..1d78e97 100644
--- a/adocs/documentation/src/main/asciidoc/guides/dg/_dg_ide_intellij.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/dg/_dg_ide_intellij.adoc
@@ -272,10 +272,16 @@ Let's see how to run both the app and the tests.
 [[__dg_ide_intellij_running_the-app]]
 === Running the App
 
-Once you've imported your Apache Isis application, we should run it.
-We do this by creating a Run configuration, using `Run > Edit Configurations`.
+Once you've imported your Apache Isis application, we should run it.  We do this by creating a Run configuration, using `Run > Edit Configurations`.
 
-TODO: describe how to run using `mvn jetty:run`
+Set up the details as follows:
+
+.IntelliJ Running the App - Run Configuration
+image::{_imagesdir}intellij-idea/110-running-the-app/010-run-configuration.png[width="600px",link="{_imagesdir}intellij-idea/110-running-the-app/010-run-configuration.png"]
+
+We specify the `Main class` to be `org.apache.isis.WebServer`; this is a wrapper around Jetty.  It's possible to pass program arguments to this (eg to automatically install fixtures), but for now leave this blank.
+
+Also note that `Use classpath of module` is the webapp module for your app, and that the `working directory` is `$MODULE_DIR$`.
 
 Next, and most importantly, configure the DataNucleus enhancer to run for your `dom` goal.  This can be done by defining a Maven goal to run before the app:
 
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_classes_AppManifest-bootstrapping.adoc b/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_classes_AppManifest-bootstrapping.adoc
index 96a93a3..12d95c2 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_classes_AppManifest-bootstrapping.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_classes_AppManifest-bootstrapping.adoc
@@ -210,9 +210,9 @@ This will allow the architectural layering of the overall application to be enfo
 
 What then remains is to update the bootstrapping code itself.
 
-There are a couple of contexts in which the framework needs to be bootstrapped:
+There are several different contexts in which the framework needs to be bootstrapped:
 
-* the normal situation is as a "regular" webapp (using the xref:../ugvw/ugvw.adoc#[Wicket viewer]).
+* the first is as a "regular" webapp (using the xref:../ugvw/ugvw.adoc#[Wicket viewer]).
 Here the `AppManifest` just needs to be specified as a configuration property, usually done using the `WEB-INF/isis.properties` configuration file: +
 +
 [source,ini]
@@ -220,7 +220,17 @@ Here the `AppManifest` just needs to be specified as a configuration property, u
 isis.appManifest=domainapp.app.MyAppAppManifest
 ----
 
-* the other main use-case is within an integration test. +
+* the second is also as a webapp, but from within the context of the IDE. +
++
+Here, it's common to use the `org.apache.isis.WebServer` class to launch your application from the xref:../ugbtb/ugbtb.adoc#_ugbtb_deployment_cmd-line[command line].
+This allows the `AppManifest` to be specified using the `-m` (or `--manifest`) flag: +
++
+[source,ini]
+----
+java org.apache.isis.WebServer -m com.mycompany.myapp.MyAppAppManifestWithFixtures
+----
+
+* the third case is within an integration test. +
 +
 The code to boostrap an integration test is shown in the xref:../ugtst/ugtst.adoc#_ugtst_integ-test-support_bootstrapping[testing guide], but once again an `AppManifest` is required.
 
diff --git a/adocs/documentation/src/main/asciidoc/guides/ugbtb/_ugbtb_deployment_externalized-configuration.adoc b/adocs/documentation/src/main/asciidoc/guides/ugbtb/_ugbtb_deployment_externalized-configuration.adoc
index 4990d10..2f97c46 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ugbtb/_ugbtb_deployment_externalized-configuration.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ugbtb/_ugbtb_deployment_externalized-configuration.adoc
@@ -64,6 +64,12 @@ Most (if not all) servlet containers will provide a means to define context para
 
 
 
+[NOTE]
+====
+Note that running the app using Apache Isis' `org.apache.isis.WebServer` bootstrapper does not use externalized Apache Isis configuration.
+====
+
+
 
 
 
diff --git a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_getting-started_helloworld-archetype.adoc b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_getting-started_helloworld-archetype.adoc
index f366c3b..da402f9 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_getting-started_helloworld-archetype.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_getting-started_helloworld-archetype.adoc
@@ -353,13 +353,15 @@ The default configuration does not require any configuration of the servlet cont
 
 Most of the time, though, you'll probably want to run the app from within your IDE.
 The mechanics of doing this will vary by IDE; see the xref:../dg/dg.adoc#_dg_ide[Developers' Guide] for details of setting up Eclipse or IntelliJ IDEA.
-One easy way to do this is to use maven to run `jetty:run`.
-This can also be combined with `datanucleus:enhance` to ensure that the xref:../dg/dg.adoc#_dg_hints-and-tips_datanucleus-enhancer[DataNucleus enhancer] has properly processed all domain entities.
+Basically, though, it amounts to running `org.apache.isis.WebServer`, and ensuring that the xref:../dg/dg.adoc#_dg_hints-and-tips_datanucleus-enhancer[DataNucleus enhancer] has properly processed all domain entities.
 
 Here's what the setup looks like in IntelliJ IDEA:
 
-TODO: v2: update this images; should basically show `mvn datanucleus:enhance jetty:run -o`
+image::{_imagesdir}getting-started/helloworld.png[width="600px",link="{_imagesdir}getting-started/helloworld.png"]
 
+with the maven goal to run the DataNucleus enhancer (discussed in more detail xref:../dg/dg.adoc#_dg_hints-and-tips_datanucleus-enhancer[here]) before launch defined as:
+
+image::{_imagesdir}getting-started/helloworld-before-launch.png[width="600px",link="{_imagesdir}getting-started/helloworld-before-launch.png"]
 
 
 
diff --git a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_getting-started_simpleapp-archetype.adoc b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_getting-started_simpleapp-archetype.adoc
index ede5d35..f7abdca 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_getting-started_simpleapp-archetype.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_getting-started_simpleapp-archetype.adoc
@@ -615,13 +615,15 @@ Once more, see link:https://github.com/danhaywood/java-mavenmixin-docker#how-to-
 
 Most of the time, though, you'll probably want to run the app from within your IDE.
 The mechanics of doing this will vary by IDE; see the xref:../dg/dg.adoc#_dg_ide[Developers' Guide] for details of setting up Eclipse or IntelliJ IDEA.
-One way to do this is to run through Maven with `jetty:run`.
-It is important though to ensure that the xref:../dg/dg.adoc#_dg_hints-and-tips_datanucleus-enhancer[DataNucleus enhancer] has properly processed all domain entities.
+Basically, though, it amounts to running `org.apache.isis.WebServer`, and ensuring that the xref:../dg/dg.adoc#_dg_hints-and-tips_datanucleus-enhancer[DataNucleus enhancer] has properly processed all domain entities.
 
 Here's what the setup looks like in IntelliJ IDEA:
 
-TODO: v2: update these images.  Basically need to run "mvn datanucleus:enhance" as a pre-goal in the module-simple module, then "mvn jetty:run" in the webapp module.
+image::{_imagesdir}getting-started/simpleapp-webapp.png[width="600px",link="{_imagesdir}getting-started/simpleapp-webapp.png"]
 
+with the maven goal to run the DataNucleus enhancer (discussed in more detail xref:../dg/dg.adoc#_dg_hints-and-tips_datanucleus-enhancer[here]) before launch defined as:
+
+image::{_imagesdir}getting-started/simpleapp-webapp-before-launch.png[width="600px",link="{_imagesdir}getting-started/simpleapp-webapp-before-launch.png"]
 
 
 
diff --git a/core/config/src/main/java/org/apache/isis/config/builder/IsisConfigurationBuilder.java b/core/config/src/main/java/org/apache/isis/config/builder/IsisConfigurationBuilder.java
index e273493..421e9d4 100644
--- a/core/config/src/main/java/org/apache/isis/config/builder/IsisConfigurationBuilder.java
+++ b/core/config/src/main/java/org/apache/isis/config/builder/IsisConfigurationBuilder.java
@@ -28,12 +28,12 @@ import org.apache.isis.config.NotFoundPolicy;
 import org.apache.isis.config.resource.ResourceStreamSource;
 
 public interface IsisConfigurationBuilder {
-    
-    void addPropertyResource(PropertyResource propertyResource);
 
-    void addResourceStreamSource(ResourceStreamSource resourceStreamSource);
-    void addResourceStreamSources(ResourceStreamSource... resourceStreamSources);
-    void addResourceStreamSources(List<ResourceStreamSource> resourceStreamSources);
+    IsisConfigurationBuilder addPropertyResource(PropertyResource propertyResource);
+
+    IsisConfigurationBuilder addResourceStreamSource(ResourceStreamSource resourceStreamSource);
+    IsisConfigurationBuilder addResourceStreamSources(ResourceStreamSource... resourceStreamSources);
+    IsisConfigurationBuilder addResourceStreamSources(List<ResourceStreamSource> resourceStreamSources);
 
     /**
      * Registers the configuration resource (usually, a file) with the specified
@@ -43,20 +43,20 @@ public interface IsisConfigurationBuilder {
      * If the configuration resource cannot be found then the provided
      * {@link NotFoundPolicy} determines whether an exception is thrown or not.
      */
-    void addConfigurationResource(String configurationResource, NotFoundPolicy notFoundPolicy,
+    IsisConfigurationBuilder addConfigurationResource(String configurationResource, NotFoundPolicy notFoundPolicy,
             IsisConfigurationDefault.ContainsPolicy containsPolicy);
 
     /**
      * Adds additional property; if already present then will _not_ be replaced.
      */
-    void add(String key, String value);
+    IsisConfigurationBuilder add(String key, String value);
 
     /**
      * Adds/updates property; if already present then _will_ be replaced.
      */
-    void put(String key, String value);
+    IsisConfigurationBuilder put(String key, String value);
 
-    void primeWith(Primer primer);
+    IsisConfigurationBuilder primeWith(Primer primer);
 
     String peekAtString(String key);
     String peekAtString(String key, String defaultValue);
@@ -72,13 +72,13 @@ public interface IsisConfigurationBuilder {
      * @param topModule
      * @since 2.0.0-M2
      */
-    void addTopModule(Module topModule);
+    IsisConfigurationBuilder addTopModule(Module topModule);
     
     /**
      * @param appManifest
      * @since 2.0.0-M2
      */
-    void addAppManifest(AppManifest appManifest);
+    IsisConfigurationBuilder addAppManifest(AppManifest appManifest);
 
     /** internal only **/
     IsisConfiguration build();
diff --git a/core/config/src/main/java/org/apache/isis/config/builder/IsisConfigurationBuilderDefault.java b/core/config/src/main/java/org/apache/isis/config/builder/IsisConfigurationBuilderDefault.java
index 2f931ee..0a5e751 100644
--- a/core/config/src/main/java/org/apache/isis/config/builder/IsisConfigurationBuilderDefault.java
+++ b/core/config/src/main/java/org/apache/isis/config/builder/IsisConfigurationBuilderDefault.java
@@ -172,20 +172,23 @@ final class IsisConfigurationBuilderDefault implements IsisConfigurationBuilder
     // -- addResourceStreamSource, addResourceStreamSources
 
     @Override
-    public void addResourceStreamSource(final ResourceStreamSource resourceStreamSource) {
+    public IsisConfigurationBuilder addResourceStreamSource(final ResourceStreamSource resourceStreamSource) {
         addResourceStreamSources(resourceStreamSource);
+        return this;
     }
 
     @Override
-    public void addResourceStreamSources(final ResourceStreamSource... resourceStreamSources) {
+    public IsisConfigurationBuilder addResourceStreamSources(final ResourceStreamSource... resourceStreamSources) {
         addResourceStreamSources(Arrays.asList(resourceStreamSources));
+        return this;
     }
 
     @Override
-    public void addResourceStreamSources(final List<ResourceStreamSource> resourceStreamSources) {
+    public IsisConfigurationBuilder addResourceStreamSources(final List<ResourceStreamSource> resourceStreamSources) {
         for (ResourceStreamSource resourceStreamSource : resourceStreamSources) {
             this.resourceStreamSourceChain.addResourceStreamSource(resourceStreamSource);
         }
+        return this;
     }
 
     // -- addConfigurationResource
@@ -202,10 +205,10 @@ final class IsisConfigurationBuilderDefault implements IsisConfigurationBuilder
      * Must be called before {@link IsisConfigurationBuilderDefault#getConfiguration()}.
      */
     @Override
-    public void addConfigurationResource(
+    public IsisConfigurationBuilder addConfigurationResource(
             final String configurationResource,
             final NotFoundPolicy notFoundPolicy,
-            final IsisConfigurationDefault.ContainsPolicy containsPolicy) {
+            final ContainsPolicy containsPolicy) {
 
         if(LOG.isDebugEnabled()) {
             LOG.debug(String.format(
@@ -213,6 +216,7 @@ final class IsisConfigurationBuilderDefault implements IsisConfigurationBuilder
                     configurationResource, notFoundPolicy));
         }
         loadConfigurationResource(configurationResource, notFoundPolicy, containsPolicy);
+        return this;
     }
 
     /**
@@ -260,53 +264,57 @@ final class IsisConfigurationBuilderDefault implements IsisConfigurationBuilder
      * Adds additional property; if already present then will _not_ be replaced.
      */
     @Override
-    public void add(final String key, final String value) {
+    public IsisConfigurationBuilder add(final String key, final String value) {
         configuration.add(key, value);
+        return this;
     }
 
     /**
      * Adds/updates property; if already present then _will_ be replaced.
      */
     @Override
-    public void put(final String key, final String value) {
+    public IsisConfigurationBuilder put(final String key, final String value) {
         configuration.put(key, value);
+        return this;
     }
 
     // -- PRIMING
 
     @Override
-    public void primeWith(final Primer primer) {
+    public IsisConfigurationBuilder primeWith(final Primer primer) {
         LOG.debug("priming configurations for '{}'", primer);
         primer.prime(this);
+        return this;
     }
     
     // -- LOAD MODULE TREE
     
     @Override
-    public void addTopModule(Module topModule) {
+    public IsisConfigurationBuilder addTopModule(Module topModule) {
         final AppManifestAbstract2.Builder manifestBuilder = AppManifestAbstract2.Builder
                 .forModule(topModule);
         final AppManifestAbstract2 manifest = new AppManifestAbstract2(manifestBuilder) {};
         addAppManifest(manifest);
+        return this;
     }
     
     @Override
-    public void addAppManifest(AppManifest appManifest) {
+    public IsisConfigurationBuilder addAppManifest(AppManifest appManifest) {
         configuration.setAppManifest(appManifest);
-        appManifest.getConfigurationProperties().forEach((k, v)->{
-            put(k, v);
-        });
+        appManifest.getConfigurationProperties().forEach(this::put);
+        return this;
     }
         
     // -- LOAD SINGLE RESOURCE
         
     @Override
-    public void addPropertyResource(PropertyResource propertyResource) {
+    public IsisConfigurationBuilder addPropertyResource(PropertyResource propertyResource) {
         IsisConfigurationDefault.ContainsPolicy ignorePolicy = IsisConfigurationDefault.ContainsPolicy.IGNORE;
         NotFoundPolicy continuePolicy = NotFoundPolicy.CONTINUE;
         
         addResourceStreamSource(new ResourceStreamSource_UsingClass(propertyResource.getResourceContext()));
         addConfigurationResource(propertyResource.getResourceName(), continuePolicy, ignorePolicy);
+        return this;
     }
 
     // -- PEEKING
diff --git a/core/metamodel/pom.xml b/core/metamodel/pom.xml
index da39cad..1d0d2dc 100644
--- a/core/metamodel/pom.xml
+++ b/core/metamodel/pom.xml
@@ -91,11 +91,6 @@
             <artifactId>isis-core-security</artifactId>
         </dependency>
 
-		<!-- command line options support  -->
-        <dependency>
-            <groupId>commons-cli</groupId>
-            <artifactId>commons-cli</artifactId>
-        </dependency>
 
         <dependency>
             <groupId>io.swagger</groupId>
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facetapi/FacetHolder.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facetapi/FacetHolder.java
index 611e107..3abc744 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facetapi/FacetHolder.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facetapi/FacetHolder.java
@@ -19,7 +19,6 @@
 
 package org.apache.isis.core.metamodel.facetapi;
 
-import java.util.function.Predicate;
 import java.util.stream.Stream;
 
 /**
@@ -57,12 +56,6 @@ public interface FacetHolder {
      */
     boolean containsDoOpNotDerivedFacet(Class<? extends Facet> facetType);
 
-    /**
-     * Returns all {@link Facet}s matching the specified {@link Predicate}.
-     *
-     * @param predicate
-     * @return
-     */
     Stream<Facet> streamFacets();
 
     /**
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facetapi/FacetHolderImpl.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facetapi/FacetHolderImpl.java
index b0a15e9..bbe6fc5 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facetapi/FacetHolderImpl.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facetapi/FacetHolderImpl.java
@@ -19,12 +19,13 @@
 
 package org.apache.isis.core.metamodel.facetapi;
 
-import static org.apache.isis.commons.internal.base._Casts.uncheckedCast;
-
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Optional;
 import java.util.stream.Stream;
 
+import static org.apache.isis.commons.internal.base._Casts.uncheckedCast;
+
 /**
  * For base subclasses or, more likely, to help write tests.
  */
@@ -97,7 +98,7 @@ public class FacetHolderImpl implements FacetHolder {
                 .stream()
                 .distinct(); //FIXME[ISIS-1976] not sure why this is required for MultiTypedFacet support as was in legacy code
     }
-    
+
     @Override
     public int getFacetCount() {
         return facetsByClass.size();
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facetapi/FacetUtil.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facetapi/FacetUtil.java
index 60faedb..626c74b 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facetapi/FacetUtil.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facetapi/FacetUtil.java
@@ -21,8 +21,8 @@ package org.apache.isis.core.metamodel.facetapi;
 
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 import java.util.function.BiConsumer;
-import java.util.stream.Collectors;
 
 import org.apache.isis.core.runtime.snapshot.XmlSchema.ExtensionData;
 
@@ -37,16 +37,14 @@ public final class FacetUtil {
             return;
         }
         final FacetHolder facetHolder = facet.getFacetHolder();
-        final List<Facet> facets = facetHolder.streamFacets()
-                .filter( each->facet.facetType() == each.facetType() && facet.getClass() == each.getClass() )
-                .collect(Collectors.toList());
-        
-        if(facets.size() == 1) {
-            final Facet existingFacet = facets.get(0);
-            final Facet underlyingFacet = existingFacet.getUnderlyingFacet();
-            facetHolder.removeFacet(existingFacet);
-            facet.setUnderlyingFacet(underlyingFacet);
-        }
+
+        Optional.ofNullable(facetHolder.getFacet(facet.facetType()))
+            .filter(each -> facet.getClass() == each.getClass())
+            .ifPresent(existingFacet -> {
+                final Facet underlyingFacet = existingFacet.getUnderlyingFacet();
+                facetHolder.removeFacet(existingFacet);
+                facet.setUnderlyingFacet(underlyingFacet);
+            } );
         facetHolder.addFacet(facet);
     }
 
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/runtime/optionhandler/BootPrinter.java b/core/metamodel/src/main/java/org/apache/isis/core/runtime/optionhandler/BootPrinter.java
deleted file mode 100644
index e74c698..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/runtime/optionhandler/BootPrinter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.runtime.optionhandler;
-
-import java.io.PrintStream;
-import java.io.PrintWriter;
-
-import org.apache.commons.cli.HelpFormatter;
-import org.apache.commons.cli.Options;
-
-import org.apache.isis.core.runtime.sysout.SystemPrinter;
-
-public class BootPrinter extends SystemPrinter {
-
-    private final PrintWriter printWriter;
-    private final String className;
-
-    public BootPrinter(final Class<?> cls, final PrintStream output) {
-        super(output);
-        this.printWriter = new PrintWriter(getOutput());
-        className = cls.getName().substring(cls.getName().lastIndexOf('.') + 1);
-    }
-
-    public BootPrinter(final Class<?> cls) {
-        this(cls, System.out);
-    }
-
-    public void printErrorAndHelp(final Options options, final String formatStr, final Object... args) {
-        getOutput().println(String.format(formatStr, args));
-        printHelp(options);
-        printWriter.flush();
-    }
-
-    public void printHelp(final Options options) {
-        final HelpFormatter help = new HelpFormatter();
-        help.printHelp(printWriter, 80, className + " [options]", null, options, 0, 0, null, false);
-        printWriter.flush();
-    }
-
-}
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/runtime/optionhandler/OptionHandler.java b/core/metamodel/src/main/java/org/apache/isis/core/runtime/optionhandler/OptionHandler.java
deleted file mode 100644
index ecdadfc..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/runtime/optionhandler/OptionHandler.java
+++ /dev/null
@@ -1,34 +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.optionhandler;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.Options;
-
-import org.apache.isis.config.builder.IsisConfigurationBuilder;
-
-public interface OptionHandler extends IsisConfigurationBuilder.Primer {
-
-    void addOption(Options options);
-
-    boolean handle(CommandLine commandLine, BootPrinter bootPrinter, Options options);
-
-
-}
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/runtime/optionhandler/OptionHandlerAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/runtime/optionhandler/OptionHandlerAbstract.java
deleted file mode 100644
index 07cf179..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/runtime/optionhandler/OptionHandlerAbstract.java
+++ /dev/null
@@ -1,45 +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.optionhandler;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.cli.CommandLine;
-
-import org.apache.isis.core.commons.lang.ListExtensions;
-
-public abstract class OptionHandlerAbstract implements OptionHandler {
-
-    public OptionHandlerAbstract() {
-    }
-
-    protected List<String> getOptionValues(final CommandLine commandLine, final String opt) {
-        final List<String> list = new ArrayList<String>();
-        final String[] optionValues = commandLine.getOptionValues(opt);
-        if (optionValues != null) {
-            for (final String optionValue : optionValues) {
-                ListExtensions.appendDelimitedStringToList(optionValue, list);
-            }
-        }
-        return list;
-    }
-
-}
diff --git a/core/pom.xml b/core/pom.xml
index c4b4d98..a477f80 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -140,12 +140,12 @@
         <findbugs-annotations.version>2.0.1</findbugs-annotations.version>
 
         <commons-logging.version>1.2</commons-logging.version>
-        <commons-cli.version>1.3.1</commons-cli.version>
         <commons-httpclient.version>3.1</commons-httpclient.version>
         <commons-codec.version>1.10</commons-codec.version>
         <commons-email.version>1.4</commons-email.version>
         <commons-io.version>2.6</commons-io.version>
         <com-sun-mail.version>1.5.2</com-sun-mail.version>
+        <jopt-simple.version>6.0-alpha-3</jopt-simple.version>
 
         <jackson.version>2.8.0</jackson.version>
         <gson.version>2.7</gson.version>
@@ -1542,11 +1542,6 @@ ${license.additional-notes}
 
             <!-- Apache Commons -->
             <dependency>
-                <groupId>commons-cli</groupId>
-                <artifactId>commons-cli</artifactId>
-                <version>${commons-cli.version}</version>
-            </dependency>
-            <dependency>
                 <groupId>commons-httpclient</groupId>
                 <artifactId>commons-httpclient</artifactId>
                 <version>${commons-httpclient.version}</version>
@@ -1562,6 +1557,12 @@ ${license.additional-notes}
                 <version>${commons-io.version}</version>
             </dependency>
 
+            <dependency>
+                <groupId>net.sf.jopt-simple</groupId>
+                <artifactId>jopt-simple</artifactId>
+                <version>${jopt-simple.version}</version>
+            </dependency>
+
             <!-- Dependency injection -->
             <dependency>
                 <groupId>com.google.inject</groupId>
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/Constants.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/Constants.java
deleted file mode 100644
index 208ad65..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/Constants.java
+++ /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.
- */
-
-package org.apache.isis.core.runtime.runner;
-
-import org.apache.isis.core.runtime.logging.LoggingConstants;
-
-public final class Constants {
-
-    private Constants() {
-    }
-
-    public static final String TYPE_OPT = "t";
-    public static final String TYPE_LONG_OPT = "type";
-
-    public static final String CONFIGURATION_OPT = "c";
-    public static final String CONFIGURATION_LONG_OPT = "config";
-
-    public static final String APP_MANIFEST_OPT = "m";
-    public static final String APP_MANIFEST_LONG_OPT = "manifest";
-
-    public static final String FIXTURE_OPT = "f";
-    public static final String FIXTURE_LONG_OPT = "fixture";
-
-    public static final String HELP_OPT = "h";
-    public static final String HELP_LONG_OPT = "help";
-
-    public static final String USER_OPT = "u";
-    public static final String USER_LONG_OPT = "user";
-
-    public static final String PASSWORD_OPT = "p";
-    public static final String PASSWORD_LONG_OPT = "password";
-
-    public static final String DEBUG_OPT = LoggingConstants.DEBUG_OPT;
-    public static final String VERBOSE_OPT = LoggingConstants.VERBOSE_OPT;
-    public static final String QUIET_OPT = LoggingConstants.QUIET_OPT;
-
-    public static final String ADDITIONAL_PROPERTY = "D";
-
-}
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerAdditionalProperty.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerAdditionalProperty.java
deleted file mode 100644
index ae3e9aa..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerAdditionalProperty.java
+++ /dev/null
@@ -1,75 +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.runner.opts;
-
-import static org.apache.isis.core.runtime.runner.Constants.ADDITIONAL_PROPERTY;
-
-import java.util.List;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.OptionBuilder;
-import org.apache.commons.cli.Options;
-
-import org.apache.isis.config.builder.IsisConfigurationBuilder;
-import org.apache.isis.core.runtime.optionhandler.BootPrinter;
-import org.apache.isis.core.runtime.optionhandler.OptionHandlerAbstract;
-import org.apache.isis.core.runtime.runner.Constants;
-
-public class OptionHandlerAdditionalProperty extends OptionHandlerAbstract {
-
-    private List<String> additionalProperties;
-
-    @Override
-    @SuppressWarnings("static-access")
-    public void addOption(final Options options) {
-        final Option option = OptionBuilder.withArgName("property=value").hasArg().withValueSeparator().withDescription("use value for given property").create(ADDITIONAL_PROPERTY);
-        option.setArgs(Option.UNLIMITED_VALUES);
-        options.addOption(option);
-    }
-
-    @Override
-    public boolean handle(final CommandLine commandLine, final BootPrinter bootPrinter, final Options options) {
-        additionalProperties = getOptionValues(commandLine, Constants.ADDITIONAL_PROPERTY);
-        return true;
-    }
-
-    @Override
-    public void prime(final IsisConfigurationBuilder isisConfigurationBuilder) {
-        addConfigurationProperties(isisConfigurationBuilder, additionalProperties);
-    }
-
-    private void addConfigurationProperties(final IsisConfigurationBuilder isisConfigurationBuilder, final List<String> additionalProperties) {
-        if (additionalProperties == null) {
-            return;
-        }
-        String key = null, value = null;
-        for (final String additionalProperty : additionalProperties) {
-            if (key == null) {
-                key = additionalProperty;
-            } else {
-                value = additionalProperty;
-                isisConfigurationBuilder.add(key, value);
-                key = null;
-            }
-        }
-    }
-
-}
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerAppManifest.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerAppManifest.java
deleted file mode 100644
index 1e4c0f1..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerAppManifest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.runtime.runner.opts;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.OptionBuilder;
-import org.apache.commons.cli.Options;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.config.ConfigurationConstants;
-import org.apache.isis.config.builder.IsisConfigurationBuilder;
-import org.apache.isis.core.runtime.optionhandler.BootPrinter;
-import org.apache.isis.core.runtime.optionhandler.OptionHandlerAbstract;
-import org.apache.isis.core.runtime.runner.Constants;
-
-import static org.apache.isis.core.runtime.runner.Constants.APP_MANIFEST_LONG_OPT;
-import static org.apache.isis.core.runtime.runner.Constants.APP_MANIFEST_OPT;
-
-public class OptionHandlerAppManifest extends OptionHandlerAbstract {
-
-    private static final Logger LOG = LoggerFactory.getLogger(OptionHandlerAppManifest.class);
-    private String appManifestClassName;
-
-    public OptionHandlerAppManifest() {
-        super();
-    }
-
-    @Override
-    @SuppressWarnings("static-access")
-    public void addOption(final Options options) {
-        final Option option = OptionBuilder
-                .withArgName("app manifest").hasArg()
-                .withLongOpt(APP_MANIFEST_LONG_OPT)
-                .withDescription("fully qualified AppManifest class")
-                .create(APP_MANIFEST_OPT);
-        options.addOption(option);
-    }
-
-    @Override
-    public boolean handle(final CommandLine commandLine, final BootPrinter bootPrinter, final Options options) {
-        appManifestClassName = commandLine.getOptionValue(Constants.APP_MANIFEST_OPT);
-        return true;
-    }
-
-    @Override
-    public void prime(final IsisConfigurationBuilder isisConfigurationBuilder) {
-        if (appManifestClassName == null) {
-            return;
-        }
-        prime(isisConfigurationBuilder, ConfigurationConstants.APP_MANIFEST_KEY, appManifestClassName);
-    }
-
-    static void prime(IsisConfigurationBuilder isisConfigurationBuilder, String key, String value) {
-        LOG.info("priming: {}={}", key, value);
-        isisConfigurationBuilder.add(key, value);
-    }
-
-
-}
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerConfiguration.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerConfiguration.java
deleted file mode 100644
index 90ec655..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerConfiguration.java
+++ /dev/null
@@ -1,65 +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.runner.opts;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.OptionBuilder;
-import org.apache.commons.cli.Options;
-
-import org.apache.isis.config.IsisConfiguration;
-import org.apache.isis.config.NotFoundPolicy;
-import org.apache.isis.config.builder.IsisConfigurationBuilder;
-import org.apache.isis.core.runtime.optionhandler.BootPrinter;
-import org.apache.isis.core.runtime.optionhandler.OptionHandlerAbstract;
-import org.apache.isis.core.runtime.runner.Constants;
-
-import static org.apache.isis.core.runtime.runner.Constants.CONFIGURATION_LONG_OPT;
-import static org.apache.isis.core.runtime.runner.Constants.CONFIGURATION_OPT;
-
-public class OptionHandlerConfiguration extends OptionHandlerAbstract {
-
-    private String configurationResource;
-
-    @Override
-    @SuppressWarnings("static-access")
-    public void addOption(final Options options) {
-        final Option option = OptionBuilder.withArgName("config file").hasArg().withLongOpt(CONFIGURATION_LONG_OPT).withDescription("read in configuration file (as well as isis.properties)").create(CONFIGURATION_OPT);
-        options.addOption(option);
-    }
-
-    @Override
-    public boolean handle(final CommandLine commandLine, final BootPrinter bootPrinter, final Options options) {
-        configurationResource = commandLine.getOptionValue(Constants.CONFIGURATION_OPT);
-        return true;
-    }
-
-    @Override
-    public void prime(final IsisConfigurationBuilder isisConfigurationBuilder) {
-        if (configurationResource == null) {
-            return;
-        }
-        isisConfigurationBuilder.addConfigurationResource(
-                configurationResource, 
-                NotFoundPolicy.FAIL_FAST, 
-                IsisConfiguration.ContainsPolicy.IGNORE);
-    }
-
-}
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerFixture.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerFixture.java
deleted file mode 100644
index e113ae5..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerFixture.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.runtime.runner.opts;
-
-import static org.apache.isis.core.runtime.runner.Constants.FIXTURE_LONG_OPT;
-import static org.apache.isis.core.runtime.runner.Constants.FIXTURE_OPT;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.OptionBuilder;
-import org.apache.commons.cli.Options;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.core.runtime.optionhandler.BootPrinter;
-import org.apache.isis.core.runtime.runner.Constants;
-
-public class OptionHandlerFixture extends OptionHandlerFixtureAbstract {
-
-    private static final Logger LOG = LoggerFactory.getLogger(OptionHandlerFixture.class);
-
-    public OptionHandlerFixture() {
-        super();
-    }
-
-    @Override
-    @SuppressWarnings("static-access")
-    public void addOption(final Options options) {
-        final Option option = OptionBuilder
-                .withArgName("class name").hasArg()
-                .withLongOpt(FIXTURE_LONG_OPT)
-                .withDescription("fully qualified fixture class")
-                .create(FIXTURE_OPT);
-        options.addOption(option);
-    }
-
-    @Override
-    public boolean handle(final CommandLine commandLine, final BootPrinter bootPrinter, final Options options) {
-        fixtureClassName = commandLine.getOptionValue(Constants.FIXTURE_OPT);
-        return true;
-    }
-
-
-}
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerFixtureAbstract.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerFixtureAbstract.java
deleted file mode 100644
index a4a339d..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerFixtureAbstract.java
+++ /dev/null
@@ -1,53 +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.runner.opts;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.config.ConfigurationConstants;
-import org.apache.isis.config.builder.IsisConfigurationBuilder;
-import org.apache.isis.core.runtime.optionhandler.OptionHandlerAbstract;
-import org.apache.isis.core.runtime.system.SystemConstants;
-
-public abstract class OptionHandlerFixtureAbstract extends OptionHandlerAbstract {
-
-    private static final Logger LOG = LoggerFactory.getLogger(OptionHandlerFixtureAbstract.class);
-
-    public static final String DATANUCLEUS_ROOT_KEY = ConfigurationConstants.ROOT + "persistor.datanucleus.";
-    public static final String DATANUCLEUS_INSTALL_FIXTURES_KEY = DATANUCLEUS_ROOT_KEY + "install-fixtures";
-
-    protected String fixtureClassName;
-
-    @Override
-    public void prime(final IsisConfigurationBuilder isisConfigurationBuilder) {
-        if (fixtureClassName == null) {
-            return;
-        }
-        prime(isisConfigurationBuilder, SystemConstants.FIXTURE_KEY, fixtureClassName);
-        prime(isisConfigurationBuilder, DATANUCLEUS_INSTALL_FIXTURES_KEY, "true");
-    }
-
-    static void prime(IsisConfigurationBuilder isisConfigurationBuilder, String key, String value) {
-        LOG.info("priming: {}={}", key, value);
-        isisConfigurationBuilder.add(key, value);
-    }
-
-}
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerFixtureFromEnvironmentVariable.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerFixtureFromEnvironmentVariable.java
deleted file mode 100644
index defbead..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerFixtureFromEnvironmentVariable.java
+++ /dev/null
@@ -1,54 +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.runner.opts;
-
-import java.util.Map;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.Options;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.core.runtime.optionhandler.BootPrinter;
-
-public class OptionHandlerFixtureFromEnvironmentVariable extends OptionHandlerFixtureAbstract {
-
-    private static final Logger LOG = LoggerFactory.getLogger(OptionHandlerFixtureFromEnvironmentVariable.class);
-
-
-    @Override
-    @SuppressWarnings("static-access")
-    public void addOption(final Options options) {
-        // no-op
-    }
-
-    @Override
-    public boolean handle(final CommandLine commandLine, final BootPrinter bootPrinter, final Options options) {
-        Map<String, String> properties = System.getenv();
-        for (String key : properties.keySet()) {
-            if (key.equalsIgnoreCase("IsisFixture") || key.equalsIgnoreCase("IsisFixtures")) {
-                this.fixtureClassName = properties.get(key);
-                return true;
-            }
-        }
-        return true;
-    }
-
-}
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerHelp.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerHelp.java
deleted file mode 100644
index e7d2283..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerHelp.java
+++ /dev/null
@@ -1,60 +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.runner.opts;
-
-import static org.apache.isis.core.runtime.runner.Constants.HELP_LONG_OPT;
-import static org.apache.isis.core.runtime.runner.Constants.HELP_OPT;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.Options;
-
-import org.apache.isis.config.builder.IsisConfigurationBuilder;
-import org.apache.isis.core.runtime.optionhandler.BootPrinter;
-import org.apache.isis.core.runtime.optionhandler.OptionHandlerAbstract;
-import org.apache.isis.core.runtime.runner.Constants;
-
-public class OptionHandlerHelp extends OptionHandlerAbstract {
-
-    public OptionHandlerHelp() {
-        super();
-    }
-
-    @Override
-    public void addOption(final Options options) {
-        options.addOption(HELP_OPT, HELP_LONG_OPT, false, "show this help");
-
-    }
-
-    @Override
-    public boolean handle(final CommandLine commandLine, final BootPrinter bootPrinter, final Options options) {
-        if (commandLine.hasOption(Constants.HELP_OPT)) {
-            bootPrinter.printHelp(options);
-            return false;
-        }
-        return true;
-    }
-
-    @Override
-    public void prime(final IsisConfigurationBuilder isisConfigurationBuilder) {
-        // nothing to do
-
-    }
-
-}
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerInitParameters.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerInitParameters.java
deleted file mode 100644
index d974522..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerInitParameters.java
+++ /dev/null
@@ -1,89 +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.runner.opts;
-
-import java.util.Enumeration;
-import java.util.Map;
-
-import javax.servlet.ServletContext;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.Options;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.commons.internal.collections._Maps;
-import org.apache.isis.config.builder.IsisConfigurationBuilder;
-import org.apache.isis.core.runtime.optionhandler.BootPrinter;
-import org.apache.isis.core.runtime.optionhandler.OptionHandlerAbstract;
-
-public class OptionHandlerInitParameters extends OptionHandlerAbstract {
-
-    private static final Logger LOG = LoggerFactory.getLogger(OptionHandlerInitParameters.class);
-    private final ServletContext servletContext;
-
-
-
-    public OptionHandlerInitParameters(ServletContext servletContext) {
-        this.servletContext = servletContext;
-    }
-
-    @Override
-    @SuppressWarnings("static-access")
-    public void addOption(final Options options) {
-        // no-op
-    }
-
-    @Override
-    public boolean handle(final CommandLine commandLine, final BootPrinter bootPrinter, final Options options) {
-        // no-op
-        return true;
-    }
-
-    @Override
-    public void prime(final IsisConfigurationBuilder isisConfigurationBuilder) {
-        Map<String,String> additionalProperties = asMap(servletContext);
-        LOG.debug("priming configuration builder: {} properties to prime", additionalProperties.size());
-        addConfigurationProperties(isisConfigurationBuilder, additionalProperties);
-    }
-
-    private static Map<String, String> asMap(ServletContext servletContext) {
-        Enumeration<String> initParameterNames = servletContext.getInitParameterNames();
-        final Map<String,String> map = _Maps.newTreeMap();
-        while(initParameterNames.hasMoreElements()) {
-            final String initParameterName = initParameterNames.nextElement();
-            final String initParameterValue = servletContext.getInitParameter(initParameterName);
-            if (initParameterName.startsWith("isis.")) {
-                map.put(initParameterName, initParameterValue);
-            }
-        }
-        return map;
-    }
-
-    private static void addConfigurationProperties(final IsisConfigurationBuilder isisConfigurationBuilder, final Map<String, String> additionalProperties) {
-        for (final String propertyKey : additionalProperties.keySet()) {
-            final String propertyValue = additionalProperties.get(propertyKey);
-
-            LOG.debug("priming: {}={}", propertyKey, propertyValue);
-            isisConfigurationBuilder.add(propertyKey, propertyValue);
-        }
-    }
-
-}
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerPassword.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerPassword.java
deleted file mode 100644
index fe058d6..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerPassword.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.runtime.runner.opts;
-
-import static org.apache.isis.core.runtime.runner.Constants.PASSWORD_LONG_OPT;
-import static org.apache.isis.core.runtime.runner.Constants.PASSWORD_OPT;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.OptionBuilder;
-import org.apache.commons.cli.Options;
-
-import org.apache.isis.config.builder.IsisConfigurationBuilder;
-import org.apache.isis.core.runtime.optionhandler.BootPrinter;
-import org.apache.isis.core.runtime.optionhandler.OptionHandlerAbstract;
-import org.apache.isis.core.runtime.runner.Constants;
-import org.apache.isis.core.runtime.system.SystemConstants;
-
-public class OptionHandlerPassword extends OptionHandlerAbstract {
-
-    private String password;
-
-    public OptionHandlerPassword() {
-        super();
-    }
-
-    @Override
-    @SuppressWarnings("static-access")
-    public void addOption(final Options options) {
-        final Option option = OptionBuilder.withArgName("password").hasArg().withLongOpt(PASSWORD_LONG_OPT).withDescription("password to automatically log in with").create(PASSWORD_OPT);
-        options.addOption(option);
-    }
-
-    @Override
-    public boolean handle(final CommandLine commandLine, final BootPrinter bootPrinter, final Options options) {
-        password = commandLine.getOptionValue(Constants.PASSWORD_OPT);
-        return true;
-    }
-
-    @Override
-    public void prime(final IsisConfigurationBuilder isisConfigurationBuilder) {
-        isisConfigurationBuilder.add(SystemConstants.PASSWORD_KEY, password);
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-}
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerSystemProperties.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerSystemProperties.java
deleted file mode 100644
index c5c4654..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerSystemProperties.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.runtime.runner.opts;
-
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.Options;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.commons.internal.collections._Maps;
-import org.apache.isis.config.builder.IsisConfigurationBuilder;
-import org.apache.isis.core.runtime.optionhandler.BootPrinter;
-import org.apache.isis.core.runtime.optionhandler.OptionHandlerAbstract;
-
-public class OptionHandlerSystemProperties extends OptionHandlerAbstract {
-
-    private static final Logger LOG = LoggerFactory.getLogger(OptionHandlerSystemProperties.class);
-
-    private Map<String,String> additionalProperties;
-
-    @Override
-    public void addOption(final Options options) {
-        // no-op
-    }
-
-    @Override
-    public boolean handle(final CommandLine commandLine, final BootPrinter bootPrinter, final Options options) {
-        this.additionalProperties = asMap(System.getProperties());
-        return true;
-    }
-
-    private static Map<String, String> asMap(Properties properties) {
-        final Map<String,String> map = _Maps.newTreeMap();
-        for (String key : properties.stringPropertyNames()) {
-            final String value = properties.getProperty(key);
-            if (key.startsWith("isis.")) {
-                map.put(key, value);
-            }
-        }
-        return map;
-    }
-
-    @Override
-    public void prime(final IsisConfigurationBuilder isisConfigurationBuilder) {
-        LOG.debug("priming configuration builder: {} properties to prime", additionalProperties.size());
-        addConfigurationProperties(isisConfigurationBuilder, additionalProperties);
-    }
-
-    private static void addConfigurationProperties(final IsisConfigurationBuilder isisConfigurationBuilder, final Map<String, String> additionalProperties) {
-        for (final String propertyKey : additionalProperties.keySet()) {
-            final String propertyValue = additionalProperties.get(propertyKey);
-
-            LOG.info("priming: {}={}", propertyKey, propertyValue);
-            isisConfigurationBuilder.add(propertyKey, propertyValue);
-        }
-    }
-
-}
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerUser.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerUser.java
deleted file mode 100644
index 02c6eab..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerUser.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.runtime.runner.opts;
-
-import static org.apache.isis.core.runtime.runner.Constants.USER_LONG_OPT;
-import static org.apache.isis.core.runtime.runner.Constants.USER_OPT;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.OptionBuilder;
-import org.apache.commons.cli.Options;
-
-import org.apache.isis.config.builder.IsisConfigurationBuilder;
-import org.apache.isis.core.runtime.optionhandler.BootPrinter;
-import org.apache.isis.core.runtime.optionhandler.OptionHandlerAbstract;
-import org.apache.isis.core.runtime.runner.Constants;
-import org.apache.isis.core.runtime.system.SystemConstants;
-
-public class OptionHandlerUser extends OptionHandlerAbstract {
-
-    private String userName;
-
-    public OptionHandlerUser() {
-        super();
-    }
-
-    @Override
-    @SuppressWarnings("static-access")
-    public void addOption(final Options options) {
-        final Option option = OptionBuilder.withArgName("user name").hasArg().withLongOpt(USER_LONG_OPT).withDescription("user name to log in with").create(USER_OPT);
-        options.addOption(option);
-
-    }
-
-    @Override
-    public boolean handle(final CommandLine commandLine, final BootPrinter bootPrinter, final Options options) {
-        userName = commandLine.getOptionValue(Constants.USER_OPT);
-        return true;
-    }
-
-    @Override
-    public void prime(final IsisConfigurationBuilder isisConfigurationBuilder) {
-        isisConfigurationBuilder.add(SystemConstants.USER_KEY, userName);
-    }
-
-    public String getUserName() {
-        return userName;
-    }
-
-}
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java
index cc69aed..f4d7d76 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java
@@ -22,6 +22,7 @@ import java.util.Map;
 import javax.jdo.PersistenceManager;
 
 import org.apache.isis.applib.query.Query;
+import org.apache.isis.config.ConfigurationConstants;
 import org.apache.isis.config.IsisConfiguration;
 import org.apache.isis.core.commons.components.SessionScopedComponent;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -31,7 +32,6 @@ import org.apache.isis.core.metamodel.adapter.oid.RootOid;
 import org.apache.isis.core.metamodel.services.ServicesInjector;
 import org.apache.isis.core.runtime.persistence.objectstore.transaction.PersistenceCommand;
 import org.apache.isis.core.runtime.persistence.objectstore.transaction.TransactionalResource;
-import org.apache.isis.core.runtime.runner.opts.OptionHandlerFixtureAbstract;
 import org.apache.isis.core.runtime.system.persistence.adaptermanager.ObjectAdapterContext.MementoRecreateObjectSupport;
 import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;
 
@@ -155,11 +155,11 @@ extends
     static final String SERVICE_IDENTIFIER = "1";
 
     // -- FIXTURE SUPPORT
-    
+
     /**
      * @see #isFixturesInstalled()
      */
-    static final String INSTALL_FIXTURES_KEY = OptionHandlerFixtureAbstract.DATANUCLEUS_INSTALL_FIXTURES_KEY;
+    static final String INSTALL_FIXTURES_KEY = "isis.persistor.datanucleus.install-fixtures";
     static final boolean INSTALL_FIXTURES_DEFAULT = false;
     
     boolean isFixturesInstalled();
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionBase.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionBase.java
index 94cc0de..90c98e4 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionBase.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionBase.java
@@ -40,7 +40,6 @@ import org.apache.isis.core.commons.util.ToString;
 import org.apache.isis.core.metamodel.services.ServicesInjector;
 import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
 import org.apache.isis.core.runtime.persistence.FixturesInstalledFlag;
-import org.apache.isis.core.runtime.runner.opts.OptionHandlerFixtureAbstract;
 import org.apache.isis.core.runtime.services.changes.ChangedObjectsServiceInternal;
 import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;
 import org.apache.isis.core.security.authentication.AuthenticationSession;
@@ -51,7 +50,6 @@ abstract class PersistenceSessionBase implements PersistenceSession {
     // -- CONSTANTS
 
     protected static final Logger LOG = LoggerFactory.getLogger(PersistenceSession.class);
-    protected static final String ROOT_KEY = OptionHandlerFixtureAbstract.DATANUCLEUS_ROOT_KEY;
 
     // -- FIELDS
 
diff --git a/core/webserver/pom.xml b/core/webserver/pom.xml
index 09b2438..e567a15 100644
--- a/core/webserver/pom.xml
+++ b/core/webserver/pom.xml
@@ -68,6 +68,12 @@
             <artifactId>jetty-webapp</artifactId>
         </dependency>
 
+        <!-- command line options support  -->
+        <dependency>
+            <groupId>net.sf.jopt-simple</groupId>
+            <artifactId>jopt-simple</artifactId>
+        </dependency>
+
         <dependency>
             <groupId>org.apache.isis.core</groupId>
             <artifactId>isis-core-plugins-discovery-reflections</artifactId>
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/Strings.java b/core/webserver/src/main/java/org/apache/isis/WebServer.java
similarity index 69%
rename from core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/Strings.java
rename to core/webserver/src/main/java/org/apache/isis/WebServer.java
index 7b608bc..78c7c7a 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/Strings.java
+++ b/core/webserver/src/main/java/org/apache/isis/WebServer.java
@@ -17,17 +17,22 @@
  *  under the License.
  */
 
-package org.apache.isis.core.runtime.runner.opts;
+package org.apache.isis;
 
-import java.util.List;
+public class WebServer {
 
-final class Strings {
-
-    private Strings() {
+    public static void main(final String[] args) {
+        org.apache.isis.core.webserver.WebServer.main(args);
     }
 
-    static String plural(final List<String> collection, final String moreThanOne, final String ifNone) {
-        return (collection.size() > 1 ? moreThanOne : ifNone);
-    }
+    public static final class Constants {
+
+        private Constants() {
+        }
 
-}
\ No newline at end of file
+        public static final String APP_MANIFEST_OPT = "m";
+        public static final String APP_MANIFEST_LONG_OPT = "manifest";
+
+
+    }
+}
diff --git a/core/webserver/src/main/java/org/apache/isis/core/webserver/WebServer.java b/core/webserver/src/main/java/org/apache/isis/core/webserver/WebServer.java
new file mode 100644
index 0000000..a0e16b1
--- /dev/null
+++ b/core/webserver/src/main/java/org/apache/isis/core/webserver/WebServer.java
@@ -0,0 +1,144 @@
+/*
+ *  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.webserver;
+
+import java.io.IOException;
+import java.util.Arrays;
+
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.webapp.WebAppContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.isis.applib.AppManifest;
+import org.apache.isis.commons.internal.context._Context;
+import org.apache.isis.core.commons.exceptions.IsisException;
+
+import joptsimple.OptionParser;
+import joptsimple.OptionSet;
+import joptsimple.OptionSpec;
+import joptsimple.ValueConversionException;
+import joptsimple.ValueConverter;
+
+public class WebServer {
+
+    private static final Logger LOG = LoggerFactory.getLogger(WebServer.class);
+
+    public static void main(final String[] args) {
+        new WebServer().run(args);
+    }
+
+    public void run(final String[] args) {
+
+        final OptionParser parser = new OptionParser();
+
+        final OptionSpec<Class> appManifestClassOptSpec =
+                parser.acceptsAll( Arrays.asList("m", "manifest", "appManifest"), "AppManifest implementation" )
+                        .withRequiredArg()
+                        .withValuesConvertedBy(new ValueConverter<Class>() {
+                            @Override public Class convert(final String className) {
+                                try {
+                                    final Class<?> aClass = _Context.getDefaultClassLoader().loadClass(className);
+                                    if(!AppManifest.class.isAssignableFrom(aClass)) {
+                                        throw new ValueConversionException("not a subclass of " + AppManifest.class.getName() );
+                                    }
+                                    return aClass;
+                                } catch (ClassNotFoundException e) {
+                                    throw new ValueConversionException("not recognised as a class");
+                                }
+                            }
+
+                            @Override public Class<? extends Class> valueType() {
+                                return Class.class;
+                            }
+
+                            @Override public String valuePattern() {
+                                return null;
+                            }
+                        });
+
+        final OptionSpec<Integer> portOptSpec =
+                parser.acceptsAll( Arrays.asList("p", "port"), "port to listen on" )
+                        .withRequiredArg()
+                        .ofType( Integer.class )
+                        .defaultsTo(8080);
+        final OptionSpec<Void> prototypeOptSpec =
+                parser.acceptsAll( Arrays.asList("d", "dev", "prototype"), "Prototype mode" );
+
+        final OptionSet optionSet = parser.parse(args);
+        try {
+            optionSet.valueOfOptional(appManifestClassOptSpec).ifPresent(
+                    appManifestClass -> System.setProperty("isis.appManifest", appManifestClass.getName()));
+            if(optionSet.has(prototypeOptSpec)) {
+                System.setProperty("isis.deploymentType", "PROTOTYPING");
+            }
+        } catch (Exception ex) {
+            try {
+                parser.printHelpOn(System.err);
+                System.err.println();
+                System.err.print(ex.getMessage());
+                final Throwable cause = ex.getCause();
+                if(cause != null) {
+                    System.err.println(": " + cause.getMessage());
+                    System.err.println();
+                }
+            } catch (IOException e) {
+                // ignore
+            }
+            System.exit(1);
+        }
+
+        final int port = optionSet.valueOf(portOptSpec);
+        // create and start
+        LOG.info("Running Jetty on port '{}' to serve the web application", port);
+
+        final Server jettyServer = new Server(port);
+        final WebAppContext context = new WebAppContext("src/main/webapp", "");
+        jettyServer.setHandler(context);
+
+        start(jettyServer);
+    }
+
+    private void start(final Server jettyServer) {
+        long start = System.currentTimeMillis();
+        try {
+            jettyServer.start();
+            LOG.info("Started the application in {}ms", System.currentTimeMillis() - start);
+
+        } catch (final Exception ex) {
+            try {
+                jettyServer.stop();
+                jettyServer.join();
+            } catch (Exception e) {
+                // ignore
+            }
+            throw new IsisException("Unable to start Jetty server", ex);
+        }
+        try {
+            System.in.read();
+            System.out.println(">>> STOPPING EMBEDDED JETTY SERVER");
+            jettyServer.stop();
+            jettyServer.join();
+
+        } catch (final Exception ex) {
+            throw new IsisException("Unable to stop Jetty server", ex);
+        }
+    }
+}
diff --git a/example/application/simpleapp/application/src/main/java/domainapp/application/services/homepage/HomePageViewModel.layout.xml b/example/application/simpleapp/application/src/main/java/domainapp/application/services/homepage/HomePageViewModel.layout.xml
index 6f6aa72..26cc3df 100644
--- a/example/application/simpleapp/application/src/main/java/domainapp/application/services/homepage/HomePageViewModel.layout.xml
+++ b/example/application/simpleapp/application/src/main/java/domainapp/application/services/homepage/HomePageViewModel.layout.xml
@@ -24,7 +24,7 @@
             <bs3:row>
                 <bs3:col span="12" unreferencedActions="true">
                     <domainObject/>
-                    <action id="clearHints" hidden="EVERYWHERE"/>
+                    <action id="clearHints"/>
                     <action id="downloadLayoutXml" hidden="EVERYWHERE"/>
                     <action id="rebuildMetamodel" hidden="EVERYWHERE"/>
                     <action id="openRestApi" hidden="EVERYWHERE"/>