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 2014/11/04 09:15:28 UTC

[3/9] git commit: ISIS-939: more simplified of persistence sessions and object stores.

ISIS-939: more simplified of persistence sessions and object stores.

- deleted ObjectStoreSpi, just use ObjectStore (impl) directly;
- deleted AdapterManagerAbstract, not used
- deleted AdapterMapDelegator, not used
- for in-memory objectstore, renamed ObjectStorePersistedObjectsDefault (impl) to ObjectStorePersistedObjects (unextracted interface)
- renamed PersistenceSessionFactoryDelegate to ObjectStoreFactory
- renamed PersistenceSessionFactoryDelegating to PersistenceSessionFactory (unextracted interface)
- removed AdapterManagerSpi interface, just use AdapterManagerDefault directly instead.
- deleted AdpaterUtils, not used


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

Branch: refs/heads/ISIS-939
Commit: 1b33482f4ada6e5eb7ab287305ab5ee8a19c1649
Parents: 341df6f
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Mon Nov 3 19:27:18 2014 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Nov 4 00:43:15 2014 +0000

----------------------------------------------------------------------
 .../integtestsupport/IsisSystemDefault.java     |   2 +-
 .../integtestsupport/IsisSystemForTest.java     |   4 +-
 .../adapter/mgr/AdapterManagerAbstract.java     |  31 ---
 .../adapter/mgr/AdapterMapDelegator.java        |  50 ----
 .../noruntime/RuntimeContextNoRuntime.java      |  12 +-
 .../core/objectstore/InMemoryObjectStore.java   |  22 +-
 .../InMemoryPersistenceMechanismInstaller.java  |   6 +-
 .../InMemoryPersistenceSessionFactory.java      |  13 +-
 .../AbstractInMemoryPersistenceCommand.java     |   1 -
 .../commands/InMemoryCreateObjectCommand.java   |   1 -
 .../commands/InMemoryDestroyObjectCommand.java  |   1 -
 .../commands/InMemorySaveObjectCommand.java     |   1 -
 .../internal/ObjectStoreInstances.java          |   7 +-
 .../internal/ObjectStorePersistedObjects.java   |  62 ++++-
 .../ObjectStorePersistedObjectsDefault.java     | 102 --------
 .../PersistenceMechanismInstaller.java          |   6 +-
 .../PersistenceMechanismInstallerAbstract.java  |   5 +-
 .../persistence/FixturesInstalledFlag.java      |   3 +-
 .../runtime/persistence/ObjectStoreFactory.java |  35 +++
 .../persistence/PersistenceConstants.java       |   2 -
 .../PersistenceSessionFactoryDelegate.java      |  36 ---
 .../PersistenceSessionFactoryDelegating.java    | 237 -------------------
 .../adaptermanager/AdapterManagerDefault.java   |  62 +++--
 .../adaptermanager/AdapterUtils.java            |  58 -----
 .../persistence/objectstore/ObjectStoreSpi.java |  27 ---
 .../transaction/TransactionalResource.java      |  18 +-
 .../system/IsisSystemFixturesHookAbstract.java  |   2 +-
 .../core/runtime/system/SystemConstants.java    |   3 +-
 .../system/persistence/AdapterManagerSpi.java   |  51 ----
 .../runtime/system/persistence/ObjectStore.java |   7 +-
 .../system/persistence/PersistenceSession.java  |  13 +-
 .../persistence/PersistenceSessionFactory.java  | 199 ++++++++++++++--
 .../runtime/system/persistence/Persistor.java   |   2 +-
 .../system/session/IsisSessionFactory.java      |   6 +-
 .../session/IsisSessionFactoryDefault.java      |   3 +-
 .../IsisSystemAbstract.java                     |   4 +-
 .../IsisSystemUsingInstallers.java              |   2 +-
 .../jdo/datanucleus/DataNucleusObjectStore.java |   8 +-
 ...ataNucleusPersistenceMechanismInstaller.java |   4 +-
 ...bjectStoreInstances_findInstancesAndAdd.java |  16 +-
 ...tStorePersistedObjectsDefault_instances.java |   5 +-
 ...jectsDefault_savesOidGeneratorAsMemento.java |   4 +-
 ...ctStorePersistedObjectsDefault_services.java |   4 +-
 .../core/runtime/context/IsisContextTest.java   |  10 +-
 .../persistence/PersistenceSessionTest.java     |   5 +-
 ...onFactoryAbstractTest_init_and_shutdown.java |   2 +-
 .../system/transaction/IsisTransactionTest.java |  18 +-
 .../IsisSystemWithFixtures.java                 |   4 +-
 .../tck/ObjectStoreContractTest_persist.java    |   6 +-
 .../InMemoryObjectStoreTest_openAndClose.java   |   7 +-
 50 files changed, 407 insertions(+), 782 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/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 8f8a05c..65d0ac9 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
@@ -42,10 +42,10 @@ 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.installerregistry.installerapi.PersistenceMechanismInstaller;
+import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
 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;

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/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 b4976ff..66ac70c 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
@@ -47,10 +47,10 @@ import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
 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.persistence.objectstore.ObjectStoreSpi;
 import org.apache.isis.core.runtime.services.ServicesInstallerFromAnnotation;
 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;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
 import org.apache.isis.core.runtime.system.persistence.Persistor;
 import org.apache.isis.core.runtime.system.transaction.IsisTransaction;
@@ -565,7 +565,7 @@ public class IsisSystemForTest implements org.junit.rules.TestRule, DomainServic
     }
 
     @SuppressWarnings("unchecked")
-    public <T extends ObjectStoreSpi> T getObjectStore(Class<T> cls) {
+    public <T extends ObjectStore> T getObjectStore(Class<T> cls) {
         final PersistenceSession persistenceSession = getPersistenceSession();
         return (T) persistenceSession.getObjectStore();
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterManagerAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterManagerAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterManagerAbstract.java
deleted file mode 100644
index a3ee9ad..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterManagerAbstract.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.apache.isis.core.metamodel.adapter.mgr;
-
-import org.apache.isis.core.commons.components.Injectable;
-
-public abstract class AdapterManagerAbstract implements AdapterManager, Injectable {
-
-    @Override
-    public void injectInto(final Object candidate) {
-        if (AdapterManagerAware.class.isAssignableFrom(candidate.getClass())) {
-            final AdapterManagerAware cast = AdapterManagerAware.class.cast(candidate);
-            cast.setAdapterManager(this);
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterMapDelegator.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterMapDelegator.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterMapDelegator.java
deleted file mode 100644
index 51ab391..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterMapDelegator.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 org.apache.isis.core.metamodel.adapter.mgr;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
-
-/**
- * Just delegates to an underlying {@link AdapterManager}.
- * 
- * <p>
- * Provided to allow subclasses to override specific methods if required.
- */
-public abstract class AdapterMapDelegator extends AdapterManagerAbstract {
-
-    private final AdapterManager underlying;
-
-    public AdapterMapDelegator(final AdapterManager underlying) {
-        this.underlying = underlying;
-    }
-
-    @Override
-    public ObjectAdapter getAdapterFor(final Object pojo) {
-        return underlying.getAdapterFor(pojo);
-    }
-
-    @Override
-    public ObjectAdapter adapterFor(final Object domainObject) {
-        return underlying.adapterFor(domainObject);
-    }
-
-    @Override
-    public ObjectAdapter adapterFor(final Object pojo, final ObjectAdapter ownerAdapter, final OneToManyAssociation collection) {
-        return underlying.adapterFor(pojo, ownerAdapter, collection);
-    }
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/noruntime/RuntimeContextNoRuntime.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/noruntime/RuntimeContextNoRuntime.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/noruntime/RuntimeContextNoRuntime.java
index 33c0419..8e19839 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/noruntime/RuntimeContextNoRuntime.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/noruntime/RuntimeContextNoRuntime.java
@@ -29,7 +29,7 @@ import org.apache.isis.core.commons.authentication.AuthenticationSessionProvider
 import org.apache.isis.core.commons.authentication.AuthenticationSessionProviderAbstract;
 import org.apache.isis.core.metamodel.adapter.*;
 import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
-import org.apache.isis.core.metamodel.adapter.mgr.AdapterManagerAbstract;
+import org.apache.isis.core.metamodel.adapter.mgr.AdapterManagerAware;
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
 import org.apache.isis.core.metamodel.adapter.oid.TypedOid;
 import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
@@ -96,7 +96,15 @@ public class RuntimeContextNoRuntime extends RuntimeContextAbstract {
                 throw new UnsupportedOperationException("Not supported by this implementation of RuntimeContext");
             }
         };
-        adapterManager = new AdapterManagerAbstract() {
+        adapterManager = new AdapterManager() {
+
+            @Override
+            public void injectInto(final Object candidate) {
+                if (AdapterManagerAware.class.isAssignableFrom(candidate.getClass())) {
+                    final AdapterManagerAware cast = AdapterManagerAware.class.cast(candidate);
+                    cast.setAdapterManager(this);
+                }
+            }
 
             @Override
             public ObjectAdapter getAdapterFor(final Object pojo) {

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/objectstore/InMemoryObjectStore.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/objectstore/InMemoryObjectStore.java b/core/runtime/src/main/java/org/apache/isis/core/objectstore/InMemoryObjectStore.java
index 5ae36cf..58a426c 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/objectstore/InMemoryObjectStore.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/objectstore/InMemoryObjectStore.java
@@ -23,14 +23,9 @@ import java.text.MessageFormat;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Vector;
-
 import com.google.common.collect.Lists;
-
-import org.apache.isis.core.runtime.persistence.ObjectNotFoundException;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
 import org.apache.isis.core.commons.debug.DebugBuilder;
 import org.apache.isis.core.commons.debug.DebugUtils;
 import org.apache.isis.core.commons.exceptions.IsisException;
@@ -52,21 +47,21 @@ import org.apache.isis.core.objectstore.commands.InMemoryDestroyObjectCommand;
 import org.apache.isis.core.objectstore.commands.InMemorySaveObjectCommand;
 import org.apache.isis.core.objectstore.internal.ObjectStoreInstances;
 import org.apache.isis.core.objectstore.internal.ObjectStorePersistedObjects;
-import org.apache.isis.core.objectstore.internal.ObjectStorePersistedObjectsDefault;
+import org.apache.isis.core.runtime.persistence.ObjectNotFoundException;
 import org.apache.isis.core.runtime.persistence.ObjectPersistenceException;
 import org.apache.isis.core.runtime.persistence.UnsupportedFindException;
-import org.apache.isis.core.runtime.persistence.objectstore.ObjectStoreSpi;
 import org.apache.isis.core.runtime.persistence.objectstore.transaction.CreateObjectCommand;
 import org.apache.isis.core.runtime.persistence.objectstore.transaction.DestroyObjectCommand;
 import org.apache.isis.core.runtime.persistence.objectstore.transaction.PersistenceCommand;
 import org.apache.isis.core.runtime.persistence.objectstore.transaction.SaveObjectCommand;
 import org.apache.isis.core.runtime.persistence.query.PersistenceQueryBuiltIn;
 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.PersistenceQuery;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
 
-public class InMemoryObjectStore implements ObjectStoreSpi {
+public class InMemoryObjectStore implements ObjectStore {
 
     private final static Logger LOG = LoggerFactory.getLogger(InMemoryObjectStore.class);
 
@@ -99,7 +94,7 @@ public class InMemoryObjectStore implements ObjectStoreSpi {
             if (inMemoryPersistenceSessionFactory != null) {
                 persistedObjects = inMemoryPersistenceSessionFactory.createPersistedObjects();
             } else {
-                persistedObjects = new ObjectStorePersistedObjectsDefault();
+                persistedObjects = new ObjectStorePersistedObjects();
             }
         } else {
             recreateAdapters();
@@ -465,8 +460,7 @@ public class InMemoryObjectStore implements ObjectStoreSpi {
     /**
      * Must use {@link IsisContext context}, because although this object is
      * recreated with each {@link PersistenceSession session}, the persisted
-     * objects that get
-     * {@link #attachPersistedObjects(ObjectStorePersistedObjects) attached} to
+     * objects that get attached to
      * it span multiple sessions.
      * 
      * <p>
@@ -481,9 +475,7 @@ public class InMemoryObjectStore implements ObjectStoreSpi {
     /**
      * Must use {@link IsisContext context}, because although this object is
      * recreated with each {@link PersistenceSession session}, the persisted
-     * objects that get
-     * {@link #attachPersistedObjects(ObjectStorePersistedObjects) attached} to
-     * it span multiple sessions.
+     * objects that get attached to it span multiple sessions.
      * 
      * <p>
      * The alternative design would be to laboriously inject the session into
@@ -500,7 +492,7 @@ public class InMemoryObjectStore implements ObjectStoreSpi {
 
 
     /**
-     * Downcasts the {@link PersistenceSessionFactory} to
+     * Downcasts the {@link org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory} to
      * {@link InMemoryPersistenceSessionFactory}.
      */
     protected InMemoryPersistenceSessionFactory getInMemoryPersistenceSessionFactory() {

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/objectstore/InMemoryPersistenceMechanismInstaller.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/objectstore/InMemoryPersistenceMechanismInstaller.java b/core/runtime/src/main/java/org/apache/isis/core/objectstore/InMemoryPersistenceMechanismInstaller.java
index 293d557..cc48c06 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/objectstore/InMemoryPersistenceMechanismInstaller.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/objectstore/InMemoryPersistenceMechanismInstaller.java
@@ -21,8 +21,8 @@ package org.apache.isis.core.objectstore;
 
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.runtime.installerregistry.installerapi.PersistenceMechanismInstallerAbstract;
-import org.apache.isis.core.runtime.persistence.objectstore.ObjectStoreSpi;
 import org.apache.isis.core.runtime.system.DeploymentType;
+import org.apache.isis.core.runtime.system.persistence.ObjectStore;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
 
 /**
@@ -50,10 +50,10 @@ public class InMemoryPersistenceMechanismInstaller extends PersistenceMechanismI
     // ///////////////////////////////////////////////////////////////
 
     /**
-     * Hook method to return {@link ObjectStoreSpi}.
+     * Hook method to return {@link ObjectStore}.
      */
     @Override
-    public ObjectStoreSpi createObjectStore(
+    public ObjectStore createObjectStore(
             final IsisConfiguration configuration) {
         return new InMemoryObjectStore();
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/objectstore/InMemoryPersistenceSessionFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/objectstore/InMemoryPersistenceSessionFactory.java b/core/runtime/src/main/java/org/apache/isis/core/objectstore/InMemoryPersistenceSessionFactory.java
index 3dc4ed1..455ca6a 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/objectstore/InMemoryPersistenceSessionFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/objectstore/InMemoryPersistenceSessionFactory.java
@@ -22,21 +22,20 @@ package org.apache.isis.core.objectstore;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.objectstore.internal.ObjectStoreInstances;
 import org.apache.isis.core.objectstore.internal.ObjectStorePersistedObjects;
-import org.apache.isis.core.objectstore.internal.ObjectStorePersistedObjectsDefault;
-import org.apache.isis.core.runtime.persistence.PersistenceSessionFactoryDelegate;
-import org.apache.isis.core.runtime.persistence.PersistenceSessionFactoryDelegating;
+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.IdentifierGenerator;
 import org.apache.isis.core.runtime.system.persistence.IdentifierGeneratorDefault;
 import org.apache.isis.core.runtime.system.persistence.OidGenerator;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
 
-public class InMemoryPersistenceSessionFactory extends PersistenceSessionFactoryDelegating {
+public class InMemoryPersistenceSessionFactory extends PersistenceSessionFactory {
 
     private ObjectStorePersistedObjects persistedObjects;
 
-    public InMemoryPersistenceSessionFactory(final DeploymentType deploymentType, final IsisConfiguration configuration, final PersistenceSessionFactoryDelegate persistenceSessionFactoryDelegate) {
-        super(deploymentType, configuration, persistenceSessionFactoryDelegate);
+    public InMemoryPersistenceSessionFactory(final DeploymentType deploymentType, final IsisConfiguration configuration, final ObjectStoreFactory objectStoreFactory) {
+        super(deploymentType, configuration, objectStoreFactory);
     }
 
     ObjectStorePersistedObjects getPersistedObjects() {
@@ -63,7 +62,7 @@ public class InMemoryPersistenceSessionFactory extends PersistenceSessionFactory
      * {@link InMemoryObjectStore#open() open}ed.
      */
     public ObjectStorePersistedObjects createPersistedObjects() {
-        return new ObjectStorePersistedObjectsDefault();
+        return new ObjectStorePersistedObjects();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/objectstore/commands/AbstractInMemoryPersistenceCommand.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/objectstore/commands/AbstractInMemoryPersistenceCommand.java b/core/runtime/src/main/java/org/apache/isis/core/objectstore/commands/AbstractInMemoryPersistenceCommand.java
index 6937cf6..9c5602c 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/objectstore/commands/AbstractInMemoryPersistenceCommand.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/objectstore/commands/AbstractInMemoryPersistenceCommand.java
@@ -21,7 +21,6 @@ package org.apache.isis.core.objectstore.commands;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.spec.ObjectSpecId;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/objectstore/commands/InMemoryCreateObjectCommand.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/objectstore/commands/InMemoryCreateObjectCommand.java b/core/runtime/src/main/java/org/apache/isis/core/objectstore/commands/InMemoryCreateObjectCommand.java
index efab9de..af2d363 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/objectstore/commands/InMemoryCreateObjectCommand.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/objectstore/commands/InMemoryCreateObjectCommand.java
@@ -21,7 +21,6 @@ package org.apache.isis.core.objectstore.commands;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.objectstore.internal.ObjectStorePersistedObjects;
 import org.apache.isis.core.runtime.persistence.ObjectPersistenceException;

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/objectstore/commands/InMemoryDestroyObjectCommand.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/objectstore/commands/InMemoryDestroyObjectCommand.java b/core/runtime/src/main/java/org/apache/isis/core/objectstore/commands/InMemoryDestroyObjectCommand.java
index 18d6b0c..16093ab 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/objectstore/commands/InMemoryDestroyObjectCommand.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/objectstore/commands/InMemoryDestroyObjectCommand.java
@@ -21,7 +21,6 @@ package org.apache.isis.core.objectstore.commands;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.objectstore.internal.ObjectStorePersistedObjects;
 import org.apache.isis.core.runtime.persistence.ObjectPersistenceException;

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/objectstore/commands/InMemorySaveObjectCommand.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/objectstore/commands/InMemorySaveObjectCommand.java b/core/runtime/src/main/java/org/apache/isis/core/objectstore/commands/InMemorySaveObjectCommand.java
index 789b86f..4b48f61 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/objectstore/commands/InMemorySaveObjectCommand.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/objectstore/commands/InMemorySaveObjectCommand.java
@@ -21,7 +21,6 @@ package org.apache.isis.core.objectstore.commands;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.objectstore.internal.ObjectStorePersistedObjects;
 import org.apache.isis.core.runtime.persistence.ObjectPersistenceException;

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/objectstore/internal/ObjectStoreInstances.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/objectstore/internal/ObjectStoreInstances.java b/core/runtime/src/main/java/org/apache/isis/core/objectstore/internal/ObjectStoreInstances.java
index 3a6ea23..028dffb 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/objectstore/internal/ObjectStoreInstances.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/objectstore/internal/ObjectStoreInstances.java
@@ -40,7 +40,6 @@ import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.objectstore.InMemoryObjectStore;
 import org.apache.isis.core.runtime.persistence.query.PersistenceQueryBuiltIn;
 import org.apache.isis.core.runtime.system.context.IsisContext;
-import org.apache.isis.core.runtime.system.persistence.AdapterManagerSpi;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
 
 /*
@@ -125,10 +124,8 @@ public class ObjectStoreInstances {
 
     /**
      * If the pojo exists in the object store, then looks up the
-     * {@link ObjectAdapter adapter} from the {@link AdapterManagerSpi}, and only
-     * if none found does it
-     * {@link PersistenceSessionHydrator#mapRecreatedPojo(Object, Object) recreate}
-     * a new {@link ObjectAdapter adapter}.
+     * {@link ObjectAdapter adapter} from the {@link org.apache.isis.core.runtime.persistence.adaptermanager.AdapterManagerDefault}, and only
+     * if none found does it recreates a new {@link ObjectAdapter adapter}.
      */
     public ObjectAdapter getObjectAndMapIfRequired(final Oid oid) {
         final Object pojo = getObjectInstances().get(oid);

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/objectstore/internal/ObjectStorePersistedObjects.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/objectstore/internal/ObjectStorePersistedObjects.java b/core/runtime/src/main/java/org/apache/isis/core/objectstore/internal/ObjectStorePersistedObjects.java
index 85dffcb..4e3cf35 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/objectstore/internal/ObjectStorePersistedObjects.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/objectstore/internal/ObjectStorePersistedObjects.java
@@ -19,6 +19,12 @@
 
 package org.apache.isis.core.objectstore.internal;
 
+import java.util.Map;
+import java.util.Set;
+
+import com.google.common.collect.Maps;
+
+import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
 import org.apache.isis.core.metamodel.spec.ObjectSpecId;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
@@ -29,22 +35,60 @@ import org.apache.isis.core.runtime.system.persistence.IdentifierGeneratorDefaul
  * 
  * Attached and detached to each session.
  */
-public interface ObjectStorePersistedObjects {
+public class ObjectStorePersistedObjects {
+
+    private final Map<ObjectSpecId, ObjectStoreInstances> instancesBySpecMap = Maps.newHashMap();
+    private final Map<ObjectSpecId, Oid> serviceOidByIdMap = Maps.newHashMap();
+
+    private IdentifierGeneratorDefault.Memento oidGeneratorMemento;
+
 
-    public IdentifierGeneratorDefault.Memento getOidGeneratorMemento();
+    public IdentifierGeneratorDefault.Memento getOidGeneratorMemento() {
+        return oidGeneratorMemento;
+    }
 
-    public void saveOidGeneratorMemento(IdentifierGeneratorDefault.Memento memento);
+    public void saveOidGeneratorMemento(final IdentifierGeneratorDefault.Memento memento) {
+        this.oidGeneratorMemento = memento;
+    }
 
-    public void registerService(ObjectSpecId objectSpecId, Oid oid);
+    public Oid getService(final ObjectSpecId objectSpecId) {
+        return serviceOidByIdMap.get(objectSpecId);
+    }
 
-    public Oid getService(ObjectSpecId objectSpecId);
+    public void registerService(final ObjectSpecId objectSpecId, final Oid oid) {
+        final Oid oidLookedUpByName = serviceOidByIdMap.get(objectSpecId);
+        if (oidLookedUpByName != null) {
+            if (oidLookedUpByName.equals(oid)) {
+                throw new IsisException("Already another service registered as name: " + objectSpecId + " (existing Oid: " + oidLookedUpByName + ", " + "intended: " + oid + ")");
+            }
+        } else {
+            serviceOidByIdMap.put(objectSpecId, oid);
+        }
+    }
 
-    public Iterable<ObjectSpecId> specifications();
+    // TODO: this is where the clever logic needs to go to determine how to save
+    // into our custom Map.
+    // also think we shouldn't surface the entire Map, just the API we require
+    // (keySet, values etc).
+    public ObjectStoreInstances instancesFor(final ObjectSpecId specId) {
+        ObjectStoreInstances ins = instancesBySpecMap.get(specId);
+        if (ins == null) {
+            ins = new ObjectStoreInstances(specId);
+            instancesBySpecMap.put(specId, ins);
+        }
+        return ins;
+    }
 
-    public ObjectStoreInstances instancesFor(ObjectSpecId spec);
+    public Iterable<ObjectSpecId> specifications() {
+        return instancesBySpecMap.keySet();
+    }
 
-    public Iterable<ObjectStoreInstances> instances();
+    public void clear() {
+        instancesBySpecMap.clear();
+    }
 
-    public void clear();
+    public Iterable<ObjectStoreInstances> instances() {
+        return instancesBySpecMap.values();
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/objectstore/internal/ObjectStorePersistedObjectsDefault.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/objectstore/internal/ObjectStorePersistedObjectsDefault.java b/core/runtime/src/main/java/org/apache/isis/core/objectstore/internal/ObjectStorePersistedObjectsDefault.java
deleted file mode 100644
index 33d06a0..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/objectstore/internal/ObjectStorePersistedObjectsDefault.java
+++ /dev/null
@@ -1,102 +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.objectstore.internal;
-
-import java.util.Map;
-import java.util.Set;
-
-import com.google.common.collect.Maps;
-
-import org.apache.isis.core.commons.exceptions.IsisException;
-import org.apache.isis.core.metamodel.adapter.oid.Oid;
-import org.apache.isis.core.metamodel.spec.ObjectSpecId;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.runtime.system.persistence.IdentifierGeneratorDefault;
-
-/**
- * Represents the persisted objects.
- * 
- * Attached and detached to each session.
- */
-public class ObjectStorePersistedObjectsDefault implements ObjectStorePersistedObjects {
-
-    private final Map<ObjectSpecId, ObjectStoreInstances> instancesBySpecMap = Maps.newHashMap();
-    private final Map<ObjectSpecId, Oid> serviceOidByIdMap = Maps.newHashMap();
-
-    private IdentifierGeneratorDefault.Memento oidGeneratorMemento;
-
-
-    @Override
-    public IdentifierGeneratorDefault.Memento getOidGeneratorMemento() {
-        return oidGeneratorMemento;
-    }
-
-    @Override
-    public void saveOidGeneratorMemento(final IdentifierGeneratorDefault.Memento memento) {
-        this.oidGeneratorMemento = memento;
-    }
-
-    @Override
-    public Oid getService(final ObjectSpecId objectSpecId) {
-        return serviceOidByIdMap.get(objectSpecId);
-    }
-
-    @Override
-    public void registerService(final ObjectSpecId objectSpecId, final Oid oid) {
-        final Oid oidLookedUpByName = serviceOidByIdMap.get(objectSpecId);
-        if (oidLookedUpByName != null) {
-            if (oidLookedUpByName.equals(oid)) {
-                throw new IsisException("Already another service registered as name: " + objectSpecId + " (existing Oid: " + oidLookedUpByName + ", " + "intended: " + oid + ")");
-            }
-        } else {
-            serviceOidByIdMap.put(objectSpecId, oid);
-        }
-    }
-
-    // TODO: this is where the clever logic needs to go to determine how to save
-    // into our custom Map.
-    // also think we shouldn't surface the entire Map, just the API we require
-    // (keySet, values etc).
-    @Override
-    public ObjectStoreInstances instancesFor(final ObjectSpecId specId) {
-        ObjectStoreInstances ins = instancesBySpecMap.get(specId);
-        if (ins == null) {
-            ins = new ObjectStoreInstances(specId);
-            instancesBySpecMap.put(specId, ins);
-        }
-        return ins;
-    }
-
-    @Override
-    public Iterable<ObjectSpecId> specifications() {
-        return instancesBySpecMap.keySet();
-    }
-
-    @Override
-    public void clear() {
-        instancesBySpecMap.clear();
-    }
-
-    @Override
-    public Iterable<ObjectStoreInstances> instances() {
-        return instancesBySpecMap.values();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/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 3376c02..f7594cc 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,15 +20,15 @@
 package org.apache.isis.core.runtime.installerregistry.installerapi;
 
 import org.apache.isis.core.commons.components.Installer;
-import org.apache.isis.core.runtime.persistence.PersistenceSessionFactoryDelegate;
+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.
  */
-public interface PersistenceMechanismInstaller extends Installer, PersistenceSessionFactoryDelegate {
+public interface PersistenceMechanismInstaller extends Installer, ObjectStoreFactory {
 
     static String TYPE = "persistor";
 

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/installerapi/PersistenceMechanismInstallerAbstract.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/installerapi/PersistenceMechanismInstallerAbstract.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/installerapi/PersistenceMechanismInstallerAbstract.java
index 75e6fc4..58e04ae 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/installerapi/PersistenceMechanismInstallerAbstract.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/installerregistry/installerapi/PersistenceMechanismInstallerAbstract.java
@@ -27,11 +27,10 @@ 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.metamodel.specloader.validator.MetaModelValidatorComposite;
-import org.apache.isis.core.runtime.persistence.PersistenceSessionFactoryDelegating;
+import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
 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.ObjectFactory;
-import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
 
 /**
  * An abstract implementation of {@link PersistenceMechanismInstaller} that will
@@ -52,7 +51,7 @@ public abstract class PersistenceMechanismInstallerAbstract extends InstallerAbs
     
     @Override
     public PersistenceSessionFactory createPersistenceSessionFactory(final DeploymentType deploymentType) {
-        return new PersistenceSessionFactoryDelegating(deploymentType, getConfiguration(), this);
+        return new PersistenceSessionFactory(deploymentType, getConfiguration(), this);
     }
 
     //endregion

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/FixturesInstalledFlag.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/FixturesInstalledFlag.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/FixturesInstalledFlag.java
index 44ded4d..8eacc26 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/FixturesInstalledFlag.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/FixturesInstalledFlag.java
@@ -20,10 +20,9 @@
 package org.apache.isis.core.runtime.persistence;
 
 import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
-import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
 
 /**
- * For {@link PersistenceSessionFactory} implementations that can cache the
+ * For {@link org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory} implementations that can cache the
  * {@link PersistenceSession#isFixturesInstalled()} so is only called once per
  * application scope.
  */

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/ObjectStoreFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/ObjectStoreFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/ObjectStoreFactory.java
new file mode 100644
index 0000000..fb0fdec
--- /dev/null
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/ObjectStoreFactory.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 org.apache.isis.core.runtime.persistence;
+
+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.runtime.system.persistence.ObjectStore;
+
+/**
+ * Creates an {@link org.apache.isis.core.runtime.system.persistence.ObjectStore} on behalf of a
+ * {@link org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory}.
+ */
+public interface ObjectStoreFactory extends IsisConfigurationBuilderAware, MetaModelRefiner {
+
+    ObjectStore createObjectStore(final IsisConfiguration configuration);
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/PersistenceConstants.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/PersistenceConstants.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/PersistenceConstants.java
index cdeaaec..0d97653 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/PersistenceConstants.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/PersistenceConstants.java
@@ -19,8 +19,6 @@
 
 package org.apache.isis.core.runtime.persistence;
 
-import org.apache.isis.core.runtime.system.persistence.ObjectFactory;
-
 public final class PersistenceConstants {
 
 

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/PersistenceSessionFactoryDelegate.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/PersistenceSessionFactoryDelegate.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/PersistenceSessionFactoryDelegate.java
deleted file mode 100644
index 59a6010..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/PersistenceSessionFactoryDelegate.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.runtime.persistence;
-
-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.runtime.persistence.objectstore.ObjectStoreSpi;
-import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
-
-/**
- * Creates an {@link org.apache.isis.core.runtime.system.persistence.ObjectStore} on behalf of a
- * {@link PersistenceSessionFactory}.
- */
-public interface PersistenceSessionFactoryDelegate extends IsisConfigurationBuilderAware, MetaModelRefiner {
-
-    ObjectStoreSpi createObjectStore(final IsisConfiguration configuration);
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/PersistenceSessionFactoryDelegating.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/PersistenceSessionFactoryDelegating.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/PersistenceSessionFactoryDelegating.java
deleted file mode 100644
index 69153f2..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/PersistenceSessionFactoryDelegating.java
+++ /dev/null
@@ -1,237 +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.persistence;
-
-import java.util.List;
-import java.util.Properties;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.isis.applib.clock.Clock;
-import org.apache.isis.applib.fixtures.FixtureClock;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-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;
-import org.apache.isis.core.runtime.persistence.internal.RuntimeContextFromSession;
-import org.apache.isis.core.runtime.persistence.objectstore.ObjectStoreSpi;
-import org.apache.isis.core.runtime.system.DeploymentType;
-import org.apache.isis.core.runtime.system.context.IsisContext;
-import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
-import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
-import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;
-
-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.*;
-
-/**
- * Implementation that just delegates to a supplied
- * {@link PersistenceSessionFactoryDelegate}.
- */
-public class PersistenceSessionFactoryDelegating implements PersistenceSessionFactory, FixturesInstalledFlag {
-
-    private static final Logger LOG = LoggerFactory.getLogger(PersistenceSessionFactoryDelegating.class);
-
-    private final DeploymentType deploymentType;
-    private final IsisConfiguration configuration;
-    private final PersistenceSessionFactoryDelegate persistenceSessionFactoryDelegate;
-
-    /**
-     * @see #setServices(List)
-     */
-    private List<Object> serviceList;
-
-    private Boolean fixturesInstalled;
-
-    private final ServicesInjectorSpi servicesInjector = new ServicesInjectorDefault();
-    private RuntimeContext runtimeContext;
-
-    public PersistenceSessionFactoryDelegating(
-            final DeploymentType deploymentType, 
-            final IsisConfiguration isisConfiguration, 
-            final PersistenceSessionFactoryDelegate persistenceSessionFactoryDelegate) {
-        this.deploymentType = deploymentType;
-        this.configuration = isisConfiguration;
-        this.persistenceSessionFactoryDelegate = persistenceSessionFactoryDelegate;
-    }
-
-    @Override
-    public DeploymentType getDeploymentType() {
-        return deploymentType;
-    }
-
-    public PersistenceSessionFactoryDelegate getDelegate() {
-        return persistenceSessionFactoryDelegate;
-    }
-
-    @Override
-    public PersistenceSession createPersistenceSession() {
-
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("installing " + this.getClass().getName());
-        }
-
-        ServicesInjectorSpi servicesInjector = getServicesInjector();
-
-        final ObjectStoreSpi objectStore = persistenceSessionFactoryDelegate.createObjectStore(getConfiguration());
-
-        ensureThatArg(objectStore, is(not(nullValue())));
-
-        final PersistenceSession persistenceSession =new PersistenceSession(this, servicesInjector, objectStore, getConfiguration());
-
-        final IsisTransactionManager transactionManager = new IsisTransactionManager(persistenceSession, objectStore, servicesInjector);
-
-        persistenceSession.setDirtiableSupport(true);
-        persistenceSession.setTransactionManager(transactionManager);
-
-        return persistenceSession;
-    }
-
-    @Override
-    public final void init() {
-
-        // check prereq dependencies injected
-        ensureThatState(serviceList, is(notNullValue()));
-
-        // a bit of a workaround, but required if anything in the metamodel (for
-        // example, a
-        // ValueSemanticsProvider for a date value type) needs to use the Clock
-        // singleton
-        // we do this after loading the services to allow a service to prime a
-        // different clock
-        // implementation (eg to use an NTP time service).
-        if (!deploymentType.isProduction() && !Clock.isInitialized()) {
-            FixtureClock.initialize();
-        }
-
-        runtimeContext = createRuntimeContext(getConfiguration());
-        ensureThatState(runtimeContext, is(not(nullValue())));
-
-        // inject the specification loader etc.
-        runtimeContext.injectInto(servicesInjector);
-        
-        // wire up components
-
-        getSpecificationLoader().injectInto(runtimeContext);
-        for (Object service : serviceList) {
-            runtimeContext.injectInto(service);
-        }
-
-        servicesInjector.setServices(serviceList);
-        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;
-    }
-
-
-
-    @Override
-    public final void shutdown() {
-        doShutdown();
-    }
-
-    /**
-     * Optional hook method for implementation-specific shutdown.
-     */
-    protected void doShutdown() {
-    }
-
-    
-    // //////////////////////////////////////////////////////
-    // Components (setup during init...)
-    // //////////////////////////////////////////////////////
-
-    public ServicesInjectorSpi getServicesInjector() {
-        return servicesInjector;
-    }
-
-    // //////////////////////////////////////////////////////
-    // MetaModelAdjuster impl
-    // //////////////////////////////////////////////////////
-
-    @Override
-    public void refineMetaModelValidator(MetaModelValidatorComposite metaModelValidator, IsisConfiguration configuration) {
-        persistenceSessionFactoryDelegate.refineMetaModelValidator(metaModelValidator, configuration);
-    }
-
-    @Override
-    public void refineProgrammingModel(ProgrammingModel baseProgrammingModel, IsisConfiguration configuration) {
-        persistenceSessionFactoryDelegate.refineProgrammingModel(baseProgrammingModel, configuration);
-    }
-
-    // //////////////////////////////////////////////////////
-    // FixturesInstalledFlag impl
-    // //////////////////////////////////////////////////////
-
-    @Override
-    public Boolean isFixturesInstalled() {
-        return fixturesInstalled;
-    }
-
-    @Override
-    public void setFixturesInstalled(final Boolean fixturesInstalled) {
-        this.fixturesInstalled = fixturesInstalled;
-    }
-
-    // //////////////////////////////////////////////////////
-    // Dependencies (injected from constructor)
-    // //////////////////////////////////////////////////////
-
-    public IsisConfiguration getConfiguration() {
-        return configuration;
-    }
-    
-    // //////////////////////////////////////////////////////
-    // Dependencies (injected via setters)
-    // //////////////////////////////////////////////////////
-
-    @Override
-    public void setServices(final List<Object> serviceList) {
-        this.serviceList = serviceList;
-    }
-
-    // //////////////////////////////////////////////////////
-    // Dependencies (from context)
-    // //////////////////////////////////////////////////////
-
-    protected SpecificationLoaderSpi getSpecificationLoader() {
-        return IsisContext.getSpecificationLoader();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/adaptermanager/AdapterManagerDefault.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/adaptermanager/AdapterManagerDefault.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/adaptermanager/AdapterManagerDefault.java
index 9d67051..8de9088 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/adaptermanager/AdapterManagerDefault.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/adaptermanager/AdapterManagerDefault.java
@@ -19,43 +19,33 @@
 
 package org.apache.isis.core.runtime.persistence.adaptermanager;
 
-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.notNullValue;
-import static org.hamcrest.CoreMatchers.nullValue;
-
 import java.util.Iterator;
-
-import org.apache.isis.core.runtime.persistence.PojoRecreationException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
+import org.apache.isis.core.commons.components.Resettable;
+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.DebuggableWithTitle;
 import org.apache.isis.core.commons.ensure.Assert;
 import org.apache.isis.core.commons.ensure.Ensure;
 import org.apache.isis.core.commons.ensure.IsisAssertException;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapterFactory;
 import org.apache.isis.core.metamodel.adapter.ResolveState;
+import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
 import org.apache.isis.core.metamodel.adapter.mgr.AdapterManagerAware;
-import org.apache.isis.core.metamodel.adapter.oid.AggregatedOid;
-import org.apache.isis.core.metamodel.adapter.oid.CollectionOid;
-import org.apache.isis.core.metamodel.adapter.oid.Oid;
-import org.apache.isis.core.metamodel.adapter.oid.OidMarshaller;
-import org.apache.isis.core.metamodel.adapter.oid.RootOid;
-import org.apache.isis.core.metamodel.adapter.oid.TypedOid;
+import org.apache.isis.core.metamodel.adapter.oid.*;
 import org.apache.isis.core.metamodel.adapter.version.ConcurrencyException;
 import org.apache.isis.core.metamodel.adapter.version.Version;
-import org.apache.isis.core.metamodel.facets.propcoll.accessor.PropertyOrCollectionAccessorFacet;
+import org.apache.isis.core.metamodel.facets.actcoll.typeof.ElementSpecificationProviderFromTypeOfFacet;
+import org.apache.isis.core.metamodel.facets.actcoll.typeof.TypeOfFacet;
 import org.apache.isis.core.metamodel.facets.collections.modify.CollectionFacet;
 import org.apache.isis.core.metamodel.facets.collections.modify.CollectionFacetUtils;
 import org.apache.isis.core.metamodel.facets.object.parented.ParentedFacet;
 import org.apache.isis.core.metamodel.facets.object.value.ValueFacet;
-import org.apache.isis.core.metamodel.facets.actcoll.typeof.ElementSpecificationProviderFromTypeOfFacet;
-import org.apache.isis.core.metamodel.facets.actcoll.typeof.TypeOfFacet;
+import org.apache.isis.core.metamodel.facets.propcoll.accessor.PropertyOrCollectionAccessorFacet;
 import org.apache.isis.core.metamodel.runtimecontext.ServicesInjector;
 import org.apache.isis.core.metamodel.spec.ObjectSpecId;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
@@ -63,12 +53,36 @@ import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
 import org.apache.isis.core.metamodel.spec.feature.Contributed;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
 import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
+import org.apache.isis.core.runtime.persistence.PojoRecreationException;
 import org.apache.isis.core.runtime.system.context.IsisContext;
-import org.apache.isis.core.runtime.system.persistence.AdapterManagerSpi;
+import org.apache.isis.core.runtime.system.persistence.AdapterLifecycleTransitioner;
 import org.apache.isis.core.runtime.system.persistence.OidGenerator;
 import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
+import org.apache.isis.core.runtime.system.persistence.RecreatedPojoRemapper;
+
+import static org.apache.isis.core.commons.ensure.Ensure.ensureThatArg;
+import static org.hamcrest.CoreMatchers.*;
 
-public class AdapterManagerDefault implements AdapterManagerSpi {
+/**
+ * Responsible for managing the {@link ObjectAdapter adapter}s and {@link Oid
+ * identities} for each and every POJO that is being used by the framework.
+ *
+ * <p>
+ * It provides a consistent set of adapters in memory, providing an
+ * {@link ObjectAdapter adapter} for the POJOs that are in use ensuring that the
+ * same object is not loaded twice into memory.
+ *
+ * <p>
+ * Each POJO is given an {@link ObjectAdapter adapter} so that the framework can
+ * work with the POJOs even though it does not understand their types. Each POJO
+ * maps to an {@link ObjectAdapter adapter} and these are reused.
+ */
+public class AdapterManagerDefault implements AdapterManager, Iterable<ObjectAdapter>,
+        RecreatedPojoRemapper,
+        AdapterLifecycleTransitioner,
+        SessionScopedComponent,
+        DebuggableWithTitle,
+        Resettable {
 
     private static final Logger LOG = LoggerFactory.getLogger(AdapterManagerDefault.class);
 
@@ -87,7 +101,7 @@ public class AdapterManagerDefault implements AdapterManagerSpi {
      * to allow transient objects to be reattached; can instead provide a
      * {@link PojoRecreator} implementation that is injected into the Adapter Manager.
      * 
-     * @see http://www.datanucleus.org/servlet/forum/viewthread_thread,7238_lastpage,yes#35976
+     * @see <a href="http://www.datanucleus.org/servlet/forum/viewthread_thread,7238_lastpage,yes#35976">this thread</a>
      */
     public AdapterManagerDefault(PojoRecreator pojoRecreator) {
         this.pojoRecreator = pojoRecreator;
@@ -292,12 +306,12 @@ public class AdapterManagerDefault implements AdapterManagerSpi {
 
     @Override
     public ObjectAdapter adapterFor(final TypedOid typedOid) {
-        return adapterFor(typedOid, ConcurrencyChecking.NO_CHECK);
+        return adapterFor(typedOid, AdapterManager.ConcurrencyChecking.NO_CHECK);
     }
 
 
     @Override
-    public ObjectAdapter adapterFor(final TypedOid typedOid, final ConcurrencyChecking concurrencyChecking) {
+    public ObjectAdapter adapterFor(final TypedOid typedOid, final AdapterManager.ConcurrencyChecking concurrencyChecking) {
 
         // attempt to locate adapter for the Oid
         ObjectAdapter adapter = getAdapterFor(typedOid);
@@ -327,7 +341,7 @@ public class AdapterManagerDefault implements AdapterManagerSpi {
                        otherVersion != null && 
                        thisVersion.different(otherVersion)) {
                         
-                        if(isConcurrencyCheckingGloballyEnabled() && ConcurrencyChecking.isCurrentlyEnabled()) {
+                        if(isConcurrencyCheckingGloballyEnabled() && AdapterManager.ConcurrencyChecking.isCurrentlyEnabled()) {
                             LOG.info("concurrency conflict detected on " + recreatedOid + " (" + otherVersion + ")");
                             final String currentUser = getAuthenticationSession().getUserName();
                             throw new ConcurrencyException(currentUser, recreatedOid, thisVersion, otherVersion);

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/adaptermanager/AdapterUtils.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/adaptermanager/AdapterUtils.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/adaptermanager/AdapterUtils.java
deleted file mode 100644
index b610802..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/adaptermanager/AdapterUtils.java
+++ /dev/null
@@ -1,58 +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.persistence.adaptermanager;
-
-import org.apache.isis.core.commons.exceptions.UnknownTypeException;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facets.collections.modify.CollectionFacet;
-import org.apache.isis.core.metamodel.facets.collections.modify.CollectionFacetUtils;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
-import org.apache.isis.core.runtime.system.persistence.AdapterManagerSpi;
-
-public final class AdapterUtils {
-    private AdapterUtils() {
-    }
-
-    public static ObjectAdapter createAdapter(final Class<?> type, final Object object, final AdapterManagerSpi adapterManager, final SpecificationLoaderSpi specificationLoader) {
-        final ObjectSpecification specification = specificationLoader.loadSpecification(type);
-        if (specification.isNotCollection()) {
-            return adapterManager.adapterFor(object);
-        } else {
-            throw new UnknownTypeException("not an object, is this a collection?");
-        }
-    }
-
-    public static Object[] getCollectionAsObjectArray(final Object option, final ObjectSpecification spec, final AdapterManagerSpi adapterManager) {
-        final ObjectAdapter collection = adapterManager.adapterFor(option);
-        final CollectionFacet facet = CollectionFacetUtils.getCollectionFacetFromSpec(collection);
-        final Object[] optionArray = new Object[facet.size(collection)];
-        int j = 0;
-        for (final ObjectAdapter adapter : facet.iterable(collection)) {
-            optionArray[j++] = adapter.getObject();
-        }
-        return optionArray;
-    }
-
-    public static Object domainObject(final ObjectAdapter inObject) {
-        return inObject == null ? null : inObject.getObject();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/objectstore/ObjectStoreSpi.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/objectstore/ObjectStoreSpi.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/objectstore/ObjectStoreSpi.java
deleted file mode 100644
index 82ce9f1..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/objectstore/ObjectStoreSpi.java
+++ /dev/null
@@ -1,27 +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.persistence.objectstore;
-
-import org.apache.isis.core.runtime.persistence.objectstore.transaction.TransactionalResource;
-import org.apache.isis.core.runtime.system.persistence.ObjectStore;
-
-public interface ObjectStoreSpi extends ObjectStore, TransactionalResource {
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/objectstore/transaction/TransactionalResource.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/objectstore/transaction/TransactionalResource.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/objectstore/transaction/TransactionalResource.java
index 8e8ad1b..1e012d8 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/objectstore/transaction/TransactionalResource.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/objectstore/transaction/TransactionalResource.java
@@ -20,40 +20,38 @@
 package org.apache.isis.core.runtime.persistence.objectstore.transaction;
 
 import java.util.List;
-
-import org.apache.isis.core.runtime.persistence.objectstore.ObjectStoreSpi;
 import org.apache.isis.core.runtime.system.transaction.IsisTransaction;
 import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;
 
 /**
  * Interface for the {@link IsisTransactionManager} to interact with some
- * transactional resource (ie a {@link ObjectStoreSpi}).
+ * transactional resource (ie a {@link org.apache.isis.core.runtime.system.persistence.ObjectStore}).
  */
 public interface TransactionalResource {
 
     /**
-     * Used by the {@link ObjectStoreTransactionManager} to tell the underlying
-     * {@link ObjectStoreSpi} to start a transaction.
+     * Used by the {@link IsisTransactionManager} to tell the underlying
+     * {@link org.apache.isis.core.runtime.system.persistence.ObjectStore} to start a transaction.
      */
     void startTransaction();
 
     /**
      * Used by the current {@link IsisTransaction} to flush changes to
-     * the {@link ObjectStoreSpi} (either via a
+     * the {@link org.apache.isis.core.runtime.system.persistence.ObjectStore} (either via a
      * {@link IsisTransactionManager#flushTransaction()} or a
      * {@link IsisTransactionManager#endTransaction()}).
      */
     void execute(List<PersistenceCommand> unmodifiableList);
 
     /**
-     * Used by the {@link ObjectStoreTransactionManager} to tell the underlying
-     * {@link ObjectStoreSpi} to commit a transaction.
+     * Used by the {@link IsisTransactionManager} to tell the underlying
+     * {@link org.apache.isis.core.runtime.system.persistence.ObjectStore} to commit a transaction.
      */
     void endTransaction();
 
     /**
-     * Used by the {@link ObjectStoreTransactionManager} to tell the underlying
-     * {@link ObjectStoreSpi} to abort a transaction.
+     * Used by the {@link IsisTransactionManager} to tell the underlying
+     * {@link org.apache.isis.core.runtime.system.persistence.ObjectStore} to abort a transaction.
      */
     void abortTransaction();
 

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemFixturesHookAbstract.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemFixturesHookAbstract.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemFixturesHookAbstract.java
index 7f4aa22..7f4d207 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemFixturesHookAbstract.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemFixturesHookAbstract.java
@@ -37,11 +37,11 @@ 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.installerregistry.InstallerLookup;
+import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
 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.PersistenceSessionFactory;
 import org.apache.isis.core.runtime.system.session.IsisSession;
 import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
 import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/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 62a2bee..5d82d26 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
@@ -30,7 +30,6 @@ 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.persistence.PersistenceSessionFactory;
 
 public final class SystemConstants {
 
@@ -57,7 +56,7 @@ public final class SystemConstants {
 
 
     /**
-     * Key used to lookup {@link PersistenceSessionFactory persistor} in
+     * Key used to lookup {@link org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory persistor} in
      * {@link IsisConfiguration}, and root for any
      * {@link PersistenceMechanismInstaller persistor}-specific configuration
      * keys.

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/AdapterManagerSpi.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/AdapterManagerSpi.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/AdapterManagerSpi.java
deleted file mode 100644
index 9d11937..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/AdapterManagerSpi.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 org.apache.isis.core.runtime.system.persistence;
-
-import org.apache.isis.core.commons.components.Resettable;
-import org.apache.isis.core.commons.components.SessionScopedComponent;
-import org.apache.isis.core.commons.debug.DebuggableWithTitle;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
-import org.apache.isis.core.metamodel.adapter.oid.Oid;
-
-/**
- * Responsible for managing the {@link ObjectAdapter adapter}s and {@link Oid
- * identities} for each and every POJO that is being used by the framework.
- * 
- * <p>
- * It provides a consistent set of adapters in memory, providing an
- * {@link ObjectAdapter adapter} for the POJOs that are in use ensuring that the
- * same object is not loaded twice into memory.
- * 
- * <p>
- * Each POJO is given an {@link ObjectAdapter adapter} so that the framework can
- * work with the POJOs even though it does not understand their types. Each POJO
- * maps to an {@link ObjectAdapter adapter} and these are reused.
- */
-public interface AdapterManagerSpi extends AdapterManager, Iterable<ObjectAdapter>,
-    RecreatedPojoRemapper,
-    AdapterLifecycleTransitioner,
-    SessionScopedComponent,
-    DebuggableWithTitle,  
-    Resettable {
-
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/ObjectStore.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/ObjectStore.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/ObjectStore.java
index 539b393..a5b8005 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/ObjectStore.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/ObjectStore.java
@@ -29,12 +29,9 @@ import org.apache.isis.core.metamodel.adapter.oid.RootOid;
 import org.apache.isis.core.metamodel.adapter.oid.TypedOid;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
-import org.apache.isis.core.runtime.persistence.objectstore.transaction.CreateObjectCommand;
-import org.apache.isis.core.runtime.persistence.objectstore.transaction.DestroyObjectCommand;
-import org.apache.isis.core.runtime.persistence.objectstore.transaction.PersistenceCommand;
-import org.apache.isis.core.runtime.persistence.objectstore.transaction.SaveObjectCommand;
+import org.apache.isis.core.runtime.persistence.objectstore.transaction.*;
 
-public interface ObjectStore extends DebuggableWithTitle, SessionScopedComponent {
+public interface ObjectStore extends TransactionalResource, DebuggableWithTitle, SessionScopedComponent {
 
     /**
      * The name of this component.

http://git-wip-us.apache.org/repos/asf/isis/blob/1b33482f/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java
index cdd3a10..294ef30 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
@@ -57,7 +57,6 @@ import org.apache.isis.core.runtime.persistence.NotPersistableException;
 import org.apache.isis.core.runtime.persistence.adapter.PojoAdapterFactory;
 import org.apache.isis.core.runtime.persistence.adaptermanager.AdapterManagerDefault;
 import org.apache.isis.core.runtime.persistence.adaptermanager.PojoRecreatorUnified;
-import org.apache.isis.core.runtime.persistence.objectstore.ObjectStoreSpi;
 import org.apache.isis.core.runtime.persistence.objectstore.algorithm.PersistAlgorithm;
 import org.apache.isis.core.runtime.persistence.objectstore.algorithm.PersistAlgorithmUnified;
 import org.apache.isis.core.runtime.persistence.objectstore.algorithm.ToPersistObjectSet;
@@ -82,7 +81,7 @@ public class PersistenceSession implements Persistor, EnlistedObjectDirtying, To
     private final ObjectAdapterFactory objectAdapterFactory;
     private final ServicesInjectorSpi servicesInjector;
     private final OidGenerator oidGenerator;
-    private final AdapterManagerSpi adapterManager;
+    private final AdapterManagerDefault adapterManager;
 
     private final PersistAlgorithm persistAlgorithm ;
     private final ObjectStore objectStore;
@@ -574,10 +573,10 @@ public class PersistenceSession implements Persistor, EnlistedObjectDirtying, To
      * initialise the persistor.
      * 
      * <p>
-     * Returns the cached value of {@link ObjectStoreSpi#isFixturesInstalled()
+     * Returns the cached value of {@link ObjectStore#isFixturesInstalled()
      * whether fixtures are installed} from the
      * {@link PersistenceSessionFactory} (provided it implements
-     * {@link FixturesInstalledFlag}), otherwise queries {@link ObjectStoreSpi}
+     * {@link FixturesInstalledFlag}), otherwise queries {@link ObjectStore}
      * directly.
      * <p>
      * This caching is important because if we've determined, for a given run,
@@ -979,8 +978,8 @@ public class PersistenceSession implements Persistor, EnlistedObjectDirtying, To
     }
 
     /**
-     * Uses the {@link ObjectStoreSpi} to
-     * {@link ObjectStoreSpi#createCreateObjectCommand(ObjectAdapter) create} a
+     * Uses the {@link ObjectStore} to
+     * {@link ObjectStore#createCreateObjectCommand(ObjectAdapter) create} a
      * {@link CreateObjectCommand}, and adds to the
      * {@link IsisTransactionManager}.
      */
@@ -1104,7 +1103,7 @@ public class PersistenceSession implements Persistor, EnlistedObjectDirtying, To
     }
 
     /**
-     * The configured {@link AdapterManagerSpi}.
+     * The configured {@link AdapterManager}.
      * 
      * <p>
      * Injected in constructor.