isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1359401 - in /incubator/isis/trunk/framework: core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ runtimes/dflt/objectstores/dflt/src/main/java/org/apach...
Date Mon, 09 Jul 2012 21:10:26 GMT
Author: danhaywood
Date: Mon Jul  9 21:10:26 2012
New Revision: 1359401

URL: http://svn.apache.org/viewvc?rev=1359401&view=rev
Log:
Further simplifying refactorings to ResolveState

Modified:
    incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ObjectAdapter.java
    incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ResolveState.java
    incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_GetEndStateTest.java
    incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsDestroyedTest.java
    incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsGhostTest.java
    incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsNewTest.java
    incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsPersistentTest.java
    incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsResolvedTest.java
    incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsResolvingTest.java
    incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsTransientTest.java
    incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsValidToChangeToTest.java
    incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_RespondToChangesInPersistentObjectsTest.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStore.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/AutoCollectionMapper.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ForeignKeyCollectionMapper.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ReversedAutoAssociationMapper.java
    incubator/isis/trunk/framework/runtimes/dflt/objectstores/xml/src/main/java/org/apache/isis/runtimes/dflt/objectstores/xml/XmlObjectStore.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapter.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/container/DomainObjectContainerResolve.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/dflt/DefaultPersistAlgorithm.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSession.java

Modified: incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ObjectAdapter.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ObjectAdapter.java?rev=1359401&r1=1359400&r2=1359401&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ObjectAdapter.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ObjectAdapter.java Mon Jul  9 21:10:26 2012
@@ -137,6 +137,8 @@ public interface ObjectAdapter extends O
 
     boolean isNew();
 
+    boolean canTransitionToResolving();
+
 
 
 }

Modified: incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ResolveState.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ResolveState.java?rev=1359401&r1=1359400&r2=1359401&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ResolveState.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ResolveState.java Mon Jul  9 21:10:26 2012
@@ -23,12 +23,8 @@ import static org.apache.isis.core.metam
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RepresentsPersistent.REPRESENTS_PERSISTENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RepresentsTransient.DOES_NOT_REPRESENT_TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RepresentsTransient.REPRESENTS_TRANSIENT;
-import static org.apache.isis.core.metamodel.adapter.ResolveState.ResolvableFrom.NOT_RESOLVABLE_FROM;
-import static org.apache.isis.core.metamodel.adapter.ResolveState.ResolvableFrom.RESOLVABLE_FROM;
-import static org.apache.isis.core.metamodel.adapter.ResolveState.ResolvableInto.NOT_RESOLVABLE_INTO;
-import static org.apache.isis.core.metamodel.adapter.ResolveState.ResolvableInto.RESOLVABLE_INTO;
-import static org.apache.isis.core.metamodel.adapter.ResolveState.ResolvePotential.COULD_RESOLVE;
-import static org.apache.isis.core.metamodel.adapter.ResolveState.ResolvePotential.WILL_NEVER_RESOLVE;
+import static org.apache.isis.core.metamodel.adapter.ResolveState.TransitionFrom.CANNOT_TRANSITION_FROM;
+import static org.apache.isis.core.metamodel.adapter.ResolveState.TransitionFrom.CAN_TRANSITION_FROM;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RespondsToChanges.DOES_NOT_RESPOND_TO_CHANGES;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RespondsToChanges.RESPONDS_TO_CHANGES;
 
@@ -43,12 +39,8 @@ import com.google.common.collect.Maps;
 public final class ResolveState {
     private static final Map<String, ResolveState> statesByName = Maps.newHashMap();
 
-    static enum ResolvableFrom {
-        RESOLVABLE_FROM, NOT_RESOLVABLE_FROM
-    }
-
-    static enum ResolvableInto {
-        RESOLVABLE_INTO, NOT_RESOLVABLE_INTO
+    static enum TransitionFrom {
+        CAN_TRANSITION_FROM, CANNOT_TRANSITION_FROM
     }
 
     static enum RespondsToChanges {
@@ -64,33 +56,21 @@ public final class ResolveState {
     }
 
     /**
-     * Whether or not an object in this state could cause a resolve (database
-     * load) to occur if interacted with.
-     */
-    static enum ResolvePotential {
-        COULD_RESOLVE, WILL_NEVER_RESOLVE
-    }
-
-    /**
      * When first instantiated by <tt>PojoAdapterFactory</tt>.
      */
-    public static final ResolveState NEW = new ResolveState("New", "N~~~", null, NOT_RESOLVABLE_FROM, NOT_RESOLVABLE_INTO, DOES_NOT_RESPOND_TO_CHANGES, DOES_NOT_REPRESENT_TRANSIENT, DOES_NOT_REPRESENT_PERSISTENT, WILL_NEVER_RESOLVE);
-    public static final ResolveState TRANSIENT = new ResolveState("Transient", "T~~~", null, NOT_RESOLVABLE_FROM, NOT_RESOLVABLE_INTO, DOES_NOT_RESPOND_TO_CHANGES, REPRESENTS_TRANSIENT, DOES_NOT_REPRESENT_PERSISTENT, WILL_NEVER_RESOLVE);
-    public static final ResolveState GHOST = new ResolveState("Ghost", "PG~~", null, RESOLVABLE_FROM, NOT_RESOLVABLE_INTO, RESPONDS_TO_CHANGES, DOES_NOT_REPRESENT_TRANSIENT, REPRESENTS_PERSISTENT, COULD_RESOLVE);
-    public static final ResolveState RESOLVED = new ResolveState("Resolved", "PR~~", null, RESOLVABLE_FROM, NOT_RESOLVABLE_INTO, RESPONDS_TO_CHANGES, DOES_NOT_REPRESENT_TRANSIENT, REPRESENTS_PERSISTENT, WILL_NEVER_RESOLVE);
-    public static final ResolveState RESOLVING = new ResolveState("Resolving", "P~R~", RESOLVED, NOT_RESOLVABLE_FROM, RESOLVABLE_INTO, DOES_NOT_RESPOND_TO_CHANGES, DOES_NOT_REPRESENT_TRANSIENT, REPRESENTS_PERSISTENT, COULD_RESOLVE);
-    /**
-     * 20120709: used only in <tt>Memento</tt>, when recreating a transient
-     * object.
-     */
-    public static final ResolveState SERIALIZING_TRANSIENT = new ResolveState("Serializing Transient", "T~~S", TRANSIENT, NOT_RESOLVABLE_FROM, NOT_RESOLVABLE_INTO, DOES_NOT_RESPOND_TO_CHANGES, REPRESENTS_TRANSIENT, DOES_NOT_REPRESENT_PERSISTENT, WILL_NEVER_RESOLVE);
+    public static final ResolveState NEW                   = new ResolveState("New",                   "N~~", null,      CANNOT_TRANSITION_FROM, DOES_NOT_RESPOND_TO_CHANGES, DOES_NOT_REPRESENT_TRANSIENT, DOES_NOT_REPRESENT_PERSISTENT);
+    public static final ResolveState TRANSIENT             = new ResolveState("Transient",             "T~~", null,      CANNOT_TRANSITION_FROM, DOES_NOT_RESPOND_TO_CHANGES, REPRESENTS_TRANSIENT,         DOES_NOT_REPRESENT_PERSISTENT);
+    public static final ResolveState GHOST                 = new ResolveState("Ghost",                 "PG~", null,      CAN_TRANSITION_FROM,    RESPONDS_TO_CHANGES,         DOES_NOT_REPRESENT_TRANSIENT, REPRESENTS_PERSISTENT);
+    public static final ResolveState RESOLVED              = new ResolveState("Resolved",              "PR~", null,      CAN_TRANSITION_FROM,    RESPONDS_TO_CHANGES,         DOES_NOT_REPRESENT_TRANSIENT, REPRESENTS_PERSISTENT);
+    public static final ResolveState RESOLVING             = new ResolveState("Resolving",             "Pr~", RESOLVED,  CANNOT_TRANSITION_FROM, DOES_NOT_RESPOND_TO_CHANGES, DOES_NOT_REPRESENT_TRANSIENT, REPRESENTS_PERSISTENT);
+    public static final ResolveState UPDATING              = new ResolveState("Updating",              "PU~", RESOLVED,  CANNOT_TRANSITION_FROM, DOES_NOT_RESPOND_TO_CHANGES, DOES_NOT_REPRESENT_TRANSIENT, REPRESENTS_PERSISTENT);
+    public static final ResolveState DESTROYED             = new ResolveState("Destroyed",             "D~~", null,      CANNOT_TRANSITION_FROM, RESPONDS_TO_CHANGES,         DOES_NOT_REPRESENT_TRANSIENT, DOES_NOT_REPRESENT_PERSISTENT);
+    public static final ResolveState VALUE                 = new ResolveState("Value",                 "V~~", null,      CANNOT_TRANSITION_FROM, RESPONDS_TO_CHANGES,         DOES_NOT_REPRESENT_TRANSIENT, DOES_NOT_REPRESENT_PERSISTENT);
+
     /**
-     * 20120709: used only in <tt>DefaultPersistAlgorithm</tt>
+     * 20120709: used only in <tt>Memento</tt>, when recreating a transient object.
      */
-    public static final ResolveState SERIALIZING_RESOLVED = new ResolveState("Serializing Resolved", "PR~S", RESOLVED, NOT_RESOLVABLE_FROM, NOT_RESOLVABLE_INTO, DOES_NOT_RESPOND_TO_CHANGES, DOES_NOT_REPRESENT_TRANSIENT, REPRESENTS_PERSISTENT, WILL_NEVER_RESOLVE);
-    public static final ResolveState UPDATING = new ResolveState("Updating", "PU~~", RESOLVED, NOT_RESOLVABLE_FROM, RESOLVABLE_INTO, DOES_NOT_RESPOND_TO_CHANGES, DOES_NOT_REPRESENT_TRANSIENT, REPRESENTS_PERSISTENT, COULD_RESOLVE);
-    public static final ResolveState DESTROYED = new ResolveState("Destroyed", "D~~~", null, NOT_RESOLVABLE_FROM, NOT_RESOLVABLE_INTO, RESPONDS_TO_CHANGES, DOES_NOT_REPRESENT_TRANSIENT, DOES_NOT_REPRESENT_PERSISTENT, WILL_NEVER_RESOLVE);
-    public static final ResolveState VALUE = new ResolveState("Value", "V~~~", null, NOT_RESOLVABLE_FROM, NOT_RESOLVABLE_INTO, RESPONDS_TO_CHANGES, DOES_NOT_REPRESENT_TRANSIENT, DOES_NOT_REPRESENT_PERSISTENT, WILL_NEVER_RESOLVE);
+    public static final ResolveState SERIALIZING_TRANSIENT = new ResolveState("Serializing Transient", "T~S", TRANSIENT, CANNOT_TRANSITION_FROM, DOES_NOT_RESPOND_TO_CHANGES, REPRESENTS_TRANSIENT,         DOES_NOT_REPRESENT_PERSISTENT);
 
     // no longer seem to be used
 
@@ -118,6 +98,11 @@ public final class ResolveState {
     // DOES_NOT_REPRESENT_RESOLVING,
     // COULD_RESOLVE);
 
+    // 20120709: only used in <tt>DefaultPersistAlgorithm</tt>
+    // able to remove because, after refactoring simplifications, ended up as equivalent to UPDATING.
+    // public static final ResolveState SERIALIZING_RESOLVED  = new ResolveState("Serializing Resolved",   "PRS", RESOLVED,  CANNOT_TRANSITION_FROM, DOES_NOT_RESPOND_TO_CHANGES, DOES_NOT_REPRESENT_TRANSIENT, REPRESENTS_PERSISTENT);
+
+
     /**
      * These cannot be passed into the constructor because cannot reference an
      * instance until it has been declared.
@@ -130,8 +115,9 @@ public final class ResolveState {
             put(NEW, new ResolveState[] { TRANSIENT, GHOST, VALUE });
             put(TRANSIENT, new ResolveState[] { RESOLVED, SERIALIZING_TRANSIENT });
             put(RESOLVING, new ResolveState[] { RESOLVED });
-            put(RESOLVED, new ResolveState[] { GHOST, SERIALIZING_RESOLVED, UPDATING, DESTROYED });
-            put(SERIALIZING_RESOLVED, new ResolveState[] { RESOLVED });
+            // previously also SERIALIZING_RESOLVED
+            put(RESOLVED, new ResolveState[] { GHOST, UPDATING, DESTROYED });
+            //put(SERIALIZING_RESOLVED, new ResolveState[] { RESOLVED });
             put(SERIALIZING_TRANSIENT, new ResolveState[] { TRANSIENT });
             put(UPDATING, new ResolveState[] { RESOLVED });
             put(DESTROYED, new ResolveState[] {});
@@ -151,25 +137,20 @@ public final class ResolveState {
     private final String code;
     private final ResolveState endState;
     private final String name;
-    private final ResolvableFrom resolvableFrom;
-    private final ResolvableInto resolvableInto;
+    private final TransitionFrom transitionFrom;
     private final RespondsToChanges respondsToChanges;
     private final RepresentsTransient representsTransient;
     private final RepresentsPersistent representsPersistent;
-    private final ResolvePotential resolvePotential;
     private HashSet<ResolveState> changeToStates;
 
-    private ResolveState(final String name, final String code, final ResolveState endState, final ResolvableFrom resolvableFrom, final ResolvableInto resolvableInto, final RespondsToChanges respondsToChanges, final RepresentsTransient representsTransient,
-            final RepresentsPersistent representsPersistent, final ResolvePotential resolvePotential) {
+    private ResolveState(final String name, final String code, final ResolveState endState, final TransitionFrom transitionFrom, final RespondsToChanges respondsToChanges, final RepresentsTransient representsTransient, final RepresentsPersistent representsPersistent) {
         this.name = name;
         this.code = code;
         this.endState = endState;
-        this.resolvableFrom = resolvableFrom;
-        this.resolvableInto = resolvableInto;
+        this.transitionFrom = transitionFrom;
         this.respondsToChanges = respondsToChanges;
         this.representsTransient = representsTransient;
         this.representsPersistent = representsPersistent;
-        this.resolvePotential = resolvePotential;
         statesByName.put(name, this);
     }
 
@@ -177,7 +158,7 @@ public final class ResolveState {
      * Four character representation of the state.
      * 
      * <p>
-     * The format is <tt>XYZW</tt> where:
+     * The format is <tt>XYZ</tt> where:
      * <ul>
      * <li><tt>X</tt> is transient state:
      * <ul>
@@ -185,25 +166,18 @@ public final class ResolveState {
      * <li>T</li> for <b>T</b>ransient
      * <li>P</li> for <b>P</b>ersistent
      * <li>D</li> for <b>D</b>estroyed
-     * <li>A</li> for st<b>A</b>ndalone
+     * <li>V</li> for <b>V</b>alue
      * </ul>
      * </li>
      * <li><tt>Y</tt> (for persistent only) is the resolve state:
      * <ul>
      * <li>G</li> for <b>G</b>host
      * <li>R</li> for <b>R</b>esolved
-     * <li>r</li> for Part <b>r</b>esolved
-     * <li>~</li> if not persistent
-     * </ul>
-     * </li>
-     * <li><tt>Z</tt> (for persistent only) is the resolving state:
-     * <ul>
-     * <li>R</li> for <b>R</b>esolving
-     * <li>r</li> for Part <b>r</b>esolving
+     * <li>r</li> for <b>r</b>esolving
      * <li>~</li> if not persistent
      * </ul>
      * </li>
-     * <li><tt>W</tt> (for non-standalone, not resolving, not updating, not
+     * <li><tt>Z</tt> (for non-standalone, not resolving, not updating, not
      * destroyed) is the serialization state:
      * <ul>
      * <li>~</li> not serializing
@@ -244,18 +218,13 @@ public final class ResolveState {
 
     /**
      * As per {@link #isValidToChangeTo(ResolveState)}, but will additionally
-     * throw a {@link ResolveException} if the requested state can never be
-     * transitioned into, and will return <tt>false</tt> if the current state
-     * can never be transitioned from.
+     * return <tt>false</tt> if the current state can never be transitioned from.
      */
-    public boolean canChangeTo(final ResolveState newState) {
-        if (newState.resolvableInto == NOT_RESOLVABLE_INTO) {
-            throw new ResolveException("new state must be resolvable into");
-        }
-        if (this.resolvableFrom == RESOLVABLE_FROM) {
-            return isValidToChangeTo(newState);
-        }
-        return false;
+    public boolean canTransitionTo(final ResolveState newState) {
+        if (this.transitionFrom != CAN_TRANSITION_FROM) {
+            return false;
+        } 
+        return isValidToChangeTo(newState);
     }
 
     /**
@@ -301,20 +270,6 @@ public final class ResolveState {
     }
 
     /**
-     * Returns <tt>true</tt> if an object in this state could trigger some sort
-     * of database loading.
-     * 
-     * <p>
-     * Used to prevent calls to <tt>title()</tt> etc on objects that are not
-     * resolved.
-     * 
-     * @see ResolvePotential
-     */
-    public boolean couldResolve() {
-        return this.resolvePotential == COULD_RESOLVE;
-    }
-
-    /**
      * Determines if the resolved state can be changed from this state to the
      * specified state. Returns true if the change is valid.
      */

Modified: incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_GetEndStateTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_GetEndStateTest.java?rev=1359401&r1=1359400&r2=1359401&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_GetEndStateTest.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_GetEndStateTest.java Mon Jul  9 21:10:26 2012
@@ -24,7 +24,6 @@ import static org.apache.isis.core.metam
 import static org.apache.isis.core.metamodel.adapter.ResolveState.NEW;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RESOLVED;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RESOLVING;
-import static org.apache.isis.core.metamodel.adapter.ResolveState.SERIALIZING_RESOLVED;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.SERIALIZING_TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.UPDATING;
@@ -51,7 +50,8 @@ public class ResolveState_GetEndStateTes
                 { RESOLVING, RESOLVED }, { RESOLVED, null }, { UPDATING, RESOLVED }, { SERIALIZING_TRANSIENT, TRANSIENT },
                 // { SERIALIZING_PART_RESOLVED, PART_RESOLVED },
                 // { SERIALIZING_GHOST, GHOST },
-                { SERIALIZING_RESOLVED, RESOLVED }, { VALUE, null }, { DESTROYED, null }, });
+                // { SERIALIZING_RESOLVED, RESOLVED }, 
+                { VALUE, null }, { DESTROYED, null }, });
     }
 
     private final ResolveState from;

Modified: incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsDestroyedTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsDestroyedTest.java?rev=1359401&r1=1359400&r2=1359401&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsDestroyedTest.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsDestroyedTest.java Mon Jul  9 21:10:26 2012
@@ -24,7 +24,6 @@ import static org.apache.isis.core.metam
 import static org.apache.isis.core.metamodel.adapter.ResolveState.NEW;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RESOLVED;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RESOLVING;
-import static org.apache.isis.core.metamodel.adapter.ResolveState.SERIALIZING_RESOLVED;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.SERIALIZING_TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.UPDATING;
@@ -45,14 +44,22 @@ public class ResolveState_IsDestroyedTes
 
     @Parameters
     public static Collection<Object[]> data() {
-        return Arrays.asList(new Object[][] { { false, GHOST }, { false, NEW },
+        return Arrays.asList(new Object[][] { 
+                { false, GHOST }, //
+                { false, NEW },//
                 // { false, PART_RESOLVED },
-                { false, RESOLVED }, { false, RESOLVING },
+                { false, RESOLVED }, //
+                { false, RESOLVING }, //
                 // { false, RESOLVING_PART },
-                { false, TRANSIENT }, { true, DESTROYED }, { false, UPDATING }, { false, SERIALIZING_TRANSIENT },
+                { false, TRANSIENT }, //
+                { true, DESTROYED }, //
+                { false, UPDATING }, //
+                { false, SERIALIZING_TRANSIENT },
                 // { false, SERIALIZING_GHOST },
                 // { false, SERIALIZING_PART_RESOLVED },
-                { false, SERIALIZING_RESOLVED }, { false, VALUE }, });
+                // { false, SERIALIZING_RESOLVED }, 
+                { false, VALUE },// 
+                });
     }
 
     private final boolean whetherIs;

Modified: incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsGhostTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsGhostTest.java?rev=1359401&r1=1359400&r2=1359401&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsGhostTest.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsGhostTest.java Mon Jul  9 21:10:26 2012
@@ -24,7 +24,6 @@ import static org.apache.isis.core.metam
 import static org.apache.isis.core.metamodel.adapter.ResolveState.NEW;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RESOLVED;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RESOLVING;
-import static org.apache.isis.core.metamodel.adapter.ResolveState.SERIALIZING_RESOLVED;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.SERIALIZING_TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.UPDATING;
@@ -45,14 +44,22 @@ public class ResolveState_IsGhostTest {
 
     @Parameters
     public static Collection<Object[]> data() {
-        return Arrays.asList(new Object[][] { { true, GHOST }, { false, NEW },
+        return Arrays.asList(new Object[][] { 
+                { true, GHOST }, //
+                { false, NEW }, //
                 // { false, PART_RESOLVED },
-                { false, RESOLVED }, { false, RESOLVING },
+                { false, RESOLVED },  //
+                { false, RESOLVING }, //
                 // { false, RESOLVING_PART },
-                { false, TRANSIENT }, { false, DESTROYED }, { false, UPDATING }, { false, SERIALIZING_TRANSIENT },
+                { false, TRANSIENT }, // 
+                { false, DESTROYED }, //
+                { false, UPDATING }, //
+                { false, SERIALIZING_TRANSIENT }, //
                 // { false, SERIALIZING_GHOST },
                 // { false, SERIALIZING_PART_RESOLVED },
-                { false, SERIALIZING_RESOLVED }, { false, VALUE }, });
+                // { false, SERIALIZING_RESOLVED }, 
+                { false, VALUE },// 
+                });
     }
 
     private final boolean whetherIs;

Modified: incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsNewTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsNewTest.java?rev=1359401&r1=1359400&r2=1359401&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsNewTest.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsNewTest.java Mon Jul  9 21:10:26 2012
@@ -24,7 +24,6 @@ import static org.apache.isis.core.metam
 import static org.apache.isis.core.metamodel.adapter.ResolveState.NEW;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RESOLVED;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RESOLVING;
-import static org.apache.isis.core.metamodel.adapter.ResolveState.SERIALIZING_RESOLVED;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.SERIALIZING_TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.UPDATING;
@@ -45,14 +44,22 @@ public class ResolveState_IsNewTest {
 
     @Parameters
     public static Collection<Object[]> data() {
-        return Arrays.asList(new Object[][] { { false, GHOST }, { true, NEW },
+        return Arrays.asList(new Object[][] { 
+                { false, GHOST }, //
+                { true, NEW }, //
                 // { false, PART_RESOLVED },
-                { false, RESOLVED }, { false, RESOLVING },
+                { false, RESOLVED }, //
+                { false, RESOLVING }, //
                 // { false, RESOLVING_PART },
-                { false, TRANSIENT }, { false, DESTROYED }, { false, UPDATING }, { false, SERIALIZING_TRANSIENT },
+                { false, TRANSIENT }, //
+                { false, DESTROYED }, //
+                { false, UPDATING }, //
+                { false, SERIALIZING_TRANSIENT }, //
                 // { false, SERIALIZING_GHOST },
                 // { false, SERIALIZING_PART_RESOLVED },
-                { false, SERIALIZING_RESOLVED }, { false, VALUE }, });
+                // { false, SERIALIZING_RESOLVED }, 
+                { false, VALUE }, //
+                });
     }
 
     private final boolean whetherIs;

Modified: incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsPersistentTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsPersistentTest.java?rev=1359401&r1=1359400&r2=1359401&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsPersistentTest.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsPersistentTest.java Mon Jul  9 21:10:26 2012
@@ -24,7 +24,6 @@ import static org.apache.isis.core.metam
 import static org.apache.isis.core.metamodel.adapter.ResolveState.NEW;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RESOLVED;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RESOLVING;
-import static org.apache.isis.core.metamodel.adapter.ResolveState.SERIALIZING_RESOLVED;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.SERIALIZING_TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.UPDATING;
@@ -45,14 +44,22 @@ public class ResolveState_IsPersistentTe
 
     @Parameters
     public static Collection<Object[]> data() {
-        return Arrays.asList(new Object[][] { { true, GHOST }, { false, NEW },
+        return Arrays.asList(new Object[][] { 
+                { true, GHOST }, //
+                { false, NEW }, //
                 // { true, PART_RESOLVED },
-                { true, RESOLVED }, { true, RESOLVING },
+                { true, RESOLVED }, //
+                { true, RESOLVING }, //
                 // { true, RESOLVING_PART },
-                { false, TRANSIENT }, { false, DESTROYED }, { true, UPDATING }, { false, SERIALIZING_TRANSIENT },
+                { false, TRANSIENT }, //
+                { false, DESTROYED }, //
+                { true, UPDATING }, //
+                { false, SERIALIZING_TRANSIENT }, //
                 // { true, SERIALIZING_GHOST },
                 // { true, SERIALIZING_PART_RESOLVED },
-                { true, SERIALIZING_RESOLVED }, { false, VALUE }, });
+                // { true, SERIALIZING_RESOLVED }, 
+                { false, VALUE }, //
+                });
     }
 
     private final boolean whetherIs;

Modified: incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsResolvedTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsResolvedTest.java?rev=1359401&r1=1359400&r2=1359401&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsResolvedTest.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsResolvedTest.java Mon Jul  9 21:10:26 2012
@@ -24,7 +24,6 @@ import static org.apache.isis.core.metam
 import static org.apache.isis.core.metamodel.adapter.ResolveState.NEW;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RESOLVED;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RESOLVING;
-import static org.apache.isis.core.metamodel.adapter.ResolveState.SERIALIZING_RESOLVED;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.SERIALIZING_TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.UPDATING;
@@ -45,14 +44,22 @@ public class ResolveState_IsResolvedTest
 
     @Parameters
     public static Collection<Object[]> data() {
-        return Arrays.asList(new Object[][] { { false, GHOST }, { false, NEW },
+        return Arrays.asList(new Object[][] { 
+                { false, GHOST }, //
+                { false, NEW }, //
                 // { false, PART_RESOLVED },
-                { true, RESOLVED }, { false, RESOLVING },
+                { true, RESOLVED }, //
+                { false, RESOLVING }, //
                 // { false, RESOLVING_PART },
-                { false, TRANSIENT }, { false, DESTROYED }, { false, UPDATING }, { false, SERIALIZING_TRANSIENT },
+                { false, TRANSIENT }, //
+                { false, DESTROYED }, //
+                { false, UPDATING }, //
+                { false, SERIALIZING_TRANSIENT }, //
                 // { false, SERIALIZING_GHOST },
                 // { false, SERIALIZING_PART_RESOLVED },
-                { false, SERIALIZING_RESOLVED }, { false, VALUE }, });
+                // { false, SERIALIZING_RESOLVED }, 
+                { false, VALUE }, //
+                });
     }
 
     private final boolean whetherIs;

Modified: incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsResolvingTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsResolvingTest.java?rev=1359401&r1=1359400&r2=1359401&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsResolvingTest.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsResolvingTest.java Mon Jul  9 21:10:26 2012
@@ -24,7 +24,6 @@ import static org.apache.isis.core.metam
 import static org.apache.isis.core.metamodel.adapter.ResolveState.NEW;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RESOLVED;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RESOLVING;
-import static org.apache.isis.core.metamodel.adapter.ResolveState.SERIALIZING_RESOLVED;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.SERIALIZING_TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.UPDATING;
@@ -45,14 +44,21 @@ public class ResolveState_IsResolvingTes
 
     @Parameters
     public static Collection<Object[]> data() {
-        return Arrays.asList(new Object[][] { { false, GHOST }, { false, NEW },
+        return Arrays.asList(new Object[][] { 
+                { false, GHOST }, //
+                { false, NEW }, //
                 // { false, PART_RESOLVED },
-                { false, RESOLVED }, { true, RESOLVING },
+                { false, RESOLVED }, //
+                { true, RESOLVING }, //
                 // { true, RESOLVING_PART },
-                { false, TRANSIENT }, { false, DESTROYED }, { false, UPDATING }, { false, SERIALIZING_TRANSIENT },
+                { false, TRANSIENT }, //
+                { false, DESTROYED }, //
+                { false, UPDATING }, { false, SERIALIZING_TRANSIENT },
                 // { false, SERIALIZING_GHOST },
                 // { false, SERIALIZING_PART_RESOLVED },
-                { false, SERIALIZING_RESOLVED }, { false, VALUE }, });
+                // { false, SERIALIZING_RESOLVED }, 
+                { false, VALUE }, //
+                });
     }
 
     private final boolean whetherIs;

Modified: incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsTransientTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsTransientTest.java?rev=1359401&r1=1359400&r2=1359401&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsTransientTest.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsTransientTest.java Mon Jul  9 21:10:26 2012
@@ -24,7 +24,6 @@ import static org.apache.isis.core.metam
 import static org.apache.isis.core.metamodel.adapter.ResolveState.NEW;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RESOLVED;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RESOLVING;
-import static org.apache.isis.core.metamodel.adapter.ResolveState.SERIALIZING_RESOLVED;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.SERIALIZING_TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.UPDATING;
@@ -45,14 +44,22 @@ public class ResolveState_IsTransientTes
 
     @Parameters
     public static Collection<Object[]> data() {
-        return Arrays.asList(new Object[][] { { false, GHOST }, { false, NEW },
+        return Arrays.asList(new Object[][] { 
+                { false, GHOST }, //
+                { false, NEW }, //
                 // { false, PART_RESOLVED },
-                { false, RESOLVED }, { false, RESOLVING },
+                { false, RESOLVED }, //
+                { false, RESOLVING }, //
                 // { false, RESOLVING_PART },
-                { true, TRANSIENT }, { false, DESTROYED }, { false, UPDATING }, { true, SERIALIZING_TRANSIENT },
+                { true, TRANSIENT }, //
+                { false, DESTROYED }, //
+                { false, UPDATING }, //
+                { true, SERIALIZING_TRANSIENT }, //
                 // { false, SERIALIZING_GHOST },
                 // { false, SERIALIZING_PART_RESOLVED },
-                { false, SERIALIZING_RESOLVED }, { false, VALUE }, });
+                // { false, SERIALIZING_RESOLVED }, 
+                { false, VALUE }, //
+                });
     }
 
     private final boolean whetherIs;

Modified: incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsValidToChangeToTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsValidToChangeToTest.java?rev=1359401&r1=1359400&r2=1359401&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsValidToChangeToTest.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsValidToChangeToTest.java Mon Jul  9 21:10:26 2012
@@ -24,7 +24,6 @@ import static org.apache.isis.core.metam
 import static org.apache.isis.core.metamodel.adapter.ResolveState.NEW;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RESOLVED;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RESOLVING;
-import static org.apache.isis.core.metamodel.adapter.ResolveState.SERIALIZING_RESOLVED;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.SERIALIZING_TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.UPDATING;
@@ -57,7 +56,7 @@ public class ResolveState_IsValidToChang
                 { false, NEW, SERIALIZING_TRANSIENT },//
                 // { false, NEW, SERIALIZING_GHOST },
                 // { false, NEW, SERIALIZING_PART_RESOLVED },
-                { false, NEW, SERIALIZING_RESOLVED },//
+                // { false, NEW, SERIALIZING_RESOLVED },//
                 { true, NEW, VALUE },//
 
                 { false, GHOST, GHOST },//
@@ -72,7 +71,7 @@ public class ResolveState_IsValidToChang
                 { false, GHOST, SERIALIZING_TRANSIENT },//
                 // { true, GHOST, SERIALIZING_GHOST },
                 // { false, GHOST, SERIALIZING_PART_RESOLVED },
-                { false, GHOST, SERIALIZING_RESOLVED }, //
+                // { false, GHOST, SERIALIZING_RESOLVED }, //
                 { false, GHOST, VALUE },//
 
                 { false, TRANSIENT, GHOST },//
@@ -87,7 +86,7 @@ public class ResolveState_IsValidToChang
                 { true, TRANSIENT, SERIALIZING_TRANSIENT },//
                 // { false, TRANSIENT, SERIALIZING_GHOST },
                 // { false, TRANSIENT, SERIALIZING_PART_RESOLVED },
-                { false, TRANSIENT, SERIALIZING_RESOLVED },//
+                // { false, TRANSIENT, SERIALIZING_RESOLVED },//
                 { false, TRANSIENT, VALUE },//
 
                 // { false, RESOLVING_PART, GHOST }, //
@@ -132,7 +131,7 @@ public class ResolveState_IsValidToChang
                 { false, RESOLVING, SERIALIZING_TRANSIENT },//
                 // { false, RESOLVING, SERIALIZING_GHOST },
                 // { false, RESOLVING, SERIALIZING_PART_RESOLVED },
-                { false, RESOLVING, SERIALIZING_RESOLVED },//
+                // { false, RESOLVING, SERIALIZING_RESOLVED },//
                 { false, RESOLVING, VALUE },//
 
                 { true, RESOLVED, GHOST }, //
@@ -147,7 +146,7 @@ public class ResolveState_IsValidToChang
                 { false, RESOLVED, SERIALIZING_TRANSIENT },//
                 // { false, RESOLVED, SERIALIZING_GHOST },
                 // { false, RESOLVED, SERIALIZING_PART_RESOLVED },
-                { true, RESOLVED, SERIALIZING_RESOLVED }, //
+                // { true, RESOLVED, SERIALIZING_RESOLVED }, //
                 { false, RESOLVED, VALUE },
 
                 { false, UPDATING, GHOST }, //
@@ -162,7 +161,7 @@ public class ResolveState_IsValidToChang
                 { false, UPDATING, SERIALIZING_TRANSIENT },//
                 // { false, UPDATING, SERIALIZING_GHOST },
                 // { false, UPDATING, SERIALIZING_PART_RESOLVED },
-                { false, UPDATING, SERIALIZING_RESOLVED }, //
+                // { false, UPDATING, SERIALIZING_RESOLVED }, //
                 { false, UPDATING, VALUE },//
 
                 { false, SERIALIZING_TRANSIENT, GHOST },//
@@ -177,7 +176,7 @@ public class ResolveState_IsValidToChang
                 { false, SERIALIZING_TRANSIENT, SERIALIZING_TRANSIENT },//
                 // { false, SERIALIZING_TRANSIENT, SERIALIZING_GHOST },
                 // { false, SERIALIZING_TRANSIENT, SERIALIZING_PART_RESOLVED },
-                { false, SERIALIZING_TRANSIENT, SERIALIZING_RESOLVED }, //
+                // { false, SERIALIZING_TRANSIENT, SERIALIZING_RESOLVED }, //
                 { false, SERIALIZING_TRANSIENT, VALUE },//
 
                 // { false, SERIALIZING_PART_RESOLVED, GHOST }, { false,
@@ -195,20 +194,20 @@ public class ResolveState_IsValidToChang
                 // }, { false, SERIALIZING_PART_RESOLVED, SERIALIZING_RESOLVED
                 // }, { false, SERIALIZING_PART_RESOLVED, VALUE },
 
-                { false, SERIALIZING_RESOLVED, GHOST }, //
-                { false, SERIALIZING_RESOLVED, NEW }, //
-                // { false, SERIALIZING_RESOLVED, PART_RESOLVED }, //
-                { true, SERIALIZING_RESOLVED, RESOLVED }, //
-                { false, SERIALIZING_RESOLVED, RESOLVING }, //
-                // { false, SERIALIZING_RESOLVED, RESOLVING_PART }, //
-                { false, SERIALIZING_RESOLVED, TRANSIENT }, //
-                { false, SERIALIZING_RESOLVED, DESTROYED }, //
-                { false, SERIALIZING_RESOLVED, UPDATING }, //
-                { false, SERIALIZING_RESOLVED, SERIALIZING_TRANSIENT },
-                // { false, SERIALIZING_RESOLVED, SERIALIZING_GHOST },
-                // { false, SERIALIZING_RESOLVED, SERIALIZING_PART_RESOLVED },
-                { false, SERIALIZING_RESOLVED, SERIALIZING_RESOLVED }, //
-                { false, SERIALIZING_RESOLVED, VALUE },
+//                { false, SERIALIZING_RESOLVED, GHOST }, //
+//                { false, SERIALIZING_RESOLVED, NEW }, //
+//                // { false, SERIALIZING_RESOLVED, PART_RESOLVED }, //
+//                { true, SERIALIZING_RESOLVED, RESOLVED }, //
+//                { false, SERIALIZING_RESOLVED, RESOLVING }, //
+//                // { false, SERIALIZING_RESOLVED, RESOLVING_PART }, //
+//                { false, SERIALIZING_RESOLVED, TRANSIENT }, //
+//                { false, SERIALIZING_RESOLVED, DESTROYED }, //
+//                { false, SERIALIZING_RESOLVED, UPDATING }, //
+//                { false, SERIALIZING_RESOLVED, SERIALIZING_TRANSIENT },
+//                // { false, SERIALIZING_RESOLVED, SERIALIZING_GHOST },
+//                // { false, SERIALIZING_RESOLVED, SERIALIZING_PART_RESOLVED },
+//                { false, SERIALIZING_RESOLVED, SERIALIZING_RESOLVED }, //
+//                { false, SERIALIZING_RESOLVED, VALUE },
 
                 // { true, SERIALIZING_GHOST, GHOST }, { false,
                 // SERIALIZING_GHOST, NEW }, { false, SERIALIZING_GHOST,
@@ -236,7 +235,7 @@ public class ResolveState_IsValidToChang
                 { false, VALUE, SERIALIZING_TRANSIENT },
                 // { false, VALUE, SERIALIZING_GHOST },
                 // { false, VALUE, SERIALIZING_PART_RESOLVED },
-                { false, VALUE, SERIALIZING_RESOLVED }, //
+                // { false, VALUE, SERIALIZING_RESOLVED }, //
                 { false, VALUE, VALUE },
 
                 { false, DESTROYED, GHOST }, //
@@ -251,7 +250,7 @@ public class ResolveState_IsValidToChang
                 { false, DESTROYED, SERIALIZING_TRANSIENT },
                 // { false, DESTROYED, SERIALIZING_GHOST },
                 // { false, DESTROYED, SERIALIZING_PART_RESOLVED },
-                { false, DESTROYED, SERIALIZING_RESOLVED }, //
+                // { false, DESTROYED, SERIALIZING_RESOLVED }, //
                 { false, DESTROYED, VALUE },
 
         });

Modified: incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_RespondToChangesInPersistentObjectsTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_RespondToChangesInPersistentObjectsTest.java?rev=1359401&r1=1359400&r2=1359401&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_RespondToChangesInPersistentObjectsTest.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_RespondToChangesInPersistentObjectsTest.java Mon Jul  9 21:10:26 2012
@@ -24,7 +24,6 @@ import static org.apache.isis.core.metam
 import static org.apache.isis.core.metamodel.adapter.ResolveState.NEW;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RESOLVED;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.RESOLVING;
-import static org.apache.isis.core.metamodel.adapter.ResolveState.SERIALIZING_RESOLVED;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.SERIALIZING_TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.TRANSIENT;
 import static org.apache.isis.core.metamodel.adapter.ResolveState.UPDATING;
@@ -45,14 +44,22 @@ public class ResolveState_RespondToChang
 
     @Parameters
     public static Collection<Object[]> data() {
-        return Arrays.asList(new Object[][] { { true, GHOST }, { false, NEW }, 
+        return Arrays.asList(new Object[][] { 
+                { true, GHOST }, //
+                { false, NEW }, // 
                 // { true, PART_RESOLVED }, 
-                { true, RESOLVED }, { false, RESOLVING },
+                { true, RESOLVED }, //
+                { false, RESOLVING }, //
                 // { false, RESOLVING_PART },
-                { false, TRANSIENT }, { true, DESTROYED }, { false, UPDATING }, { false, SERIALIZING_TRANSIENT },
+                { false, TRANSIENT }, //
+                { true, DESTROYED }, //
+                { false, UPDATING }, //
+                { false, SERIALIZING_TRANSIENT }, //
                 // { false, SERIALIZING_GHOST },
                 // { false, SERIALIZING_PART_RESOLVED },
-                { false, SERIALIZING_RESOLVED }, { true, VALUE }, });
+                // { false, SERIALIZING_RESOLVED }, 
+                { true, VALUE }, //
+                });
     }
 
     private final boolean whetherIs;

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStore.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStore.java?rev=1359401&r1=1359400&r2=1359401&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStore.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/dflt/src/main/java/org/apache/isis/runtimes/dflt/objectstores/dflt/InMemoryObjectStore.java Mon Jul  9 21:10:26 2012
@@ -257,7 +257,7 @@ public class InMemoryObjectStore impleme
         // as belt-n-braces, have also made PSOS#resolveImmediately synchronize
         // on
         // the object being resolved.
-        if (adapter.getResolveState().canChangeTo(ResolveState.RESOLVING)) {
+        if (adapter.canTransitionToResolving()) {
             LOG.debug("resolve " + adapter);
 
             PersistorUtil.startStateTransition(adapter, ResolveState.RESOLVING);
@@ -324,7 +324,7 @@ public class InMemoryObjectStore impleme
 
     private static List<ObjectAdapter> resolved(final List<ObjectAdapter> instances) {
         for (ObjectAdapter adapter: instances) {
-            if (adapter.getResolveState().canChangeTo(ResolveState.RESOLVING)) {
+            if (adapter.canTransitionToResolving()) {
                 PersistorUtil.startStateTransition(adapter, ResolveState.RESOLVING);
                 PersistorUtil.endStateTransition(adapter);
             }

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/AutoCollectionMapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/AutoCollectionMapper.java?rev=1359401&r1=1359400&r2=1359401&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/AutoCollectionMapper.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/AutoCollectionMapper.java Mon Jul  9 21:10:26 2012
@@ -85,7 +85,7 @@ public class AutoCollectionMapper extend
     @Override
     public void loadInternalCollection(final DatabaseConnector connector, final ObjectAdapter parentAdapter, final boolean makeResolved) {
         final ObjectAdapter collectionAdapter = field.get(parentAdapter);
-        if (!collectionAdapter.getResolveState().canChangeTo(ResolveState.RESOLVING)) {
+        if (!collectionAdapter.canTransitionToResolving()) {
             return;
         } 
         

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ForeignKeyCollectionMapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ForeignKeyCollectionMapper.java?rev=1359401&r1=1359400&r2=1359401&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ForeignKeyCollectionMapper.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ForeignKeyCollectionMapper.java Mon Jul  9 21:10:26 2012
@@ -192,7 +192,7 @@ public class ForeignKeyCollectionMapper 
     public void loadInternalCollection(final DatabaseConnector connector, final ObjectAdapter parentAdapter, final boolean makeResolved) {
 
         final ObjectAdapter collectionAdapter = field.get(parentAdapter);
-        if (!collectionAdapter.getResolveState().canChangeTo(ResolveState.RESOLVING)) {
+        if (!collectionAdapter.canTransitionToResolving()) {
             return;
         } 
         
@@ -255,7 +255,7 @@ public class ForeignKeyCollectionMapper 
     }
 
     protected void loadFields(final ObjectAdapter adapter, final Results rs, final boolean makeResolved, final Map<ObjectAssociation, FieldMapping> fieldMappingByField) {
-        if (!adapter.getResolveState().canChangeTo(ResolveState.RESOLVING)) {
+        if (!adapter.canTransitionToResolving()) {
             return;
         }
         

Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ReversedAutoAssociationMapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ReversedAutoAssociationMapper.java?rev=1359401&r1=1359400&r2=1359401&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ReversedAutoAssociationMapper.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/sql/sql-impl/src/main/java/org/apache/isis/runtimes/dflt/objectstores/sql/auto/ReversedAutoAssociationMapper.java Mon Jul  9 21:10:26 2012
@@ -91,7 +91,7 @@ public class ReversedAutoAssociationMapp
     public void loadInternalCollection(final DatabaseConnector connector, final ObjectAdapter parentAdapter, final boolean makeResolved) {
         final ObjectAdapter collectionAdapter = field.get(parentAdapter);
         
-        if (!collectionAdapter.getResolveState().canChangeTo(ResolveState.RESOLVING)) {
+        if (!collectionAdapter.canTransitionToResolving()) {
             return;
         } 
         if(LOG.isDebugEnabled()) {

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=1359401&r1=1359400&r2=1359401&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 Mon Jul  9 21:10:26 2012
@@ -144,7 +144,7 @@ public class XmlObjectStore implements O
     }
 
     private void initObject(final ObjectAdapter adapter, final ObjectData data) {
-        if (!adapter.getResolveState().canChangeTo(ResolveState.RESOLVING)) {
+        if (!adapter.canTransitionToResolving()) {
             return;
         } 
         PersistorUtil.startStateTransition(adapter, ResolveState.RESOLVING);
@@ -233,7 +233,7 @@ public class XmlObjectStore implements O
         final ListOfRootOid refs = (ListOfRootOid) data.get(field.getId());
         
         final ObjectAdapter collectionAdapter = field.get(objectAdapter);
-        if (!collectionAdapter.getResolveState().canChangeTo(ResolveState.RESOLVING)) {
+        if (!collectionAdapter.canTransitionToResolving()) {
             return;
         } 
         

Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapter.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapter.java?rev=1359401&r1=1359400&r2=1359401&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapter.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapter.java Mon Jul  9 21:10:26 2012
@@ -229,6 +229,12 @@ public class PojoAdapter extends Instanc
 
 
     @Override
+    public boolean canTransitionToResolving() {
+        return getResolveState().canTransitionTo(ResolveState.RESOLVING);
+    }
+
+
+    @Override
     public boolean isTitleAvailable() {
         final ResolveState resolveState = getResolveState();
         return resolveState.isValue() || resolveState.isResolved();
@@ -239,10 +245,11 @@ public class PojoAdapter extends Instanc
      */
     @Override
     public void markAsResolvedIfPossible() {
-        if (getResolveState().canChangeTo(ResolveState.RESOLVING)) {
-            changeState(ResolveState.RESOLVING);
-            changeState(ResolveState.RESOLVED);
-        }
+        if (!canTransitionToResolving()) {
+            return;
+        } 
+        changeState(ResolveState.RESOLVING);
+        changeState(ResolveState.RESOLVED);
     }
 
 
@@ -513,4 +520,6 @@ public class PojoAdapter extends Instanc
 
 
 
+
+
 }

Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/container/DomainObjectContainerResolve.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/container/DomainObjectContainerResolve.java?rev=1359401&r1=1359400&r2=1359401&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/container/DomainObjectContainerResolve.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/container/DomainObjectContainerResolve.java Mon Jul  9 21:10:26 2012
@@ -47,8 +47,7 @@ public class DomainObjectContainerResolv
 
     public void resolve(final Object parent) {
         final ObjectAdapter adapter = adapterFor(parent);
-        final ResolveState resolveState = adapter.getResolveState();
-        if (resolveState.canChangeTo(ResolveState.RESOLVING)) {
+        if (adapter.canTransitionToResolving()) {
             getPersistenceSession().resolveImmediately(adapter);
         }
     }

Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/dflt/DefaultPersistAlgorithm.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/algorithm/dflt/DefaultPersistAlgorithm.java?rev=1359401&r1=1359400&r2=1359401&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/dflt/DefaultPersistAlgorithm.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/dflt/DefaultPersistAlgorithm.java Mon Jul  9 21:10:26 2012
@@ -78,7 +78,11 @@ public class DefaultPersistAlgorithm ext
             }
             CallbackUtils.callCallback(object, PersistingCallbackFacet.class);
             toPersistObjectSet.remapAsPersistent(object);
-            object.changeState(ResolveState.SERIALIZING_RESOLVED);
+            
+            // was previously to SERIALIZING_RESOLVED, but after refactoring simplifications this is now equivalent to UPDATING
+            final ResolveState stateWhilePersisting = ResolveState.UPDATING;
+            
+            object.changeState(stateWhilePersisting);  
 
             for (int i = 0; i < fields.size(); i++) {
                 final ObjectAssociation field = fields.get(i);
@@ -101,7 +105,7 @@ public class DefaultPersistAlgorithm ext
             }
             toPersistObjectSet.addCreateObjectCommand(object);
             CallbackUtils.callCallback(object, PersistedCallbackFacet.class);
-            object.changeState(ResolveState.SERIALIZING_RESOLVED.getEndState());
+            object.changeState(stateWhilePersisting.getEndState());
         }
 
     }

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=1359401&r1=1359400&r2=1359401&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 Mon Jul  9 21:10:26 2012
@@ -911,17 +911,16 @@ public class PersistenceSession implemen
         // with DnD viewer + in-memory object store +
         // cglib bytecode enhancement
         synchronized (getAuthenticationSession()) {
-            final ResolveState resolveState = adapter.getResolveState();
-            if (!resolveState.canChangeTo(ResolveState.RESOLVING)) {
+            if (!adapter.canTransitionToResolving()) {
                 return;
             }
-            Assert.assertFalse("only resolve object that is not yet resolved", adapter, resolveState.isResolved());
+            Assert.assertFalse("only resolve object that is not yet resolved", adapter, adapter.isResolved());
             Assert.assertTrue("only resolve object that is persistent", adapter, adapter.isPersistent());
             resolveImmediatelyFromPersistenceLayer(adapter);
             if (LOG.isDebugEnabled()) {
                 // don't log object - its toString() may use the unresolved
                 // field, or unresolved collection
-                LOG.debug("resolved: " + adapter.getSpecification().getShortIdentifier() + " " + resolveState.code() + " " + adapter.getOid());
+                LOG.debug("resolved: " + adapter.getSpecification().getShortIdentifier() + " " + adapter.getResolveState().code() + " " + adapter.getOid());
             }
         }
     }



Mime
View raw message