isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1343912 [2/2] - in /incubator/isis/trunk/framework: core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/ core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/executed/ core/metamodel/src/main/java/org/a...
Date Tue, 29 May 2012 18:50:00 GMT
Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlObjectStore.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlObjectStore.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlObjectStore.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlObjectStore.java Tue May 29 18:49:57 2012
@@ -22,6 +22,8 @@ package org.apache.isis.runtimes.dflt.ob
 import java.text.MessageFormat;
 import java.util.List;
 
+import com.google.common.collect.Lists;
+
 import org.apache.log4j.Logger;
 
 import org.apache.isis.core.commons.config.ConfigurationConstants;
@@ -350,7 +352,7 @@ public class XmlObjectStore implements O
     // /////////////////////////////////////////////////////////
 
     @Override
-    public ObjectAdapter[] getInstances(final PersistenceQuery persistenceQuery) {
+    public List<ObjectAdapter> getInstances(final PersistenceQuery persistenceQuery) {
 
         if (!(persistenceQuery instanceof PersistenceQueryBuiltIn)) {
             throw new IllegalArgumentException(MessageFormat.format("Provided PersistenceQuery not supported; was {0}; " + "the XML object store only supports {1}", persistenceQuery.getClass().getName(), PersistenceQueryBuiltIn.class.getName()));
@@ -361,34 +363,33 @@ public class XmlObjectStore implements O
         LOG.debug("getInstances of " + objSpec + " where " + builtIn);
         final RootOid oid = RootOidDefault.create(objSpec.getSpecId(), "dummy");
         final ObjectData patternData = new ObjectData(oid, null);
-        final ObjectAdapter[] instances = getInstances(patternData, builtIn);
-        return instances;
+        return getInstances(patternData, builtIn);
     }
 
-    private ObjectAdapter[] getInstances(final ObjectData patternData, final PersistenceQueryBuiltIn persistenceQuery) {
+    private List<ObjectAdapter> getInstances(final ObjectData patternData, final PersistenceQueryBuiltIn persistenceQuery) {
         final ObjectDataVector data = dataManager.getInstances(patternData);
-        final ObjectAdapter[] instances = new ObjectAdapter[data.size()];
-        int count = 0;
-
+        final List<ObjectAdapter> instances = Lists.newArrayList();
+        
         for (int i = 0; i < data.size(); i++) {
             final ObjectData instanceData = data.element(i);
-            LOG.debug("instance data " + instanceData);
+            if(LOG.isDebugEnabled()) {
+                LOG.debug("instance data " + instanceData);
+            }
 
             final RootOid oid = instanceData.getRootOid();
 
             final ObjectSpecification spec = specFor(instanceData);
-            final ObjectAdapter instance = getPersistenceSession().recreateAdapter(spec, oid);
-            LOG.debug("recreated instance " + instance);
-            initObject(instance, instanceData);
+            final ObjectAdapter adapter = getPersistenceSession().recreateAdapter(spec, oid);
+            if(LOG.isDebugEnabled()) {
+                LOG.debug("recreated instance " + adapter);
+            }
+            initObject(adapter, instanceData);
 
-            if (persistenceQuery == null || persistenceQuery.matches(instance)) {
-                instances[count++] = instance;
+            if (persistenceQuery == null || persistenceQuery.matches(adapter)) {
+                instances.add(adapter);
             }
         }
-
-        final ObjectAdapter[] array = new ObjectAdapter[count];
-        System.arraycopy(instances, 0, array, 0, count);
-        return array;
+        return instances;
     }
 
     private ObjectSpecification specFor(final Data data) {

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlPersistenceMechanismInstaller.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlPersistenceMechanismInstaller.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlPersistenceMechanismInstaller.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlPersistenceMechanismInstaller.java Tue May 29 18:49:57 2012
@@ -24,15 +24,13 @@ import java.util.Date;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapterFactory;
 import org.apache.isis.runtimes.dflt.objectstores.xml.internal.clock.DefaultClock;
-import org.apache.isis.runtimes.dflt.runtime.installerregistry.installerapi.ObjectStorePersistenceMechanismInstallerAbstract;
+import org.apache.isis.runtimes.dflt.runtime.installerregistry.installerapi.PersistenceMechanismInstallerAbstract;
 import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.ObjectStore;
-import org.apache.isis.runtimes.dflt.runtime.system.DeploymentType;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.AdapterManager;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.IdentifierGenerator;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.IdentifierGeneratorDefault;
-import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSessionFactory;
 
-public class XmlPersistenceMechanismInstaller extends ObjectStorePersistenceMechanismInstallerAbstract {
+public class XmlPersistenceMechanismInstaller extends PersistenceMechanismInstallerAbstract {
 
     public static final String NAME = "xml";
     
@@ -56,9 +54,4 @@ public class XmlPersistenceMechanismInst
         final long currentTime = new Date().getTime();
         return new IdentifierGeneratorDefault(currentTime);
     }
-
-    @Override
-    public PersistenceSessionFactory createPersistenceSessionFactory(final DeploymentType deploymentType) {
-        return new XmlPersistenceSessionFactory(deploymentType, this);
-    }
 }

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/commands/XmlCreateObjectCommand.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/commands/XmlCreateObjectCommand.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/commands/XmlCreateObjectCommand.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/commands/XmlCreateObjectCommand.java Tue May 29 18:49:57 2012
@@ -39,16 +39,16 @@ public final class XmlCreateObjectComman
     @Override
     public void execute(final PersistenceCommandContext context) throws ObjectPersistenceException {
         if (LOG.isDebugEnabled()) {
-            LOG.debug("  create object " + onObject());
+            LOG.debug("  create object " + onAdapter());
         }
         final String user = getAuthenticationSession().getUserName();
-        onObject().setVersion(new FileVersion(user));
-        final ObjectData data = createObjectData(onObject(), true);
+        onAdapter().setVersion(new FileVersion(user));
+        final ObjectData data = createObjectData(onAdapter(), true);
         getDataManager().insertObject(data);
     }
 
     @Override
     public String toString() {
-        return "CreateObjectCommand [object=" + onObject() + "]";
+        return "CreateObjectCommand [object=" + onAdapter() + "]";
     }
 }
\ No newline at end of file

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/commands/XmlDestroyObjectCommand.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/commands/XmlDestroyObjectCommand.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/commands/XmlDestroyObjectCommand.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/commands/XmlDestroyObjectCommand.java Tue May 29 18:49:57 2012
@@ -38,15 +38,15 @@ public final class XmlDestroyObjectComma
     @Override
     public void execute(final PersistenceCommandContext context) throws ObjectPersistenceException {
         if (LOG.isDebugEnabled()) {
-            LOG.debug("  destroy object " + onObject());
+            LOG.debug("  destroy object " + onAdapter());
         }
-        final RootOidDefault oid = (RootOidDefault) onObject().getOid();
+        final RootOidDefault oid = (RootOidDefault) onAdapter().getOid();
         getDataManager().remove(oid);
-        onObject().setVersion(null);
+        onAdapter().setVersion(null);
     }
 
     @Override
     public String toString() {
-        return "DestroyObjectCommand [object=" + onObject() + "]";
+        return "DestroyObjectCommand [object=" + onAdapter() + "]";
     }
 }
\ No newline at end of file

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/commands/XmlUpdateObjectCommand.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/commands/XmlUpdateObjectCommand.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/commands/XmlUpdateObjectCommand.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/commands/XmlUpdateObjectCommand.java Tue May 29 18:49:57 2012
@@ -40,18 +40,18 @@ public final class XmlUpdateObjectComman
     @Override
     public void execute(final PersistenceCommandContext context) throws ObjectPersistenceException {
         if (LOG.isDebugEnabled()) {
-            LOG.debug("  save object " + onObject());
+            LOG.debug("  save object " + onAdapter());
         }
         final String user = getAuthenticationSession().getUserName();
-        onObject().setVersion(new FileVersion(user));
+        onAdapter().setVersion(new FileVersion(user));
 
-        final Data data = createObjectData(onObject(), true);
+        final Data data = createObjectData(onAdapter(), true);
         getDataManager().save(data);
     }
 
     @Override
     public String toString() {
-        return "SaveObjectCommand [object=" + onObject() + "]";
+        return "SaveObjectCommand [object=" + onAdapter() + "]";
     }
 
 }
\ No newline at end of file

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/data/ListOfRootOid.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/data/ListOfRootOid.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/data/ListOfRootOid.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/internal/data/ListOfRootOid.java Tue May 29 18:49:57 2012
@@ -20,13 +20,11 @@
 package org.apache.isis.runtimes.dflt.objectstores.xml.internal.data;
 
 import java.util.List;
-import java.util.Vector;
 
 import com.google.common.collect.Lists;
 
 import org.apache.isis.core.commons.lang.ToString;
 import org.apache.isis.core.metamodel.adapter.oid.RootOid;
-import org.apache.isis.core.metamodel.adapter.oid.RootOidDefault;
 
 public class ListOfRootOid {
     

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/test/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlObjectStoreTest_isFixturesInstalled.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/test/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlObjectStoreTest_isFixturesInstalled.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/test/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlObjectStoreTest_isFixturesInstalled.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/test/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlObjectStoreTest_isFixturesInstalled.java Tue May 29 18:49:57 2012
@@ -20,7 +20,6 @@
 package org.apache.isis.runtimes.dflt.objectstores.xml;
 
 import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
 
 import org.jmock.auto.Mock;
 import org.junit.Before;

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/test/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlObjectStoreTest_toRefactor.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/test/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlObjectStoreTest_toRefactor.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/test/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlObjectStoreTest_toRefactor.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/test/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlObjectStoreTest_toRefactor.java Tue May 29 18:49:57 2012
@@ -23,6 +23,7 @@ import static org.junit.Assert.assertFal
 import static org.junit.Assert.assertTrue;
 
 import java.util.Collections;
+import java.util.List;
 
 import org.jmock.Expectations;
 import org.jmock.auto.Mock;
@@ -128,8 +129,8 @@ public class XmlObjectStoreTest_toRefact
     public void validatesGettingObjectStoreInstances() throws Exception {
         final SaveObjectCommand command = objectStore.createSaveObjectCommand(adapter1);
         objectStore.execute(Collections.<PersistenceCommand> singletonList(command));
-        final ObjectAdapter[] array = objectStore.getInstances(persistenceHelper);
-        assertTrue(array.length == 1);
+        final List<ObjectAdapter> array = objectStore.getInstances(persistenceHelper);
+        assertTrue(array.size() == 1);
     }
 
     @Ignore // DKH: refactor to use contract tests (see in-memory object store for basis)

Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/installerregistry/installerapi/PersistenceMechanismInstallerAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/installerregistry/installerapi/PersistenceMechanismInstallerAbstract.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/installerregistry/installerapi/PersistenceMechanismInstallerAbstract.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/installerregistry/installerapi/PersistenceMechanismInstallerAbstract.java Tue May 29 18:49:57 2012
@@ -39,15 +39,26 @@ import org.apache.isis.core.metamodel.se
 import org.apache.isis.runtimes.dflt.runtime.installerregistry.InstallerLookup;
 import org.apache.isis.runtimes.dflt.runtime.installerregistry.InstallerLookupAware;
 import org.apache.isis.runtimes.dflt.runtime.persistence.PersistenceConstants;
+import org.apache.isis.runtimes.dflt.runtime.persistence.PersistenceSessionFactoryDelegating;
 import org.apache.isis.runtimes.dflt.runtime.persistence.adapterfactory.pojo.PojoAdapterFactory;
 import org.apache.isis.runtimes.dflt.runtime.persistence.adaptermanager.AdapterManagerDefault;
 import org.apache.isis.runtimes.dflt.runtime.persistence.adaptermanager.AdapterManagerExtended;
 import org.apache.isis.runtimes.dflt.runtime.persistence.internal.RuntimeContextFromSession;
+import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.IsisObjectStoreLogger;
+import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.ObjectStore;
+import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.ObjectStorePersistence;
+import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.ObjectStoreTransactionManagement;
+import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.algorithm.PersistAlgorithm;
+import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.algorithm.dflt.DefaultPersistAlgorithm;
+import org.apache.isis.runtimes.dflt.runtime.system.DeploymentType;
+import org.apache.isis.runtimes.dflt.runtime.system.persistence.AdapterManager;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.IdentifierGenerator;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.ObjectFactory;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.OidGenerator;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSessionFactory;
+import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSessionTransactionManagement;
+import org.apache.isis.runtimes.dflt.runtime.system.transaction.IsisTransactionManager;
 import org.apache.isis.runtimes.dflt.runtime.systemdependencyinjector.SystemDependencyInjector;
 
 /**
@@ -78,6 +89,89 @@ public abstract class PersistenceMechani
         super(type, name);
     }
 
+
+    @Override
+    public PersistenceSessionFactory createPersistenceSessionFactory(final DeploymentType deploymentType) {
+        return new PersistenceSessionFactoryDelegating(deploymentType, this);
+    }
+
+
+    /**
+     * Will return a {@link PersistenceSessionObjectStore}; subclasses are free
+     * to downcast if required.
+     */
+    protected PersistenceSession createPersistenceSession(final PersistenceSessionFactory persistenceSessionFactory, final AdapterManagerExtended adapterManager, final ObjectAdapterFactory adapterFactory, final ObjectFactory objectFactory, final IdentifierGenerator identifierGenerator,
+            final ServicesInjector servicesInjector) {
+
+        final PersistAlgorithm persistAlgorithm = createPersistAlgorithm(getConfiguration());
+        ObjectStore objectStore = createObjectStore(getConfiguration(), adapterFactory, adapterManager);
+
+        ensureThatArg(persistAlgorithm, is(not(nullValue())));
+        ensureThatArg(objectStore, is(not(nullValue())));
+
+        if (getConfiguration().getBoolean(LOGGING_PROPERTY, false)) {
+            final String level = getConfiguration().getString(LOGGING_PROPERTY + ".level", "debug");
+            objectStore = new IsisObjectStoreLogger(objectStore, level);
+        }
+
+        final PersistenceSession persistenceSession = createObjectStorePersistor(persistenceSessionFactory, adapterFactory, objectFactory, servicesInjector, identifierGenerator, adapterManager, persistAlgorithm, objectStore);
+
+        final IsisTransactionManager transactionManager = createTransactionManager(persistenceSession, objectStore);
+
+        ensureThatArg(persistenceSession, is(not(nullValue())));
+        ensureThatArg(transactionManager, is(not(nullValue())));
+
+        persistenceSession.setDirtiableSupport(true);
+        transactionManager.injectInto(persistenceSession);
+
+        // ... and finally return
+        return persistenceSession;
+    }
+
+    
+    // ///////////////////////////////////////////
+    // Optional hook methods
+    // ///////////////////////////////////////////
+
+    /**
+     * Can optionally be overridden, but by default creates an
+     * {@link PersistenceSessionObjectStore}.
+     */
+    protected PersistenceSession createObjectStorePersistor(final PersistenceSessionFactory persistenceSessionFactory, final ObjectAdapterFactory adapterFactory, final ObjectFactory objectFactory, final ServicesInjector servicesInjector, final IdentifierGenerator identifierGenerator,
+            final AdapterManagerExtended adapterManager, final PersistAlgorithm persistAlgorithm, final ObjectStorePersistence objectStore) {
+        return new PersistenceSession(persistenceSessionFactory, adapterFactory, objectFactory, servicesInjector, identifierGenerator, adapterManager, persistAlgorithm, objectStore);
+    }
+
+    /**
+     * Hook method to create {@link PersistAlgorithm}.
+     * 
+     * <p>
+     * By default returns a {@link DefaultPersistAlgorithm}.
+     */
+    protected PersistAlgorithm createPersistAlgorithm(final IsisConfiguration configuration) {
+        return new DefaultPersistAlgorithm();
+    }
+
+    /**
+     * Hook method to return an {@link IsisTransactionManager}.
+     * 
+     * <p>
+     * By default returns a {@link ObjectStoreTransactionManager}.
+     */
+    protected IsisTransactionManager createTransactionManager(final PersistenceSessionTransactionManagement persistor, final ObjectStoreTransactionManagement objectStore) {
+        return new IsisTransactionManager(persistor, objectStore);
+    }
+
+    // ///////////////////////////////////////////
+    // Mandatory hook methods
+    // ///////////////////////////////////////////
+
+    /**
+     * Hook method to return {@link ObjectStore}.
+     */
+    protected abstract ObjectStore createObjectStore(IsisConfiguration configuration, ObjectAdapterFactory adapterFactory, AdapterManager adapterManager);
+
+    
     /**
      * Creates a {@link PersistenceSession} that is initialized with the various
      * hook methods.
@@ -131,19 +225,7 @@ public abstract class PersistenceMechani
         return persistenceSession;
     }
 
-    // ///////////////////////////////////////////
-    // Mandatory hook methods
-    // ///////////////////////////////////////////
-
-    /**
-     * Mandatory hook method called by
-     * {@link #createPersistenceSession(PersistenceSessionFactory)}, passing the
-     * components created by the other (optional) hooks.
-     * 
-     * @see #createPersistenceSession(PersistenceSessionFactory)
-     */
-    protected abstract PersistenceSession createPersistenceSession(final PersistenceSessionFactory persistenceSessionFactory, final AdapterManagerExtended adapterManager, final ObjectAdapterFactory adapterFactory, final ObjectFactory objectFactory, final IdentifierGenerator identifierGenerator,
-            final ServicesInjector servicesInjector);
+    
 
     // ///////////////////////////////////////////
     // Optional hook methods
@@ -285,4 +367,11 @@ public abstract class PersistenceMechani
         return listOf(PersistenceSessionFactory.class);
     }
 
+    
+    
+
+
+    
+    
+    
 }

Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionFactoryDelegating.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionFactoryDelegating.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionFactoryDelegating.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionFactoryDelegating.java Tue May 29 18:49:57 2012
@@ -36,7 +36,7 @@ import org.apache.isis.runtimes.dflt.run
  * Implementation that just delegates to a supplied
  * {@link PersistenceSessionFactory}.
  */
-public abstract class PersistenceSessionFactoryDelegating implements PersistenceSessionFactory, FixturesInstalledFlag {
+public class PersistenceSessionFactoryDelegating implements PersistenceSessionFactory, FixturesInstalledFlag {
 
     private final DeploymentType deploymentType;
     private final PersistenceSessionFactoryDelegate persistenceSessionFactoryDelegate;

Copied: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisObjectStoreDelegating.java (from r1340364, incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisStoreDelegating.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisObjectStoreDelegating.java?p2=incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisObjectStoreDelegating.java&p1=incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisStoreDelegating.java&r1=1340364&r2=1343912&rev=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisStoreDelegating.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisObjectStoreDelegating.java Tue May 29 18:49:57 2012
@@ -39,12 +39,12 @@ import org.apache.isis.runtimes.dflt.run
  * <p>
  * Useful for quickly writing decorating implementations.
  */
-public class IsisStoreDelegating implements ObjectStore {
+public class IsisObjectStoreDelegating implements ObjectStore {
 
     private final ObjectStore underlying;
     private final String name;
 
-    public IsisStoreDelegating(final ObjectStore underlying, final String name) {
+    public IsisObjectStoreDelegating(final ObjectStore underlying, final String name) {
         this.underlying = underlying;
         this.name = name;
     }
@@ -153,7 +153,7 @@ public class IsisStoreDelegating impleme
     // ////////////////////////////////////////////////
 
     @Override
-    public ObjectAdapter[] getInstances(final PersistenceQuery persistenceQuery) {
+    public List<ObjectAdapter> getInstances(final PersistenceQuery persistenceQuery) {
         return underlying.getInstances(persistenceQuery);
     }
 

Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisObjectStoreLogger.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisObjectStoreLogger.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisObjectStoreLogger.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisObjectStoreLogger.java Tue May 29 18:49:57 2012
@@ -91,7 +91,7 @@ public class IsisObjectStoreLogger exten
     }
 
     @Override
-    public ObjectAdapter[] getInstances(final PersistenceQuery criteria) throws ObjectPersistenceException, UnsupportedFindException {
+    public List<ObjectAdapter> getInstances(final PersistenceQuery criteria) throws ObjectPersistenceException, UnsupportedFindException {
         log("get instances matching " + criteria);
         return underlying.getInstances(criteria);
     }

Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStorePersistence.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStorePersistence.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStorePersistence.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStorePersistence.java Tue May 29 18:49:57 2012
@@ -164,7 +164,7 @@ public interface ObjectStorePersistence 
     // getInstances, hasInstances
     // ///////////////////////////////////////////////////////
 
-    ObjectAdapter[] getInstances(PersistenceQuery persistenceQuery);
+    List<ObjectAdapter> getInstances(PersistenceQuery persistenceQuery);
 
     boolean hasInstances(ObjectSpecification specification);
 

Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/PersistenceCommand.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/PersistenceCommand.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/PersistenceCommand.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/PersistenceCommand.java Tue May 29 18:49:57 2012
@@ -24,5 +24,5 @@ import org.apache.isis.core.metamodel.ad
 public interface PersistenceCommand {
     void execute(PersistenceCommandContext context);
 
-    ObjectAdapter onObject();
+    ObjectAdapter onAdapter();
 }

Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/PersistenceCommandAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/PersistenceCommandAbstract.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/PersistenceCommandAbstract.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/PersistenceCommandAbstract.java Tue May 29 18:49:57 2012
@@ -33,7 +33,7 @@ public abstract class PersistenceCommand
     }
 
     @Override
-    public ObjectAdapter onObject() {
+    public ObjectAdapter onAdapter() {
         return adapter;
     }
 

Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSession.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSession.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSession.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSession.java Tue May 29 18:49:57 2012
@@ -463,7 +463,7 @@ public class PersistenceSession implemen
 
     @Override
     public ObjectAdapter findInstances(final PersistenceQuery persistenceQuery) {
-        final ObjectAdapter[] instances = getInstances(persistenceQuery);
+        final List<ObjectAdapter> instances = getInstances(persistenceQuery);
         final ObjectSpecification specification = persistenceQuery.getSpecification();
         final FreeStandingList results = new FreeStandingList(specification, instances);
         return getAdapterManager().adapterFor(results);
@@ -474,7 +474,9 @@ public class PersistenceSession implemen
      * {@link PersistenceQuery NOF-internal representation}.
      */
     protected final PersistenceQuery createPersistenceQueryFor(final Query<?> query, final QueryCardinality cardinality) {
-        LOG.debug("createPersistenceQueryFor: " + query.getDescription());
+        if(LOG.isDebugEnabled()) {
+            LOG.debug("createPersistenceQueryFor: " + query.getDescription());
+        }
         final ObjectSpecification noSpec = specFor(query);
         if (query instanceof QueryFindAllInstances) {
             return new PersistenceQueryFindAllInstances(noSpec);
@@ -519,7 +521,7 @@ public class PersistenceSession implemen
         return argumentsAdaptersByParameterName;
     }
 
-    protected ObjectAdapter[] getInstances(final PersistenceQuery persistenceQuery) {
+    protected List<ObjectAdapter> getInstances(final PersistenceQuery persistenceQuery) {
         if (LOG.isDebugEnabled()) {
             LOG.debug("getInstances matching " + persistenceQuery);
         }
@@ -1202,10 +1204,10 @@ public class PersistenceSession implemen
     // ///////////////////////////////////////////////////////////////////////////
 
 
-    private ObjectAdapter[] getInstancesFromPersistenceLayer(final PersistenceQuery persistenceQuery) {
-        return getTransactionManager().executeWithinTransaction(new TransactionalClosureWithReturnAbstract<ObjectAdapter[]>() {
+    private List<ObjectAdapter> getInstancesFromPersistenceLayer(final PersistenceQuery persistenceQuery) {
+        return getTransactionManager().executeWithinTransaction(new TransactionalClosureWithReturnAbstract<List<ObjectAdapter>>() {
             @Override
-            public ObjectAdapter[] execute() {
+            public List<ObjectAdapter> execute() {
                 return objectStore.getInstances(persistenceQuery);
             }
 

Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/transaction/IsisTransaction.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/transaction/IsisTransaction.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/transaction/IsisTransaction.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/transaction/IsisTransaction.java Tue May 29 18:49:57 2012
@@ -212,7 +212,7 @@ public class IsisTransaction implements 
             return;
         }
 
-        final ObjectAdapter onObject = command.onObject();
+        final ObjectAdapter onObject = command.onAdapter();
 
         // Saves are ignored when preceded by another save, or a delete
         if (command instanceof SaveObjectCommand) {
@@ -313,7 +313,7 @@ public class IsisTransaction implements 
 
             for (final PersistenceCommand command : commands) {
                 if (command instanceof DestroyObjectCommand) {
-                    final ObjectAdapter adapter = command.onObject();
+                    final ObjectAdapter adapter = command.onAdapter();
                     adapter.setVersion(null);
                     adapter.changeState(ResolveState.DESTROYED);
                 }
@@ -406,7 +406,7 @@ public class IsisTransaction implements 
 
     private PersistenceCommand getCommand(final Class<?> commandClass, final ObjectAdapter onObject) {
         for (final PersistenceCommand command : commands) {
-            if (command.onObject().equals(onObject)) {
+            if (command.onAdapter().equals(onObject)) {
                 if (commandClass.isAssignableFrom(command.getClass())) {
                     return command;
                 }

Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/TransactionTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/TransactionTest.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/TransactionTest.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/TransactionTest.java Tue May 29 18:49:57 2012
@@ -74,7 +74,7 @@ public class TransactionTest {
             }
 
             @Override
-            public ObjectAdapter onObject() {
+            public ObjectAdapter onAdapter() {
                 return object;
             }
 
@@ -93,7 +93,7 @@ public class TransactionTest {
             }
 
             @Override
-            public ObjectAdapter onObject() {
+            public ObjectAdapter onAdapter() {
                 return object;
             }
 
@@ -111,7 +111,7 @@ public class TransactionTest {
             }
 
             @Override
-            public ObjectAdapter onObject() {
+            public ObjectAdapter onAdapter() {
                 return object;
             }
 
@@ -130,7 +130,7 @@ public class TransactionTest {
             }
 
             @Override
-            public ObjectAdapter onObject() {
+            public ObjectAdapter onAdapter() {
                 return object;
             }
 

Modified: incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/main/java/org/apache/isis/runtimes/dflt/testsupport/IsisSystemDefault.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/main/java/org/apache/isis/runtimes/dflt/testsupport/IsisSystemDefault.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/main/java/org/apache/isis/runtimes/dflt/testsupport/IsisSystemDefault.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/main/java/org/apache/isis/runtimes/dflt/testsupport/IsisSystemDefault.java Tue May 29 18:49:57 2012
@@ -1,6 +1,7 @@
 package org.apache.isis.runtimes.dflt.testsupport;
 
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
@@ -105,21 +106,79 @@ public class IsisSystemDefault extends I
 
 
     /**
-     * Java5, with cglib, and only the transaction facet decorators.
+     * Optional hook method, to create the reflector with defaults (Java5, with cglib, and only the transaction facet decorators)
+     * 
+     * <p>
+     * Each of the subcomponents can be overridden if required.
+     * 
+     * @see #obtainReflectorClassSubstitutor()
+     * @see #obtainReflectorCollectionTypeRegistry()
+     * @see #obtainReflectorFacetDecoratorSet()
+     * @see #obtainReflectorMetaModelValidator()
+     * @see #obtainReflectorProgrammingModel()
+     * @see #obtainReflectorSpecificationTraverser()
      */
     @Override
     protected ObjectReflector obtainReflector(DeploymentType deploymentType) throws IsisSystemException {
-        ClassSubstitutor classSubstitutor = new CglibClassSubstitutor();
-        CollectionTypeRegistry collectionTypeRegistry = new CollectionTypeRegistryDefault();
-        SpecificationTraverser specificationTraverser = new SpecificationTraverserDefault();
+        ClassSubstitutor classSubstitutor = obtainReflectorClassSubstitutor();
+        CollectionTypeRegistry collectionTypeRegistry = obtainReflectorCollectionTypeRegistry();
+        SpecificationTraverser specificationTraverser = obtainReflectorSpecificationTraverser();
         MemberLayoutArranger memberLayoutArranger = new MemberLayoutArrangerDefault();
-        ProgrammingModel programmingModel = new ProgrammingModelFacetsJava5();
-        Set<FacetDecorator> facetDecorators = Sets.newHashSet((FacetDecorator)new StandardTransactionFacetDecorator(getConfiguration()));
-        MetaModelValidator metaModelValidator = new MetaModelValidatorDefault();
+        ProgrammingModel programmingModel = obtainReflectorProgrammingModel();
+        Set<FacetDecorator> facetDecorators = obtainReflectorFacetDecoratorSet();
+        MetaModelValidator metaModelValidator = obtainReflectorMetaModelValidator();
         return new ObjectReflectorDefault(getConfiguration(), classSubstitutor, collectionTypeRegistry, specificationTraverser, memberLayoutArranger, programmingModel, facetDecorators, metaModelValidator);
     }
 
     /**
+     * Optional hook method, called from {@link #obtainReflector(DeploymentType)}.
+     * @return
+     */
+    protected ClassSubstitutor obtainReflectorClassSubstitutor() {
+        return new CglibClassSubstitutor();
+    }
+
+    /**
+     * Optional hook method, called from {@link #obtainReflector(DeploymentType)}.
+     * @return
+     */
+    protected CollectionTypeRegistry obtainReflectorCollectionTypeRegistry() {
+        return new CollectionTypeRegistryDefault();
+    }
+
+    /**
+     * Optional hook method, called from {@link #obtainReflector(DeploymentType)}.
+     * @return
+     */
+    protected SpecificationTraverser obtainReflectorSpecificationTraverser() {
+        return new SpecificationTraverserDefault();
+    }
+
+    /**
+     * Optional hook method, called from {@link #obtainReflector(DeploymentType)}.
+     * @return
+     */
+    protected ProgrammingModel obtainReflectorProgrammingModel() {
+        return new ProgrammingModelFacetsJava5();
+    }
+
+    /**
+     * Optional hook method, called from {@link #obtainReflector(DeploymentType)}.
+     * @return
+     */
+    protected Set<FacetDecorator> obtainReflectorFacetDecoratorSet() {
+        return Sets.newHashSet((FacetDecorator)new StandardTransactionFacetDecorator(getConfiguration()));
+    }
+
+    /**
+     * Optional hook method, called from {@link #obtainReflector(DeploymentType)}.
+     * @return
+     */
+    protected MetaModelValidator obtainReflectorMetaModelValidator() {
+        return new MetaModelValidatorDefault();
+    }
+
+    /**
      * The standard authentication manager, configured with the default authenticator (allows all requests through).
      */
     @Override

Modified: incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/main/java/org/apache/isis/runtimes/dflt/testsupport/IsisSystemWithFixtures.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/main/java/org/apache/isis/runtimes/dflt/testsupport/IsisSystemWithFixtures.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/main/java/org/apache/isis/runtimes/dflt/testsupport/IsisSystemWithFixtures.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/main/java/org/apache/isis/runtimes/dflt/testsupport/IsisSystemWithFixtures.java Tue May 29 18:49:57 2012
@@ -37,7 +37,9 @@ import org.apache.isis.core.commons.auth
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.oid.RootOid;
+import org.apache.isis.core.metamodel.progmodel.ProgrammingModel;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidator;
 import org.apache.isis.core.runtime.authentication.AuthenticationManager;
 import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
 import org.apache.isis.runtimes.dflt.objectstores.dflt.InMemoryPersistenceMechanismInstaller;
@@ -175,6 +177,8 @@ public class IsisSystemWithFixtures impl
     private final AuthenticationRequest authenticationRequest;
     private final List<Object> services;
     private List <Listener> listeners;
+    private final MetaModelValidator metaModelValidator;
+    private final ProgrammingModel programmingModel;
 
     
     ////////////////////////////////////////////////////////////
@@ -188,10 +192,13 @@ public class IsisSystemWithFixtures impl
         private Initialization fixturesInitialization = Initialization.INIT;
         private IsisConfiguration configuration;
         private PersistenceMechanismInstaller persistenceMechanismInstaller = new InMemoryPersistenceMechanismInstaller();
+        private MetaModelValidator metaModelValidator;
+        private ProgrammingModel programmingModel;
 
         private final List <Listener> listeners = Lists.newArrayList();
         private Object[] services;
 
+
         public Builder with(IsisConfiguration configuration) {
             this.configuration = configuration;
             return this;
@@ -219,7 +226,7 @@ public class IsisSystemWithFixtures impl
         
         public IsisSystemWithFixtures build() {
             final List<Object> servicesIfAny = services != null? Arrays.asList(services): null;
-            return new IsisSystemWithFixtures(fixturesInitialization, configuration, persistenceMechanismInstaller, authenticationRequest, servicesIfAny, listeners);
+            return new IsisSystemWithFixtures(fixturesInitialization, configuration, programmingModel, metaModelValidator, persistenceMechanismInstaller, authenticationRequest, servicesIfAny, listeners);
         }
 
         public Builder with(Listener listener) {
@@ -228,15 +235,27 @@ public class IsisSystemWithFixtures impl
             }
             return this;
         }
+
+        public Builder with(MetaModelValidator metaModelValidator) {
+            this.metaModelValidator = metaModelValidator;
+            return this;
+        }
+
+        public Builder with(ProgrammingModel programmingModel) {
+            this.programmingModel = programmingModel;
+            return this;
+        }
     }
 
     public static Builder builder() {
         return new Builder();
     }
 
-    private IsisSystemWithFixtures(Initialization fixturesInitialization, IsisConfiguration configuration, PersistenceMechanismInstaller persistenceMechanismInstaller, AuthenticationRequest authenticationRequest, List<Object> services, List<Listener> listeners) {
+    private IsisSystemWithFixtures(Initialization fixturesInitialization, IsisConfiguration configuration, ProgrammingModel programmingModel, MetaModelValidator metaModelValidator, PersistenceMechanismInstaller persistenceMechanismInstaller, AuthenticationRequest authenticationRequest, List<Object> services, List<Listener> listeners) {
         this.fixturesInitialization = fixturesInitialization;
         this.configuration = configuration;
+        this.programmingModel = programmingModel;
+        this.metaModelValidator = metaModelValidator;
         this.persistenceMechanismInstaller = persistenceMechanismInstaller;
         this.authenticationRequest = authenticationRequest;
         this.fixtures = new Fixtures();
@@ -310,6 +329,22 @@ public class IsisSystemWithFixtures impl
                 }
             }
             @Override
+            protected ProgrammingModel obtainReflectorProgrammingModel() {
+                if(IsisSystemWithFixtures.this.programmingModel != null) {
+                    return IsisSystemWithFixtures.this.programmingModel;
+                } else {
+                    return super.obtainReflectorProgrammingModel();
+                }
+            }
+            @Override
+            protected MetaModelValidator obtainReflectorMetaModelValidator() {
+                if(IsisSystemWithFixtures.this.metaModelValidator != null) {
+                    return IsisSystemWithFixtures.this.metaModelValidator;
+                } else {
+                    return super.obtainReflectorMetaModelValidator();
+                }
+            }
+            @Override
             protected PersistenceMechanismInstaller obtainPersistenceMechanismInstaller(IsisConfiguration configuration) {
                 final PersistenceMechanismInstaller installer = IsisSystemWithFixtures.this.persistenceMechanismInstaller;
                 configuration.injectInto(installer);

Modified: incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/main/java/org/apache/isis/runtimes/dflt/testsupport/tck/ObjectStoreContractTest_persist.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/main/java/org/apache/isis/runtimes/dflt/testsupport/tck/ObjectStoreContractTest_persist.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/main/java/org/apache/isis/runtimes/dflt/testsupport/tck/ObjectStoreContractTest_persist.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/main/java/org/apache/isis/runtimes/dflt/testsupport/tck/ObjectStoreContractTest_persist.java Tue May 29 18:49:57 2012
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertFal
 import static org.junit.Assert.assertNotSame;
 
 import java.util.Date;
+import java.util.List;
 
 import org.junit.Before;
 import org.junit.Rule;
@@ -103,11 +104,11 @@ public abstract class ObjectStoreContrac
         iswf.bounceSystem();
         
         // when search for object
-        ObjectAdapter[] retrievedInstance = getStore().getInstances(new PersistenceQueryFindByTitle(epvSpecification, epv2Adapter.titleString()));
+        List<ObjectAdapter> retrievedInstance = getStore().getInstances(new PersistenceQueryFindByTitle(epvSpecification, epv2Adapter.titleString()));
         
         // then find
-        assertEquals(1, retrievedInstance.length);
-        final ObjectAdapter retrievedAdapter = retrievedInstance[0];
+        assertEquals(1, retrievedInstance.size());
+        final ObjectAdapter retrievedAdapter = retrievedInstance.get(0);
 
         assertNotSame(epv2Adapter, retrievedAdapter);
         assertEquals(((SimpleEntity)epv2Adapter.getObject()).getName(), ((SimpleEntity)retrievedAdapter.getObject()).getName());
@@ -117,7 +118,7 @@ public abstract class ObjectStoreContrac
         retrievedInstance = getStore().getInstances(new PersistenceQueryFindByTitle(epvSpecification, "some other title"));
         
         // then don't find
-        assertEquals(0, retrievedInstance.length);
+        assertEquals(0, retrievedInstance.size());
     }
 
 
@@ -139,10 +140,10 @@ public abstract class ObjectStoreContrac
         iswf.bounceSystem();
 
         // then found
-        ObjectAdapter[] retrievedInstance = getStore().getInstances(new PersistenceQueryFindByTitle(epvSpecification, adapter.titleString()));
-        assertEquals(1, retrievedInstance.length);
+        List<ObjectAdapter> retrievedInstance = getStore().getInstances(new PersistenceQueryFindByTitle(epvSpecification, adapter.titleString()));
+        assertEquals(1, retrievedInstance.size());
         
-        final ObjectAdapter retrievedAdapter = retrievedInstance[0];
+        final ObjectAdapter retrievedAdapter = retrievedInstance.get(0);
         assertNotSame(adapter, retrievedAdapter);
         assertEquals(((SimpleEntity)adapter.getObject()).getName(), ((SimpleEntity)retrievedAdapter.getObject()).getName());
         assertEquals(adapter.getOid(), retrievedAdapter.getOid());

Modified: incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_retrieve.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_retrieve.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_retrieve.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/testsupport/src/test/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStoreTest_retrieve.java Tue May 29 18:49:57 2012
@@ -23,12 +23,13 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertNotSame;
 import static org.junit.Assert.fail;
 
+import java.util.List;
+
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.oid.Oid;
 import org.apache.isis.core.metamodel.adapter.oid.RootOidDefault;
 import org.apache.isis.core.metamodel.adapter.oid.TypedOid;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
@@ -83,8 +84,8 @@ public class InMemoryObjectStoreTest_ret
 
     @Test
     public void getInstances_whenDoesNotExist() throws Exception {
-        final ObjectAdapter[] retrievedAdapters = getStore().getInstances(new PersistenceQueryFindByTitle(epvSpecification, epv2Adapter.titleString()));
-        assertEquals(0, retrievedAdapters.length);
+        final List<ObjectAdapter> retrievedAdapters = getStore().getInstances(new PersistenceQueryFindByTitle(epvSpecification, epv2Adapter.titleString()));
+        assertEquals(0, retrievedAdapters.size());
     }
 
     @Test
@@ -94,11 +95,11 @@ public class InMemoryObjectStoreTest_ret
         iswf.bounceSystem();
 
         // when
-        final ObjectAdapter[] retrievedAdapters = getStore().getInstances(new PersistenceQueryFindByTitle(epvSpecification, epv2Adapter.titleString()));
+        final List<ObjectAdapter> retrievedAdapters = getStore().getInstances(new PersistenceQueryFindByTitle(epvSpecification, epv2Adapter.titleString()));
         
         // then
-        assertEquals(1, retrievedAdapters.length);
-        final ObjectAdapter retrievedAdapter = retrievedAdapters[0];
+        assertEquals(1, retrievedAdapters.size());
+        final ObjectAdapter retrievedAdapter = retrievedAdapters.get(0);
 
         assertNotSame(epv2Adapter, retrievedAdapter);
         assertEquals(((SimpleEntity)epv2Adapter.getObject()).getName(), ((SimpleEntity)retrievedAdapter.getObject()).getName());
@@ -112,11 +113,11 @@ public class InMemoryObjectStoreTest_ret
         iswf.bounceSystem();
 
         // when
-        final ObjectAdapter[] retrievedAdapters = getStore().getInstances(new PersistenceQueryFindAllInstances(epvSpecification));
+        final List<ObjectAdapter> retrievedAdapters = getStore().getInstances(new PersistenceQueryFindAllInstances(epvSpecification));
         
         // then
-        assertEquals(1, retrievedAdapters.length);
-        final ObjectAdapter retrievedAdapter = retrievedAdapters[0];
+        assertEquals(1, retrievedAdapters.size());
+        final ObjectAdapter retrievedAdapter = retrievedAdapters.get(0);
 
         assertNotSame(epv2Adapter, retrievedAdapter);
         assertEquals(((SimpleEntity)epv2Adapter.getObject()).getName(), ((SimpleEntity)retrievedAdapter.getObject()).getName());

Modified: incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/ApplibValuedEntityRepository.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/ApplibValuedEntityRepository.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/ApplibValuedEntityRepository.java (original)
+++ incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/ApplibValuedEntityRepository.java Tue May 29 18:49:57 2012
@@ -27,13 +27,13 @@ import org.apache.isis.applib.annotation
 import org.apache.isis.applib.annotation.ObjectType;
 import org.apache.isis.applib.annotation.QueryOnly;
 
-@Named("ApplibValues")
-@ObjectType("ApplibValues")
+@Named("ApplibValuedEntities")
+@ObjectType("ApplibValuedEntities")
 public class ApplibValuedEntityRepository extends AbstractFactoryAndRepository {
 
     @Override
     public String getId() {
-        return "applibValuedEntities";
+        return "ApplibValuedEntities";
     }
 
     @QueryOnly

Modified: incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/JdkValuedEntityRepository.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/JdkValuedEntityRepository.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/JdkValuedEntityRepository.java (original)
+++ incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/JdkValuedEntityRepository.java Tue May 29 18:49:57 2012
@@ -27,12 +27,12 @@ import org.apache.isis.applib.annotation
 import org.apache.isis.applib.annotation.ObjectType;
 import org.apache.isis.applib.annotation.QueryOnly;
 
-@Named("JdkValues")
-@ObjectType("JdkValues")
+@Named("JdkValuedEntities")
+@ObjectType("JdkValuedEntities")
 public class JdkValuedEntityRepository extends AbstractFactoryAndRepository {
 
     public String getId() {
-        return "jdkValuedEntities";
+        return "JdkValuedEntities";
     }
 
     @MemberOrder(sequence = "1")

Modified: incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/PrimitiveValuedEntity.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/PrimitiveValuedEntity.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/PrimitiveValuedEntity.java (original)
+++ incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/PrimitiveValuedEntity.java Tue May 29 18:49:57 2012
@@ -21,7 +21,9 @@ package org.apache.isis.tck.dom.scalars;
 
 import org.apache.isis.applib.AbstractDomainObject;
 import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.ObjectType;
 
+@ObjectType("PRMV")
 public class PrimitiveValuedEntity extends AbstractDomainObject {
 
     // {{ Title

Modified: incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/PrimitiveValuedEntityRepository.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/PrimitiveValuedEntityRepository.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/PrimitiveValuedEntityRepository.java (original)
+++ incubator/isis/trunk/framework/tck/tck-dom/src/main/java/org/apache/isis/tck/dom/scalars/PrimitiveValuedEntityRepository.java Tue May 29 18:49:57 2012
@@ -27,13 +27,13 @@ import org.apache.isis.applib.annotation
 import org.apache.isis.applib.annotation.ObjectType;
 import org.apache.isis.applib.annotation.QueryOnly;
 
-@Named("PrimitiveValues")
-@ObjectType("PRMV")
+@Named("PrimitiveValuedEntities")
+@ObjectType("PrimitiveValuedEntities")
 public class PrimitiveValuedEntityRepository extends AbstractFactoryAndRepository {
 
     @Override
     public String getId() {
-        return "primitiveValuedEntities";
+        return "PrimitiveValuedEntities";
     }
 
     @QueryOnly

Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/ApplicationWorkspace.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/ApplicationWorkspace.java?rev=1343912&r1=1343911&r2=1343912&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/ApplicationWorkspace.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/ApplicationWorkspace.java Tue May 29 18:49:57 2012
@@ -24,6 +24,8 @@ import java.util.List;
 import java.util.Set;
 import java.util.Vector;
 
+import com.google.common.collect.Lists;
+
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.consent.Allow;
@@ -358,15 +360,14 @@ public final class ApplicationWorkspace 
         options.add(new UserActionAbstract("Services...") {
             @Override
             public void execute(final Workspace workspace, final View view, final Location at) {
-                final List<Object> services = IsisContext.getServices();
-                final ObjectAdapter[] serviceObjects = new ObjectAdapter[services.size()];
-                int i = 0;
-                for (final Object object : services) {
+                final List<Object> servicePojos = IsisContext.getServices();
+                final List<ObjectAdapter> serviceAdapters = Lists.newArrayList();
+                for (final Object servicePojo : servicePojos) {
                     final AdapterManager adapterManager = IsisContext.getPersistenceSession().getAdapterManager();
-                    serviceObjects[i++] = adapterManager.adapterFor(object);
+                    serviceAdapters.add(adapterManager.adapterFor(servicePojo));
                 }
                 final ObjectSpecification spec = getSpecificationLoader().loadSpecification(Object.class);
-                final FreeStandingList collection = new FreeStandingList(spec, serviceObjects);
+                final FreeStandingList collection = new FreeStandingList(spec, serviceAdapters);
                 addWindowFor(getAdapterManager().adapterFor(collection), new Placement(at));
             }
         });



Mime
View raw message