You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2012/12/05 00:41:09 UTC

[17/52] [partial] ISIS-188: consolidating isis-core

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/PropertyOrCollectionIdentifyingFacetFactoryAbstract.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/PropertyOrCollectionIdentifyingFacetFactoryAbstract.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/PropertyOrCollectionIdentifyingFacetFactoryAbstract.java
new file mode 100644
index 0000000..83bd78f
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/PropertyOrCollectionIdentifyingFacetFactoryAbstract.java
@@ -0,0 +1,60 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets;
+
+import java.util.List;
+
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.FacetFactory;
+import org.apache.isis.core.metamodel.facets.PropertyOrCollectionIdentifyingFacetFactory;
+import org.apache.isis.core.metamodel.specloader.collectiontyperegistry.CollectionTypeRegistry;
+import org.apache.isis.core.metamodel.specloader.collectiontyperegistry.CollectionTypeRegistryAware;
+
+public abstract class PropertyOrCollectionIdentifyingFacetFactoryAbstract extends MethodPrefixBasedFacetFactoryAbstract implements PropertyOrCollectionIdentifyingFacetFactory, CollectionTypeRegistryAware {
+
+    private CollectionTypeRegistry collectionTypeRegistry;
+
+    public PropertyOrCollectionIdentifyingFacetFactoryAbstract(final List<FeatureType> featureTypes, final String... prefixes) {
+        super(featureTypes, OrphanValidation.DONT_VALIDATE, prefixes);
+    }
+
+    protected boolean isCollectionOrArray(final Class<?> cls) {
+        return getCollectionTypeRepository().isCollectionType(cls) || getCollectionTypeRepository().isArrayType(cls);
+    }
+
+    // /////////////////////////////////////////////////////////////////////////
+    // Injected: CollectionTypeRegistry
+    // /////////////////////////////////////////////////////////////////////////
+
+    protected CollectionTypeRegistry getCollectionTypeRepository() {
+        return collectionTypeRegistry;
+    }
+
+    /**
+     * Injected so can propogate to any {@link #registerFactory(FacetFactory)
+     * registered} {@link FacetFactory} s that are also
+     * {@link CollectionTypeRegistryAware}.
+     */
+    @Override
+    public void setCollectionTypeRegistry(final CollectionTypeRegistry collectionTypeRegistry) {
+        this.collectionTypeRegistry = collectionTypeRegistry;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/debug/DebugFacetAbstract.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/debug/DebugFacetAbstract.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/debug/DebugFacetAbstract.java
new file mode 100644
index 0000000..3ef3b35
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/debug/DebugFacetAbstract.java
@@ -0,0 +1,37 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.debug;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.MarkerFacetAbstract;
+import org.apache.isis.core.metamodel.facets.actions.debug.DebugFacet;
+
+public abstract class DebugFacetAbstract extends MarkerFacetAbstract implements DebugFacet {
+
+    public static Class<? extends Facet> type() {
+        return DebugFacet.class;
+    }
+
+    public DebugFacetAbstract(final FacetHolder holder) {
+        super(type(), holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/debug/annotation/DebugAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/debug/annotation/DebugAnnotationFacetFactory.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/debug/annotation/DebugAnnotationFacetFactory.java
new file mode 100644
index 0000000..178c3ca
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/debug/annotation/DebugAnnotationFacetFactory.java
@@ -0,0 +1,51 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.debug.annotation;
+
+import org.apache.isis.applib.annotation.Debug;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.Annotations;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.actions.debug.DebugFacet;
+import org.apache.isis.core.progmodel.facets.actions.invoke.ActionInvocationFacetFactory;
+
+/**
+ * {@link DebugFacet} can also be installed via a naming convention, see
+ * {@link ActionInvocationFacetFactory}.
+ */
+public class DebugAnnotationFacetFactory extends FacetFactoryAbstract {
+
+    public DebugAnnotationFacetFactory() {
+        super(FeatureType.ACTIONS_ONLY);
+    }
+
+    @Override
+    public void process(final ProcessMethodContext processMethodContext) {
+        final Debug annotation = Annotations.getAnnotation(processMethodContext.getMethod(), Debug.class);
+        FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
+    }
+
+    private DebugFacet create(final Debug annotation, final FacetHolder holder) {
+        return annotation == null ? null : new DebugFacetAnnotation(holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/debug/annotation/DebugFacetAnnotation.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/debug/annotation/DebugFacetAnnotation.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/debug/annotation/DebugFacetAnnotation.java
new file mode 100644
index 0000000..b1a7074
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/debug/annotation/DebugFacetAnnotation.java
@@ -0,0 +1,31 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.debug.annotation;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.progmodel.facets.actions.debug.DebugFacetAbstract;
+
+public class DebugFacetAnnotation extends DebugFacetAbstract {
+
+    public DebugFacetAnnotation(final FacetHolder holder) {
+        super(holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/defaults/method/ActionDefaultsFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/defaults/method/ActionDefaultsFacetFactory.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/defaults/method/ActionDefaultsFacetFactory.java
new file mode 100644
index 0000000..43ba05d
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/defaults/method/ActionDefaultsFacetFactory.java
@@ -0,0 +1,87 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.defaults.method;
+
+import java.lang.reflect.Method;
+import java.util.List;
+
+import org.apache.isis.core.commons.lang.NameUtils;
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.methodutils.MethodScope;
+import org.apache.isis.core.progmodel.facets.MethodFinderUtils;
+import org.apache.isis.core.progmodel.facets.MethodPrefixBasedFacetFactoryAbstract;
+import org.apache.isis.core.progmodel.facets.MethodPrefixConstants;
+
+/**
+ * Sets up all the {@link Facet}s for an action in a single shot.
+ */
+public class ActionDefaultsFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
+
+    private static final String[] PREFIXES = { MethodPrefixConstants.DEFAULT_PREFIX };
+
+    /**
+     * Note that the {@link Facet}s registered are the generic ones from
+     * noa-architecture (where they exist)
+     */
+    public ActionDefaultsFacetFactory() {
+        super(FeatureType.ACTIONS_ONLY, OrphanValidation.VALIDATE, PREFIXES);
+    }
+
+    // ///////////////////////////////////////////////////////
+    // Actions
+    // ///////////////////////////////////////////////////////
+
+    @Override
+    public void process(final ProcessMethodContext processMethodContext) {
+
+        attachActionDefaultsFacetIfParameterDefaultsMethodIsFound(processMethodContext);
+    }
+
+    private static void attachActionDefaultsFacetIfParameterDefaultsMethodIsFound(final ProcessMethodContext processMethodContext) {
+
+        Method defaultsMethod = findDefaultsMethodReturning(processMethodContext, Object[].class);
+        if (defaultsMethod == null) {
+            defaultsMethod = findDefaultsMethodReturning(processMethodContext, List.class);
+        }
+        if (defaultsMethod == null) {
+            return;
+        }
+
+        processMethodContext.removeMethod(defaultsMethod);
+
+        final FacetHolder facetedMethod = processMethodContext.getFacetHolder();
+        final ActionDefaultsFacetViaMethod facet = new ActionDefaultsFacetViaMethod(defaultsMethod, facetedMethod);
+        FacetUtil.addFacet(facet);
+    }
+
+    private static Method findDefaultsMethodReturning(final ProcessMethodContext processMethodContext, final Class<?> returnType) {
+
+        final Method actionMethod = processMethodContext.getMethod();
+        final String capitalizedName = NameUtils.capitalizeName(actionMethod.getName());
+        final String name = MethodPrefixConstants.DEFAULT_PREFIX + capitalizedName;
+
+        final Class<?> cls = processMethodContext.getCls();
+        return MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, name, returnType, new Class[0]);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/defaults/method/ActionDefaultsFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/defaults/method/ActionDefaultsFacetViaMethod.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/defaults/method/ActionDefaultsFacetViaMethod.java
new file mode 100644
index 0000000..d73e76c
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/defaults/method/ActionDefaultsFacetViaMethod.java
@@ -0,0 +1,89 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.defaults.method;
+
+import java.lang.reflect.Method;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.util.AdapterInvokeUtils;
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.ImperativeFacet;
+import org.apache.isis.core.metamodel.facets.actions.defaults.ActionDefaultsFacetAbstract;
+import org.apache.isis.core.metamodel.facets.actions.invoke.ActionInvocationFacet;
+import org.apache.isis.core.progmodel.facets.actions.invoke.ActionInvocationFacetViaMethod;
+
+public class ActionDefaultsFacetViaMethod extends ActionDefaultsFacetAbstract implements ImperativeFacet {
+
+    private final Method defaultMethod;
+
+    @SuppressWarnings("unused")
+    private final Method actionMethod;
+
+    public ActionDefaultsFacetViaMethod(final Method defaultMethod, final FacetHolder holder) {
+        super(holder, Derivation.NOT_DERIVED);
+        this.defaultMethod = defaultMethod;
+        this.actionMethod = determineActionMethod(holder);
+    }
+
+    private static Method determineActionMethod(final FacetHolder holder) {
+        Method method2;
+        final Facet actionInvocationFacet = holder.getFacet(ActionInvocationFacet.class);
+        if (actionInvocationFacet instanceof ActionInvocationFacetViaMethod) {
+            final ActionInvocationFacetViaMethod facetViaMethod = (ActionInvocationFacetViaMethod) actionInvocationFacet;
+            method2 = facetViaMethod.getMethods().get(0);
+        } else {
+            method2 = null;
+        }
+        return method2;
+    }
+
+    /**
+     * Returns a singleton list of the {@link Method} provided in the
+     * constructor.
+     */
+    @Override
+    public List<Method> getMethods() {
+        return Collections.singletonList(defaultMethod);
+    }
+
+    @Override
+    public boolean impliesResolve() {
+        return true;
+    }
+
+    @Override
+    public boolean impliesObjectChanged() {
+        return false;
+    }
+
+    @Override
+    public Object[] getDefaults(final ObjectAdapter owningAdapter) {
+        return (Object[]) AdapterInvokeUtils.invoke(defaultMethod, owningAdapter);
+    }
+
+    @Override
+    protected String toStringValues() {
+        return "method=" + defaultMethod;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/exploration/ExplorationFacetAbstract.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/exploration/ExplorationFacetAbstract.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/exploration/ExplorationFacetAbstract.java
new file mode 100644
index 0000000..56ff5de
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/exploration/ExplorationFacetAbstract.java
@@ -0,0 +1,46 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.exploration;
+
+import org.apache.isis.applib.events.VisibilityEvent;
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.MarkerFacetAbstract;
+import org.apache.isis.core.metamodel.facets.actions.exploration.ExplorationFacet;
+import org.apache.isis.core.metamodel.interactions.VisibilityContext;
+
+public abstract class ExplorationFacetAbstract extends MarkerFacetAbstract implements ExplorationFacet {
+
+    public static Class<? extends Facet> type() {
+        return ExplorationFacet.class;
+    }
+
+    public ExplorationFacetAbstract(final FacetHolder holder) {
+        super(type(), holder);
+    }
+
+    @Override
+    public String hides(
+        VisibilityContext<? extends VisibilityEvent> ic) {
+        return ic.getDeploymentCategory().isExploring()? null: "Not visible";
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/exploration/annotation/ExplorationAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/exploration/annotation/ExplorationAnnotationFacetFactory.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/exploration/annotation/ExplorationAnnotationFacetFactory.java
new file mode 100644
index 0000000..dcdb955
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/exploration/annotation/ExplorationAnnotationFacetFactory.java
@@ -0,0 +1,51 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.exploration.annotation;
+
+import org.apache.isis.applib.annotation.Exploration;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.Annotations;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.actions.exploration.ExplorationFacet;
+import org.apache.isis.core.progmodel.facets.actions.invoke.ActionInvocationFacetFactory;
+
+/**
+ * {@link ExplorationFacet} can also be installed via a naming convention, see
+ * {@link ActionInvocationFacetFactory}.
+ */
+public class ExplorationAnnotationFacetFactory extends FacetFactoryAbstract {
+
+    public ExplorationAnnotationFacetFactory() {
+        super(FeatureType.ACTIONS_ONLY);
+    }
+
+    @Override
+    public void process(final ProcessMethodContext processMethodContext) {
+        final Exploration annotation = Annotations.getAnnotation(processMethodContext.getMethod(), Exploration.class);
+        FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
+    }
+
+    private ExplorationFacet create(final Exploration annotation, final FacetHolder holder) {
+        return annotation == null ? null : new ExplorationFacetAnnotation(holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/exploration/annotation/ExplorationFacetAnnotation.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/exploration/annotation/ExplorationFacetAnnotation.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/exploration/annotation/ExplorationFacetAnnotation.java
new file mode 100644
index 0000000..0096203
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/exploration/annotation/ExplorationFacetAnnotation.java
@@ -0,0 +1,31 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.exploration.annotation;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.progmodel.facets.actions.exploration.ExplorationFacetAbstract;
+
+public class ExplorationFacetAnnotation extends ExplorationFacetAbstract {
+
+    public ExplorationFacetAnnotation(final FacetHolder holder) {
+        super(holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetFactory.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetFactory.java
new file mode 100644
index 0000000..b40a194
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetFactory.java
@@ -0,0 +1,162 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.invoke;
+
+import java.lang.reflect.Method;
+
+import org.apache.isis.core.commons.lang.NameUtils;
+import org.apache.isis.core.commons.lang.StringUtils;
+import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
+import org.apache.isis.core.metamodel.adapter.mgr.AdapterManagerAware;
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.actions.debug.DebugFacet;
+import org.apache.isis.core.metamodel.facets.actions.exploration.ExplorationFacet;
+import org.apache.isis.core.metamodel.facets.actions.invoke.ActionInvocationFacet;
+import org.apache.isis.core.metamodel.facets.named.NamedFacet;
+import org.apache.isis.core.metamodel.facets.named.NamedFacetInferred;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.progmodel.facets.MethodPrefixBasedFacetFactoryAbstract;
+
+/**
+ * Sets up {@link ActionInvocationFacet}, along with a number of supporting
+ * facets that are based on the action's name.
+ * 
+ * <p>
+ * The supporting methods are: {@link ExecutedFacet}, {@link ExplorationFacet}
+ * and {@link DebugFacet}. In addition a {@link NamedFacet} is inferred from the
+ * name (taking into account the above well-known prefixes).
+ */
+public class ActionInvocationFacetFactory extends MethodPrefixBasedFacetFactoryAbstract implements AdapterManagerAware {
+
+    private static final String EXPLORATION_PREFIX = "Exploration";
+    private static final String DEBUG_PREFIX = "Debug";
+
+    private static final String[] PREFIXES = { EXPLORATION_PREFIX, DEBUG_PREFIX };
+
+    private AdapterManager adapterManager;
+
+    /**
+     * Note that the {@link Facet}s registered are the generic ones from
+     * noa-architecture (where they exist)
+     */
+    public ActionInvocationFacetFactory() {
+        super(FeatureType.ACTIONS_ONLY, OrphanValidation.VALIDATE, PREFIXES);
+    }
+
+    // ///////////////////////////////////////////////////////
+    // Actions
+    // ///////////////////////////////////////////////////////
+
+    @Override
+    public void process(final ProcessMethodContext processMethodContext) {
+
+        // InvocationFacet
+        attachInvocationFacet(processMethodContext);
+
+        // DebugFacet, ExplorationFacet
+        attachDebugFacetIfActionMethodNamePrefixed(processMethodContext);
+        attachExplorationFacetIfActionMethodNamePrefixed(processMethodContext);
+
+        // inferred name
+        // (must be called after the attachinvocationFacet methods)
+        attachNamedFacetInferredFromMethodName(processMethodContext); 
+    }
+
+    private void attachInvocationFacet(final ProcessMethodContext processMethodContext) {
+
+        final Method actionMethod = processMethodContext.getMethod();
+
+        try {
+            final Class<?> returnType = actionMethod.getReturnType();
+            final ObjectSpecification returnSpec = getSpecificationLoader().loadSpecification(returnType);
+            if (returnSpec == null) {
+                return;
+            }
+
+            final Class<?> cls = processMethodContext.getCls();
+            final ObjectSpecification typeSpec = getSpecificationLoader().loadSpecification(cls);
+            final FacetHolder holder = processMethodContext.getFacetHolder();
+
+            FacetUtil.addFacet(new ActionInvocationFacetViaMethod(actionMethod, typeSpec, returnSpec, holder, getAdapterManager()));
+        } finally {
+            processMethodContext.removeMethod(actionMethod);
+        }
+    }
+
+    private void attachDebugFacetIfActionMethodNamePrefixed(final ProcessMethodContext processMethodContext) {
+
+        final Method actionMethod = processMethodContext.getMethod();
+        final String capitalizedName = NameUtils.capitalizeName(actionMethod.getName());
+        if (!capitalizedName.startsWith(DEBUG_PREFIX)) {
+            return;
+        }
+        final FacetHolder facetedMethod = processMethodContext.getFacetHolder();
+        FacetUtil.addFacet(new DebugFacetViaNamingConvention(facetedMethod));
+    }
+
+    private void attachExplorationFacetIfActionMethodNamePrefixed(final ProcessMethodContext processMethodContext) {
+
+        final Method actionMethod = processMethodContext.getMethod();
+        final String capitalizedName = NameUtils.capitalizeName(actionMethod.getName());
+        if (!capitalizedName.startsWith(EXPLORATION_PREFIX)) {
+            return;
+        }
+        final FacetHolder facetedMethod = processMethodContext.getFacetHolder();
+        FacetUtil.addFacet(new ExplorationFacetViaNamingConvention(facetedMethod));
+    }
+
+    /**
+     * Must be called after added the debug, exploration etc facets.
+     * 
+     * <p>
+     * TODO: remove this hack
+     */
+    private void attachNamedFacetInferredFromMethodName(final ProcessMethodContext processMethodContext) {
+
+        final Method method = processMethodContext.getMethod();
+        final String capitalizedName = NameUtils.capitalizeName(method.getName());
+
+        // this is nasty...
+        String name = capitalizedName;
+        name = StringUtils.removePrefix(name, DEBUG_PREFIX);
+        name = StringUtils.removePrefix(name, EXPLORATION_PREFIX);
+        name = NameUtils.naturalName(name);
+
+        final FacetHolder facetedMethod = processMethodContext.getFacetHolder();
+        FacetUtil.addFacet(new NamedFacetInferred(name, facetedMethod));
+    }
+
+    // ///////////////////////////////////////////////////////////////
+    // Dependencies
+    // ///////////////////////////////////////////////////////////////
+
+    @Override
+    public void setAdapterManager(final AdapterManager adapterManager) {
+        this.adapterManager = adapterManager;
+    }
+
+    private AdapterManager getAdapterManager() {
+        return adapterManager;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetViaMethod.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetViaMethod.java
new file mode 100644
index 0000000..8020f8d
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetViaMethod.java
@@ -0,0 +1,146 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.invoke;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
+import org.apache.isis.core.metamodel.adapter.util.InvokeUtils;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.ImperativeFacet;
+import org.apache.isis.core.metamodel.facets.actions.invoke.ActionInvocationFacetAbstract;
+import org.apache.isis.core.metamodel.facets.typeof.ElementSpecificationProviderFromTypeOfFacet;
+import org.apache.isis.core.metamodel.facets.typeof.TypeOfFacet;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.specloader.ReflectiveActionException;
+
+public class ActionInvocationFacetViaMethod extends ActionInvocationFacetAbstract implements ImperativeFacet {
+
+    private final static Logger LOG = Logger.getLogger(ActionInvocationFacetViaMethod.class);
+
+    private final Method method;
+    private final int paramCount;
+    private final ObjectSpecification onType;
+    private final ObjectSpecification returnType;
+
+    private final AdapterManager adapterManager;
+
+    public ActionInvocationFacetViaMethod(final Method method, final ObjectSpecification onType, final ObjectSpecification returnType, final FacetHolder holder, final AdapterManager adapterManager) {
+        super(holder);
+        this.method = method;
+        this.paramCount = method.getParameterTypes().length;
+        this.onType = onType;
+        this.returnType = returnType;
+        this.adapterManager = adapterManager;
+    }
+
+    /**
+     * Returns a singleton list of the {@link Method} provided in the
+     * constructor.
+     */
+    @Override
+    public List<Method> getMethods() {
+        return Collections.singletonList(method);
+    }
+
+    @Override
+    public ObjectSpecification getReturnType() {
+        return returnType;
+    }
+
+    @Override
+    public ObjectSpecification getOnType() {
+        return onType;
+    }
+
+    @Override
+    public ObjectAdapter invoke(final ObjectAdapter inObject, final ObjectAdapter[] parameters) {
+        if (parameters.length != paramCount) {
+            LOG.error(method + " requires " + paramCount + " parameters, not " + parameters.length);
+        }
+
+        try {
+            final Object[] executionParameters = new Object[parameters.length];
+            for (int i = 0; i < parameters.length; i++) {
+                executionParameters[i] = unwrap(parameters[i]);
+            }
+
+            final Object object = unwrap(inObject);
+            final Object result = method.invoke(object, executionParameters);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug(" action result " + result);
+            }
+            if (result == null) {
+                return null;
+            }
+
+            final ObjectAdapter resultAdapter = getAdapterManager().adapterFor(result);
+            final TypeOfFacet typeOfFacet = getFacetHolder().getFacet(TypeOfFacet.class);
+            resultAdapter.setElementSpecificationProvider(ElementSpecificationProviderFromTypeOfFacet.createFrom(typeOfFacet));
+            return resultAdapter;
+
+        } catch (final IllegalArgumentException e) {
+            throw e;
+        } catch (final InvocationTargetException e) {
+            if (e.getTargetException() instanceof IllegalStateException) {
+                throw new ReflectiveActionException("IllegalStateException thrown while executing " + method + " " + e.getTargetException().getMessage(), e.getTargetException());
+            } else {
+                InvokeUtils.invocationException("Exception executing " + method, e);
+                return null;
+            }
+        } catch (final IllegalAccessException e) {
+            throw new ReflectiveActionException("Illegal access of " + method, e);
+        }
+    }
+
+    private static Object unwrap(final ObjectAdapter adapter) {
+        return adapter == null ? null : adapter.getObject();
+    }
+
+    @Override
+    public boolean impliesResolve() {
+        return true;
+    }
+
+    @Override
+    public boolean impliesObjectChanged() {
+        return false;
+    }
+
+    @Override
+    protected String toStringValues() {
+        return "method=" + method;
+    }
+
+    // /////////////////////////////////////////////////////////
+    // Dependencies (from constructor)
+    // /////////////////////////////////////////////////////////
+
+    private AdapterManager getAdapterManager() {
+        return adapterManager;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/DebugFacetViaNamingConvention.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/DebugFacetViaNamingConvention.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/DebugFacetViaNamingConvention.java
new file mode 100644
index 0000000..c62692f
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/DebugFacetViaNamingConvention.java
@@ -0,0 +1,31 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.invoke;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.progmodel.facets.actions.debug.DebugFacetAbstract;
+
+public class DebugFacetViaNamingConvention extends DebugFacetAbstract {
+
+    public DebugFacetViaNamingConvention(final FacetHolder holder) {
+        super(holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ExplorationFacetViaNamingConvention.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ExplorationFacetViaNamingConvention.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ExplorationFacetViaNamingConvention.java
new file mode 100644
index 0000000..02cff9a
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ExplorationFacetViaNamingConvention.java
@@ -0,0 +1,31 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.invoke;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.progmodel.facets.actions.exploration.ExplorationFacetAbstract;
+
+public class ExplorationFacetViaNamingConvention extends ExplorationFacetAbstract {
+
+    public ExplorationFacetViaNamingConvention(final FacetHolder holder) {
+        super(holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/NotContributedFacet.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/NotContributedFacet.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/NotContributedFacet.java
new file mode 100644
index 0000000..c776fa3
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/NotContributedFacet.java
@@ -0,0 +1,34 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.notcontributed;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+
+/**
+ * Indicates that the (repository) action should not be contributed to any
+ * objects.
+ * 
+ * <p>
+ * In the standard Apache Isis Programming Model, corresponds to annotating the
+ * action method using <tt>@NotContributed</tt>.
+ */
+public interface NotContributedFacet extends Facet {
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/NotContributedFacetAbstract.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/NotContributedFacetAbstract.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/NotContributedFacetAbstract.java
new file mode 100644
index 0000000..ab5b748
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/NotContributedFacetAbstract.java
@@ -0,0 +1,36 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.notcontributed;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.MarkerFacetAbstract;
+
+public abstract class NotContributedFacetAbstract extends MarkerFacetAbstract implements NotContributedFacet {
+
+    public static Class<? extends Facet> type() {
+        return NotContributedFacet.class;
+    }
+
+    public NotContributedFacetAbstract(final FacetHolder holder) {
+        super(type(), holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/annotation/NotContributedAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/annotation/NotContributedAnnotationFacetFactory.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/annotation/NotContributedAnnotationFacetFactory.java
new file mode 100644
index 0000000..27f5540
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/annotation/NotContributedAnnotationFacetFactory.java
@@ -0,0 +1,46 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.notcontributed.annotation;
+
+import org.apache.isis.applib.annotation.NotContributed;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.Annotations;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+import org.apache.isis.core.progmodel.facets.actions.notcontributed.NotContributedFacet;
+
+public class NotContributedAnnotationFacetFactory extends FacetFactoryAbstract {
+
+    public NotContributedAnnotationFacetFactory() {
+        super(FeatureType.ACTIONS_ONLY);
+    }
+
+    @Override
+    public void process(final ProcessMethodContext processMethodContext) {
+        final NotContributed annotation = Annotations.getAnnotation(processMethodContext.getMethod(), NotContributed.class);
+        FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
+    }
+
+    private NotContributedFacet create(final NotContributed annotation, final FacetHolder holder) {
+        return annotation == null ? null : new NotContributedFacetAnnotation(holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/annotation/NotContributedFacetAnnotation.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/annotation/NotContributedFacetAnnotation.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/annotation/NotContributedFacetAnnotation.java
new file mode 100644
index 0000000..b1b4821
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/annotation/NotContributedFacetAnnotation.java
@@ -0,0 +1,31 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.notcontributed.annotation;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.progmodel.facets.actions.notcontributed.NotContributedFacetAbstract;
+
+public class NotContributedFacetAnnotation extends NotContributedFacetAbstract {
+
+    public NotContributedFacetAnnotation(final FacetHolder holder) {
+        super(holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/NotInServiceMenuFacet.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/NotInServiceMenuFacet.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/NotInServiceMenuFacet.java
new file mode 100644
index 0000000..c07f9c7
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/NotInServiceMenuFacet.java
@@ -0,0 +1,38 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.notinservicemenu;
+
+import org.apache.isis.applib.events.VisibilityEvent;
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.interactions.VisibilityContext;
+
+/**
+ * Indicates that the (repository) action should not be contributed to any
+ * objects.
+ * 
+ * <p>
+ * In the standard Apache Isis Programming Model, corresponds to annotating the
+ * action method using <tt>@NotContributed</tt>.
+ */
+public interface NotInServiceMenuFacet extends Facet {
+
+    String hides(VisibilityContext<? extends VisibilityEvent> ic);
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/NotInServiceMenuFacetAbstract.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/NotInServiceMenuFacetAbstract.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/NotInServiceMenuFacetAbstract.java
new file mode 100644
index 0000000..79b378b
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/NotInServiceMenuFacetAbstract.java
@@ -0,0 +1,36 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.notinservicemenu;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.MarkerFacetAbstract;
+
+public abstract class NotInServiceMenuFacetAbstract extends MarkerFacetAbstract implements NotInServiceMenuFacet {
+
+    public static Class<? extends Facet> type() {
+        return NotInServiceMenuFacet.class;
+    }
+
+    public NotInServiceMenuFacetAbstract(final FacetHolder holder) {
+        super(type(), holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuAnnotationFacetFactory.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuAnnotationFacetFactory.java
new file mode 100644
index 0000000..4838e04
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuAnnotationFacetFactory.java
@@ -0,0 +1,46 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.notinservicemenu.annotation;
+
+import org.apache.isis.applib.annotation.NotInServiceMenu;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.Annotations;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+import org.apache.isis.core.progmodel.facets.actions.notinservicemenu.NotInServiceMenuFacet;
+
+public class NotInServiceMenuAnnotationFacetFactory extends FacetFactoryAbstract {
+
+    public NotInServiceMenuAnnotationFacetFactory() {
+        super(FeatureType.ACTIONS_ONLY);
+    }
+
+    @Override
+    public void process(final ProcessMethodContext processMethodContext) {
+        final NotInServiceMenu annotation = Annotations.getAnnotation(processMethodContext.getMethod(), NotInServiceMenu.class);
+        FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
+    }
+
+    private NotInServiceMenuFacet create(final NotInServiceMenu annotation, final FacetHolder holder) {
+        return annotation == null ? null : new NotInServiceMenuFacetAnnotation(holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuFacetAnnotation.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuFacetAnnotation.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuFacetAnnotation.java
new file mode 100644
index 0000000..ebc68ab
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuFacetAnnotation.java
@@ -0,0 +1,38 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.notinservicemenu.annotation;
+
+import org.apache.isis.applib.events.VisibilityEvent;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.interactions.VisibilityContext;
+import org.apache.isis.core.progmodel.facets.actions.notinservicemenu.NotInServiceMenuFacetAbstract;
+
+public class NotInServiceMenuFacetAnnotation extends NotInServiceMenuFacetAbstract {
+
+    public NotInServiceMenuFacetAnnotation(final FacetHolder holder) {
+        super(holder);
+    }
+
+    @Override
+    public String hides(final VisibilityContext<? extends VisibilityEvent> ic) {
+        return "@NotInServiceMenu annotation present";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/method/NotInServiceMenuFacetMethod.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/method/NotInServiceMenuFacetMethod.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/method/NotInServiceMenuFacetMethod.java
new file mode 100755
index 0000000..4371f1b
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/method/NotInServiceMenuFacetMethod.java
@@ -0,0 +1,50 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.notinservicemenu.method;
+
+import java.lang.reflect.Method;
+
+import org.apache.isis.applib.events.VisibilityEvent;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.util.AdapterInvokeUtils;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.interactions.VisibilityContext;
+import org.apache.isis.core.progmodel.facets.actions.notinservicemenu.NotInServiceMenuFacetAbstract;
+
+public class NotInServiceMenuFacetMethod extends NotInServiceMenuFacetAbstract {
+
+    private final Method notInServiceMenuMethod;
+
+    public NotInServiceMenuFacetMethod(final Method notInServiceMenuMethod, final FacetHolder holder) {
+        super(holder);
+        this.notInServiceMenuMethod = notInServiceMenuMethod;
+    }
+
+    @Override
+    public String hides(final VisibilityContext<? extends VisibilityEvent> ic) {
+        final ObjectAdapter owningAdapter = ic.getTarget();
+        if (owningAdapter == null) {
+            return null;
+        }
+        final Boolean currentlyHidden = (Boolean) AdapterInvokeUtils.invoke(notInServiceMenuMethod, owningAdapter);
+        return currentlyHidden.booleanValue() ? "notInServiceMenuXxx() method returning true" : null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/method/NotInServiceMenuMethodFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/method/NotInServiceMenuMethodFacetFactory.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/method/NotInServiceMenuMethodFacetFactory.java
new file mode 100755
index 0000000..4fcd17d
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/method/NotInServiceMenuMethodFacetFactory.java
@@ -0,0 +1,63 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.notinservicemenu.method;
+
+import java.lang.reflect.Method;
+
+import org.apache.isis.core.commons.lang.NameUtils;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.methodutils.MethodScope;
+import org.apache.isis.core.progmodel.facets.MethodFinderUtils;
+import org.apache.isis.core.progmodel.facets.MethodPrefixBasedFacetFactoryAbstract;
+
+public class NotInServiceMenuMethodFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
+
+    public NotInServiceMenuMethodFacetFactory() {
+        super(FeatureType.ACTIONS_ONLY, OrphanValidation.VALIDATE);
+    }
+
+    @Override
+    public void process(final ProcessMethodContext processMethodContext) {
+        final Method getMethod = processMethodContext.getMethod();
+        final String capitalizedName = NameUtils.javaBaseNameStripAccessorPrefixIfRequired(getMethod.getName());
+
+        final Class<?> cls = processMethodContext.getCls();
+        final Method hideMethod = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, /*
+                                                                                         * MethodPrefixConstants
+                                                                                         * .
+                                                                                         * HIDE_PREFIX
+                                                                                         */
+                "notInServiceMenu" + capitalizedName, boolean.class, new Class[] {});
+        if (hideMethod == null) {
+            return;
+        }
+
+        processMethodContext.removeMethod(hideMethod);
+
+        final FacetHolder facetedMethod = processMethodContext.getFacetHolder();
+        // FacetUtil.addFacet(new
+        // NotInServiceMenuFacetAnnotation(facetedMethod));
+        FacetUtil.addFacet(new NotInServiceMenuFacetMethod(hideMethod, facetedMethod));
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/prototype/PrototypeFacetAbstract.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/prototype/PrototypeFacetAbstract.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/prototype/PrototypeFacetAbstract.java
new file mode 100644
index 0000000..a52d6b6
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/prototype/PrototypeFacetAbstract.java
@@ -0,0 +1,45 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.prototype;
+
+import org.apache.isis.applib.events.VisibilityEvent;
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.MarkerFacetAbstract;
+import org.apache.isis.core.metamodel.facets.actions.prototype.PrototypeFacet;
+import org.apache.isis.core.metamodel.interactions.VisibilityContext;
+
+public abstract class PrototypeFacetAbstract extends MarkerFacetAbstract implements PrototypeFacet {
+
+    public static Class<? extends Facet> type() {
+        return PrototypeFacet.class;
+    }
+
+    public PrototypeFacetAbstract(final FacetHolder holder) {
+        super(type(), holder);
+    }
+
+    @Override
+    public String hides(
+        VisibilityContext<? extends VisibilityEvent> ic) {
+        return ic.getDeploymentCategory().isPrototyping()? null: "Not visible";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/prototype/annotation/PrototypeAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/prototype/annotation/PrototypeAnnotationFacetFactory.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/prototype/annotation/PrototypeAnnotationFacetFactory.java
new file mode 100644
index 0000000..08ca82b
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/prototype/annotation/PrototypeAnnotationFacetFactory.java
@@ -0,0 +1,46 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.prototype.annotation;
+
+import org.apache.isis.applib.annotation.Prototype;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.Annotations;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.actions.prototype.PrototypeFacet;
+
+public class PrototypeAnnotationFacetFactory extends FacetFactoryAbstract {
+
+    public PrototypeAnnotationFacetFactory() {
+        super(FeatureType.ACTIONS_ONLY);
+    }
+
+    @Override
+    public void process(final ProcessMethodContext processMethodContext) {
+        final Prototype annotation = Annotations.getAnnotation(processMethodContext.getMethod(), Prototype.class);
+        FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
+    }
+
+    private PrototypeFacet create(final Prototype annotation, final FacetHolder holder) {
+        return annotation == null ? null : new PrototypeFacetAnnotation(holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/prototype/annotation/PrototypeFacetAnnotation.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/prototype/annotation/PrototypeFacetAnnotation.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/prototype/annotation/PrototypeFacetAnnotation.java
new file mode 100644
index 0000000..0b6ceeb
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/prototype/annotation/PrototypeFacetAnnotation.java
@@ -0,0 +1,34 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.prototype.annotation;
+
+import org.apache.isis.applib.events.VisibilityEvent;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.interactions.VisibilityContext;
+import org.apache.isis.core.progmodel.facets.actions.prototype.PrototypeFacetAbstract;
+
+public class PrototypeFacetAnnotation extends PrototypeFacetAbstract {
+
+    public PrototypeFacetAnnotation(final FacetHolder holder) {
+        super(holder);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/semantics/ActionSemanticsAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/semantics/ActionSemanticsAnnotationFacetFactory.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/semantics/ActionSemanticsAnnotationFacetFactory.java
new file mode 100644
index 0000000..c08a103
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/semantics/ActionSemanticsAnnotationFacetFactory.java
@@ -0,0 +1,46 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.semantics;
+
+import org.apache.isis.applib.annotation.ActionSemantics;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.Annotations;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.actions.semantics.ActionSemanticsFacet;
+
+public class ActionSemanticsAnnotationFacetFactory extends FacetFactoryAbstract {
+
+    public ActionSemanticsAnnotationFacetFactory() {
+        super(FeatureType.ACTIONS_ONLY);
+    }
+
+    @Override
+    public void process(final ProcessMethodContext processMethodContext) {
+        final ActionSemantics annotation = Annotations.getAnnotation(processMethodContext.getMethod(), ActionSemantics.class);
+        FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
+    }
+
+    private ActionSemanticsFacet create(final ActionSemantics annotation, final FacetHolder holder) {
+        return annotation == null ? null : new ActionSemanticsFacetAnnotation(annotation.value(), holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/semantics/ActionSemanticsFacetAnnotation.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/semantics/ActionSemanticsFacetAnnotation.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/semantics/ActionSemanticsFacetAnnotation.java
new file mode 100644
index 0000000..cf94837
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/semantics/ActionSemanticsFacetAnnotation.java
@@ -0,0 +1,32 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.semantics;
+
+import org.apache.isis.applib.annotation.ActionSemantics.Of;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.actions.semantics.ActionSemanticsFacetAbstract;
+
+public class ActionSemanticsFacetAnnotation extends ActionSemanticsFacetAbstract {
+
+    public ActionSemanticsFacetAnnotation(Of of, final FacetHolder holder) {
+        super(of, holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/semantics/ActionSemanticsFacetFallbackToNonIdempotent.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/semantics/ActionSemanticsFacetFallbackToNonIdempotent.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/semantics/ActionSemanticsFacetFallbackToNonIdempotent.java
new file mode 100644
index 0000000..6f4dd49
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/semantics/ActionSemanticsFacetFallbackToNonIdempotent.java
@@ -0,0 +1,32 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.semantics;
+
+import org.apache.isis.applib.annotation.ActionSemantics;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.actions.semantics.ActionSemanticsFacetAbstract;
+
+public class ActionSemanticsFacetFallbackToNonIdempotent extends ActionSemanticsFacetAbstract {
+
+    public ActionSemanticsFacetFallbackToNonIdempotent(final FacetHolder holder) {
+        super(ActionSemantics.Of.NON_IDEMPOTENT, holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/e4735c72/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/semantics/ActionSemanticsFallbackFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/semantics/ActionSemanticsFallbackFacetFactory.java b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/semantics/ActionSemanticsFallbackFacetFactory.java
new file mode 100644
index 0000000..f203fd3
--- /dev/null
+++ b/framework/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/semantics/ActionSemanticsFallbackFacetFactory.java
@@ -0,0 +1,43 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.actions.semantics;
+
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.FacetedMethod;
+import org.apache.isis.core.metamodel.facets.actions.semantics.ActionSemanticsFacet;
+
+public class ActionSemanticsFallbackFacetFactory extends FacetFactoryAbstract {
+
+    public ActionSemanticsFallbackFacetFactory() {
+        super(FeatureType.ACTIONS_ONLY);
+    }
+
+    @Override
+    public void process(final ProcessMethodContext processMethodContext) {
+        final FacetedMethod facetHolder = processMethodContext.getFacetHolder();
+        if(facetHolder.containsDoOpFacet(ActionSemanticsFacet.class)) {
+            return;
+        }
+        FacetUtil.addFacet(new ActionSemanticsFacetFallbackToNonIdempotent(facetHolder));
+    }
+
+}