isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1051971 [8/18] - in /incubator/isis/trunk: alternatives/bytecode/identity/src/main/java/org/apache/isis/alternatives/bytecode/identity/objectfactory/ alternatives/bytecode/javassist/src/main/java/org/apache/isis/alternatives/bytecode/javas...
Date Wed, 22 Dec 2010 16:22:32 GMT
Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/DomainObjectContainerDefault.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/DomainObjectContainerDefault.java?rev=1051971&r1=1051970&r2=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/DomainObjectContainerDefault.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/DomainObjectContainerDefault.java Wed Dec 22 16:22:08 2010
@@ -31,27 +31,27 @@ import org.apache.isis.applib.query.Quer
 import org.apache.isis.applib.security.RoleMemento;
 import org.apache.isis.applib.security.UserMemento;
 import org.apache.isis.core.commons.ensure.Assert;
+import org.apache.isis.core.metamodel.adapter.AdapterMap;
+import org.apache.isis.core.metamodel.adapter.AdapterMapAware;
+import org.apache.isis.core.metamodel.adapter.AdapterUtils;
+import org.apache.isis.core.metamodel.adapter.DomainObjectServices;
+import org.apache.isis.core.metamodel.adapter.DomainObjectServicesAware;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.ObjectDirtier;
+import org.apache.isis.core.metamodel.adapter.ObjectDirtierAware;
+import org.apache.isis.core.metamodel.adapter.ObjectPersistor;
+import org.apache.isis.core.metamodel.adapter.ObjectPersistorAware;
+import org.apache.isis.core.metamodel.adapter.QuerySubmitter;
+import org.apache.isis.core.metamodel.adapter.QuerySubmitterAware;
 import org.apache.isis.core.metamodel.authentication.AuthenticationSession;
+import org.apache.isis.core.metamodel.authentication.AuthenticationSessionProvider;
+import org.apache.isis.core.metamodel.authentication.AuthenticationSessionProviderAware;
 import org.apache.isis.core.metamodel.consent.InteractionResult;
-import org.apache.isis.core.metamodel.runtimecontext.AuthenticationSessionProvider;
-import org.apache.isis.core.metamodel.runtimecontext.AuthenticationSessionProviderAware;
-import org.apache.isis.core.metamodel.runtimecontext.DomainObjectServices;
-import org.apache.isis.core.metamodel.runtimecontext.DomainObjectServicesAware;
-import org.apache.isis.core.metamodel.runtimecontext.AdapterMap;
-import org.apache.isis.core.metamodel.runtimecontext.AdapterMapAware;
-import org.apache.isis.core.metamodel.runtimecontext.ObjectDirtier;
-import org.apache.isis.core.metamodel.runtimecontext.ObjectDirtierAware;
-import org.apache.isis.core.metamodel.runtimecontext.ObjectPersistor;
-import org.apache.isis.core.metamodel.runtimecontext.ObjectPersistorAware;
-import org.apache.isis.core.metamodel.runtimecontext.QuerySubmitter;
-import org.apache.isis.core.metamodel.runtimecontext.QuerySubmitterAware;
-import org.apache.isis.core.metamodel.runtimecontext.SpecificationLookup;
-import org.apache.isis.core.metamodel.runtimecontext.SpecificationLookupAware;
 import org.apache.isis.core.metamodel.services.container.query.QueryFindByPattern;
 import org.apache.isis.core.metamodel.services.container.query.QueryFindByTitle;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.util.IsisUtils;
+import org.apache.isis.core.metamodel.spec.SpecificationLookup;
+import org.apache.isis.core.metamodel.spec.SpecificationLookupAware;
 
 public class DomainObjectContainerDefault implements DomainObjectContainer, QuerySubmitterAware, ObjectDirtierAware,
     DomainObjectServicesAware, ObjectPersistorAware, SpecificationLookupAware, AuthenticationSessionProviderAware, AdapterMapAware {
@@ -308,7 +308,7 @@ public class DomainObjectContainerDefaul
     @Override
     public <T> List<T> allMatches(final Query<T> query) {
         List<ObjectAdapter> allMatching = getQuerySubmitter().allMatchingQuery(query);
-        return IsisUtils.unwrap(allMatching);
+        return AdapterUtils.unwrap(allMatching);
     }
 
     // //////////////////////////////////////////////////////////////////
@@ -342,7 +342,7 @@ public class DomainObjectContainerDefaul
     @SuppressWarnings("unchecked")
     public <T> T firstMatch(final Query<T> query) {
         ObjectAdapter firstMatching = getQuerySubmitter().firstMatchingQuery(query);
-        return (T) IsisUtils.unwrap(firstMatching);
+        return (T) AdapterUtils.unwrap(firstMatching);
     }
 
     // //////////////////////////////////////////////////////////////////

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/query/QueryFindByPattern.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/query/QueryFindByPattern.java?rev=1051971&r1=1051970&r2=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/query/QueryFindByPattern.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/query/QueryFindByPattern.java Wed Dec 22 16:22:08 2010
@@ -20,9 +20,9 @@
 
 package org.apache.isis.core.metamodel.services.container.query;
 
-import java.io.Serializable;
-
-import org.apache.isis.applib.query.Query;
+import java.io.Serializable;
+
+import org.apache.isis.applib.query.Query;
 import org.apache.isis.applib.query.QueryBuiltInAbstract;
 
 

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/query/QueryFindByTitle.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/query/QueryFindByTitle.java?rev=1051971&r1=1051970&r2=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/query/QueryFindByTitle.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/query/QueryFindByTitle.java Wed Dec 22 16:22:08 2010
@@ -20,10 +20,10 @@
 
 package org.apache.isis.core.metamodel.services.container.query;
 
-import java.io.Serializable;
-import java.text.MessageFormat;
-
-import org.apache.isis.applib.query.Query;
+import java.io.Serializable;
+import java.text.MessageFormat;
+
+import org.apache.isis.applib.query.Query;
 import org.apache.isis.applib.query.QueryBuiltInAbstract;
 
 

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/Hierarchical.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/Hierarchical.java?rev=1051971&r1=1051970&r2=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/Hierarchical.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/Hierarchical.java Wed Dec 22 16:22:08 2010
@@ -24,11 +24,6 @@ import java.util.List;
 
 public interface Hierarchical {
 
-	/**
-	 * Add the class for the specified specification as a subclass of this
-	 * specification's class.
-	 */
-	void addSubclass(ObjectSpecification specification);
 
 	/**
 	 * Returns true if the <tt>subclasses()</tt> method will return an array of

Copied: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/InstanceCollectionSpecification.java (from r1051471, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/specloader/internal/instances/InstanceCollectionSpecification.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/InstanceCollectionSpecification.java?p2=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/InstanceCollectionSpecification.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/specloader/internal/instances/InstanceCollectionSpecification.java&r1=1051471&r2=1051971&rev=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/specloader/internal/instances/InstanceCollectionSpecification.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/InstanceCollectionSpecification.java Wed Dec 22 16:22:08 2010
@@ -18,101 +18,121 @@
  */
 
 
-package org.apache.isis.core.progmodel.specloader.internal.instances;
+package org.apache.isis.core.metamodel.spec;
 
 import java.util.Collections;
 import java.util.List;
 
-import org.apache.isis.applib.Identifier;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.ObjectList;
-import org.apache.isis.core.metamodel.facetdecorator.FacetDecoratorSet;
-import org.apache.isis.core.metamodel.runtimecontext.AuthenticationSessionProvider;
-import org.apache.isis.core.metamodel.runtimecontext.ObjectInstantiator;
-import org.apache.isis.core.metamodel.runtimecontext.ServicesProvider;
-import org.apache.isis.core.metamodel.runtimecontext.spec.IntrospectableSpecificationAbstract;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.adapter.ServicesProvider;
+import org.apache.isis.core.metamodel.authentication.AuthenticationSessionProvider;
+import org.apache.isis.core.metamodel.facets.actcoll.typeof.TypeOfFacetDefaultToObject;
+import org.apache.isis.core.metamodel.facets.collections.modify.CollectionFacet;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
 import org.apache.isis.core.metamodel.spec.feature.ObjectActionType;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
-import org.apache.isis.core.progmodel.facets.actcoll.typeof.TypeOfFacetDefaultToObject;
 
 
+/**
+ * A custom {@link ObjectSpecification} that is designed to treat the
+ * {@link ObjectList} class as a "standalone" collection.
+ */
 public class InstanceCollectionSpecification extends IntrospectableSpecificationAbstract {
 
-    private final SpecificationLoader specificationLoader;
+    /**
+     * Used as {@link #getShortName()}, {@link #getName()} and {@link #getPluralName()}.
+     */
+	private static final String NAME = "Instances";
+	private static final String DESCRIBED_AS = "Typed instances";
+	private static final String ICON_NAME = "instances";
 
-	public InstanceCollectionSpecification(
-    		final SpecificationLoader specificationLoader,
+    public InstanceCollectionSpecification(
+    		final SpecificationLookup specificationLookup,
             final AuthenticationSessionProvider authenticationSessionProvider,
             final ServicesProvider servicesProvider,
             final ObjectInstantiator objectInstantiator) {
-		super(authenticationSessionProvider, servicesProvider, objectInstantiator);
-		this.specificationLoader = specificationLoader;
+		super(ObjectList.class, NAME, authenticationSessionProvider, servicesProvider, objectInstantiator, specificationLookup);
 	}
 
-	@Override
-    public void markAsService() {}
+    
+    ///////////////////////////////////////////////////////////
+    // Intrinsic to class
+    ///////////////////////////////////////////////////////////
+    
+    /**
+     * Review: wouldn't it be better to have a FacetFactory that specifically
+     * recognized {@link ObjectList} as a type and installed a {@link CollectionFacet}
+     * for it.
+     */
+    @Override
+    public boolean isCollectionOrIsAggregated() {
+        return true;
+    }
+
+    ///////////////////////////////////////////////////////////
+    // Introspection
+    ///////////////////////////////////////////////////////////
 
     @Override
-    public void introspect(final FacetDecoratorSet decorator) {
-        fullName = ObjectList.class.getName();
-        identifier = Identifier.classIdentifier(fullName);
-        superClassSpecification = specificationLoader.loadSpecification(Object.class);
-        superClassSpecification.addSubclass(this);
-        fields = Collections.emptyList();
+    public void introspectTypeHierarchyAndMembers() {
+        setSuperclass(Object.class);
 
         addFacet(new InstancesCollectionFacet(this));
-        addFacet(new TypeOfFacetDefaultToObject(this, specificationLoader) {
-        });
-
-        setIntrospected(true);
+        addFacet(new TypeOfFacetDefaultToObject(this, getSpecificationLookup()) {});
     }
 
     @Override
-    public ObjectAssociation getAssociation(final String name) {
-        return null;
+    public void completeIntrospection() {
+        setSingularName(NAME);
+        setPluralName(NAME);
+        setDescribedAs(DESCRIBED_AS);
+        // REVIEW... is this right?
+        setPersistability(Persistability.USER_PERSISTABLE);
+        
+        setIntrospected(true);
     }
 
-    @Override
-    public List<ObjectAction> getServiceActionsFor(final ObjectActionType... type) {
-        return Collections.emptyList();
-    }
 
-    @Override
-    public List<ObjectAction> getObjectActions(final ObjectActionType... type) {
-        return Collections.emptyList();
-    }
 
+    ///////////////////////////////////////////////////////
+    // Service
+    ///////////////////////////////////////////////////////
+
+    /**
+     * No-op.
+     *
+     * <p>
+     * Review: is this ever called for an instance of this class?  If not, then
+     * no need to override.
+     */
     @Override
-    public ObjectAction getObjectAction(
-            final ObjectActionType type,
-            final String id,
-            final List<ObjectSpecification> parameters) {
-        return null;
-    }
+    public void markAsService() {}
 
     @Override
-    public ObjectAction getObjectAction(final ObjectActionType type, final String id) {
-        return null;
+    public boolean isService() {
+        return false;
     }
 
-    @Override
-    public String getSingularName() {
-        return "Instances";
-    }
 
-    @Override
-    public String getPluralName() {
-        return "Instances";
-    }
+    ///////////////////////////////////////////////////////
+    // Associations
+    ///////////////////////////////////////////////////////
 
+    /**
+     * Review: is this ever called for an instance of this class?  If not, then
+     * no need to override.
+     */
     @Override
-    public String getShortName() {
-        return "Instances";
+    public ObjectAssociation getAssociation(final String id) {
+        return null;
     }
 
+
+    ///////////////////////////////////////////////////////
+    // Title and Icon
+    ///////////////////////////////////////////////////////
+
     @Override
     public String getTitle(final ObjectAdapter object) {
         return ((ObjectList) object.getObject()).titleString();
@@ -120,18 +140,46 @@ public class InstanceCollectionSpecifica
 
     @Override
     public String getIconName(final ObjectAdapter object) {
-        return "instances";
+        return ICON_NAME;
+    }
+
+
+    
+    ///////////////////////////////////////////////////////
+    // Object Actions
+    ///////////////////////////////////////////////////////
+
+    /**
+     * Review: is it necessary to override for this subclass?
+     */
+    @Override
+    public ObjectAction getObjectAction(
+            final ObjectActionType type,
+            final String id,
+            final List<ObjectSpecification> parameters) {
+        return null;
     }
 
+    /**
+     * Review: is it necessary to override for this subclass?
+     */
     @Override
-    public String getDescription() {
-        return "Typed instances";
+    public ObjectAction getObjectAction(final ObjectActionType type, final String id) {
+        return null;
     }
 
+    ///////////////////////////////////////////////////////
+    // Service Actions
+    ///////////////////////////////////////////////////////
+
+    /**
+     * Review: is it necessary to override for this subclass?
+     */
     @Override
-    public boolean isCollectionOrIsAggregated() {
-        return true;
+    public List<ObjectAction> getServiceActionsReturning(final ObjectActionType... type) {
+        return Collections.emptyList();
     }
 
+
 }
 

Copied: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/InstancesCollectionFacet.java (from r1051446, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/specloader/internal/instances/InstancesCollectionFacet.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/InstancesCollectionFacet.java?p2=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/InstancesCollectionFacet.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/specloader/internal/instances/InstancesCollectionFacet.java&r1=1051446&r2=1051971&rev=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/specloader/internal/instances/InstancesCollectionFacet.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/InstancesCollectionFacet.java Wed Dec 22 16:22:08 2010
@@ -18,14 +18,14 @@
  */
 
 
-package org.apache.isis.core.progmodel.specloader.internal.instances;
+package org.apache.isis.core.metamodel.spec;
 
 import java.util.List;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.ObjectList;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
-import org.apache.isis.core.progmodel.facets.collections.modify.CollectionFacetAbstract;
+import org.apache.isis.core.metamodel.facets.collections.CollectionFacetAbstract;
 
 
 public class InstancesCollectionFacet extends CollectionFacetAbstract {
@@ -37,6 +37,7 @@ public class InstancesCollectionFacet ex
     /**
      * Expected to be called with a {@link ObjectAdapter} wrapping a {@link ObjectList}.
      */
+    @Override
     public List<ObjectAdapter> collection(final ObjectAdapter wrappedObjectList) {
         return (ObjectList) wrappedObjectList.getObject();
     }
@@ -45,6 +46,7 @@ public class InstancesCollectionFacet ex
     /**
      * Expected to be called with a {@link ObjectAdapter} wrapping a {@link ObjectList}.
      */
+    @Override
     public ObjectAdapter firstElement(final ObjectAdapter wrappedInstanceCollectionVector) {
         List<ObjectAdapter> icv = collection(wrappedInstanceCollectionVector);
         return icv.size() > 0? icv.get(0): null;
@@ -53,6 +55,7 @@ public class InstancesCollectionFacet ex
     /**
      * Expected to be called with a {@link ObjectAdapter} wrapping a {@link ObjectList}.
      */
+    @Override
     public int size(final ObjectAdapter wrappedInstanceCollectionVector) {
         return collection(wrappedInstanceCollectionVector).size();
     }
@@ -60,6 +63,7 @@ public class InstancesCollectionFacet ex
     /**
      * Does nothing.
      */
+    @Override
     public void init(final ObjectAdapter collection, final ObjectAdapter[] initData) {}
 
 

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/IntrospectableSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/IntrospectableSpecification.java?rev=1051971&r1=1051970&r2=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/IntrospectableSpecification.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/IntrospectableSpecification.java Wed Dec 22 16:22:08 2010
@@ -20,24 +20,38 @@
 
 package org.apache.isis.core.metamodel.spec;
 
-import org.apache.isis.core.metamodel.facetdecorator.FacetDecoratorSet;
 
 
 /**
- * In effect the SPI for {@link ObjectSpecification}.
- */
-public interface IntrospectableSpecification {
-
-    /**
-     * Discovers what attributes and behaviour the type specified by this specification. 
-     * 
-     * <p>
-     * As specifications are cyclic (specifically a class will reference its subclasses, which in turn reference their superclass)
-     * they need be created first, and then later work out its internals. This allows for cyclic references to
-     * the be accommodated as there should always a specification available even though it might not be
-     * complete.
+ * Discovers what attributes and behaviour the type specified by this 
+ * specification (in effect the SPI for {@link ObjectSpecification}).
+ * 
+ * <p>
+ * As specifications are cyclic (specifically a class will reference its 
+ * subclasses, which in turn reference their superclass) they need be created 
+ * first, and then later work out its internals.  Hence we create 
+ * {@link ObjectSpecification}s as we need them, and then introspect them later.
+ */
+public interface IntrospectableSpecification extends ObjectSpecification {
+
+    /**
+     * Builds actions and associations.
+     * 
+     * <p>
+     * Is called prior to running the <tt>FacetDecoratorSet</tt>
      */
-    public void introspect(FacetDecoratorSet decorator);
+    public void introspectTypeHierarchyAndMembers();
+
+    /**
+     * Is called after to running the <tt>FacetDecoratorSet</tt>.
+     * 
+     * <p>
+     * TODO: it's possible that this could be merged with {@link #introspectTypeHierarchyAndMembers()};
+     * need to check though, because this would cause facets to be decorated at the end of
+     * introspection, rather than midway as is currently.
+     * 
+     */
+    public void completeIntrospection();
 
     public void markAsService();
 

Copied: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/IntrospectableSpecificationAbstract.java (from r1051471, incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/spec/IntrospectableSpecificationAbstract.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/IntrospectableSpecificationAbstract.java?p2=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/IntrospectableSpecificationAbstract.java&p1=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/spec/IntrospectableSpecificationAbstract.java&r1=1051471&r2=1051971&rev=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/spec/IntrospectableSpecificationAbstract.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/IntrospectableSpecificationAbstract.java Wed Dec 22 16:22:08 2010
@@ -17,21 +17,28 @@
  *  under the License.
  */
 
-
-package org.apache.isis.core.metamodel.runtimecontext.spec;
+package org.apache.isis.core.metamodel.spec;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
 
 import com.google.common.collect.Lists;
+import com.google.inject.internal.Maps;
 
 import org.apache.isis.applib.Identifier;
 import org.apache.isis.core.commons.filters.Filter;
+import org.apache.isis.core.commons.lang.JavaClassUtils;
 import org.apache.isis.core.commons.lang.ToString;
 import org.apache.isis.core.metamodel.adapter.Instance;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.ServicesProvider;
 import org.apache.isis.core.metamodel.authentication.AuthenticationSession;
+import org.apache.isis.core.metamodel.authentication.AuthenticationSessionProvider;
 import org.apache.isis.core.metamodel.consent.Consent;
 import org.apache.isis.core.metamodel.consent.InteractionInvocationMethod;
 import org.apache.isis.core.metamodel.consent.InteractionResult;
@@ -41,21 +48,18 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.collections.modify.CollectionFacet;
 import org.apache.isis.core.metamodel.facets.hide.HiddenFacet;
 import org.apache.isis.core.metamodel.facets.object.aggregated.AggregatedFacet;
+import org.apache.isis.core.metamodel.facets.object.dirty.ClearDirtyObjectFacet;
+import org.apache.isis.core.metamodel.facets.object.dirty.IsDirtyObjectFacet;
+import org.apache.isis.core.metamodel.facets.object.dirty.MarkDirtyObjectFacet;
 import org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet;
 import org.apache.isis.core.metamodel.facets.object.immutable.ImmutableFacet;
 import org.apache.isis.core.metamodel.facets.object.parseable.ParseableFacet;
 import org.apache.isis.core.metamodel.facets.object.value.ValueFacet;
+import org.apache.isis.core.metamodel.feature.FeatureType;
 import org.apache.isis.core.metamodel.interactions.InteractionContext;
 import org.apache.isis.core.metamodel.interactions.InteractionUtils;
 import org.apache.isis.core.metamodel.interactions.ObjectTitleContext;
 import org.apache.isis.core.metamodel.interactions.ObjectValidityContext;
-import org.apache.isis.core.metamodel.runtimecontext.AuthenticationSessionProvider;
-import org.apache.isis.core.metamodel.runtimecontext.ObjectInstantiator;
-import org.apache.isis.core.metamodel.runtimecontext.ServicesProvider;
-import org.apache.isis.core.metamodel.runtimecontext.spec.feature.ObjectActionSet;
-import org.apache.isis.core.metamodel.spec.IntrospectableSpecification;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.Persistability;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
 import org.apache.isis.core.metamodel.spec.feature.ObjectActionParameter;
 import org.apache.isis.core.metamodel.spec.feature.ObjectActionType;
@@ -64,97 +68,359 @@ import org.apache.isis.core.metamodel.sp
 import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
 import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
 
-
 // TODO work through all subclasses and remove duplicated overridden methods - this
 // hierarchy is badly structured move common, and default, functionality to this class from subclasses.
-public abstract class IntrospectableSpecificationAbstract
-		extends FacetHolderImpl
-		implements ObjectSpecification, IntrospectableSpecification {
+public abstract class IntrospectableSpecificationAbstract extends FacetHolderImpl implements
+    IntrospectableSpecification {
+
+    private final static Logger LOG = Logger.getLogger(IntrospectableSpecificationAbstract.class);
+
+    private static class SubclassList {
+        private final List<ObjectSpecification> classes = Lists.newArrayList();
+
+        public void addSubclass(final ObjectSpecification subclass) {
+            classes.add(subclass);
+        }
+
+        public boolean hasSubclasses() {
+            return !classes.isEmpty();
+        }
+
+        /**
+         * @return
+         */
+        public List<ObjectSpecification> toList() {
+            return Collections.unmodifiableList(classes);
+        }
+    }
 
     private final AuthenticationSessionProvider authenticationSessionProvider;
     private final ServicesProvider servicesProvider;
     private final ObjectInstantiator objectInstantiator;
+    private final SpecificationLookup specificationLookup;
+
+    private final List<ObjectAction> objectActions = Lists.newArrayList();
+    private final List<ObjectAssociation> associations = Lists.newArrayList();
+    private final List<ObjectSpecification> interfaces = Lists.newArrayList();
+    private final SubclassList subclasses = new SubclassList();
 
-	private boolean introspected = false;
+    /**
+     * Lazily populated.
+     */
+    private final Map<ObjectActionType, List<ObjectAction>> contributedActionSetsByType = Maps.newLinkedHashMap();
 
-    protected String fullName;
-    protected List<ObjectAssociation> fields;
-    protected List<ObjectAction> objectActions;
-    protected ObjectSpecification superClassSpecification;
-    protected Identifier identifier;
+    private final Class<?> introspectedClass;
+    private final String fullName;
+    private final String shortName;
+    private final Identifier identifier;
+    private final boolean isAbstract;
 
+    private ObjectSpecification superclassSpec;
+
+    /**
+     * Expect to be populated using {@link #setSingularName(String)}, but has default name as well.
+     */
+    private String singularName = "(no name)";
+    /**
+     * Expect to be populated using {@link #setPluralName(String)} but has default name as well.
+     */
+    private String pluralName = "(no name)";
+    /**
+     * Expect to be populated using {@link #setDescribedAs(String)} but has default name as well.
+     */
+    private String describedAs = "(no description)";
+
+    private Persistability persistability = Persistability.USER_PERSISTABLE;
+
+    private MarkDirtyObjectFacet markDirtyObjectFacet;
+    private ClearDirtyObjectFacet clearDirtyObjectFacet;
+    private IsDirtyObjectFacet isDirtyObjectFacet;
+
+    private boolean introspected = false;
 
     // //////////////////////////////////////////////////////////////////////
     // Constructor
     // //////////////////////////////////////////////////////////////////////
 
-    public IntrospectableSpecificationAbstract(
-    		final AuthenticationSessionProvider authenticationSessionProvider,
-    		final ServicesProvider servicesProvider,
-    		final ObjectInstantiator objectInstantiator) {
-    	this.authenticationSessionProvider = authenticationSessionProvider;
-    	this.servicesProvider = servicesProvider;
-    	this.objectInstantiator = objectInstantiator;
+    public IntrospectableSpecificationAbstract(final Class<?> introspectedClass, final String shortName,
+        final AuthenticationSessionProvider authenticationSessionProvider, final ServicesProvider servicesProvider,
+        final ObjectInstantiator objectInstantiator, final SpecificationLookup specificationLookup) {
+
+        this.introspectedClass = introspectedClass;
+        this.fullName = introspectedClass.getName();
+        this.shortName = shortName;
+        this.isAbstract = JavaClassUtils.isAbstract(introspectedClass);
+        this.identifier = Identifier.classIdentifier(introspectedClass);
+
+        // dependencies
+        this.authenticationSessionProvider = authenticationSessionProvider;
+        this.servicesProvider = servicesProvider;
+        this.objectInstantiator = objectInstantiator;
+        this.specificationLookup = specificationLookup;
     }
 
     // //////////////////////////////////////////////////////////////////////
-    // Class and stuff immediately derivable from class
+    // Stuff immediately derivable from class
     // //////////////////////////////////////////////////////////////////////
 
     @Override
-    public String getFullName() {
-        return fullName;
+    public FeatureType getFeatureType() {
+        return FeatureType.OBJECT;
     }
 
-    @Override
-    public String getIconName(final ObjectAdapter object) {
-        return null;
+    /**
+     * As provided explicitly within the
+     * {@link #IntrospectableSpecificationAbstract(Class, String, AuthenticationSessionProvider, ServicesProvider, ObjectInstantiator, SpecificationLookup)
+     * constructor}.
+     */
+    protected Class<?> getIntrospectedClass() {
+        return introspectedClass;
     }
 
+    /**
+     * As provided explicitly within the
+     * {@link #IntrospectableSpecificationAbstract(Class, String, AuthenticationSessionProvider, ServicesProvider, ObjectInstantiator, SpecificationLookup)
+     * constructor}.
+     */
     @Override
-    public boolean hasSubclasses() {
-        return false;
+    public String getShortName() {
+        return shortName;
     }
 
+    /**
+     * The {@link Class#getName() (full) name} of the {@link #getIntrospectedClass() class}.
+     */
     @Override
-    public List<ObjectSpecification> interfaces() {
-        return Collections.emptyList();
+    public String getFullName() {
+        return fullName;
     }
 
+    /**
+     * Only if {@link #setIntrospected(boolean)} has been called (should be called within
+     * {@link #completeIntrospection()}.
+     */
     @Override
-    public List<ObjectSpecification> subclasses() {
-        return Collections.emptyList();
+    public boolean isIntrospected() {
+        return introspected;
+    }
+
+    // //////////////////////////////////////////////////////////////////////
+    // Introspection (part 1)
+    // //////////////////////////////////////////////////////////////////////
+
+    /**
+     * Intended to be called within {@link #introspectTypeHierarchyAndMembers()}.
+     */
+    protected void setSuperclass(Class<?> superclass) {
+        if (superclass == null) {
+            return;
+        }
+        superclassSpec = getSpecificationLookup().loadSpecification(superclass);
+        if (superclassSpec != null) {
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("  Superclass " + superclass.getName());
+            }
+            addAsSubclassTo(superclassSpec);
+        }
+    }
+
+    /**
+     * Intended to be called within {@link #introspectTypeHierarchyAndMembers()}.
+     */
+    protected void addInterfaces(List<ObjectSpecification> interfaces) {
+        this.interfaces.addAll(interfaces);
+    }
+
+    /**
+     * Intended to be called within {@link #introspectTypeHierarchyAndMembers()}.
+     */
+    protected void addAsSubclassTo(ObjectSpecification supertypeSpec) {
+        if (!(supertypeSpec instanceof IntrospectableSpecificationAbstract)) {
+            return;
+        }
+        // downcast required because addSubclass is (deliberately) not public API
+        IntrospectableSpecificationAbstract introspectableSpec = (IntrospectableSpecificationAbstract) supertypeSpec;
+        introspectableSpec.addSubclass(this);
     }
 
+    /**
+     * Intended to be called within {@link #introspectTypeHierarchyAndMembers()}.
+     */
+    protected void addAsSubclassTo(List<ObjectSpecification> supertypeSpecs) {
+        for (ObjectSpecification supertypeSpec : supertypeSpecs) {
+            addAsSubclassTo(supertypeSpec);
+        }
+    }
+
+    private void addSubclass(final ObjectSpecification subclass) {
+        this.subclasses.addSubclass(subclass);
+    }
+
+    /**
+     * Intended to be called within {@link #introspectTypeHierarchyAndMembers()}.
+     */
+    protected void addAssociations(List<ObjectAssociation> associations) {
+        this.associations.addAll(associations);
+    }
+
+    /**
+     * Intended to be called within {@link #introspectTypeHierarchyAndMembers()}.
+     */
+    protected void addObjectActions(List<ObjectAction> objectActions) {
+        this.objectActions.addAll(objectActions);
+    }
+
+    // //////////////////////////////////////////////////////////////////////
+    // Introspection (part 2)
+    // //////////////////////////////////////////////////////////////////////
+
+    /**
+     * Intended to be called within
+     */
+    protected void setSingularName(String singularName) {
+        this.singularName = singularName;
+    }
+
+    /**
+     * Intended to be called (if at all) within {@link #completeIntrospection()}.
+     */
+    protected void setPluralName(String pluralName) {
+        this.pluralName = pluralName;
+    }
+
+    /**
+     * Intended to be called (if at all) within {@link #completeIntrospection()}.
+     */
+    protected void setDescribedAs(String describedAs) {
+        this.describedAs = describedAs;
+    }
+
+    /**
+     * Intended to be called (if at all) within {@link #completeIntrospection()}.
+     */
+    protected void setPersistability(Persistability persistability) {
+        this.persistability = persistability;
+    }
+
+    /**
+     * Intended to be called (if at all) within {@link #completeIntrospection()}.
+     */
+    protected void setClearDirtyObjectFacet(ClearDirtyObjectFacet clearDirtyObjectFacet) {
+        this.clearDirtyObjectFacet = clearDirtyObjectFacet;
+    }
+
+    /**
+     * Intended to be called (if at all) within {@link #completeIntrospection()}.
+     */
+    protected void setMarkDirtyObjectFacet(MarkDirtyObjectFacet markDirtyObjectFacet) {
+        this.markDirtyObjectFacet = markDirtyObjectFacet;
+    }
+
+    /**
+     * Intended to be called (if at all) within {@link #completeIntrospection()}.
+     */
+    protected void setIsDirtyObjectFacet(IsDirtyObjectFacet isDirtyObjectFacet) {
+        this.isDirtyObjectFacet = isDirtyObjectFacet;
+    }
+
+    /**
+     * Intended to be called within {@link #completeIntrospection()}.
+     */
+    protected void setIntrospected(boolean introspected) {
+        this.introspected = introspected;
+    }
+
+    // //////////////////////////////////////////////////////////////////////
+    // Specification
+    // //////////////////////////////////////////////////////////////////////
+
     @Override
-    public ObjectSpecification superclass() {
-        return superClassSpecification;
+    public Instance getInstance(ObjectAdapter adapter) {
+        return adapter;
     }
 
+    // //////////////////////////////////////////////////////////////////////
+    // Hierarchical
+    // //////////////////////////////////////////////////////////////////////
+
+    /**
+     * Determines if this class represents the same class, or a subclass, of the specified class.
+     * 
+     * <p>
+     * cf {@link Class#isAssignableFrom(Class)}, though target and parameter are the opposite way around, ie:
+     * 
+     * <pre>
+     * cls1.isAssignableFrom(cls2);
+     * </pre>
+     * <p>
+     * is equivalent to:
+     * 
+     * <pre>
+     * spec2.isOfType(spec1);
+     * </pre>
+     * 
+     * <p>
+     * Callable after {@link #introspectTypeHierarchyAndMembers()} has been called.
+     */
     @Override
     public boolean isOfType(final ObjectSpecification specification) {
-        return specification == this;
+        if (specification == this) {
+            return true;
+        }
+        for (ObjectSpecification interfaceSpec : interfaces()) {
+            if (interfaceSpec.isOfType(specification)) {
+                return true;
+            }
+        }
+        final ObjectSpecification superclassSpec = superclass();
+        return superclassSpec != null ? superclassSpec.isOfType(specification) : false;
     }
 
+    // //////////////////////////////////////////////////////////////////////
+    // Name, Description, Persistability
+    // //////////////////////////////////////////////////////////////////////
+
     @Override
-    public void addSubclass(final ObjectSpecification specification) {}
+    public String getName() {
+        return singularName;
+    }
 
     @Override
-    public Instance getInstance(ObjectAdapter adapter) {
-        return adapter;
+    public String getPluralName() {
+        return pluralName;
     }
 
+    @Override
+    public String getDescription() {
+        return describedAs == null ? "" : describedAs;
+    }
+
+    @Override
+    public Persistability persistability() {
+        return persistability;
+    }
 
     // //////////////////////////////////////////////////////////////////////
-    // Introspection
+    // Dirty object support
     // //////////////////////////////////////////////////////////////////////
 
-    protected void setIntrospected(boolean introspected) {
-		this.introspected = introspected;
-	}
     @Override
-    public boolean isIntrospected() {
-    	return introspected;
+    public boolean isDirty(final ObjectAdapter object) {
+        return isDirtyObjectFacet == null ? false : isDirtyObjectFacet.invoke(object);
+    }
+
+    @Override
+    public void clearDirty(final ObjectAdapter object) {
+        if (clearDirtyObjectFacet != null) {
+            clearDirtyObjectFacet.invoke(object);
+        }
+    }
+
+    @Override
+    public void markDirty(final ObjectAdapter object) {
+        if (markDirtyObjectFacet != null) {
+            markDirtyObjectFacet.invoke(object);
+        }
     }
 
     // //////////////////////////////////////////////////////////////////////
@@ -171,33 +437,33 @@ public abstract class IntrospectableSpec
             noopFacet = facet;
         }
         if (interfaces() != null) {
-        	final List<ObjectSpecification> interfaces = interfaces();
-        	for (int i = 0; i < interfaces.size(); i++) {
-        		final ObjectSpecification interfaceSpec = interfaces.get(i);
-        		if (interfaceSpec == null) {
-        			// HACK: shouldn't happen, but occurring on occasion when running
-        			// XATs under JUnit4. Some sort of race condition?
-        			continue;
-        		}
-        		final Q interfaceFacet = interfaceSpec.getFacet(facetType);
-        		if (isNotANoopFacet(interfaceFacet)) {
-        			return interfaceFacet;
-        		} else {
-        			if (noopFacet == null) {
-        				noopFacet = interfaceFacet;
-        			}
-        		}
-        	}
+            final List<ObjectSpecification> interfaces = interfaces();
+            for (int i = 0; i < interfaces.size(); i++) {
+                final ObjectSpecification interfaceSpec = interfaces.get(i);
+                if (interfaceSpec == null) {
+                    // HACK: shouldn't happen, but occurring on occasion when running
+                    // XATs under JUnit4. Some sort of race condition?
+                    continue;
+                }
+                final Q interfaceFacet = interfaceSpec.getFacet(facetType);
+                if (isNotANoopFacet(interfaceFacet)) {
+                    return interfaceFacet;
+                } else {
+                    if (noopFacet == null) {
+                        noopFacet = interfaceFacet;
+                    }
+                }
+            }
         }
         // search up the inheritance hierarchy
         ObjectSpecification superSpec = superclass();
         if (superSpec != null) {
-        	Q superClassFacet = superSpec.getFacet(facetType);
-        	if(isNotANoopFacet(superClassFacet)) {
-        		return superClassFacet;
-        	}
+            Q superClassFacet = superSpec.getFacet(facetType);
+            if (isNotANoopFacet(superClassFacet)) {
+                return superClassFacet;
+            }
         }
-    	return noopFacet;
+        return noopFacet;
     }
 
     private boolean isNotANoopFacet(final Facet facet) {
@@ -227,21 +493,71 @@ public abstract class IntrospectableSpec
     // //////////////////////////////////////////////////////////////////
 
     @Override
-    public ObjectTitleContext createTitleInteractionContext(
-            final AuthenticationSession session,
-            final InteractionInvocationMethod interactionMethod,
-            final ObjectAdapter targetObjectAdapter) {
-        return new ObjectTitleContext(session, interactionMethod, targetObjectAdapter, getIdentifier(), targetObjectAdapter
-                .titleString());
+    public ObjectTitleContext createTitleInteractionContext(final AuthenticationSession session,
+        final InteractionInvocationMethod interactionMethod, final ObjectAdapter targetObjectAdapter) {
+        return new ObjectTitleContext(session, interactionMethod, targetObjectAdapter, getIdentifier(),
+            targetObjectAdapter.titleString());
+    }
+
+    // //////////////////////////////////////////////////////////////////////
+    // Superclass, Interfaces, Subclasses, isAbstract
+    // //////////////////////////////////////////////////////////////////////
+
+    @Override
+    public ObjectSpecification superclass() {
+        return superclassSpec;
+    }
+
+    @Override
+    public List<ObjectSpecification> interfaces() {
+        return Collections.unmodifiableList(interfaces);
+    }
+
+    @Override
+    public List<ObjectSpecification> subclasses() {
+        return subclasses.toList();
+    }
+
+    @Override
+    public boolean hasSubclasses() {
+        return subclasses.hasSubclasses();
+    }
+
+    @Override
+    public final boolean isAbstract() {
+        return isAbstract;
     }
 
     // //////////////////////////////////////////////////////////////////////
-    // getStaticallyAvailableFields, getDynamically..Fields, getField
+    // Associations
     // //////////////////////////////////////////////////////////////////////
 
     @Override
     public List<ObjectAssociation> getAssociations() {
-        return fields;
+        return Collections.unmodifiableList(associations);
+    }
+
+    /**
+     * The association with the given {@link ObjectAssociation#getId() id}.
+     * 
+     * <p>
+     * This is overridable because {@link InstanceCollectionSpecification} simply returns <tt>null</tt>.
+     * 
+     * <p>
+     * TODO put fields into hash.
+     * 
+     * <p>
+     * TODO: could this be made final? (ie does the framework ever call this method for an
+     * {@link InstanceCollectionSpecification})
+     */
+    @Override
+    public ObjectAssociation getAssociation(final String id) {
+        for (ObjectAssociation objectAssociation : getAssociations()) {
+            if (objectAssociation.getId().equals(id)) {
+                return objectAssociation;
+            }
+        }
+        throw new ObjectSpecificationException("No association called '" + id + "' in '" + getName() + "'");
     }
 
     @Override
@@ -276,163 +592,188 @@ public abstract class IntrospectableSpec
         return list;
     }
 
-
     // //////////////////////////////////////////////////////////////////////
     // getObjectAction, getAction, getActions
     // //////////////////////////////////////////////////////////////////////
 
-    protected List<ObjectAction> getActions(final List<ObjectAction> availableActions, final ObjectActionType type) {
-        return Collections.emptyList();
+    public List<ObjectAction> getObjectActionsAll() {
+        return Collections.unmodifiableList(objectActions);
     }
 
     @Override
-    public List<ObjectAction> getObjectActions(final ObjectActionType... types) {
-        List<ObjectAction> actions = new ArrayList<ObjectAction>();
-        for(ObjectActionType type: types) {
+    public List<ObjectAction> getObjectActions(final ObjectActionType... requestedTypes) {
+        List<ObjectAction> actions = Lists.newArrayList();
+        for (ObjectActionType type : requestedTypes) {
             addActions(type, actions);
         }
         return actions;
     }
 
-	private void addActions(ObjectActionType type,
-			List<ObjectAction> actions) {
-		if (!isService()) {
-			actions.addAll(getServiceActions(type));
-		}
-		actions.addAll(getActions(objectActions, type));
-	}
+    private void addActions(ObjectActionType type, List<ObjectAction> actions) {
+        if (!isService()) {
+            actions.addAll(getContributedActions(type));
+        }
+        actions.addAll(getActions(objectActions, type));
+    }
 
-    @Override
-    public List<ObjectAction> getServiceActionsFor(final ObjectActionType... types) {
-        final List<ObjectAdapter> services = getServicesProvider().getServices();
-        final List<ObjectAction> relatedActions = new ArrayList<ObjectAction>();
-            for (ObjectAdapter serviceAdapter : services) {
-                final List<ObjectAction> matchingActions = new ArrayList<ObjectAction>();
-            for (ObjectActionType type : types) {
-                final List<ObjectAction> serviceActions = serviceAdapter.getSpecification().getObjectActions(type);
-                for (int j = 0; j < serviceActions.size(); j++) {
-                    final ObjectSpecification returnType = serviceActions.get(j).getReturnType();
-                    if (returnType != null && returnType.isCollection()) {
-                        final TypeOfFacet facet = serviceActions.get(j).getFacet(TypeOfFacet.class);
-                        if (facet != null) {
-                            final ObjectSpecification elementType = facet.valueSpec();
-                            if (elementType.isOfType(this)) {
-                                matchingActions.add(serviceActions.get(j));
-                            }
-                        }
-                    } else if (returnType != null && returnType.isOfType(this)) {
-                        matchingActions.add(serviceActions.get(j));
+    private List<ObjectAction> getActions(final List<ObjectAction> availableActions, final ObjectActionType type) {
+        final List<ObjectAction> actions = Lists.newArrayList();
+        for (final ObjectAction action : availableActions) {
+            final ObjectActionType actionType = action.getType();
+            if (actionType == ObjectActionType.SET) {
+                final ObjectActionSet actionSet = (ObjectActionSet) action;
+                final List<ObjectAction> subActions = actionSet.getActions();
+                for (final ObjectAction subAction : subActions) {
+                    if (sameActionTypeOrNotSpecified(type, subAction)) {
+                        actions.add(subAction);
+                        // REVIEW: why was there a break here?
+                        // break;
                     }
                 }
-            }
-            if (matchingActions.size() > 0) {
-                final ObjectActionSet set = new ObjectActionSet("id", serviceAdapter.titleString(), matchingActions);
-                relatedActions.add(set);
+            } else {
+                if (sameActionTypeOrNotSpecified(type, action)) {
+                    actions.add(action);
+                }
             }
         }
-        return relatedActions;
-    }
 
-    @Override
-    public boolean isAbstract() {
-        return false;
+        return actions;
     }
 
-    /**
-     * Whether or not this specification's class is marked as final, that is it may not have subclasses, and
-     * hence methods that could be overridden.
-     *
-     * <p>
-     * Note - not used at present.
-     */
-    public boolean isFinal() {
-        return false;
+    protected boolean sameActionTypeOrNotSpecified(final ObjectActionType type, final ObjectAction action) {
+        return type == null || action.getType().equals(type);
     }
 
-    @Override
-    public boolean isService() {
-        return false;
-    }
 
     // //////////////////////////////////////////////////////////////////////
-    // Dirty
+    // service actions
     // //////////////////////////////////////////////////////////////////////
 
     @Override
-    public boolean isDirty(final ObjectAdapter object) {
-        return false;
+    public List<ObjectAction> getServiceActionsReturning(final ObjectActionType... types) {
+        final List<ObjectAction> serviceActions = Lists.newArrayList();
+        final List<ObjectAdapter> services = getServicesProvider().getServices();
+        for (ObjectAdapter serviceAdapter : services) {
+            appendServiceActionsReturning(serviceAdapter, Arrays.asList(types), serviceActions);
+        }
+        return serviceActions;
     }
 
-    @Override
-    public void clearDirty(final ObjectAdapter object) {}
+    private void appendServiceActionsReturning(ObjectAdapter serviceAdapter, final List<ObjectActionType> types,
+        final List<ObjectAction> relatedActionsToAppendTo) {
+        final List<ObjectAction> matchingActionsToAppendTo = Lists.newArrayList();
+        for (ObjectActionType type : types) {
+            final List<ObjectAction> serviceActions = serviceAdapter.getSpecification().getObjectActions(type);
+            for (ObjectAction serviceAction : serviceActions) {
+                addIfReturnsSubtype(serviceAction, matchingActionsToAppendTo);
+            }
+        }
+        if (matchingActionsToAppendTo.size() > 0) {
+            final ObjectActionSet set = new ObjectActionSet("id", serviceAdapter.titleString(), matchingActionsToAppendTo);
+            relatedActionsToAppendTo.add(set);
+        }
+    }
 
-    @Override
-    public void markDirty(final ObjectAdapter object) {}
+    private void addIfReturnsSubtype(final ObjectAction serviceAction, final List<ObjectAction> matchingActionsToAppendTo) {
+        final ObjectSpecification returnType = serviceAction.getReturnType();
+        if (returnType == null) {
+            return;
+        } 
+        if (returnType.isCollection()) {
+            final TypeOfFacet facet = serviceAction.getFacet(TypeOfFacet.class);
+            if (facet != null) {
+                final ObjectSpecification elementType = facet.valueSpec();
+                addIfReturnsSubtype(serviceAction, elementType, matchingActionsToAppendTo);
+            }
+        } else {
+            addIfReturnsSubtype(serviceAction, returnType, matchingActionsToAppendTo);
+        }
+    }
+
+    private void addIfReturnsSubtype(final ObjectAction serviceAction, final ObjectSpecification actionType,
+        final List<ObjectAction> matchingActionsToAppendTo) {
+        if (actionType.isOfType(this)) {
+            matchingActionsToAppendTo.add(serviceAction);
+        }
+    }
 
     // //////////////////////////////////////////////////////////////////////
-    // markAsService, findServiceMethodsWithParameter
+    // contributed actions
     // //////////////////////////////////////////////////////////////////////
 
     /**
-     * Finds all service actions of the specified type, if any.
-     *
+     * Finds all service actions that contribute to this spec, if any.
+     * 
      * <p>
-     * However, if this specification {@link #isService() is actually for} a service, then returns an empty
-     * array.
-     *
-     * @return an array of {@link ObjectActionSet}s (!!), each of which contains
-     *         {@link ObjectAction}s of the requested type.
-     *
+     * If this specification {@link #isService() is actually for} a service, then returns an empty array.
+     * 
+     * @return an array of {@link ObjectActionSet}s (!!), each of which contains {@link ObjectAction}s of the requested
+     *         type.
+     * 
      */
-    protected List<ObjectAction> getServiceActions(final ObjectActionType type) {
+    protected List<ObjectAction> getContributedActions(final ObjectActionType actionType) {
         if (isService()) {
             return Collections.emptyList();
         }
-        final List<ObjectAdapter> services = getServicesProvider().getServices();
+        List<ObjectAction> contributedActionSets = contributedActionSetsByType.get(actionType);
+        if (contributedActionSets == null) {
+            // populate an ActionSet with all actions contributed by each service
+            contributedActionSets = Lists.newArrayList();
+            final List<ObjectAdapter> services = getServicesProvider().getServices();
+            for (ObjectAdapter serviceAdapter : services) {
+                addContributedActionsIfAny(serviceAdapter, actionType, contributedActionSets);
+            }
+            contributedActionSetsByType.put(actionType, contributedActionSets);
+        }
+        return contributedActionSets;
+    }
 
-        // will populate an ActionSet with all actions contributed by each service
-        final List<ObjectAction> serviceActionSets = Lists.newArrayList();
+    private void addContributedActionsIfAny(ObjectAdapter serviceAdapter, final ObjectActionType actionType,
+        final List<ObjectAction> contributedActionSetsToAppendTo) {
+        final ObjectSpecification specification = serviceAdapter.getSpecification();
+        if (specification == this) {
+            return;
+        }
+        final List<ObjectAction> contributedActions = findContributedActions(specification, actionType);
+        // only add if there are matching subactions.
+        if (contributedActions.size() == 0) {
+            return;
+        }
+        final ObjectActionSet contributedActionSet =
+            new ObjectActionSet("id", serviceAdapter.titleString(), contributedActions);
+        contributedActionSetsToAppendTo.add(contributedActionSet);
+    }
 
-        for (ObjectAdapter serviceAdapter : services) {
-            final ObjectSpecification specification = serviceAdapter.getSpecification();
-            if (specification == this) {
+    private List<ObjectAction> findContributedActions(final ObjectSpecification specification,
+        final ObjectActionType actionType) {
+        final List<ObjectAction> contributedActions = Lists.newArrayList();
+        final List<ObjectAction> serviceActions = specification.getObjectActions(actionType);
+        for (ObjectAction serviceAction : serviceActions) {
+            if (serviceAction.isAlwaysHidden()) {
                 continue;
             }
-
-            final List<ObjectAction> serviceActions = specification.getObjectActions(type);
-            final List<ObjectAction> matchingServiceActions = new ArrayList<ObjectAction>();
-            for (int j = 0; j < serviceActions.size(); j++) {
-                final ObjectAction serviceAction = serviceActions.get(j);
-                if (serviceAction.isAlwaysHidden()) {
-                    // ignore if permanently hidden
-                    continue;
-                }
-                // see if qualifies by inspecting all parameters
-                if (matchesParameterOf(serviceAction)) {
-                    matchingServiceActions.add(serviceAction);
-                }
-            }
-            // only add if there are matching subactions.
-            if (matchingServiceActions.size() > 0) {
-                final ObjectActionSet objectActionSet = new ObjectActionSet("id", serviceAdapter.titleString(),
-                    matchingServiceActions);
-                serviceActionSets.add(objectActionSet);
+            // see if qualifies by inspecting all parameters
+            if (matchesParameterOf(serviceAction)) {
+                contributedActions.add(serviceAction);
             }
-
         }
-        return serviceActionSets;
+        return contributedActions;
     }
 
     private boolean matchesParameterOf(final ObjectAction serviceAction) {
         final List<ObjectActionParameter> params = serviceAction.getParameters();
-        for (int k = 0; k < params.size(); k++) {
-            if ( isOfType(params.get(k).getSpecification())) {
+        for (ObjectActionParameter param : params) {
+            if (isOfType(param.getSpecification())) {
                 return true;
             }
         }
         return false;
     }
 
+    // //////////////////////////////////////////////////////////////////////
+    // validity
+    // //////////////////////////////////////////////////////////////////////
+
     @Override
     public Consent isValid(final ObjectAdapter inObject) {
         return isValidResult(inObject).createConsent();
@@ -444,8 +785,9 @@ public abstract class IntrospectableSpec
      */
     @Override
     public InteractionResult isValidResult(final ObjectAdapter targetObjectAdapter) {
-        final ObjectValidityContext validityContext = createValidityInteractionContext(getAuthenticationSession(),
-                InteractionInvocationMethod.BY_USER, targetObjectAdapter);
+        final ObjectValidityContext validityContext =
+            createValidityInteractionContext(getAuthenticationSession(), InteractionInvocationMethod.BY_USER,
+                targetObjectAdapter);
         return InteractionUtils.isValidResult(this, validityContext);
     }
 
@@ -453,23 +795,26 @@ public abstract class IntrospectableSpec
      * Create an {@link InteractionContext} representing an attempt to save the object.
      */
     @Override
-    public ObjectValidityContext createValidityInteractionContext(
-            final AuthenticationSession session,
-            final InteractionInvocationMethod interactionMethod,
-            final ObjectAdapter targetObjectAdapter) {
+    public ObjectValidityContext createValidityInteractionContext(final AuthenticationSession session,
+        final InteractionInvocationMethod interactionMethod, final ObjectAdapter targetObjectAdapter) {
         return new ObjectValidityContext(session, interactionMethod, targetObjectAdapter, getIdentifier());
     }
 
-    @Override
-    public Persistability persistability() {
-        return Persistability.USER_PERSISTABLE;
-    }
-
     // //////////////////////////////////////////////////////////////////////
     // convenience isXxx (looked up from facets)
     // //////////////////////////////////////////////////////////////////////
 
     @Override
+    public boolean isImmutable() {
+        return containsFacet(ImmutableFacet.class);
+    }
+
+    @Override
+    public boolean isHidden() {
+        return containsFacet(HiddenFacet.class);
+    }
+
+    @Override
     public boolean isParseable() {
         return containsFacet(ParseableFacet.class);
     }
@@ -480,11 +825,6 @@ public abstract class IntrospectableSpec
     }
 
     @Override
-    public boolean isValueOrIsAggregated() {
-        return isValue() || isAggregated();
-    }
-
-    @Override
     public boolean isValue() {
         return containsFacet(ValueFacet.class);
     }
@@ -505,13 +845,8 @@ public abstract class IntrospectableSpec
     }
 
     @Override
-    public boolean isImmutable() {
-        return containsFacet(ImmutableFacet.class);
-    }
-
-    @Override
-    public boolean isHidden() {
-        return containsFacet(HiddenFacet.class);
+    public boolean isValueOrIsAggregated() {
+        return isValue() || isAggregated();
     }
 
     // //////////////////////////////////////////////////////////////////////
@@ -528,8 +863,6 @@ public abstract class IntrospectableSpec
         throw new UnsupportedOperationException(getFullName());
     }
 
-
-
     // //////////////////////////////////////////////////////////////////////
     // toString
     // //////////////////////////////////////////////////////////////////////
@@ -537,15 +870,22 @@ public abstract class IntrospectableSpec
     @Override
     public String toString() {
         final ToString str = new ToString(this);
-        str.append("class", fullName);
+        str.append("class", getFullName());
         return str.toString();
     }
 
+    // //////////////////////////////////////////////////////////////////////
+    // Convenience
+    // //////////////////////////////////////////////////////////////////////
+
+    /**
+     * convenience method to return the current {@link AuthenticationSession} from the
+     * {@link #getAuthenticationSessionProvider() injected} {@link AuthenticationSessionProvider}.
+     */
     protected final AuthenticationSession getAuthenticationSession() {
         return getAuthenticationSessionProvider().getAuthenticationSession();
     }
 
-
     // //////////////////////////////////////////////////////////////////////
     // Dependencies (injected in constructor)
     // //////////////////////////////////////////////////////////////////////
@@ -561,6 +901,8 @@ public abstract class IntrospectableSpec
     public ObjectInstantiator getObjectInstantiator() {
         return objectInstantiator;
     }
-    
-}
 
+    public SpecificationLookup getSpecificationLookup() {
+        return specificationLookup;
+    }
+}

Copied: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectActionSet.java (from r1051471, incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/spec/feature/ObjectActionSet.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectActionSet.java?p2=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectActionSet.java&p1=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/spec/feature/ObjectActionSet.java&r1=1051471&r2=1051971&rev=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/spec/feature/ObjectActionSet.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectActionSet.java Wed Dec 22 16:22:08 2010
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.metamodel.runtimecontext.spec.feature;
+package org.apache.isis.core.metamodel.spec;
 
 import java.util.Collections;
 import java.util.List;
@@ -34,11 +34,10 @@ import org.apache.isis.core.metamodel.co
 import org.apache.isis.core.metamodel.consent.InteractionInvocationMethod;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.facets.MultiTypedFacet;
+import org.apache.isis.core.metamodel.feature.FeatureType;
 import org.apache.isis.core.metamodel.interactions.ActionInvocationContext;
 import org.apache.isis.core.metamodel.interactions.UsabilityContext;
 import org.apache.isis.core.metamodel.interactions.VisibilityContext;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.Target;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
 import org.apache.isis.core.metamodel.spec.feature.ObjectActionParameter;
 import org.apache.isis.core.metamodel.spec.feature.ObjectActionType;

Copied: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectInstantiationException.java (from r1051446, incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/ObjectInstantiationException.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectInstantiationException.java?p2=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectInstantiationException.java&p1=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/ObjectInstantiationException.java&r1=1051446&r2=1051971&rev=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/ObjectInstantiationException.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectInstantiationException.java Wed Dec 22 16:22:08 2010
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.metamodel.runtimecontext;
+package org.apache.isis.core.metamodel.spec;
 
 public class ObjectInstantiationException extends Exception {
 

Copied: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectInstantiator.java (from r1051471, incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/ObjectInstantiator.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectInstantiator.java?p2=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectInstantiator.java&p1=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/ObjectInstantiator.java&r1=1051471&r2=1051971&rev=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/ObjectInstantiator.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectInstantiator.java Wed Dec 22 16:22:08 2010
@@ -14,7 +14,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.isis.core.metamodel.runtimecontext;
+package org.apache.isis.core.metamodel.spec;
 
 import org.apache.isis.core.commons.components.Injectable;
 

Copied: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectInstantiatorAbstract.java (from r1051471, incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/ObjectInstantiatorAbstract.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectInstantiatorAbstract.java?p2=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectInstantiatorAbstract.java&p1=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/ObjectInstantiatorAbstract.java&r1=1051471&r2=1051971&rev=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/ObjectInstantiatorAbstract.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectInstantiatorAbstract.java Wed Dec 22 16:22:08 2010
@@ -14,7 +14,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.isis.core.metamodel.runtimecontext;
+package org.apache.isis.core.metamodel.spec;
 
 
 public abstract class ObjectInstantiatorAbstract implements ObjectInstantiator {

Copied: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectInstantiatorAware.java (from r1051471, incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/ObjectInstantiatorAware.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectInstantiatorAware.java?p2=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectInstantiatorAware.java&p1=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/ObjectInstantiatorAware.java&r1=1051471&r2=1051971&rev=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/ObjectInstantiatorAware.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectInstantiatorAware.java Wed Dec 22 16:22:08 2010
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.metamodel.runtimecontext;
+package org.apache.isis.core.metamodel.spec;
 
 public interface ObjectInstantiatorAware {
 	

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectSpecification.java?rev=1051971&r1=1051970&r2=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectSpecification.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectSpecification.java Wed Dec 22 16:22:08 2010
@@ -74,14 +74,14 @@ public interface ObjectSpecification ext
     String getShortName();
 
     /**
-     * Returns the description, if any, of the specification.
+     * Returns the (singular) name for objects of this specification.
      */
-    String getDescription();
-
+    String getName();
+    
     /**
-     * Returns the singular name for objects of this specification.
+     * Returns the description, if any, of the specification.
      */
-    String getSingularName();
+    String getDescription();
 
     /**
      * Returns the title string for the specified object.

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/Specification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/Specification.java?rev=1051971&r1=1051970&r2=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/Specification.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/Specification.java Wed Dec 22 16:22:08 2010
@@ -22,11 +22,12 @@ package org.apache.isis.core.metamodel.s
 
 import org.apache.isis.core.metamodel.adapter.Instance;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.feature.FeatureType;
+import org.apache.isis.core.metamodel.feature.IdentifiedHolder;
 import org.apache.isis.core.metamodel.spec.feature.ObjectActionParameter;
 import org.apache.isis.core.metamodel.spec.feature.ObjectFeature;
 import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
 import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
-import org.apache.isis.core.metamodel.spec.identifier.Identified;
 
 /**
  * Base interface for elements of the metamodel.
@@ -40,9 +41,11 @@ import org.apache.isis.core.metamodel.sp
  * Introduces so that viewers can deal with abstract Instances of said.
  * 
  */
-public interface Specification extends Identified {
+public interface Specification extends IdentifiedHolder, NamedAndDescribed {
+
+    
+    FeatureType getFeatureType();
 
-    
     /**
      * Return an {@link Instance} of this {@link Specification} with respect
      * to the provided {@link ObjectAdapter}.

Copied: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoader.java (from r1051471, incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoader.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoader.java?p2=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoader.java&p1=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoader.java&r1=1051471&r2=1051971&rev=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoader.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoader.java Wed Dec 22 16:22:08 2010
@@ -18,20 +18,23 @@
  */
 
 
-package org.apache.isis.core.metamodel.specloader;
+package org.apache.isis.core.metamodel.spec;
 
 import java.util.List;
 
 import org.apache.isis.core.commons.components.ApplicationScopedComponent;
 import org.apache.isis.core.commons.debug.DebugInfo;
-import org.apache.isis.core.metamodel.runtimecontext.SpecificationLookup;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 
 
 public interface SpecificationLoader extends ApplicationScopedComponent, DebugInfo, SpecificationLookup {
 
     ObjectSpecification[] allSpecifications();
 
+    /**
+     * @see #loadSpecification(String)
+     */
+    @Override
+    ObjectSpecification loadSpecification(Class<?> cls);
 
     /**
      * Return the specification for the specified class of object.

Copied: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoaderAware.java (from r1051446, incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoaderAware.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoaderAware.java?p2=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoaderAware.java&p1=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoaderAware.java&r1=1051446&r2=1051971&rev=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoaderAware.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLoaderAware.java Wed Dec 22 16:22:08 2010
@@ -18,7 +18,8 @@
  */
 
 
-package org.apache.isis.core.metamodel.specloader;
+package org.apache.isis.core.metamodel.spec;
+
 
 public interface SpecificationLoaderAware {
 

Copied: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookup.java (from r1051471, incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/SpecificationLookup.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookup.java?p2=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookup.java&p1=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/SpecificationLookup.java&r1=1051471&r2=1051971&rev=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/SpecificationLookup.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookup.java Wed Dec 22 16:22:08 2010
@@ -14,10 +14,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.isis.core.metamodel.runtimecontext;
+package org.apache.isis.core.metamodel.spec;
 
 import org.apache.isis.core.commons.components.Injectable;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 
 
 public interface SpecificationLookup extends Injectable {

Copied: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupAbstract.java (from r1051471, incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/SpecificationLookupAbstract.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupAbstract.java?p2=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupAbstract.java&p1=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/SpecificationLookupAbstract.java&r1=1051471&r2=1051971&rev=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/SpecificationLookupAbstract.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupAbstract.java Wed Dec 22 16:22:08 2010
@@ -14,7 +14,8 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.isis.core.metamodel.runtimecontext;
+package org.apache.isis.core.metamodel.spec;
+
 
 
 public abstract class SpecificationLookupAbstract implements SpecificationLookup {

Copied: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupAware.java (from r1051471, incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/SpecificationLookupAware.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupAware.java?p2=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupAware.java&p1=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/SpecificationLookupAware.java&r1=1051471&r2=1051971&rev=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/SpecificationLookupAware.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupAware.java Wed Dec 22 16:22:08 2010
@@ -18,7 +18,8 @@
  */
 
 
-package org.apache.isis.core.metamodel.runtimecontext;
+package org.apache.isis.core.metamodel.spec;
+
 
 public interface SpecificationLookupAware {
 	

Copied: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupDelegator.java (from r1051471, incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/SpecificationLookupDelegator.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupDelegator.java?p2=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupDelegator.java&p1=incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/SpecificationLookupDelegator.java&r1=1051471&r2=1051971&rev=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/runtimecontext/SpecificationLookupDelegator.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/SpecificationLookupDelegator.java Wed Dec 22 16:22:08 2010
@@ -14,9 +14,8 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.isis.core.metamodel.runtimecontext;
+package org.apache.isis.core.metamodel.spec;
 
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 
 /**
  * Allows a SpecificationLookup to be provided even if the 

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/CurrentHolder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/CurrentHolder.java?rev=1051971&r1=1051970&r2=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/CurrentHolder.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/CurrentHolder.java Wed Dec 22 16:22:08 2010
@@ -21,10 +21,9 @@
 package org.apache.isis.core.metamodel.spec.feature;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.spec.TypedSpecification;
 
 /**
- * Mix-in interface for {@link TypedSpecification}s that reference or
+ * Mix-in interface for {@link ObjectFeature}s that reference or
  * otherwise contain a 'current' value.
  * 
  * <p>

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/MutableCurrentHolder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/MutableCurrentHolder.java?rev=1051971&r1=1051970&r2=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/MutableCurrentHolder.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/MutableCurrentHolder.java Wed Dec 22 16:22:08 2010
@@ -21,10 +21,9 @@
 package org.apache.isis.core.metamodel.spec.feature;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.spec.TypedSpecification;
 
 /**
- * Mix-in interface for {@link TypedSpecification}s that reference or
+ * Mix-in interface for {@link ObjectAction}s that reference or
  * otherwise contain a 'current' value that moreover can be changed.
  * 
  * <p>

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectActionContainer.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectActionContainer.java?rev=1051971&r1=1051970&r2=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectActionContainer.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectActionContainer.java Wed Dec 22 16:22:08 2010
@@ -31,7 +31,7 @@ public interface ObjectActionContainer {
     /**
      * TODO: convert to relatedResourceActions
      */
-    List<ObjectAction> getServiceActionsFor(ObjectActionType... type);
+    List<ObjectAction> getServiceActionsReturning(ObjectActionType... type);
 
     /**
      * Returns the action of the specified type with the specified signature.

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectActionParameter.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectActionParameter.java?rev=1051971&r1=1051970&r2=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectActionParameter.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectActionParameter.java Wed Dec 22 16:22:08 2010
@@ -24,12 +24,11 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.authentication.AuthenticationSession;
 import org.apache.isis.core.metamodel.consent.InteractionInvocationMethod;
 import org.apache.isis.core.metamodel.interactions.ActionArgumentContext;
-import org.apache.isis.core.metamodel.spec.NamedAndDescribed;
 
 /**
  * Analogous to {@link ObjectAssociation}.
 */
-public interface ObjectActionParameter extends ObjectFeature, NamedAndDescribed, CurrentHolder {
+public interface ObjectActionParameter extends ObjectFeature, CurrentHolder {
 
     /**
      * If true then can cast to a {@link OneToOneActionParameter}.

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectActionType.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectActionType.java?rev=1051971&r1=1051970&r2=1051971&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectActionType.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectActionType.java Wed Dec 22 16:22:08 2010
@@ -52,5 +52,5 @@ public enum ObjectActionType {
             return PROTOTYPE;
         }
         return USER;
-	}
+	}
 }



Mime
View raw message