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 2015/11/25 19:24:10 UTC

[1/5] isis git commit: ISIS-803: new annotation attributes allowing suclasses of the lifecycle events to be posted (or disabled altogether). also updated docs.

Repository: isis
Updated Branches:
  refs/heads/master 06bbb1e42 -> 8cf480de9


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

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/remove/RemovingCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/remove/RemovingCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/remove/RemovingCallbackFacetViaMethod.java
deleted file mode 100644
index 935ce03..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/remove/RemovingCallbackFacetViaMethod.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.object.callbacks.remove;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.ImperativeFacet;
-
-public class RemovingCallbackFacetViaMethod extends RemovingCallbackFacetAbstract implements ImperativeFacet {
-
-    private final List<Method> methods = new ArrayList<Method>();
-
-    public RemovingCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
-        super(holder);
-        addMethod(method);
-    }
-
-    @Override
-    public void addMethod(final Method method) {
-        methods.add(method);
-    }
-
-    @Override
-    public Intent getIntent(final Method method) {
-        return Intent.LIFECYCLE;
-    }
-
-    @Override
-    public List<Method> getMethods() {
-        return Collections.unmodifiableList(methods);
-    }
-
-    @Override
-    public void invoke(final ObjectAdapter adapter) {
-        ObjectAdapter.InvokeUtils.invokeAll(methods, adapter);
-    }
-
-    @Override
-    protected String toStringValues() {
-        return "methods=" + methods;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/update/UpdateCallbackFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/update/UpdateCallbackFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/update/UpdateCallbackFacetFactory.java
deleted file mode 100644
index ed84700..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/update/UpdateCallbackFacetFactory.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.object.callbacks.update;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-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.metamodel.facets.MethodFinderUtils;
-import org.apache.isis.core.metamodel.facets.MethodPrefixBasedFacetFactoryAbstract;
-import org.apache.isis.core.metamodel.facets.MethodPrefixConstants;
-
-public class UpdateCallbackFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
-
-    private static final String[] PREFIXES = { MethodPrefixConstants.UPDATED_PREFIX, MethodPrefixConstants.UPDATING_PREFIX, };
-
-    public UpdateCallbackFacetFactory() {
-        super(FeatureType.OBJECTS_ONLY, OrphanValidation.VALIDATE, PREFIXES);
-    }
-
-    @Override
-    public void process(final ProcessClassContext processClassContext) {
-        final Class<?> cls = processClassContext.getCls();
-        final FacetHolder facetHolder = processClassContext.getFacetHolder();
-
-        final List<Facet> facets = new ArrayList<Facet>();
-        final List<Method> methods = new ArrayList<Method>();
-
-        Method method = null;
-        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.UPDATING_PREFIX, void.class, NO_PARAMETERS_TYPES);
-        if (method != null) {
-            methods.add(method);
-            facets.add(new UpdatingCallbackFacetViaMethod(method, facetHolder));
-        }
-
-        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.UPDATED_PREFIX, void.class, NO_PARAMETERS_TYPES);
-        if (method != null) {
-            methods.add(method);
-            facets.add(new UpdatedCallbackFacetViaMethod(method, facetHolder));
-        }
-
-        processClassContext.removeMethods(methods);
-        FacetUtil.addFacets(facets);
-    }
-
-}

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

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/update/UpdatedCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/update/UpdatedCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/update/UpdatedCallbackFacetViaMethod.java
deleted file mode 100644
index 028debc..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/update/UpdatedCallbackFacetViaMethod.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.object.callbacks.update;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.ImperativeFacet;
-
-public class UpdatedCallbackFacetViaMethod extends UpdatedCallbackFacetAbstract implements ImperativeFacet {
-
-    private final List<Method> methods = new ArrayList<Method>();
-
-    public UpdatedCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
-        super(holder);
-        addMethod(method);
-    }
-
-    @Override
-    public void addMethod(final Method method) {
-        methods.add(method);
-    }
-
-    @Override
-    public List<Method> getMethods() {
-        return Collections.unmodifiableList(methods);
-    }
-
-    @Override
-    public Intent getIntent(final Method method) {
-        return Intent.LIFECYCLE;
-    }
-
-    @Override
-    public void invoke(final ObjectAdapter adapter) {
-        ObjectAdapter.InvokeUtils.invokeAll(methods, adapter);
-    }
-
-    @Override
-    protected String toStringValues() {
-        return "methods=" + methods;
-    }
-
-}

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

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/update/UpdatingCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/update/UpdatingCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/update/UpdatingCallbackFacetViaMethod.java
deleted file mode 100644
index 5810d54..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/update/UpdatingCallbackFacetViaMethod.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.core.metamodel.facets.object.callbacks.update;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import org.apache.isis.core.commons.lang.Wormhole;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.ImperativeFacet;
-
-public class UpdatingCallbackFacetViaMethod extends UpdatingCallbackFacetAbstract implements ImperativeFacet {
-
-    private final List<Method> methods = new ArrayList<Method>();
-
-    public UpdatingCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
-        super(holder);
-        addMethod(method);
-    }
-
-    @Override
-    public void addMethod(final Method method) {
-        methods.add(method);
-    }
-
-    @Override
-    public List<Method> getMethods() {
-        return Collections.unmodifiableList(methods);
-    }
-
-    @Override
-    public Intent getIntent(final Method method) {
-        return Intent.LIFECYCLE;
-    }
-
-    @Override
-    public void invoke(final ObjectAdapter adapter) {
-        Wormhole.invoke(new Runnable() {
-            @Override
-            public void run() {
-                ObjectAdapter.InvokeUtils.invokeAll(methods, adapter);
-            }
-        });
-    }
-
-    @Override
-    protected String toStringValues() {
-        return "methods=" + methods;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/domainobject/DomainObjectAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/domainobject/DomainObjectAnnotationFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/domainobject/DomainObjectAnnotationFacetFactory.java
index 2ef468e..124f7c2 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/domainobject/DomainObjectAnnotationFacetFactory.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/domainobject/DomainObjectAnnotationFacetFactory.java
@@ -34,6 +34,13 @@ import org.apache.isis.applib.annotation.Immutable;
 import org.apache.isis.applib.annotation.ObjectType;
 import org.apache.isis.applib.annotation.PublishedObject;
 import org.apache.isis.applib.services.HasTransactionId;
+import org.apache.isis.applib.services.eventbus.ObjectCreatedEvent;
+import org.apache.isis.applib.services.eventbus.ObjectLoadedEvent;
+import org.apache.isis.applib.services.eventbus.ObjectPersistedEvent;
+import org.apache.isis.applib.services.eventbus.ObjectPersistingEvent;
+import org.apache.isis.applib.services.eventbus.ObjectRemovingEvent;
+import org.apache.isis.applib.services.eventbus.ObjectUpdatedEvent;
+import org.apache.isis.applib.services.eventbus.ObjectUpdatingEvent;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.config.IsisConfigurationAware;
 import org.apache.isis.core.commons.lang.Nullable;
@@ -49,6 +56,13 @@ import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.MethodFinderUtils;
 import org.apache.isis.core.metamodel.facets.PostConstructMethodCache;
 import org.apache.isis.core.metamodel.facets.object.audit.AuditableFacet;
+import org.apache.isis.core.metamodel.facets.object.callbacks.CreatedLifecycleEventFacetForDomainObjectAnnotation;
+import org.apache.isis.core.metamodel.facets.object.callbacks.LoadedLifecycleEventFacetForDomainObjectAnnotation;
+import org.apache.isis.core.metamodel.facets.object.callbacks.PersistedLifecycleEventFacetForDomainObjectAnnotation;
+import org.apache.isis.core.metamodel.facets.object.callbacks.PersistingLifecycleEventFacetForDomainObjectAnnotation;
+import org.apache.isis.core.metamodel.facets.object.callbacks.RemovingLifecycleEventFacetForDomainObjectAnnotation;
+import org.apache.isis.core.metamodel.facets.object.callbacks.UpdatedLifecycleEventFacetForDomainObjectAnnotation;
+import org.apache.isis.core.metamodel.facets.object.callbacks.UpdatingLifecycleEventFacetForDomainObjectAnnotation;
 import org.apache.isis.core.metamodel.facets.object.domainobject.auditing.AuditableFacetForAuditedAnnotation;
 import org.apache.isis.core.metamodel.facets.object.domainobject.auditing.AuditableFacetForDomainObjectAnnotation;
 import org.apache.isis.core.metamodel.facets.object.domainobject.autocomplete.AutoCompleteFacetForAutoCompleteAnnotation;
@@ -79,6 +93,7 @@ import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorCom
 import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorForDeprecatedAnnotation;
 import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorVisiting;
 import org.apache.isis.core.metamodel.specloader.validator.ValidationFailures;
+import org.apache.isis.core.metamodel.util.EventUtil;
 import org.apache.isis.objectstore.jdo.metamodel.facets.object.persistencecapable.JdoPersistenceCapableFacet;
 
 
@@ -114,8 +129,11 @@ public class DomainObjectAnnotationFacetFactory extends FacetFactoryAbstract
         processEditing(processClassContext);
         processObjectType(processClassContext);
         processNature(processClassContext);
+        processLifecycleEvents(processClassContext);
+
     }
 
+
     void processAuditing(final ProcessClassContext processClassContext) {
         final Class<?> cls = processClassContext.getCls();
         final DomainObject domainObject = Annotations.getAnnotation(cls, DomainObject.class);
@@ -293,6 +311,144 @@ public class DomainObjectAnnotationFacetFactory extends FacetFactoryAbstract
     }
 
 
+    private void processLifecycleEvents(final ProcessClassContext processClassContext) {
+
+        final Class<?> cls = processClassContext.getCls();
+        final DomainObject domainObject = Annotations.getAnnotation(cls, DomainObject.class);
+        if(domainObject == null) {
+            return;
+        }
+        final FacetHolder holder = processClassContext.getFacetHolder();
+
+        processLifecycleEventCreated(domainObject, holder);
+        processLifecycleEventLoaded(domainObject, holder);
+        processLifecycleEventPersisted(domainObject, holder);
+        processLifecycleEventPersisting(domainObject, holder);
+        processLifecycleEventRemoving(domainObject, holder);
+        processLifecycleEventUpdated(domainObject, holder);
+        processLifecycleEventUpdating(domainObject, holder);
+
+    }
+
+    private void processLifecycleEventCreated(final DomainObject domainObject, final FacetHolder holder) {
+        final Class<? extends ObjectCreatedEvent<?>> lifecycleEvent = domainObject.createdLifecycleEvent();
+
+        final CreatedLifecycleEventFacetForDomainObjectAnnotation facet =
+                new CreatedLifecycleEventFacetForDomainObjectAnnotation(
+                        holder, lifecycleEvent, getSpecificationLoader());
+
+        if(EventUtil.eventTypeIsPostable(
+                facet.getEventType(),
+                ObjectCreatedEvent.Noop.class,
+                ObjectCreatedEvent.Default.class,
+                "isis.reflector.facet.domainObjectAnnotation.createdLifecycleEvent.postForDefault",
+                this.configuration)) {
+            FacetUtil.addFacet(facet);
+        }
+    }
+
+    private void processLifecycleEventLoaded(final DomainObject domainObject, final FacetHolder holder) {
+        final Class<? extends ObjectLoadedEvent<?>> lifecycleEvent = domainObject.loadedLifecycleEvent();
+
+        final LoadedLifecycleEventFacetForDomainObjectAnnotation facet =
+                new LoadedLifecycleEventFacetForDomainObjectAnnotation(
+                        holder, lifecycleEvent, getSpecificationLoader());
+
+        if(EventUtil.eventTypeIsPostable(
+                facet.getEventType(),
+                ObjectLoadedEvent.Noop.class,
+                ObjectLoadedEvent.Default.class,
+                "isis.reflector.facet.domainObjectAnnotation.loadedLifecycleEvent.postForDefault",
+                this.configuration)) {
+            FacetUtil.addFacet(facet);
+        }
+    }
+
+    private void processLifecycleEventPersisting(final DomainObject domainObject, final FacetHolder holder) {
+        final Class<? extends ObjectPersistingEvent<?>> lifecycleEvent = domainObject.persistingLifecycleEvent();
+
+        final PersistingLifecycleEventFacetForDomainObjectAnnotation facet =
+                new PersistingLifecycleEventFacetForDomainObjectAnnotation(
+                        holder, lifecycleEvent, getSpecificationLoader());
+
+        if(EventUtil.eventTypeIsPostable(
+                facet.getEventType(),
+                ObjectPersistingEvent.Noop.class,
+                ObjectPersistingEvent.Default.class,
+                "isis.reflector.facet.domainObjectAnnotation.persistingLifecycleEvent.postForDefault",
+                this.configuration)) {
+            FacetUtil.addFacet(facet);
+        }
+    }
+
+    private void processLifecycleEventPersisted(final DomainObject domainObject, final FacetHolder holder) {
+        final Class<? extends ObjectPersistedEvent<?>> lifecycleEvent = domainObject.persistedLifecycleEvent();
+
+        final PersistedLifecycleEventFacetForDomainObjectAnnotation facet =
+                new PersistedLifecycleEventFacetForDomainObjectAnnotation(
+                        holder, lifecycleEvent, getSpecificationLoader());
+
+        if(EventUtil.eventTypeIsPostable(
+                facet.getEventType(),
+                ObjectPersistedEvent.Noop.class,
+                ObjectPersistedEvent.Default.class,
+                "isis.reflector.facet.domainObjectAnnotation.persistedLifecycleEvent.postForDefault",
+                this.configuration)) {
+            FacetUtil.addFacet(facet);
+        }
+    }
+
+    private void processLifecycleEventRemoving(final DomainObject domainObject, final FacetHolder holder) {
+        final Class<? extends ObjectRemovingEvent<?>> lifecycleEvent = domainObject.removingLifecycleEvent();
+
+        final RemovingLifecycleEventFacetForDomainObjectAnnotation facet =
+                new RemovingLifecycleEventFacetForDomainObjectAnnotation(
+                        holder, lifecycleEvent, getSpecificationLoader());
+
+        if(EventUtil.eventTypeIsPostable(
+                facet.getEventType(),
+                ObjectRemovingEvent.Noop.class,
+                ObjectRemovingEvent.Default.class,
+                "isis.reflector.facet.domainObjectAnnotation.removingLifecycleEvent.postForDefault",
+                this.configuration)) {
+            FacetUtil.addFacet(facet);
+        }
+    }
+
+    private void processLifecycleEventUpdated(final DomainObject domainObject, final FacetHolder holder) {
+        final Class<? extends ObjectUpdatedEvent<?>> lifecycleEvent = domainObject.updatedLifecycleEvent();
+
+        final UpdatedLifecycleEventFacetForDomainObjectAnnotation facet =
+                new UpdatedLifecycleEventFacetForDomainObjectAnnotation(
+                        holder, lifecycleEvent, getSpecificationLoader());
+
+        if(EventUtil.eventTypeIsPostable(
+                facet.getEventType(),
+                ObjectUpdatedEvent.Noop.class,
+                ObjectUpdatedEvent.Default.class,
+                "isis.reflector.facet.domainObjectAnnotation.updatedLifecycleEvent.postForDefault",
+                this.configuration)) {
+            FacetUtil.addFacet(facet);
+        }
+    }
+
+    private void processLifecycleEventUpdating(final DomainObject domainObject, final FacetHolder holder) {
+        final Class<? extends ObjectUpdatingEvent<?>> lifecycleEvent = domainObject.updatingLifecycleEvent();
+
+        final UpdatingLifecycleEventFacetForDomainObjectAnnotation facet =
+                new UpdatingLifecycleEventFacetForDomainObjectAnnotation(
+                        holder, lifecycleEvent, getSpecificationLoader());
+
+        if(EventUtil.eventTypeIsPostable(
+                facet.getEventType(),
+                ObjectUpdatingEvent.Noop.class,
+                ObjectUpdatingEvent.Default.class,
+                "isis.reflector.facet.domainObjectAnnotation.updatingLifecycleEvent.postForDefault",
+                this.configuration)) {
+            FacetUtil.addFacet(facet);
+        }
+    }
+
     // //////////////////////////////////////
 
     @Override

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/ignore/annotation/RemoveSubscriberMethodsFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/ignore/annotation/RemoveSubscriberMethodsFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/ignore/annotation/RemoveSubscriberMethodsFacetFactory.java
new file mode 100644
index 0000000..76c508c
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/ignore/annotation/RemoveSubscriberMethodsFacetFactory.java
@@ -0,0 +1,70 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.ignore.annotation;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+
+import com.google.common.eventbus.Subscribe;
+
+import org.apache.isis.core.commons.lang.ClassUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facetapi.MethodRemover;
+import org.apache.isis.core.metamodel.facets.Annotations;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+
+public class RemoveSubscriberMethodsFacetFactory extends FacetFactoryAbstract {
+
+    public RemoveSubscriberMethodsFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY);
+    }
+
+    @Override
+    public void process(final ProcessClassContext processClassContext) {
+        removeIgnoredMethods(processClassContext.getCls(), processClassContext);
+    }
+
+    @SuppressWarnings("deprecation")
+    private void removeIgnoredMethods(final Class<?> cls, final MethodRemover methodRemover) {
+        if (cls == null) {
+            return;
+        }
+
+        final Method[] methods = cls.getMethods();
+        for (final Method method : methods) {
+            removeAnnotatedMethods(methodRemover, method, Subscribe.class);
+            try {
+                // doing this reflectively so that don't bring in a dependency on axon.
+                final Class annotationClass = ClassUtil.forName("org.axonframework.eventhandling.annotation.EventHandler");
+                removeAnnotatedMethods(methodRemover, method, annotationClass);
+            } catch(Exception ignore) {
+                // iignore
+            }
+        }
+    }
+
+    private static <T extends Annotation> void removeAnnotatedMethods(final MethodRemover methodRemover, final Method method, Class<T> annotationClass) {
+        if (!Annotations.isAnnotationPresent(method, annotationClass)) {
+            return;
+        } 
+        methodRemover.removeMethod(method);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java b/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
index 3ce5e46..621b75b 100644
--- a/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
+++ b/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
@@ -66,12 +66,12 @@ import org.apache.isis.core.metamodel.facets.object.ViewModelSemanticCheckingFac
 import org.apache.isis.core.metamodel.facets.object.actionorder.annotation.ActionOrderFacetAnnotationFactory;
 import org.apache.isis.core.metamodel.facets.object.audit.markerifc.AuditableFacetMarkerInterfaceFactory;
 import org.apache.isis.core.metamodel.facets.object.bookmarkpolicy.bookmarkable.BookmarkPolicyFacetViaBookmarkableAnnotationFactory;
-import org.apache.isis.core.metamodel.facets.object.callbacks.create.CreatedCallbackFacetFactory;
-import org.apache.isis.core.metamodel.facets.object.callbacks.load.LoadCallbackFacetFactory;
-import org.apache.isis.core.metamodel.facets.object.callbacks.persist.PersistCallbackFacetFactory;
-import org.apache.isis.core.metamodel.facets.object.callbacks.persist.PersistCallbackViaSaveMethodFacetFactory;
-import org.apache.isis.core.metamodel.facets.object.callbacks.remove.RemoveCallbackFacetFactory;
-import org.apache.isis.core.metamodel.facets.object.callbacks.update.UpdateCallbackFacetFactory;
+import org.apache.isis.core.metamodel.facets.object.callbacks.CreatedCallbackFacetFactory;
+import org.apache.isis.core.metamodel.facets.object.callbacks.LoadCallbackFacetFactory;
+import org.apache.isis.core.metamodel.facets.object.callbacks.PersistCallbackFacetFactory;
+import org.apache.isis.core.metamodel.facets.object.callbacks.PersistCallbackViaSaveMethodFacetFactory;
+import org.apache.isis.core.metamodel.facets.object.callbacks.RemoveCallbackFacetFactory;
+import org.apache.isis.core.metamodel.facets.object.callbacks.UpdateCallbackFacetFactory;
 import org.apache.isis.core.metamodel.facets.object.choices.boundedmarkerifc.ChoicesFacetFromBoundedMarkerInterfaceFactory;
 import org.apache.isis.core.metamodel.facets.object.choices.enums.EnumFacetUsingValueFacetUsingSemanticsProviderFactory;
 import org.apache.isis.core.metamodel.facets.object.cssclass.annotation.CssClassFacetOnTypeAnnotationFactory;
@@ -91,6 +91,7 @@ import org.apache.isis.core.metamodel.facets.object.hidden.method.HiddenObjectFa
 import org.apache.isis.core.metamodel.facets.object.icon.method.IconFacetMethodFactory;
 import org.apache.isis.core.metamodel.facets.object.ignore.annotation.RemovePostConstructOrPreDestroyAnnotationMethodsFacetFactory;
 import org.apache.isis.core.metamodel.facets.object.ignore.annotation.RemoveProgrammaticOrIgnoreAnnotationMethodsFacetFactory;
+import org.apache.isis.core.metamodel.facets.object.ignore.annotation.RemoveSubscriberMethodsFacetFactory;
 import org.apache.isis.core.metamodel.facets.object.ignore.datanucleus.RemoveDatanucleusPersistableTypesFacetFactory;
 import org.apache.isis.core.metamodel.facets.object.ignore.datanucleus.RemoveDnPrefixedMethodsFacetFactory;
 import org.apache.isis.core.metamodel.facets.object.ignore.isis.RemoveSetDomainObjectContainerMethodFacetFactory;
@@ -236,6 +237,7 @@ public final class ProgrammingModelFacetsJava5 extends ProgrammingModelAbstract
         addFactory(RemoveGetClassMethodFacetFactory.class);
         addFactory(RemovePostConstructOrPreDestroyAnnotationMethodsFacetFactory.class);
         addFactory(RemoveProgrammaticOrIgnoreAnnotationMethodsFacetFactory.class);
+        addFactory(RemoveSubscriberMethodsFacetFactory.class);
 
         // come what may, we have to ignore the PersistenceCapable supertype.
         addFactory(RemoveJdoEnhancementTypesFacetFactory.class);

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/CreatedCallbackFacetFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/CreatedCallbackFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/CreatedCallbackFacetFactoryTest.java
index d7e2d5a..ad53742 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/CreatedCallbackFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/CreatedCallbackFacetFactoryTest.java
@@ -25,8 +25,8 @@ import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessClassContext;
 import org.apache.isis.core.metamodel.facets.object.callbacks.CreatedCallbackFacet;
 import org.apache.isis.core.metamodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.metamodel.facets.object.callbacks.create.CreatedCallbackFacetFactory;
-import org.apache.isis.core.metamodel.facets.object.callbacks.create.CreatedCallbackFacetViaMethod;
+import org.apache.isis.core.metamodel.facets.object.callbacks.CreatedCallbackFacetFactory;
+import org.apache.isis.core.metamodel.facets.object.callbacks.CreatedCallbackFacetViaMethod;
 
 public class CreatedCallbackFacetFactoryTest extends AbstractFacetFactoryTest {
 

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/DeleteCallbackFacetFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/DeleteCallbackFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/DeleteCallbackFacetFactoryTest.java
index 9195b15..4ca1cd9 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/DeleteCallbackFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/DeleteCallbackFacetFactoryTest.java
@@ -26,9 +26,9 @@ import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessClassContext;
 import org.apache.isis.core.metamodel.facets.object.callbacks.RemovedCallbackFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.RemovingCallbackFacet;
 import org.apache.isis.core.metamodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.metamodel.facets.object.callbacks.remove.RemoveCallbackViaDeleteMethodFacetFactory;
-import org.apache.isis.core.metamodel.facets.object.callbacks.remove.RemovedCallbackFacetViaMethod;
-import org.apache.isis.core.metamodel.facets.object.callbacks.remove.RemovingCallbackFacetViaMethod;
+import org.apache.isis.core.metamodel.facets.object.callbacks.RemoveCallbackViaDeleteMethodFacetFactory;
+import org.apache.isis.core.metamodel.facets.object.callbacks.RemovedCallbackFacetViaMethod;
+import org.apache.isis.core.metamodel.facets.object.callbacks.RemovingCallbackFacetViaMethod;
 
 public class DeleteCallbackFacetFactoryTest extends AbstractFacetFactoryTest {
 

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/LoadCallbackFacetFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/LoadCallbackFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/LoadCallbackFacetFactoryTest.java
index c9f3fd4..edd4685 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/LoadCallbackFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/LoadCallbackFacetFactoryTest.java
@@ -26,9 +26,9 @@ import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessClassContext;
 import org.apache.isis.core.metamodel.facets.object.callbacks.LoadedCallbackFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.LoadingCallbackFacet;
 import org.apache.isis.core.metamodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.metamodel.facets.object.callbacks.load.LoadCallbackFacetFactory;
-import org.apache.isis.core.metamodel.facets.object.callbacks.load.LoadedCallbackFacetViaMethod;
-import org.apache.isis.core.metamodel.facets.object.callbacks.load.LoadingCallbackFacetViaMethod;
+import org.apache.isis.core.metamodel.facets.object.callbacks.LoadCallbackFacetFactory;
+import org.apache.isis.core.metamodel.facets.object.callbacks.LoadedCallbackFacetViaMethod;
+import org.apache.isis.core.metamodel.facets.object.callbacks.LoadingCallbackFacetViaMethod;
 
 public class LoadCallbackFacetFactoryTest extends AbstractFacetFactoryTest {
 

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/PersistAndSaveCallbackFacetFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/PersistAndSaveCallbackFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/PersistAndSaveCallbackFacetFactoryTest.java
index 374aab1..4ab7e49 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/PersistAndSaveCallbackFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/PersistAndSaveCallbackFacetFactoryTest.java
@@ -27,10 +27,10 @@ import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessClassContext;
 import org.apache.isis.core.metamodel.facets.object.callbacks.PersistedCallbackFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.PersistingCallbackFacet;
 import org.apache.isis.core.metamodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.metamodel.facets.object.callbacks.persist.PersistCallbackFacetFactory;
-import org.apache.isis.core.metamodel.facets.object.callbacks.persist.PersistCallbackViaSaveMethodFacetFactory;
-import org.apache.isis.core.metamodel.facets.object.callbacks.persist.PersistedCallbackFacetViaMethod;
-import org.apache.isis.core.metamodel.facets.object.callbacks.persist.PersistingCallbackFacetViaMethod;
+import org.apache.isis.core.metamodel.facets.object.callbacks.PersistCallbackFacetFactory;
+import org.apache.isis.core.metamodel.facets.object.callbacks.PersistCallbackViaSaveMethodFacetFactory;
+import org.apache.isis.core.metamodel.facets.object.callbacks.PersistedCallbackFacetViaMethod;
+import org.apache.isis.core.metamodel.facets.object.callbacks.PersistingCallbackFacetViaMethod;
 
 public class PersistAndSaveCallbackFacetFactoryTest extends AbstractFacetFactoryTest {
 

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/PersistCallbackFacetFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/PersistCallbackFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/PersistCallbackFacetFactoryTest.java
index d0e4bd8..cbdbb2f 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/PersistCallbackFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/PersistCallbackFacetFactoryTest.java
@@ -26,9 +26,9 @@ import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessClassContext;
 import org.apache.isis.core.metamodel.facets.object.callbacks.PersistedCallbackFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.PersistingCallbackFacet;
 import org.apache.isis.core.metamodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.metamodel.facets.object.callbacks.persist.PersistCallbackFacetFactory;
-import org.apache.isis.core.metamodel.facets.object.callbacks.persist.PersistedCallbackFacetViaMethod;
-import org.apache.isis.core.metamodel.facets.object.callbacks.persist.PersistingCallbackFacetViaMethod;
+import org.apache.isis.core.metamodel.facets.object.callbacks.PersistCallbackFacetFactory;
+import org.apache.isis.core.metamodel.facets.object.callbacks.PersistedCallbackFacetViaMethod;
+import org.apache.isis.core.metamodel.facets.object.callbacks.PersistingCallbackFacetViaMethod;
 
 public class PersistCallbackFacetFactoryTest extends AbstractFacetFactoryTest {
 

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/RemoveAndDeleteCallbackFacetFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/RemoveAndDeleteCallbackFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/RemoveAndDeleteCallbackFacetFactoryTest.java
index 65480cd..49253a6 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/RemoveAndDeleteCallbackFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/RemoveAndDeleteCallbackFacetFactoryTest.java
@@ -27,10 +27,10 @@ import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessClassContext;
 import org.apache.isis.core.metamodel.facets.object.callbacks.RemovedCallbackFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.RemovingCallbackFacet;
 import org.apache.isis.core.metamodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.metamodel.facets.object.callbacks.remove.RemoveCallbackFacetFactory;
-import org.apache.isis.core.metamodel.facets.object.callbacks.remove.RemoveCallbackViaDeleteMethodFacetFactory;
-import org.apache.isis.core.metamodel.facets.object.callbacks.remove.RemovedCallbackFacetViaMethod;
-import org.apache.isis.core.metamodel.facets.object.callbacks.remove.RemovingCallbackFacetViaMethod;
+import org.apache.isis.core.metamodel.facets.object.callbacks.RemoveCallbackFacetFactory;
+import org.apache.isis.core.metamodel.facets.object.callbacks.RemoveCallbackViaDeleteMethodFacetFactory;
+import org.apache.isis.core.metamodel.facets.object.callbacks.RemovedCallbackFacetViaMethod;
+import org.apache.isis.core.metamodel.facets.object.callbacks.RemovingCallbackFacetViaMethod;
 
 public class RemoveAndDeleteCallbackFacetFactoryTest extends AbstractFacetFactoryTest {
 

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/RemoveCallbackFacetFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/RemoveCallbackFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/RemoveCallbackFacetFactoryTest.java
index 094688c..8dc33d1 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/RemoveCallbackFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/RemoveCallbackFacetFactoryTest.java
@@ -26,9 +26,9 @@ import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessClassContext;
 import org.apache.isis.core.metamodel.facets.object.callbacks.RemovedCallbackFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.RemovingCallbackFacet;
 import org.apache.isis.core.metamodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.metamodel.facets.object.callbacks.remove.RemoveCallbackFacetFactory;
-import org.apache.isis.core.metamodel.facets.object.callbacks.remove.RemovedCallbackFacetViaMethod;
-import org.apache.isis.core.metamodel.facets.object.callbacks.remove.RemovingCallbackFacetViaMethod;
+import org.apache.isis.core.metamodel.facets.object.callbacks.RemoveCallbackFacetFactory;
+import org.apache.isis.core.metamodel.facets.object.callbacks.RemovedCallbackFacetViaMethod;
+import org.apache.isis.core.metamodel.facets.object.callbacks.RemovingCallbackFacetViaMethod;
 
 public class RemoveCallbackFacetFactoryTest extends AbstractFacetFactoryTest {
 

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/SaveCallbackFacetFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/SaveCallbackFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/SaveCallbackFacetFactoryTest.java
index ba23524..611a117 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/SaveCallbackFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/SaveCallbackFacetFactoryTest.java
@@ -26,9 +26,9 @@ import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessClassContext;
 import org.apache.isis.core.metamodel.facets.object.callbacks.PersistedCallbackFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.PersistingCallbackFacet;
 import org.apache.isis.core.metamodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.metamodel.facets.object.callbacks.persist.PersistCallbackViaSaveMethodFacetFactory;
-import org.apache.isis.core.metamodel.facets.object.callbacks.persist.PersistedCallbackFacetViaMethod;
-import org.apache.isis.core.metamodel.facets.object.callbacks.persist.PersistingCallbackFacetViaMethod;
+import org.apache.isis.core.metamodel.facets.object.callbacks.PersistCallbackViaSaveMethodFacetFactory;
+import org.apache.isis.core.metamodel.facets.object.callbacks.PersistedCallbackFacetViaMethod;
+import org.apache.isis.core.metamodel.facets.object.callbacks.PersistingCallbackFacetViaMethod;
 
 public class SaveCallbackFacetFactoryTest extends AbstractFacetFactoryTest {
 

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/UpdateCallbackFacetFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/UpdateCallbackFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/UpdateCallbackFacetFactoryTest.java
index e346065..ce76e2d 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/UpdateCallbackFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/object/callback/UpdateCallbackFacetFactoryTest.java
@@ -26,9 +26,9 @@ import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessClassContext;
 import org.apache.isis.core.metamodel.facets.object.callbacks.UpdatedCallbackFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.UpdatingCallbackFacet;
 import org.apache.isis.core.metamodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.metamodel.facets.object.callbacks.update.UpdateCallbackFacetFactory;
-import org.apache.isis.core.metamodel.facets.object.callbacks.update.UpdatedCallbackFacetViaMethod;
-import org.apache.isis.core.metamodel.facets.object.callbacks.update.UpdatingCallbackFacetViaMethod;
+import org.apache.isis.core.metamodel.facets.object.callbacks.UpdateCallbackFacetFactory;
+import org.apache.isis.core.metamodel.facets.object.callbacks.UpdatedCallbackFacetViaMethod;
+import org.apache.isis.core.metamodel.facets.object.callbacks.UpdatingCallbackFacetViaMethod;
 
 public class UpdateCallbackFacetFactoryTest extends AbstractFacetFactoryTest {
 

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java
index f561705..97a6ca3 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java
@@ -44,13 +44,6 @@ import org.apache.isis.applib.services.bookmark.Bookmark;
 import org.apache.isis.applib.services.command.Command;
 import org.apache.isis.applib.services.eventbus.AbstractLifecycleEvent;
 import org.apache.isis.applib.services.eventbus.EventBusService;
-import org.apache.isis.applib.services.eventbus.ObjectCreatedEvent;
-import org.apache.isis.applib.services.eventbus.ObjectLoadedEvent;
-import org.apache.isis.applib.services.eventbus.ObjectPersistedEvent;
-import org.apache.isis.applib.services.eventbus.ObjectPersistingEvent;
-import org.apache.isis.applib.services.eventbus.ObjectRemovingEvent;
-import org.apache.isis.applib.services.eventbus.ObjectUpdatedEvent;
-import org.apache.isis.applib.services.eventbus.ObjectUpdatingEvent;
 import org.apache.isis.applib.services.exceprecog.ExceptionRecognizer;
 import org.apache.isis.applib.services.exceprecog.ExceptionRecognizer2;
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
@@ -63,6 +56,7 @@ import org.apache.isis.core.commons.ensure.Assert;
 import org.apache.isis.core.commons.ensure.Ensure;
 import org.apache.isis.core.commons.ensure.IsisAssertException;
 import org.apache.isis.core.commons.exceptions.IsisException;
+import org.apache.isis.core.commons.factory.InstanceUtil;
 import org.apache.isis.core.commons.util.ToString;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
@@ -79,12 +73,20 @@ import org.apache.isis.core.metamodel.facets.actcoll.typeof.TypeOfFacet;
 import org.apache.isis.core.metamodel.facets.collections.modify.CollectionFacetUtils;
 import org.apache.isis.core.metamodel.facets.object.callbacks.CallbackFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.CreatedCallbackFacet;
+import org.apache.isis.core.metamodel.facets.object.callbacks.CreatedLifecycleEventFacet;
+import org.apache.isis.core.metamodel.facets.object.callbacks.LifecycleEventFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.LoadedCallbackFacet;
+import org.apache.isis.core.metamodel.facets.object.callbacks.LoadedLifecycleEventFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.PersistedCallbackFacet;
+import org.apache.isis.core.metamodel.facets.object.callbacks.PersistedLifecycleEventFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.PersistingCallbackFacet;
+import org.apache.isis.core.metamodel.facets.object.callbacks.PersistingLifecycleEventFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.RemovingCallbackFacet;
+import org.apache.isis.core.metamodel.facets.object.callbacks.RemovingLifecycleEventFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.UpdatedCallbackFacet;
+import org.apache.isis.core.metamodel.facets.object.callbacks.UpdatedLifecycleEventFacet;
 import org.apache.isis.core.metamodel.facets.object.callbacks.UpdatingCallbackFacet;
+import org.apache.isis.core.metamodel.facets.object.callbacks.UpdatingLifecycleEventFacet;
 import org.apache.isis.core.metamodel.facets.object.value.ValueFacet;
 import org.apache.isis.core.metamodel.facets.object.viewmodel.ViewModelFacet;
 import org.apache.isis.core.metamodel.facets.propcoll.accessor.PropertyOrCollectionAccessorFacet;
@@ -673,10 +675,8 @@ public class PersistenceSession implements
                 LOG.debug("Skipping postEvent for creation of Command pojo");
             }
 
-
         } else {
-            postEvent(new ObjectCreatedEvent.Default(), pojo);
-
+            postLifecycleEventIfRequired(adapter, CreatedLifecycleEventFacet.class);
         }
 
         return adapter;
@@ -719,6 +719,19 @@ public class PersistenceSession implements
     //endregion
 
     //region > helper: postEvent
+
+    void postLifecycleEventIfRequired(
+            final ObjectAdapter adapter,
+            final Class<? extends LifecycleEventFacet> lifecycleEventFacetClass) {
+        final LifecycleEventFacet facet = adapter.getSpecification().getFacet(lifecycleEventFacetClass);
+        if(facet != null) {
+            final Class<? extends AbstractLifecycleEvent<?>> eventType = facet.getEventType();
+            final Object instance = InstanceUtil.createInstance(eventType);
+            final Object pojo = adapter.getObject();
+            postEvent((AbstractLifecycleEvent) instance, pojo);
+        }
+    }
+
     void postEvent(final AbstractLifecycleEvent<Object> event, final Object pojo) {
         final EventBusService eventBusService = getServicesInjector().lookupService(EventBusService.class);
         event.setSource(pojo);
@@ -2035,7 +2048,7 @@ public class PersistenceSession implements
         transaction.enlistDeleting(adapter);
 
         CallbackFacet.Util.callCallback(adapter, RemovingCallbackFacet.class);
-        postEvent(new ObjectRemovingEvent.Default(), pojo);
+        postLifecycleEventIfRequired(adapter, RemovingLifecycleEventFacet.class);
     }
 
 
@@ -2091,15 +2104,15 @@ public class PersistenceSession implements
                 remapRecreatedPojo(adapter, pojo);
             } else {
                 adapter = mapRecreatedPojo(originalOid, pojo);
+
                 CallbackFacet.Util.callCallback(adapter, LoadedCallbackFacet.class);
-                postEvent(new ObjectLoadedEvent.Default(), pojo);
+                postLifecycleEventIfRequired(adapter, LoadedLifecycleEventFacet.class);
             }
         }
 
         adapter.setVersion(datastoreVersion);
     }
 
-
     //region > create...Oid (main API)
     /**
      * Create a new {@link Oid#isTransient() transient} {@link Oid} for the
@@ -2188,7 +2201,8 @@ public class PersistenceSession implements
             // persisting
             // previously this was performed in the DataNucleusSimplePersistAlgorithm.
             CallbackFacet.Util.callCallback(adapter, PersistingCallbackFacet.class);
-            postEvent(new ObjectPersistingEvent.Default(), pojo);
+            postLifecycleEventIfRequired(adapter, PersistingLifecycleEventFacet.class);
+
         } else {
             // updating
 
@@ -2219,7 +2233,8 @@ public class PersistenceSession implements
             remapAsPersistent(adapter, persistentOid);
 
             CallbackFacet.Util.callCallback(adapter, PersistedCallbackFacet.class);
-            postEvent(new ObjectPersistedEvent.Default(), pojo);
+            postLifecycleEventIfRequired(adapter, PersistedLifecycleEventFacet.class);
+
 
             final IsisTransaction transaction = getCurrentTransaction();
             transaction.enlistCreated(adapter);
@@ -2229,7 +2244,7 @@ public class PersistenceSession implements
             // the callback and transaction.enlist are done in the preDirty callback
             // (can't be done here, as the enlist requires to capture the 'before' values)
             CallbackFacet.Util.callCallback(adapter, UpdatedCallbackFacet.class);
-            postEvent(new ObjectUpdatedEvent.Default(), pojo);
+            postLifecycleEventIfRequired(adapter, UpdatedLifecycleEventFacet.class);
         }
 
         Version versionIfAny = getVersionIfAny(pojo);
@@ -2264,7 +2279,8 @@ public class PersistenceSession implements
         }
 
         CallbackFacet.Util.callCallback(adapter, UpdatingCallbackFacet.class);
-        postEvent(new ObjectUpdatingEvent.Default(), pojo);
+        postLifecycleEventIfRequired(adapter, UpdatingLifecycleEventFacet.class);
+
 
         getCurrentTransaction().enlistUpdating(adapter);
 

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
index debeaeb..fccaea2 100644
--- a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
+++ b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -117,13 +117,23 @@ isis.reflector.facet.cssClass.patterns=\
 #
 # whether to suppress posting of events if not specified (left as Xxx.Default); defaults to true
 #
+
 #isis.reflector.facet.actionAnnotation.domainEvent.postForDefault=false
 #isis.reflector.facet.collectionAnnotation.domainEvent.postForDefault=false
 #isis.reflector.facet.propertyAnnotation.domainEvent.postForDefault=false
+
 #isis.reflector.facet.domainObjectLayoutAnnotation.cssClassUiEvent.postForDefault=false
 #isis.reflector.facet.domainObjectLayoutAnnotation.iconUiEvent.postForDefault=false
 #isis.reflector.facet.domainObjectLayoutAnnotation.titleUiEvent.postForDefault=false
 
+isis.reflector.facet.domainObjectAnnotation.createdLifecycleEvent.postForDefault=false
+isis.reflector.facet.domainObjectAnnotation.persistingLifecycleEvent.postForDefault=false
+isis.reflector.facet.domainObjectAnnotation.persistedLifecycleEvent.postForDefault=false
+isis.reflector.facet.domainObjectAnnotation.loadedLifecycleEvent.postForDefault=false
+isis.reflector.facet.domainObjectAnnotation.updatingLifecycleEvent.postForDefault=false
+isis.reflector.facet.domainObjectAnnotation.updatedLifecycleEvent.postForDefault=false
+isis.reflector.facet.domainObjectAnnotation.removingLifecycleEvent.postForDefault=false
+
 #################################################################################
 #
 # Domain Service configuration


[2/5] isis git commit: ISIS-803: new annotation attributes allowing suclasses of the lifecycle events to be posted (or disabled altogether). also updated docs.

Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovingCallbackFacetAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovingCallbackFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovingCallbackFacetAbstract.java
new file mode 100644
index 0000000..390c771
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovingCallbackFacetAbstract.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.metamodel.facets.object.callbacks;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.object.callbacks.RemovingCallbackFacet;
+import org.apache.isis.core.metamodel.facets.object.callbacks.CallbackFacetAbstract;
+
+public abstract class RemovingCallbackFacetAbstract extends CallbackFacetAbstract implements RemovingCallbackFacet {
+
+    public static Class<? extends Facet> type() {
+        return RemovingCallbackFacet.class;
+    }
+
+    public RemovingCallbackFacetAbstract(final FacetHolder holder) {
+        super(type(), holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovingCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovingCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovingCallbackFacetViaMethod.java
new file mode 100644
index 0000000..dfa9947
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovingCallbackFacetViaMethod.java
@@ -0,0 +1,65 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.ImperativeFacet;
+
+public class RemovingCallbackFacetViaMethod extends RemovingCallbackFacetAbstract implements ImperativeFacet {
+
+    private final List<Method> methods = new ArrayList<Method>();
+
+    public RemovingCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
+        super(holder);
+        addMethod(method);
+    }
+
+    @Override
+    public void addMethod(final Method method) {
+        methods.add(method);
+    }
+
+    @Override
+    public Intent getIntent(final Method method) {
+        return Intent.LIFECYCLE;
+    }
+
+    @Override
+    public List<Method> getMethods() {
+        return Collections.unmodifiableList(methods);
+    }
+
+    @Override
+    public void invoke(final ObjectAdapter adapter) {
+        ObjectAdapter.InvokeUtils.invokeAll(methods, adapter);
+    }
+
+    @Override
+    protected String toStringValues() {
+        return "methods=" + methods;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovingLifecycleEventFacet.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovingLifecycleEventFacet.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovingLifecycleEventFacet.java
new file mode 100644
index 0000000..a3e7803
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovingLifecycleEventFacet.java
@@ -0,0 +1,30 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.core.metamodel.facets.SingleClassValueFacet;
+
+/**
+ * Corresponds to {@link DomainObject#removingLifecycleEvent()}<tt>.
+ */
+public interface RemovingLifecycleEventFacet extends SingleClassValueFacet, LifecycleEventFacet {
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovingLifecycleEventFacetForDomainObjectAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovingLifecycleEventFacetForDomainObjectAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovingLifecycleEventFacetForDomainObjectAnnotation.java
new file mode 100644
index 0000000..9b07994
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovingLifecycleEventFacetForDomainObjectAnnotation.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.metamodel.facets.object.callbacks;
+
+import org.apache.isis.applib.services.eventbus.ObjectRemovingEvent;
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.SingleClassValueFacetAbstract;
+import org.apache.isis.core.metamodel.spec.SpecificationLoader;
+
+public class RemovingLifecycleEventFacetForDomainObjectAnnotation extends SingleClassValueFacetAbstract implements LoadedLifecycleEventFacet {
+
+    static Class<? extends Facet> type() {
+        return RemovingLifecycleEventFacet.class;
+    }
+
+    public RemovingLifecycleEventFacetForDomainObjectAnnotation(
+            final FacetHolder holder,
+            final Class<? extends ObjectRemovingEvent<?>> value,
+            final SpecificationLoader specificationLoader) {
+        super(type(), holder, value, specificationLoader);
+    }
+
+    public Class<? extends ObjectRemovingEvent<?>> getEventType() {
+        //noinspection unchecked
+        return eventType();
+    }
+
+    Class eventType() {
+        return value();
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdateCallbackFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdateCallbackFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdateCallbackFacetFactory.java
new file mode 100644
index 0000000..fc1d149
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdateCallbackFacetFactory.java
@@ -0,0 +1,68 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+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.metamodel.facets.MethodFinderUtils;
+import org.apache.isis.core.metamodel.facets.MethodPrefixBasedFacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.MethodPrefixConstants;
+
+public class UpdateCallbackFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
+
+    private static final String[] PREFIXES = { MethodPrefixConstants.UPDATED_PREFIX, MethodPrefixConstants.UPDATING_PREFIX, };
+
+    public UpdateCallbackFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY, OrphanValidation.VALIDATE, PREFIXES);
+    }
+
+    @Override
+    public void process(final ProcessClassContext processClassContext) {
+        final Class<?> cls = processClassContext.getCls();
+        final FacetHolder facetHolder = processClassContext.getFacetHolder();
+
+        final List<Facet> facets = new ArrayList<Facet>();
+        final List<Method> methods = new ArrayList<Method>();
+
+        Method method = null;
+        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.UPDATING_PREFIX, void.class, NO_PARAMETERS_TYPES);
+        if (method != null) {
+            methods.add(method);
+            facets.add(new UpdatingCallbackFacetViaMethod(method, facetHolder));
+        }
+
+        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.UPDATED_PREFIX, void.class, NO_PARAMETERS_TYPES);
+        if (method != null) {
+            methods.add(method);
+            facets.add(new UpdatedCallbackFacetViaMethod(method, facetHolder));
+        }
+
+        processClassContext.removeMethods(methods);
+        FacetUtil.addFacets(facets);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatedCallbackFacetAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatedCallbackFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatedCallbackFacetAbstract.java
new file mode 100644
index 0000000..edbf7f4
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatedCallbackFacetAbstract.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.metamodel.facets.object.callbacks;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.object.callbacks.UpdatedCallbackFacet;
+import org.apache.isis.core.metamodel.facets.object.callbacks.CallbackFacetAbstract;
+
+public abstract class UpdatedCallbackFacetAbstract extends CallbackFacetAbstract implements UpdatedCallbackFacet {
+
+    public static Class<? extends Facet> type() {
+        return UpdatedCallbackFacet.class;
+    }
+
+    public UpdatedCallbackFacetAbstract(final FacetHolder holder) {
+        super(type(), holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatedCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatedCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatedCallbackFacetViaMethod.java
new file mode 100644
index 0000000..c856237
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatedCallbackFacetViaMethod.java
@@ -0,0 +1,65 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.ImperativeFacet;
+
+public class UpdatedCallbackFacetViaMethod extends UpdatedCallbackFacetAbstract implements ImperativeFacet {
+
+    private final List<Method> methods = new ArrayList<Method>();
+
+    public UpdatedCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
+        super(holder);
+        addMethod(method);
+    }
+
+    @Override
+    public void addMethod(final Method method) {
+        methods.add(method);
+    }
+
+    @Override
+    public List<Method> getMethods() {
+        return Collections.unmodifiableList(methods);
+    }
+
+    @Override
+    public Intent getIntent(final Method method) {
+        return Intent.LIFECYCLE;
+    }
+
+    @Override
+    public void invoke(final ObjectAdapter adapter) {
+        ObjectAdapter.InvokeUtils.invokeAll(methods, adapter);
+    }
+
+    @Override
+    protected String toStringValues() {
+        return "methods=" + methods;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatedLifecycleEventFacet.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatedLifecycleEventFacet.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatedLifecycleEventFacet.java
new file mode 100644
index 0000000..d7f6c8c
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatedLifecycleEventFacet.java
@@ -0,0 +1,30 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.core.metamodel.facets.SingleClassValueFacet;
+
+/**
+ * Corresponds to {@link DomainObject#updatedLifecycleEvent()}<tt>.
+ */
+public interface UpdatedLifecycleEventFacet extends SingleClassValueFacet, LifecycleEventFacet {
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatedLifecycleEventFacetForDomainObjectAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatedLifecycleEventFacetForDomainObjectAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatedLifecycleEventFacetForDomainObjectAnnotation.java
new file mode 100644
index 0000000..8549e86
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatedLifecycleEventFacetForDomainObjectAnnotation.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.metamodel.facets.object.callbacks;
+
+import org.apache.isis.applib.services.eventbus.ObjectUpdatedEvent;
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.SingleClassValueFacetAbstract;
+import org.apache.isis.core.metamodel.spec.SpecificationLoader;
+
+public class UpdatedLifecycleEventFacetForDomainObjectAnnotation extends SingleClassValueFacetAbstract implements LoadedLifecycleEventFacet {
+
+    static Class<? extends Facet> type() {
+        return UpdatedLifecycleEventFacet.class;
+    }
+
+    public UpdatedLifecycleEventFacetForDomainObjectAnnotation(
+            final FacetHolder holder,
+            final Class<? extends ObjectUpdatedEvent<?>> value,
+            final SpecificationLoader specificationLoader) {
+        super(type(), holder, value, specificationLoader);
+    }
+
+    public Class<? extends ObjectUpdatedEvent<?>> getEventType() {
+        //noinspection unchecked
+        return eventType();
+    }
+
+    Class eventType() {
+        return value();
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatingCallbackFacetAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatingCallbackFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatingCallbackFacetAbstract.java
new file mode 100644
index 0000000..a12ea17
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatingCallbackFacetAbstract.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.metamodel.facets.object.callbacks;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.object.callbacks.UpdatingCallbackFacet;
+import org.apache.isis.core.metamodel.facets.object.callbacks.CallbackFacetAbstract;
+
+public abstract class UpdatingCallbackFacetAbstract extends CallbackFacetAbstract implements UpdatingCallbackFacet {
+
+    public static Class<? extends Facet> type() {
+        return UpdatingCallbackFacet.class;
+    }
+
+    public UpdatingCallbackFacetAbstract(final FacetHolder holder) {
+        super(type(), holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatingCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatingCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatingCallbackFacetViaMethod.java
new file mode 100644
index 0000000..80c04ed
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatingCallbackFacetViaMethod.java
@@ -0,0 +1,69 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.apache.isis.core.commons.lang.Wormhole;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.ImperativeFacet;
+
+public class UpdatingCallbackFacetViaMethod extends UpdatingCallbackFacetAbstract implements ImperativeFacet {
+
+    private final List<Method> methods = new ArrayList<Method>();
+
+    public UpdatingCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
+        super(holder);
+        addMethod(method);
+    }
+
+    @Override
+    public void addMethod(final Method method) {
+        methods.add(method);
+    }
+
+    @Override
+    public List<Method> getMethods() {
+        return Collections.unmodifiableList(methods);
+    }
+
+    @Override
+    public Intent getIntent(final Method method) {
+        return Intent.LIFECYCLE;
+    }
+
+    @Override
+    public void invoke(final ObjectAdapter adapter) {
+        Wormhole.invoke(new Runnable() {
+            @Override
+            public void run() {
+                ObjectAdapter.InvokeUtils.invokeAll(methods, adapter);
+            }
+        });
+    }
+
+    @Override
+    protected String toStringValues() {
+        return "methods=" + methods;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatingLifecycleEventFacet.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatingLifecycleEventFacet.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatingLifecycleEventFacet.java
new file mode 100644
index 0000000..d7fa780
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatingLifecycleEventFacet.java
@@ -0,0 +1,30 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.core.metamodel.facets.SingleClassValueFacet;
+
+/**
+ * Corresponds to {@link DomainObject#updatingLifecycleEvent()}<tt>.
+ */
+public interface UpdatingLifecycleEventFacet extends SingleClassValueFacet, LifecycleEventFacet {
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatingLifecycleEventFacetForDomainObjectAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatingLifecycleEventFacetForDomainObjectAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatingLifecycleEventFacetForDomainObjectAnnotation.java
new file mode 100644
index 0000000..c1ad0ba
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/UpdatingLifecycleEventFacetForDomainObjectAnnotation.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.metamodel.facets.object.callbacks;
+
+import org.apache.isis.applib.services.eventbus.ObjectUpdatingEvent;
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.SingleClassValueFacetAbstract;
+import org.apache.isis.core.metamodel.spec.SpecificationLoader;
+
+public class UpdatingLifecycleEventFacetForDomainObjectAnnotation extends SingleClassValueFacetAbstract implements LoadedLifecycleEventFacet {
+
+    static Class<? extends Facet> type() {
+        return UpdatingLifecycleEventFacet.class;
+    }
+
+    public UpdatingLifecycleEventFacetForDomainObjectAnnotation(
+            final FacetHolder holder,
+            final Class<? extends ObjectUpdatingEvent<?>> value,
+            final SpecificationLoader specificationLoader) {
+        super(type(), holder, value, specificationLoader);
+    }
+
+    public Class<? extends ObjectUpdatingEvent<?>> getEventType() {
+        //noinspection unchecked
+        return eventType();
+    }
+
+    Class eventType() {
+        return value();
+    }
+
+
+}

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

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/create/CreatedCallbackFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/create/CreatedCallbackFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/create/CreatedCallbackFacetFactory.java
deleted file mode 100644
index 1d05fa9..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/create/CreatedCallbackFacetFactory.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.object.callbacks.create;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-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.metamodel.facets.MethodFinderUtils;
-import org.apache.isis.core.metamodel.facets.MethodPrefixBasedFacetFactoryAbstract;
-import org.apache.isis.core.metamodel.facets.MethodPrefixConstants;
-
-public class CreatedCallbackFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
-
-    private static final String[] PREFIXES = { MethodPrefixConstants.CREATED_PREFIX, };
-
-    public CreatedCallbackFacetFactory() {
-        super(FeatureType.OBJECTS_ONLY, OrphanValidation.VALIDATE, PREFIXES);
-    }
-
-    @Override
-    public void process(final ProcessClassContext processClassContext) {
-        final Class<?> cls = processClassContext.getCls();
-        final FacetHolder holder = processClassContext.getFacetHolder();
-
-        final List<Facet> facets = new ArrayList<Facet>();
-        final List<Method> methods = new ArrayList<Method>();
-
-        Method method = null;
-        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.CREATED_PREFIX, void.class, NO_PARAMETERS_TYPES);
-        if (method != null) {
-            methods.add(method);
-            facets.add(new CreatedCallbackFacetViaMethod(method, holder));
-        }
-
-        processClassContext.removeMethods(methods);
-        FacetUtil.addFacets(facets);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/create/CreatedCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/create/CreatedCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/create/CreatedCallbackFacetViaMethod.java
deleted file mode 100644
index ce4d7e5..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/create/CreatedCallbackFacetViaMethod.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.object.callbacks.create;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.ImperativeFacet;
-
-public class CreatedCallbackFacetViaMethod extends CreatedCallbackFacetAbstract implements ImperativeFacet {
-
-    private final List<Method> methods = new ArrayList<Method>();
-
-    public CreatedCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
-        super(holder);
-        addMethod(method);
-    }
-
-    @Override
-    public void addMethod(final Method method) {
-        methods.add(method);
-    }
-
-    @Override
-    public Intent getIntent(final Method method) {
-        return Intent.LIFECYCLE;
-    }
-
-    @Override
-    public List<Method> getMethods() {
-        return Collections.unmodifiableList(methods);
-    }
-
-    @Override
-    public void invoke(final ObjectAdapter adapter) {
-        ObjectAdapter.InvokeUtils.invokeAll(methods, adapter);
-    }
-
-    @Override
-    protected String toStringValues() {
-        return "methods=" + methods;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/load/LoadCallbackFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/load/LoadCallbackFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/load/LoadCallbackFacetFactory.java
deleted file mode 100644
index e7b3023..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/load/LoadCallbackFacetFactory.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.object.callbacks.load;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-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.metamodel.facets.MethodFinderUtils;
-import org.apache.isis.core.metamodel.facets.MethodPrefixBasedFacetFactoryAbstract;
-import org.apache.isis.core.metamodel.facets.MethodPrefixConstants;
-
-public class LoadCallbackFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
-
-    private static final String[] PREFIXES = { MethodPrefixConstants.LOADED_PREFIX, MethodPrefixConstants.LOADING_PREFIX, };
-
-    public LoadCallbackFacetFactory() {
-        super(FeatureType.OBJECTS_ONLY, OrphanValidation.VALIDATE, PREFIXES);
-    }
-
-    @Override
-    public void process(final ProcessClassContext processClassContext) {
-        final Class<?> cls = processClassContext.getCls();
-        final FacetHolder facetHolder = processClassContext.getFacetHolder();
-
-        final List<Facet> facets = new ArrayList<Facet>();
-        final List<Method> methods = new ArrayList<Method>();
-
-        Method method = null;
-        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.LOADING_PREFIX, void.class, NO_PARAMETERS_TYPES);
-        if (method != null) {
-            methods.add(method);
-            facets.add(new LoadingCallbackFacetViaMethod(method, facetHolder));
-        }
-
-        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.LOADED_PREFIX, void.class, NO_PARAMETERS_TYPES);
-        if (method != null) {
-            methods.add(method);
-            facets.add(new LoadedCallbackFacetViaMethod(method, facetHolder));
-        }
-
-        processClassContext.removeMethods(methods);
-        FacetUtil.addFacets(facets);
-    }
-
-}

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

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/load/LoadedCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/load/LoadedCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/load/LoadedCallbackFacetViaMethod.java
deleted file mode 100644
index b33c35b..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/load/LoadedCallbackFacetViaMethod.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.object.callbacks.load;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.ImperativeFacet;
-
-public class LoadedCallbackFacetViaMethod extends LoadedCallbackFacetAbstract implements ImperativeFacet {
-
-    private final List<Method> methods = new ArrayList<Method>();
-
-    public LoadedCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
-        super(holder);
-        addMethod(method);
-    }
-
-    @Override
-    public void addMethod(final Method method) {
-        methods.add(method);
-    }
-
-    @Override
-    public List<Method> getMethods() {
-        return Collections.unmodifiableList(methods);
-    }
-
-    @Override
-    public Intent getIntent(final Method method) {
-        return Intent.LIFECYCLE;
-    }
-
-    @Override
-    public void invoke(final ObjectAdapter adapter) {
-        ObjectAdapter.InvokeUtils.invokeAll(methods, adapter);
-    }
-
-    @Override
-    protected String toStringValues() {
-        return "methods=" + methods;
-    }
-
-}

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

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/load/LoadingCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/load/LoadingCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/load/LoadingCallbackFacetViaMethod.java
deleted file mode 100644
index e341560..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/load/LoadingCallbackFacetViaMethod.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.object.callbacks.load;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.ImperativeFacet;
-
-/**
- * @deprecated - THIS CAN NEVER BE CALLED (BY JDO OBJECTSTORE AT LEAST)
- */
-@Deprecated
-public class LoadingCallbackFacetViaMethod extends LoadingCallbackFacetAbstract implements ImperativeFacet {
-
-    private final List<Method> methods = new ArrayList<Method>();
-
-    public LoadingCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
-        super(holder);
-        addMethod(method);
-    }
-
-    @Override
-    public void addMethod(final Method method) {
-        methods.add(method);
-    }
-
-    @Override
-    public List<Method> getMethods() {
-        return Collections.unmodifiableList(methods);
-    }
-
-    @Override
-    public Intent getIntent(final Method method) {
-        return Intent.LIFECYCLE;
-    }
-
-    @Override
-    public void invoke(final ObjectAdapter adapter) {
-        ObjectAdapter.InvokeUtils.invokeAll(methods, adapter);
-    }
-
-    @Override
-    protected String toStringValues() {
-        return "methods=" + methods;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/persist/PersistCallbackFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/persist/PersistCallbackFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/persist/PersistCallbackFacetFactory.java
deleted file mode 100644
index 9310d82..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/persist/PersistCallbackFacetFactory.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.object.callbacks.persist;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-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.object.callbacks.PersistedCallbackFacet;
-import org.apache.isis.core.metamodel.facets.object.callbacks.PersistingCallbackFacet;
-import org.apache.isis.core.metamodel.methodutils.MethodScope;
-import org.apache.isis.core.metamodel.facets.MethodFinderUtils;
-import org.apache.isis.core.metamodel.facets.MethodPrefixBasedFacetFactoryAbstract;
-import org.apache.isis.core.metamodel.facets.MethodPrefixConstants;
-
-public class PersistCallbackFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
-
-    private static final String[] PREFIXES = { MethodPrefixConstants.PERSISTED_PREFIX, MethodPrefixConstants.PERSISTING_PREFIX, };
-
-    public PersistCallbackFacetFactory() {
-        super(FeatureType.OBJECTS_ONLY, OrphanValidation.VALIDATE, PREFIXES);
-    }
-
-    @Override
-    public void process(final ProcessClassContext processClassContext) {
-        final Class<?> cls = processClassContext.getCls();
-        final FacetHolder facetHolder = processClassContext.getFacetHolder();
-
-        final List<Facet> facets = new ArrayList<Facet>();
-        final List<Method> methods = new ArrayList<Method>();
-
-        Method method = null;
-        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.PERSISTING_PREFIX, void.class, NO_PARAMETERS_TYPES);
-        if (method != null) {
-            methods.add(method);
-            final PersistingCallbackFacet facet = facetHolder.getFacet(PersistingCallbackFacet.class);
-            if (facet == null) {
-                facets.add(new PersistingCallbackFacetViaMethod(method, facetHolder));
-            } else {
-                facet.addMethod(method);
-            }
-        }
-
-        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.PERSISTED_PREFIX, void.class, NO_PARAMETERS_TYPES);
-        if (method != null) {
-            methods.add(method);
-            final PersistedCallbackFacet facet = facetHolder.getFacet(PersistedCallbackFacet.class);
-            if (facet == null) {
-                facets.add(new PersistedCallbackFacetViaMethod(method, facetHolder));
-            } else {
-                facet.addMethod(method);
-            }
-        }
-
-        processClassContext.removeMethods(methods);
-        FacetUtil.addFacets(facets);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/persist/PersistCallbackViaSaveMethodFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/persist/PersistCallbackViaSaveMethodFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/persist/PersistCallbackViaSaveMethodFacetFactory.java
deleted file mode 100644
index 29b05db..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/persist/PersistCallbackViaSaveMethodFacetFactory.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.object.callbacks.persist;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-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.object.callbacks.PersistedCallbackFacet;
-import org.apache.isis.core.metamodel.facets.object.callbacks.PersistingCallbackFacet;
-import org.apache.isis.core.metamodel.methodutils.MethodScope;
-import org.apache.isis.core.metamodel.facets.MethodFinderUtils;
-import org.apache.isis.core.metamodel.facets.MethodPrefixBasedFacetFactoryAbstract;
-import org.apache.isis.core.metamodel.facets.MethodPrefixConstants;
-
-public class PersistCallbackViaSaveMethodFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
-
-    private static final String[] PREFIXES = { MethodPrefixConstants.SAVED_PREFIX, MethodPrefixConstants.SAVING_PREFIX, };
-
-    public PersistCallbackViaSaveMethodFacetFactory() {
-        super(FeatureType.OBJECTS_ONLY, OrphanValidation.VALIDATE, PREFIXES);
-    }
-
-    @Override
-    public void process(final ProcessClassContext processClassContext) {
-        final Class<?> cls = processClassContext.getCls();
-        final FacetHolder facetHolder = processClassContext.getFacetHolder();
-
-        final List<Facet> facets = new ArrayList<Facet>();
-        final List<Method> methods = new ArrayList<Method>();
-
-        Method method = null;
-        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.SAVING_PREFIX, void.class, NO_PARAMETERS_TYPES);
-        if (method != null) {
-            methods.add(method);
-            final PersistingCallbackFacet facet = facetHolder.getFacet(PersistingCallbackFacet.class);
-            if (facet == null) {
-                facets.add(new PersistingCallbackFacetViaMethod(method, facetHolder));
-            } else {
-                facet.addMethod(method);
-            }
-        }
-
-        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.SAVED_PREFIX, void.class, NO_PARAMETERS_TYPES);
-        if (method != null) {
-            methods.add(method);
-            final PersistedCallbackFacet facet = facetHolder.getFacet(PersistedCallbackFacet.class);
-            if (facet == null) {
-                facets.add(new PersistedCallbackFacetViaMethod(method, facetHolder));
-            } else {
-                facet.addMethod(method);
-            }
-        }
-
-        processClassContext.removeMethods(methods);
-        FacetUtil.addFacets(facets);
-    }
-
-}

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

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/persist/PersistedCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/persist/PersistedCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/persist/PersistedCallbackFacetViaMethod.java
deleted file mode 100644
index 2b4d725..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/persist/PersistedCallbackFacetViaMethod.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.object.callbacks.persist;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.ImperativeFacet;
-
-public class PersistedCallbackFacetViaMethod extends PersistedCallbackFacetAbstract implements ImperativeFacet {
-
-    private final List<Method> methods = new ArrayList<Method>();
-
-    public PersistedCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
-        super(holder);
-        addMethod(method);
-    }
-
-    @Override
-    public void addMethod(final Method method) {
-        methods.add(method);
-    }
-
-    @Override
-    public Intent getIntent(final Method method) {
-        return Intent.LIFECYCLE;
-    }
-
-    @Override
-    public List<Method> getMethods() {
-        return Collections.unmodifiableList(methods);
-    }
-
-    @Override
-    public void invoke(final ObjectAdapter adapter) {
-        ObjectAdapter.InvokeUtils.invokeAll(methods, adapter);
-    }
-
-    @Override
-    protected String toStringValues() {
-        return "methods=" + methods;
-    }
-
-}

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

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/persist/PersistingCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/persist/PersistingCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/persist/PersistingCallbackFacetViaMethod.java
deleted file mode 100644
index e30033c..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/persist/PersistingCallbackFacetViaMethod.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.object.callbacks.persist;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.ImperativeFacet;
-
-public class PersistingCallbackFacetViaMethod extends PersistingCallbackFacetAbstract implements ImperativeFacet {
-
-    private final List<Method> methods = new ArrayList<Method>();
-
-    public PersistingCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
-        super(holder);
-        addMethod(method);
-    }
-
-    @Override
-    public void addMethod(final Method method) {
-        methods.add(method);
-    }
-
-    @Override
-    public List<Method> getMethods() {
-        return Collections.unmodifiableList(methods);
-    }
-
-    @Override
-    public Intent getIntent(final Method method) {
-        return Intent.LIFECYCLE;
-    }
-
-    @Override
-    public void invoke(final ObjectAdapter adapter) {
-        ObjectAdapter.InvokeUtils.invokeAll(methods, adapter);
-    }
-
-    @Override
-    protected String toStringValues() {
-        return "methods=" + methods;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/remove/RemoveCallbackFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/remove/RemoveCallbackFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/remove/RemoveCallbackFacetFactory.java
deleted file mode 100644
index d850fd3..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/remove/RemoveCallbackFacetFactory.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.object.callbacks.remove;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-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.object.callbacks.RemovedCallbackFacet;
-import org.apache.isis.core.metamodel.facets.object.callbacks.RemovingCallbackFacet;
-import org.apache.isis.core.metamodel.methodutils.MethodScope;
-import org.apache.isis.core.metamodel.facets.MethodFinderUtils;
-import org.apache.isis.core.metamodel.facets.MethodPrefixBasedFacetFactoryAbstract;
-import org.apache.isis.core.metamodel.facets.MethodPrefixConstants;
-
-public class RemoveCallbackFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
-
-    private static final String[] PREFIXES = { MethodPrefixConstants.REMOVED_PREFIX, MethodPrefixConstants.REMOVING_PREFIX, };
-
-    public RemoveCallbackFacetFactory() {
-        super(FeatureType.OBJECTS_ONLY, OrphanValidation.VALIDATE, PREFIXES);
-    }
-
-    @Override
-    public void process(final ProcessClassContext processClassContext) {
-        final Class<?> cls = processClassContext.getCls();
-        final FacetHolder facetHolder = processClassContext.getFacetHolder();
-
-        final List<Facet> facets = new ArrayList<Facet>();
-        final List<Method> methods = new ArrayList<Method>();
-
-        Method method = null;
-        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.REMOVING_PREFIX, void.class, NO_PARAMETERS_TYPES);
-        if (method != null) {
-            methods.add(method);
-            final RemovingCallbackFacet facet = facetHolder.getFacet(RemovingCallbackFacet.class);
-            if (facet == null) {
-                facets.add(new RemovingCallbackFacetViaMethod(method, facetHolder));
-            } else {
-                facet.addMethod(method);
-            }
-        }
-
-        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.REMOVED_PREFIX, void.class, NO_PARAMETERS_TYPES);
-        if (method != null) {
-            methods.add(method);
-            final RemovedCallbackFacet facet = facetHolder.getFacet(RemovedCallbackFacet.class);
-            if (facet == null) {
-                facets.add(new RemovedCallbackFacetViaMethod(method, facetHolder));
-            } else {
-                facet.addMethod(method);
-            }
-        }
-
-        processClassContext.removeMethods(methods);
-        FacetUtil.addFacets(facets);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/remove/RemoveCallbackViaDeleteMethodFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/remove/RemoveCallbackViaDeleteMethodFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/remove/RemoveCallbackViaDeleteMethodFacetFactory.java
deleted file mode 100644
index 92da2de..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/remove/RemoveCallbackViaDeleteMethodFacetFactory.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.object.callbacks.remove;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-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.object.callbacks.RemovedCallbackFacet;
-import org.apache.isis.core.metamodel.facets.object.callbacks.RemovingCallbackFacet;
-import org.apache.isis.core.metamodel.methodutils.MethodScope;
-import org.apache.isis.core.metamodel.facets.MethodFinderUtils;
-import org.apache.isis.core.metamodel.facets.MethodPrefixBasedFacetFactoryAbstract;
-import org.apache.isis.core.metamodel.facets.MethodPrefixConstants;
-
-public class RemoveCallbackViaDeleteMethodFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
-
-    private static final String[] PREFIXES = { MethodPrefixConstants.DELETED_PREFIX, MethodPrefixConstants.DELETING_PREFIX, };
-
-    public RemoveCallbackViaDeleteMethodFacetFactory() {
-        super(FeatureType.OBJECTS_ONLY, OrphanValidation.VALIDATE, PREFIXES);
-    }
-
-    @Override
-    public void process(final ProcessClassContext processClassContext) {
-        final Class<?> cls = processClassContext.getCls();
-        final FacetHolder holder = processClassContext.getFacetHolder();
-
-        final List<Facet> facets = new ArrayList<Facet>();
-        final List<Method> methods = new ArrayList<Method>();
-
-        Method method = null;
-        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.DELETING_PREFIX, void.class, NO_PARAMETERS_TYPES);
-        if (method != null) {
-            methods.add(method);
-            final RemovingCallbackFacet facet = holder.getFacet(RemovingCallbackFacet.class);
-            if (facet == null) {
-                facets.add(new RemovingCallbackFacetViaMethod(method, holder));
-            } else {
-                facet.addMethod(method);
-            }
-        }
-
-        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.DELETED_PREFIX, void.class, NO_PARAMETERS_TYPES);
-        if (method != null) {
-            methods.add(method);
-            final RemovedCallbackFacet facet = holder.getFacet(RemovedCallbackFacet.class);
-            if (facet == null) {
-                facets.add(new RemovedCallbackFacetViaMethod(method, holder));
-            } else {
-                facet.addMethod(method);
-            }
-        }
-
-        processClassContext.removeMethods(methods);
-        FacetUtil.addFacets(facets);
-    }
-
-}

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

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/remove/RemovedCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/remove/RemovedCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/remove/RemovedCallbackFacetViaMethod.java
deleted file mode 100644
index e67940b..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/remove/RemovedCallbackFacetViaMethod.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.object.callbacks.remove;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.ImperativeFacet;
-
-public class RemovedCallbackFacetViaMethod extends RemovedCallbackFacetAbstract implements ImperativeFacet {
-
-    private final List<Method> methods = new ArrayList<Method>();
-
-    public RemovedCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
-        super(holder);
-        addMethod(method);
-    }
-
-    @Override
-    public void addMethod(final Method method) {
-        methods.add(method);
-    }
-
-    @Override
-    public List<Method> getMethods() {
-        return Collections.unmodifiableList(methods);
-    }
-
-    @Override
-    public Intent getIntent(final Method method) {
-        return Intent.LIFECYCLE;
-    }
-
-    @Override
-    public void invoke(final ObjectAdapter adapter) {
-        ObjectAdapter.InvokeUtils.invokeAll(methods, adapter);
-    }
-
-    @Override
-    protected String toStringValues() {
-        return "methods=" + methods;
-    }
-
-}


[4/5] isis git commit: ISIS-803: new annotation attributes allowing suclasses of the lifecycle events to be posted (or disabled altogether). also updated docs.

Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/adocs/documentation/src/main/asciidoc/resources/templates/intellij-live-templates-for-apache-isis.xml
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/resources/templates/intellij-live-templates-for-apache-isis.xml b/adocs/documentation/src/main/asciidoc/resources/templates/intellij-live-templates-for-apache-isis.xml
deleted file mode 100644
index 0047c3f..0000000
--- a/adocs/documentation/src/main/asciidoc/resources/templates/intellij-live-templates-for-apache-isis.xml
+++ /dev/null
@@ -1,522 +0,0 @@
-<templateSet group="Apache Isis">
-  <template name="ai-a" value="@org.apache.isis.applib.annotation.Action()&#10;public $ReturnType$ $actionName$(final $ParameterType$ $parameterType$) {&#10;    return $END$null; // TODO: business logic here&#10;}&#10;" description="Apache Isis Action" toReformat="true" toShortenFQNames="true">
-    <variable name="actionName" expression="&quot;actionName&quot;" defaultValue="" alwaysStopAt="true" />
-    <variable name="ParameterType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
-    <variable name="parameterType" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
-    <variable name="ReturnType" expression="className()" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-a-p-auto" value="public java.util.Collection&lt;$ParameterType$&gt; autoComplete$ParameterNum$$ActionName$(final String search) {&#10;    return $END$com.google.common.collect.Lists.newArrayList(); // TODO: return list of choices for argument N&#10;}" description="Apache Isis Action parameter auto-complete" toReformat="true" toShortenFQNames="true">
-    <variable name="ParameterNum" expression="&quot;Num&quot;" defaultValue="" alwaysStopAt="true" />
-    <variable name="ActionName" expression="&quot;ActionName&quot;" defaultValue="" alwaysStopAt="true" />
-    <variable name="ParameterType" expression="className()" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-a-p-cho" value="public java.util.List&lt;$ParameterType$&gt; choices$ParameterNum$$ActionName$() {&#10;    return $END$com.google.common.collect.Lists.newArrayList(); // TODO: return list of choices for argument N&#10;}" description="Apache Isis Action parameter choices" toReformat="true" toShortenFQNames="true">
-    <variable name="ParameterNum" expression="&quot;Num&quot;" defaultValue="" alwaysStopAt="true" />
-    <variable name="ActionName" expression="&quot;ActionName&quot;" defaultValue="" alwaysStopAt="true" />
-    <variable name="ParameterType" expression="className()" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-a-p-def" value="public $ParameterType$ default$ParameterNum$$ActionName$() {&#10;    return $END$null; // TODO: return default for argument N&#10;}" description="Apache Isis Action parameter defaults" toReformat="true" toShortenFQNames="true">
-    <variable name="ParameterNum" expression="&quot;Num&quot;" defaultValue="" alwaysStopAt="true" />
-    <variable name="ActionName" expression="&quot;ActionName&quot;" defaultValue="" alwaysStopAt="true" />
-    <variable name="ParameterType" expression="className()" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-a-p-val" value="public String validate$ParamNum}$ActionName$(final $ParameterType$ $parameterType$) {&#10;    return $END$null; // TODO: return reason why action argument are invalid, null if ok&#10;}" description="Apache Isis Action parameter validation" toReformat="true" toShortenFQNames="true">
-    <variable name="ActionName" expression="&quot;ActionName&quot;" defaultValue="" alwaysStopAt="true" />
-    <variable name="ParameterType" expression="className()" defaultValue="" alwaysStopAt="true" />
-    <variable name="parameterType" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-a-dis" value="public String disable$ActionName$() {&#10;    return $END$null; // TODO: return reason why action disabled, null if enabled&#10;}" description="Apache Isis Action disablement" toReformat="true" toShortenFQNames="true">
-    <variable name="ActionName" expression="&quot;ActionName&quot;" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-a-event" value="public static class $ActionName$DomainEvent extends ActionDomainEvent{}&#10;@org.apache.isis.applib.annotation.Action(&#10;        domainEvent = $ActionName$DomainEvent.class&#10;)&#10;public $ReturnType$ $actionName$(final $ParameterType$ $parameterType$) {&#10;    return $END$null; // TODO: business logic here&#10;}&#10;" description="Apache Isis Action (with domain event)" toReformat="true" toShortenFQNames="true">
-    <variable name="actionName" expression="&quot;actionName&quot;" defaultValue="" alwaysStopAt="true" />
-    <variable name="ActionName" expression="capitalize(actionName)" defaultValue="" alwaysStopAt="false" />
-    <variable name="ParameterType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
-    <variable name="parameterType" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
-    <variable name="ReturnType" expression="className()" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-a-event-decl" value="public static class $ActionName$DomainEvent extends ActionDomainEvent{}&#10;@org.apache.isis.applib.annotation.Action(&#10;        domainEvent = $ActionName$DomainEvent.class&#10;)&#10;" description="Apache Isis Action (domain event declaration only)" toReformat="true" toShortenFQNames="true">
-    <variable name="ActionName" expression="" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-a-hid" value="public boolean hide$ActionName$() {&#10;    return $END$false; // TODO: return true if action is hidden, false if visible&#10;}" description="Apache Isis Action visibility" toReformat="true" toShortenFQNames="true">
-    <variable name="ActionName" expression="&quot;ActionName&quot;" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-a-val" value="public String validate$ActionName$(final $ParameterType$ $parameterType$) {&#10;    return $END$null; // TODO: return reason why action arguments are invalid, null if ok&#10;}" description="Apache Isis Action validation" toReformat="true" toShortenFQNames="true">
-    <variable name="ActionName" expression="&quot;ActionName&quot;" defaultValue="" alwaysStopAt="true" />
-    <variable name="ParameterType" expression="className()" defaultValue="" alwaysStopAt="true" />
-    <variable name="parameterType" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-c-dis" value="public String disable$CollectionName$() {&#10;    return $END$null; // TODO: return reason why collection read-only, null if editable&#10;}" description="Apache Isis Collection disablement" toReformat="true" toShortenFQNames="true">
-    <variable name="CollectionName" expression="&quot;CollectionName&quot;" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-c-hid" value="public boolean hide$CollectionName$() {&#10;    return $END$false; // TODO: return true if hidden, false otherwise&#10;}" description="Apache Isis Collection visibility" toReformat="true" toShortenFQNames="false">
-    <variable name="CollectionName" expression="&quot;CollectionName&quot;" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-c-jdo-1m-b-fk" value="@org.apache.isis.applib.annotation.Collection()&#10;@javax.jdo.annotations.Persistent(mappedBy=&quot;$elementNameInChild$&quot;, dependentElement=&quot;$trueOrFalse$&quot;)&#10;@lombok.Getter @lombok.Setter&#10;private java.util.SortedSet&lt;$ElementType$&gt; $collectionName$ = new java.util.TreeSet&lt;$ElementType$&gt;();&#10;" description="Apache Isis Collection (JDO, 1:m parent bidirectional to foreign key)" toReformat="true" toShortenFQNames="true">
-    <variable name="ElementType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
-    <variable name="collectionName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
-    <variable name="elementNameInChild" expression="decapitalize(EntityName)" defaultValue="" alwaysStopAt="false" />
-    <variable name="trueOrFalse" expression="&quot;trueOrFalse&quot;" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-c-jdo-1m-b-jt" value="@org.apache.isis.applib.annotation.Collection()&#10;@javax.jdo.annotations.Persistent(mappedBy=&quot;$elementNameInChild$&quot;, dependentElement=&quot;$trueOrFalse$&quot;)&#10;@javax.jdo.annotations.Join&#10;@lombok.Getter @lombok.Setter&#10;private java.util.SortedSet&lt;$ElementType$&gt; $collectionName$ = new java.util.TreeSet&lt;$ElementType$&gt;();&#10;" description="Apache Isis Collection (JDO, 1:m parent bidirectional to join table)" toReformat="true" toShortenFQNames="true">
-    <variable name="ElementType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
-    <variable name="collectionName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
-    <variable name="elementNameInChild" expression="decapitalize(EntityName)" defaultValue="" alwaysStopAt="false" />
-    <variable name="trueOrFalse" expression="&quot;trueOrFalse&quot;" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-c-jdo-1m-u-fk" value="@org.apache.isis.applib.annotation.Collection()&#10;@javax.jdo.annotations.Element(column=&quot;$ColumnName$&quot;, dependent=&quot;$trueOrFalse$&quot;)&#10;@lombok.Getter @lombok.Setter&#10;private java.util.SortedSet&lt;$ElementType$&gt; $collectionName$ = new java.util.TreeSet&lt;$ElementType$&gt;();&#10;" description="Apache Isis JDO Collection (1:m parent unidirectional)" toReformat="true" toShortenFQNames="true">
-    <variable name="ElementType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
-    <variable name="collectionName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
-    <variable name="ColumnName" expression="&quot;ColumnName&quot;" defaultValue="" alwaysStopAt="true" />
-    <variable name="trueOrFalse" expression="&quot;trueOrFalse&quot;" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-c-jdo-1m-u-jt" value="@org.apache.isis.applib.annotation.Collection()&#10;@javax.jdo.annotations.Join&#10;@javax.jdo.annotations.Element(dependent=&quot;$trueOrFalse$&quot;)&#10;@lombok.Getter @lombok.Setter&#10;private java.util.SortedSet&lt;$ElementType$&gt; $collectionName$ = new java.util.TreeSet&lt;$ElementType$&gt;();&#10;" description="Apache Isis Collection (JDO, 1:m parent unidirectional to join table)" toReformat="true" toShortenFQNames="true">
-    <variable name="ElementType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
-    <variable name="collectionName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
-    <variable name="trueOrFalse" expression="&quot;trueOrFalse&quot;" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-c-jdo-mn-ub-c" value="@org.apache.isis.applib.annotation.Collection()&#10;@javax.jdo.annotations.Persistent(mappedBy=&quot;$ChildCollectionNameInParent$&quot;)&#10;@lombok.Getter @lombok.Setter&#10;private java.util.SortedSet&lt;$ElementType$&gt; $collectionName$ = new java.util.TreeSet&lt;$ElementType$&gt;(); &#10;" description="Apache Isis Collection (JDO, m:n child)" toReformat="true" toShortenFQNames="true">
-    <variable name="ElementType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
-    <variable name="collectionName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
-    <variable name="ChildCollectionNameInParent" expression="&quot;ChildCollectionNameInParent&quot;" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-c-jdo-mn-ub-p" value="@org.apache.isis.applib.annotation.Collection()&#10;@javax.jdo.annotations.Persistent(table=&quot;$TableName$&quot;) &#10;@javax.jdo.annotations.Join(column=&quot;$ThisEntityFieldName$&quot;) &#10;@javax.jdo.annotations.Element(column=&quot;$RelatedEntityFieldName$&quot;)&#10;@lombok.Getter @lombok.Setter&#10;private java.util.SortedSet&lt;$ElementType$&gt; $collectionName$ = new java.util.TreeSet&lt;$ElementType$&gt;();&#10;" description="Apache Isis Collection (JDO, m:n parent)" toReformat="true" toShortenFQNames="true">
-    <variable name="ElementType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
-    <variable name="collectionName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
-    <variable name="TableName" expression="&quot;TableName&quot;" defaultValue="" alwaysStopAt="true" />
-    <variable name="ThisEntityFieldName" expression="&quot;ThisEntityFieldName&quot;" defaultValue="" alwaysStopAt="true" />
-    <variable name="RelatedEntityFieldName" expression="&quot;RelatedEntityFieldName&quot;" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-ds-subscriber-on" value="@com.google.common.eventbus.Subscribe&#10;public void on(final $EventType$ ev) {&#10;    // TODO&#10;}&#10;" description="Apache Isis Domain Service Subscriber &quot;on&quot; event" toReformat="false" toShortenFQNames="true">
-    <variable name="EventType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="JAVA_DECLARATION" value="true" />
-    </context>
-  </template>
-  <template name="ai-jaxb-package.info" value="@javax.xml.bind.annotation.XmlSchema(&#10;        namespace = &quot;http://$namespaceBase$/$namespaceSuffix$/v$versionMajor$_$versionMinor$/$namespaceSuffix$.xsd&quot;,&#10;        xmlns = {&#10;                @javax.xml.bind.annotation.XmlNs(&#10;                        namespaceURI = &quot;http://isis.apache.org/schema/common&quot;,&#10;                        prefix = &quot;common&quot;&#10;                ),&#10;        },&#10;        elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED&#10;)" toReformat="false" toShortenFQNames="true">
-    <variable name="namespaceBase" expression="        groovyScript(&quot;def str = _1; def list = str.split(\&quot;\\\\.\&quot;); def revlist = list.reverse(); def ret = revlist.iterator().join(\&quot;.\&quot;); return ret&quot;, currentPackage())" defaultValue="" alwaysStopAt="true" />
-    <variable name="namespaceSuffix" expression="groovyScript(&quot;def str = _1; def list = str.split(\&quot;\\\\.\&quot;); def revlist = list.reverse(); def ret = revlist[0]; return ret&quot;, currentPackage())" defaultValue="" alwaysStopAt="true" />
-    <variable name="versionMajor" expression="" defaultValue="1" alwaysStopAt="true" />
-    <variable name="versionMinor" expression="" defaultValue="0" alwaysStopAt="true" />
-    <context>
-      <option name="JAVA_DECLARATION" value="true" />
-    </context>
-  </template>
-  <template name="ai-inject" value="@javax.inject.Inject&#10;$ServiceType$ $serviceType$;&#10;" description="Apache Isis Injected Dependency Service" toReformat="true" toShortenFQNames="true">
-    <variable name="ServiceType" expression="className()" defaultValue="" alwaysStopAt="true" />
-    <variable name="serviceType" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-id" value="//region &gt; title, icon etc&#10;public String title() {&#10;    final org.apache.isis.applib.util.TitleBuffer buf = new org.apache.isis.applib.util.TitleBuffer();&#10;    $END$// TODO: append to org.apache.isis.applib.util.TitleBuffer, typically value properties&#10;    return buf.toString();&#10;}&#10;public String iconName() {&#10;    return null; // TODO: return icon name (suffix)&#10;}&#10;public String cssClass() {&#10;    return null; // TODO: return CSS class name&#10;}&#10;//endregion" description="Apache Isis Identification region" toReformat="true" toShortenFQNames="true">
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-new" value="$Type$ $type$ = $container$.newTransientInstance($Type$.class);&#10;$END$// TODO: set up any properties&#10;&#10;$container$.persist($type$);&#10;" description="Apache Isis Commonly used method (factory for persistent)" toReformat="true" toShortenFQNames="true">
-    <variable name="Type" expression="className()" defaultValue="" alwaysStopAt="true" />
-    <variable name="type" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
-    <variable name="container" expression="&quot;container&quot;" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_STATEMENT" value="true" />
-      <option name="JAVA_EXPRESSION" value="false" />
-      <option name="JAVA_DECLARATION" value="false" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-p-jdo" value="@org.apache.isis.applib.annotation.Property()&#10;@javax.jdo.annotations.Column(allowsNull=&quot;$trueOrFalse$&quot;)&#10;@lombok.Getter @lombok.Setter&#10;private $PropertyType$ $propertyName$;&#10;" description="Apache Isis Property (JDO)" toReformat="true" toShortenFQNames="false">
-    <variable name="PropertyType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
-    <variable name="propertyName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
-    <variable name="trueOrFalse" expression="" defaultValue="false" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-p-auto" value="public java.util.Collection&lt;$PropertyType$&gt; autoComplete$PropertyName$(final String search) {&#10;    return $END$com.google.common.collect.Lists.newArrayList(); // TODO: return list of choices for property&#10;}" description="Apache Isis Property auto-complete" toReformat="true" toShortenFQNames="true">
-    <variable name="PropertyName" expression="&quot;PropertyName&quot;" defaultValue="" alwaysStopAt="true" />
-    <variable name="PropertyType" expression="className()" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-p-cho" value="public java.util.Collection&lt;$PropertyType$&gt; choices$PropertyName$() {&#10;    return $END$com.google.common.collect.Lists.newArrayList(); // TODO: return list of choices for property&#10;}" description="Apache Isis Property choices" toReformat="true" toShortenFQNames="true">
-    <variable name="PropertyName" expression="&quot;PropertyName&quot;" defaultValue="" alwaysStopAt="true" />
-    <variable name="PropertyType" expression="className()" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-p-def" value="public $PropertyType$ default$PropertyName$() {&#10;    return $END$null; // TODO: return default for property when first created&#10;}" description="Apache Isis Property default" toReformat="true" toShortenFQNames="true">
-    <variable name="PropertyName" expression="&quot;PropertyName&quot;" defaultValue="" alwaysStopAt="true" />
-    <variable name="PropertyType" expression="className()" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-p-dis" value="public String disable$PropertyName$() {&#10;    return $END$null; // TODO: return reason why property is disabled, null if editable&#10;}" description="Apache Isis Property disablement" toReformat="true" toShortenFQNames="true">
-    <variable name="PropertyName" expression="&quot;PropertyName&quot;" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-p-hid" value="public boolean hide$PropertyName$() {&#10;  return $END$false; // TODO: return true if hidden, false if visible&#10; }" description="Apache Isis Property visibility" toReformat="true" toShortenFQNames="true">
-    <variable name="PropertyName" expression="&quot;PropertyName&quot;" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-p-val" value="public String validate$PropertyName$(final $PropertyType$ $propertyName$) {&#10;  if ($propertyName$ == null) return null;&#10;  return $END$null; // TODO: return reason why proposed value is invalid, null if valid&#10; }" description="Apache Isis Property validation" toReformat="true" toShortenFQNames="true">
-    <variable name="PropertyName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
-    <variable name="PropertyType" expression="className()" defaultValue="" alwaysStopAt="true" />
-    <variable name="propertyName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-obj-events" value="//region &gt; domain events&#10;public static abstract class PropertyDomainEvent&lt;T&gt;&#10;        extends org.apache.isis.applib.services.eventbus.PropertyDomainEvent&lt;$EntityName$,T&gt; {&#10;}&#10;public static abstract class CollectionDomainEvent&lt;T&gt;&#10;        extends org.apache.isis.applib.services.eventbus.CollectionDomainEvent&lt;$EntityName$,T&gt; {&#10;}&#10;public static abstract class ActionDomainEvent&#10;        extends org.apache.isis.applib.services.eventbus.ActionDomainEvent&lt;$EntityName$&gt; {&#10;}&#10;//endregion&#10;" description="Apache Isis Object: abstract domain events declarations" toReformat="true" toShortenFQNames="true">
-    <variable name="EntityName" expression="className()" defaultValue="" alwaysStopAt="false" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-obj-region" value="//region &gt; $Region$ &#10;$END$ &#10;//endregion" description="Apache Isis Region" toReformat="true" toShortenFQNames="true">
-    <variable name="Region" expression="&quot;Region&quot;" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-obj-standard" value="//region &gt; compareTo, toString&#10;@Override&#10;public int compareTo(final $EntityName$ other) {&#10;    return org.apache.isis.applib.util.ObjectContracts.compare(this, other, &quot;$property$&quot;);&#10;}&#10;@Override&#10;public String toString() {&#10;    return org.apache.isis.applib.util.ObjectContracts.toString(this, &quot;$property$&quot;);&#10;}&#10;//endregion&#10;" description="Apache Isis Object: standard methods (compareTo, toString)" toReformat="true" toShortenFQNames="true">
-    <variable name="EntityName" expression="className()" defaultValue="" alwaysStopAt="false" />
-    <variable name="property" expression="" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-obj-validate" value="public String validate() {&#10;    $END$// TODO: return reason why object is in invalid state (and so cannot be saved/updated), or null if ok&#10;}" description="Apache Isis Object: validate method" toReformat="true" toShortenFQNames="true">
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-p-jdo-11c" value="@javax.jdo.annotations.Column(allowsNull=&quot;$trueOrFalse$&quot;)&#10;@javax.jdo.annotations.Persistent(mappedBy=&quot;$fieldOnChild$&quot;)&#10;@lombok.Getter @lombok.Setter&#10;private $PropertyType$ $propertyName$;&#10;" description="Apache Isis Property (JDO, 1:1 bidirectional parent to foreign key)" toReformat="true" toShortenFQNames="false">
-    <variable name="PropertyType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
-    <variable name="propertyName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
-    <variable name="fieldOnChild" expression="" defaultValue="" alwaysStopAt="true" />
-    <variable name="trueOrFalse" expression="" defaultValue="false" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-c-event-decl" value="public static class $CollectionName$DomainEvent extends CollectionDomainEvent&lt;$ElementType$&gt;{}&#10;@org.apache.isis.applib.annotation.Collection(&#10;        domainEvent = $CollectionName$DomainEvent.class&#10;)&#10;" description="Apache Isis Collection (domain event declaration only)" toReformat="true" toShortenFQNames="true">
-    <variable name="ElementType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
-    <variable name="CollectionName" expression="capitalize(collectionName)" defaultValue="" alwaysStopAt="false" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-  <template name="ai-p-event-decl" value="public static class $PropertyName$DomainEvent extends PropertyDomainEvent&lt;$ElementType$&gt;{}&#10;@org.apache.isis.applib.annotation.Property(&#10;        domainEvent = $PropertyName$DomainEvent.class&#10;)&#10;" description="Apache Isis Property (domain event declaration only)" toReformat="true" toShortenFQNames="true">
-    <variable name="ElementType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
-    <variable name="PropertyName" expression="" defaultValue="" alwaysStopAt="true" />
-    <context>
-      <option name="HTML" value="false" />
-      <option name="XML" value="false" />
-      <option name="JAVA_CODE" value="false" />
-      <option name="JAVA_DECLARATION" value="true" />
-      <option name="JAVA_COMMENT" value="false" />
-      <option name="JAVA_STRING" value="false" />
-      <option name="COMPLETION" value="false" />
-      <option name="OTHER" value="false" />
-    </context>
-  </template>
-</templateSet>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/adocs/documentation/src/main/asciidoc/resources/templates/isis-template-idea.xml
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/resources/templates/isis-template-idea.xml b/adocs/documentation/src/main/asciidoc/resources/templates/isis-template-idea.xml
new file mode 100644
index 0000000..916bceb
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/resources/templates/isis-template-idea.xml
@@ -0,0 +1,522 @@
+<templateSet group="Apache Isis">
+  <template name="isa" value="@org.apache.isis.applib.annotation.Action()&#10;public $ReturnType$ $actionName$(final $ParameterType$ $parameterType$) {&#10;    return $END$null; // TODO: business logic here&#10;}&#10;" description="Apache Isis Action" toReformat="true" toShortenFQNames="true">
+    <variable name="actionName" expression="&quot;actionName&quot;" defaultValue="" alwaysStopAt="true" />
+    <variable name="ParameterType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
+    <variable name="parameterType" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
+    <variable name="ReturnType" expression="className()" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isa-p-auto" value="public java.util.Collection&lt;$ParameterType$&gt; autoComplete$ParameterNum$$ActionName$(final String search) {&#10;    return $END$com.google.common.collect.Lists.newArrayList(); // TODO: return list of choices for argument N&#10;}" description="Apache Isis Action parameter auto-complete" toReformat="true" toShortenFQNames="true">
+    <variable name="ParameterNum" expression="&quot;Num&quot;" defaultValue="" alwaysStopAt="true" />
+    <variable name="ActionName" expression="&quot;ActionName&quot;" defaultValue="" alwaysStopAt="true" />
+    <variable name="ParameterType" expression="className()" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isa-p-cho" value="public java.util.List&lt;$ParameterType$&gt; choices$ParameterNum$$ActionName$() {&#10;    return $END$com.google.common.collect.Lists.newArrayList(); // TODO: return list of choices for argument N&#10;}" description="Apache Isis Action parameter choices" toReformat="true" toShortenFQNames="true">
+    <variable name="ParameterNum" expression="&quot;Num&quot;" defaultValue="" alwaysStopAt="true" />
+    <variable name="ActionName" expression="&quot;ActionName&quot;" defaultValue="" alwaysStopAt="true" />
+    <variable name="ParameterType" expression="className()" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isa-p-def" value="public $ParameterType$ default$ParameterNum$$ActionName$() {&#10;    return $END$null; // TODO: return default for argument N&#10;}" description="Apache Isis Action parameter defaults" toReformat="true" toShortenFQNames="true">
+    <variable name="ParameterNum" expression="&quot;Num&quot;" defaultValue="" alwaysStopAt="true" />
+    <variable name="ActionName" expression="&quot;ActionName&quot;" defaultValue="" alwaysStopAt="true" />
+    <variable name="ParameterType" expression="className()" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isa-p-val" value="public String validate$ParamNum}$ActionName$(final $ParameterType$ $parameterType$) {&#10;    return $END$null; // TODO: return reason why action argument are invalid, null if ok&#10;}" description="Apache Isis Action parameter validation" toReformat="true" toShortenFQNames="true">
+    <variable name="ActionName" expression="&quot;ActionName&quot;" defaultValue="" alwaysStopAt="true" />
+    <variable name="ParameterType" expression="className()" defaultValue="" alwaysStopAt="true" />
+    <variable name="parameterType" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isa-dis" value="public String disable$ActionName$() {&#10;    return $END$null; // TODO: return reason why action disabled, null if enabled&#10;}" description="Apache Isis Action disablement" toReformat="true" toShortenFQNames="true">
+    <variable name="ActionName" expression="&quot;ActionName&quot;" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isa-event" value="public static class $ActionName$DomainEvent extends ActionDomainEvent{}&#10;@org.apache.isis.applib.annotation.Action(&#10;        domainEvent = $ActionName$DomainEvent.class&#10;)&#10;public $ReturnType$ $actionName$(final $ParameterType$ $parameterType$) {&#10;    return $END$null; // TODO: business logic here&#10;}&#10;" description="Apache Isis Action (with domain event)" toReformat="true" toShortenFQNames="true">
+    <variable name="actionName" expression="&quot;actionName&quot;" defaultValue="" alwaysStopAt="true" />
+    <variable name="ActionName" expression="capitalize(actionName)" defaultValue="" alwaysStopAt="false" />
+    <variable name="ParameterType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
+    <variable name="parameterType" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
+    <variable name="ReturnType" expression="className()" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isa-event-decl" value="public static class $ActionName$DomainEvent extends ActionDomainEvent{}&#10;@org.apache.isis.applib.annotation.Action(&#10;        domainEvent = $ActionName$DomainEvent.class&#10;)&#10;" description="Apache Isis Action (domain event declaration only)" toReformat="true" toShortenFQNames="true">
+    <variable name="ActionName" expression="" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isa-hid" value="public boolean hide$ActionName$() {&#10;    return $END$false; // TODO: return true if action is hidden, false if visible&#10;}" description="Apache Isis Action visibility" toReformat="true" toShortenFQNames="true">
+    <variable name="ActionName" expression="&quot;ActionName&quot;" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isa-val" value="public String validate$ActionName$(final $ParameterType$ $parameterType$) {&#10;    return $END$null; // TODO: return reason why action arguments are invalid, null if ok&#10;}" description="Apache Isis Action validation" toReformat="true" toShortenFQNames="true">
+    <variable name="ActionName" expression="&quot;ActionName&quot;" defaultValue="" alwaysStopAt="true" />
+    <variable name="ParameterType" expression="className()" defaultValue="" alwaysStopAt="true" />
+    <variable name="parameterType" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isc-dis" value="public String disable$CollectionName$() {&#10;    return $END$null; // TODO: return reason why collection read-only, null if editable&#10;}" description="Apache Isis Collection disablement" toReformat="true" toShortenFQNames="true">
+    <variable name="CollectionName" expression="&quot;CollectionName&quot;" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isc-hid" value="public boolean hide$CollectionName$() {&#10;    return $END$false; // TODO: return true if hidden, false otherwise&#10;}" description="Apache Isis Collection visibility" toReformat="true" toShortenFQNames="false">
+    <variable name="CollectionName" expression="&quot;CollectionName&quot;" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isc-jdo-1m-b-fk" value="@org.apache.isis.applib.annotation.Collection()&#10;@javax.jdo.annotations.Persistent(mappedBy=&quot;$elementNameInChild$&quot;, dependentElement=&quot;$trueOrFalse$&quot;)&#10;@lombok.Getter @lombok.Setter&#10;private java.util.SortedSet&lt;$ElementType$&gt; $collectionName$ = new java.util.TreeSet&lt;$ElementType$&gt;();&#10;" description="Apache Isis Collection (JDO, 1:m parent bidirectional to foreign key)" toReformat="true" toShortenFQNames="true">
+    <variable name="ElementType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
+    <variable name="collectionName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
+    <variable name="elementNameInChild" expression="decapitalize(EntityName)" defaultValue="" alwaysStopAt="false" />
+    <variable name="trueOrFalse" expression="&quot;trueOrFalse&quot;" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isc-jdo-1m-b-jt" value="@org.apache.isis.applib.annotation.Collection()&#10;@javax.jdo.annotations.Persistent(mappedBy=&quot;$elementNameInChild$&quot;, dependentElement=&quot;$trueOrFalse$&quot;)&#10;@javax.jdo.annotations.Join&#10;@lombok.Getter @lombok.Setter&#10;private java.util.SortedSet&lt;$ElementType$&gt; $collectionName$ = new java.util.TreeSet&lt;$ElementType$&gt;();&#10;" description="Apache Isis Collection (JDO, 1:m parent bidirectional to join table)" toReformat="true" toShortenFQNames="true">
+    <variable name="ElementType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
+    <variable name="collectionName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
+    <variable name="elementNameInChild" expression="decapitalize(EntityName)" defaultValue="" alwaysStopAt="false" />
+    <variable name="trueOrFalse" expression="&quot;trueOrFalse&quot;" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isc-jdo-1m-u-fk" value="@org.apache.isis.applib.annotation.Collection()&#10;@javax.jdo.annotations.Element(column=&quot;$ColumnName$&quot;, dependent=&quot;$trueOrFalse$&quot;)&#10;@lombok.Getter @lombok.Setter&#10;private java.util.SortedSet&lt;$ElementType$&gt; $collectionName$ = new java.util.TreeSet&lt;$ElementType$&gt;();&#10;" description="Apache Isis JDO Collection (1:m parent unidirectional)" toReformat="true" toShortenFQNames="true">
+    <variable name="ElementType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
+    <variable name="collectionName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
+    <variable name="ColumnName" expression="&quot;ColumnName&quot;" defaultValue="" alwaysStopAt="true" />
+    <variable name="trueOrFalse" expression="&quot;trueOrFalse&quot;" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isc-jdo-1m-u-jt" value="@org.apache.isis.applib.annotation.Collection()&#10;@javax.jdo.annotations.Join&#10;@javax.jdo.annotations.Element(dependent=&quot;$trueOrFalse$&quot;)&#10;@lombok.Getter @lombok.Setter&#10;private java.util.SortedSet&lt;$ElementType$&gt; $collectionName$ = new java.util.TreeSet&lt;$ElementType$&gt;();&#10;" description="Apache Isis Collection (JDO, 1:m parent unidirectional to join table)" toReformat="true" toShortenFQNames="true">
+    <variable name="ElementType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
+    <variable name="collectionName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
+    <variable name="trueOrFalse" expression="&quot;trueOrFalse&quot;" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isc-jdo-mn-ub-c" value="@org.apache.isis.applib.annotation.Collection()&#10;@javax.jdo.annotations.Persistent(mappedBy=&quot;$ChildCollectionNameInParent$&quot;)&#10;@lombok.Getter @lombok.Setter&#10;private java.util.SortedSet&lt;$ElementType$&gt; $collectionName$ = new java.util.TreeSet&lt;$ElementType$&gt;(); &#10;" description="Apache Isis Collection (JDO, m:n child)" toReformat="true" toShortenFQNames="true">
+    <variable name="ElementType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
+    <variable name="collectionName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
+    <variable name="ChildCollectionNameInParent" expression="&quot;ChildCollectionNameInParent&quot;" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isc-jdo-mn-ub-p" value="@org.apache.isis.applib.annotation.Collection()&#10;@javax.jdo.annotations.Persistent(table=&quot;$TableName$&quot;) &#10;@javax.jdo.annotations.Join(column=&quot;$ThisEntityFieldName$&quot;) &#10;@javax.jdo.annotations.Element(column=&quot;$RelatedEntityFieldName$&quot;)&#10;@lombok.Getter @lombok.Setter&#10;private java.util.SortedSet&lt;$ElementType$&gt; $collectionName$ = new java.util.TreeSet&lt;$ElementType$&gt;();&#10;" description="Apache Isis Collection (JDO, m:n parent)" toReformat="true" toShortenFQNames="true">
+    <variable name="ElementType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
+    <variable name="collectionName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
+    <variable name="TableName" expression="&quot;TableName&quot;" defaultValue="" alwaysStopAt="true" />
+    <variable name="ThisEntityFieldName" expression="&quot;ThisEntityFieldName&quot;" defaultValue="" alwaysStopAt="true" />
+    <variable name="RelatedEntityFieldName" expression="&quot;RelatedEntityFieldName&quot;" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isds-subscriber-on" value="@com.google.common.eventbus.Subscribe&#10;public void on(final $EventType$ ev) {&#10;    // TODO&#10;}&#10;" description="Apache Isis Domain Service Subscriber &quot;on&quot; event" toReformat="false" toShortenFQNames="true">
+    <variable name="EventType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="JAVA_DECLARATION" value="true" />
+    </context>
+  </template>
+  <template name="isjaxb-package.info" value="@javax.xml.bind.annotation.XmlSchema(&#10;        namespace = &quot;http://$namespaceBase$/$namespaceSuffix$/v$versionMajor$_$versionMinor$/$namespaceSuffix$.xsd&quot;,&#10;        xmlns = {&#10;                @javax.xml.bind.annotation.XmlNs(&#10;                        namespaceURI = &quot;http://isis.apache.org/schema/common&quot;,&#10;                        prefix = &quot;common&quot;&#10;                ),&#10;        },&#10;        elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED&#10;)" toReformat="false" toShortenFQNames="true">
+    <variable name="namespaceBase" expression="        groovyScript(&quot;def str = _1; def list = str.split(\&quot;\\\\.\&quot;); def revlist = list.reverse(); def ret = revlist.iterator().join(\&quot;.\&quot;); return ret&quot;, currentPackage())" defaultValue="" alwaysStopAt="true" />
+    <variable name="namespaceSuffix" expression="groovyScript(&quot;def str = _1; def list = str.split(\&quot;\\\\.\&quot;); def revlist = list.reverse(); def ret = revlist[0]; return ret&quot;, currentPackage())" defaultValue="" alwaysStopAt="true" />
+    <variable name="versionMajor" expression="" defaultValue="1" alwaysStopAt="true" />
+    <variable name="versionMinor" expression="" defaultValue="0" alwaysStopAt="true" />
+    <context>
+      <option name="JAVA_DECLARATION" value="true" />
+    </context>
+  </template>
+  <template name="isinject" value="@javax.inject.Inject&#10;$ServiceType$ $serviceType$;&#10;" description="Apache Isis Injected Dependency Service" toReformat="true" toShortenFQNames="true">
+    <variable name="ServiceType" expression="className()" defaultValue="" alwaysStopAt="true" />
+    <variable name="serviceType" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isid" value="//region &gt; title, icon etc&#10;public String title() {&#10;    final org.apache.isis.applib.util.TitleBuffer buf = new org.apache.isis.applib.util.TitleBuffer();&#10;    $END$// TODO: append to org.apache.isis.applib.util.TitleBuffer, typically value properties&#10;    return buf.toString();&#10;}&#10;public String iconName() {&#10;    return null; // TODO: return icon name (suffix)&#10;}&#10;public String cssClass() {&#10;    return null; // TODO: return CSS class name&#10;}&#10;//endregion" description="Apache Isis Identification region" toReformat="true" toShortenFQNames="true">
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isnew" value="$Type$ $type$ = $container$.newTransientInstance($Type$.class);&#10;$END$// TODO: set up any properties&#10;&#10;$container$.persist($type$);&#10;" description="Apache Isis Commonly used method (factory for persistent)" toReformat="true" toShortenFQNames="true">
+    <variable name="Type" expression="className()" defaultValue="" alwaysStopAt="true" />
+    <variable name="type" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
+    <variable name="container" expression="&quot;container&quot;" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_STATEMENT" value="true" />
+      <option name="JAVA_EXPRESSION" value="false" />
+      <option name="JAVA_DECLARATION" value="false" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isp-jdo" value="@org.apache.isis.applib.annotation.Property()&#10;@javax.jdo.annotations.Column(allowsNull=&quot;$trueOrFalse$&quot;)&#10;@lombok.Getter @lombok.Setter&#10;private $PropertyType$ $propertyName$;&#10;" description="Apache Isis Property (JDO)" toReformat="true" toShortenFQNames="false">
+    <variable name="PropertyType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
+    <variable name="propertyName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
+    <variable name="trueOrFalse" expression="" defaultValue="false" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isp-auto" value="public java.util.Collection&lt;$PropertyType$&gt; autoComplete$PropertyName$(final String search) {&#10;    return $END$com.google.common.collect.Lists.newArrayList(); // TODO: return list of choices for property&#10;}" description="Apache Isis Property auto-complete" toReformat="true" toShortenFQNames="true">
+    <variable name="PropertyName" expression="&quot;PropertyName&quot;" defaultValue="" alwaysStopAt="true" />
+    <variable name="PropertyType" expression="className()" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isp-cho" value="public java.util.Collection&lt;$PropertyType$&gt; choices$PropertyName$() {&#10;    return $END$com.google.common.collect.Lists.newArrayList(); // TODO: return list of choices for property&#10;}" description="Apache Isis Property choices" toReformat="true" toShortenFQNames="true">
+    <variable name="PropertyName" expression="&quot;PropertyName&quot;" defaultValue="" alwaysStopAt="true" />
+    <variable name="PropertyType" expression="className()" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isp-def" value="public $PropertyType$ default$PropertyName$() {&#10;    return $END$null; // TODO: return default for property when first created&#10;}" description="Apache Isis Property default" toReformat="true" toShortenFQNames="true">
+    <variable name="PropertyName" expression="&quot;PropertyName&quot;" defaultValue="" alwaysStopAt="true" />
+    <variable name="PropertyType" expression="className()" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isp-dis" value="public String disable$PropertyName$() {&#10;    return $END$null; // TODO: return reason why property is disabled, null if editable&#10;}" description="Apache Isis Property disablement" toReformat="true" toShortenFQNames="true">
+    <variable name="PropertyName" expression="&quot;PropertyName&quot;" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isp-hid" value="public boolean hide$PropertyName$() {&#10;  return $END$false; // TODO: return true if hidden, false if visible&#10; }" description="Apache Isis Property visibility" toReformat="true" toShortenFQNames="true">
+    <variable name="PropertyName" expression="&quot;PropertyName&quot;" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isp-val" value="public String validate$PropertyName$(final $PropertyType$ $propertyName$) {&#10;  if ($propertyName$ == null) return null;&#10;  return $END$null; // TODO: return reason why proposed value is invalid, null if valid&#10; }" description="Apache Isis Property validation" toReformat="true" toShortenFQNames="true">
+    <variable name="PropertyName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
+    <variable name="PropertyType" expression="className()" defaultValue="" alwaysStopAt="true" />
+    <variable name="propertyName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isobj-events" value="//region &gt; domain events&#10;public static abstract class PropertyDomainEvent&lt;T&gt;&#10;        extends org.apache.isis.applib.services.eventbus.PropertyDomainEvent&lt;$EntityName$,T&gt; {&#10;}&#10;public static abstract class CollectionDomainEvent&lt;T&gt;&#10;        extends org.apache.isis.applib.services.eventbus.CollectionDomainEvent&lt;$EntityName$,T&gt; {&#10;}&#10;public static abstract class ActionDomainEvent&#10;        extends org.apache.isis.applib.services.eventbus.ActionDomainEvent&lt;$EntityName$&gt; {&#10;}&#10;//endregion&#10;" description="Apache Isis Object: abstract domain events declarations" toReformat="true" toShortenFQNames="true">
+    <variable name="EntityName" expression="className()" defaultValue="" alwaysStopAt="false" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isobj-region" value="//region &gt; $Region$ &#10;$END$ &#10;//endregion" description="Apache Isis Region" toReformat="true" toShortenFQNames="true">
+    <variable name="Region" expression="&quot;Region&quot;" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isobj-standard" value="//region &gt; compareTo, toString&#10;@Override&#10;public int compareTo(final $EntityName$ other) {&#10;    return org.apache.isis.applib.util.ObjectContracts.compare(this, other, &quot;$property$&quot;);&#10;}&#10;@Override&#10;public String toString() {&#10;    return org.apache.isis.applib.util.ObjectContracts.toString(this, &quot;$property$&quot;);&#10;}&#10;//endregion&#10;" description="Apache Isis Object: standard methods (compareTo, toString)" toReformat="true" toShortenFQNames="true">
+    <variable name="EntityName" expression="className()" defaultValue="" alwaysStopAt="false" />
+    <variable name="property" expression="" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isobj-validate" value="public String validate() {&#10;    $END$// TODO: return reason why object is in invalid state (and so cannot be saved/updated), or null if ok&#10;}" description="Apache Isis Object: validate method" toReformat="true" toShortenFQNames="true">
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isp-jdo-11c" value="@javax.jdo.annotations.Column(allowsNull=&quot;$trueOrFalse$&quot;)&#10;@javax.jdo.annotations.Persistent(mappedBy=&quot;$fieldOnChild$&quot;)&#10;@lombok.Getter @lombok.Setter&#10;private $PropertyType$ $propertyName$;&#10;" description="Apache Isis Property (JDO, 1:1 bidirectional parent to foreign key)" toReformat="true" toShortenFQNames="false">
+    <variable name="PropertyType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
+    <variable name="propertyName" expression="suggestVariableName()" defaultValue="" alwaysStopAt="true" />
+    <variable name="fieldOnChild" expression="" defaultValue="" alwaysStopAt="true" />
+    <variable name="trueOrFalse" expression="" defaultValue="false" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isc-event-decl" value="public static class $CollectionName$DomainEvent extends CollectionDomainEvent&lt;$ElementType$&gt;{}&#10;@org.apache.isis.applib.annotation.Collection(&#10;        domainEvent = $CollectionName$DomainEvent.class&#10;)&#10;" description="Apache Isis Collection (domain event declaration only)" toReformat="true" toShortenFQNames="true">
+    <variable name="ElementType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
+    <variable name="CollectionName" expression="capitalize(collectionName)" defaultValue="" alwaysStopAt="false" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+  <template name="isp-event-decl" value="public static class $PropertyName$DomainEvent extends PropertyDomainEvent&lt;$ElementType$&gt;{}&#10;@org.apache.isis.applib.annotation.Property(&#10;        domainEvent = $PropertyName$DomainEvent.class&#10;)&#10;" description="Apache Isis Property (domain event declaration only)" toReformat="true" toShortenFQNames="true">
+    <variable name="ElementType" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
+    <variable name="PropertyName" expression="" defaultValue="" alwaysStopAt="true" />
+    <context>
+      <option name="HTML" value="false" />
+      <option name="XML" value="false" />
+      <option name="JAVA_CODE" value="false" />
+      <option name="JAVA_DECLARATION" value="true" />
+      <option name="JAVA_COMMENT" value="false" />
+      <option name="JAVA_STRING" value="false" />
+      <option name="COMPLETION" value="false" />
+      <option name="OTHER" value="false" />
+    </context>
+  </template>
+</templateSet>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/applib/src/main/java/org/apache/isis/applib/annotation/DomainObject.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/DomainObject.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/DomainObject.java
index 86509c3..0621def 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/DomainObject.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/DomainObject.java
@@ -24,6 +24,14 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
+import org.apache.isis.applib.services.eventbus.ObjectCreatedEvent;
+import org.apache.isis.applib.services.eventbus.ObjectLoadedEvent;
+import org.apache.isis.applib.services.eventbus.ObjectPersistedEvent;
+import org.apache.isis.applib.services.eventbus.ObjectPersistingEvent;
+import org.apache.isis.applib.services.eventbus.ObjectRemovingEvent;
+import org.apache.isis.applib.services.eventbus.ObjectUpdatedEvent;
+import org.apache.isis.applib.services.eventbus.ObjectUpdatingEvent;
+
 /**
  * Domain semantics for domain objects (entities and view models; for services see {@link org.apache.isis.applib.annotation.DomainService}).
  */
@@ -147,4 +155,87 @@ public @interface DomainObject {
      */
     Nature nature() default Nature.NOT_SPECIFIED;
 
+
+    // //////////////////////////////////////
+
+
+    /**
+     * Indicates that the loading of the domain object should be posted to the
+     * {@link org.apache.isis.applib.services.eventbus.EventBusService event bus} using a custom (subclass of)
+     * {@link org.apache.isis.applib.services.eventbus.ObjectCreatedEvent}.
+     *
+     * <p>
+     * This subclass must provide a no-arg constructor; the fields are set reflectively.
+     * </p>
+     */
+    Class<? extends ObjectCreatedEvent<?>> createdLifecycleEvent() default ObjectCreatedEvent.Default.class;
+
+    /**
+     * Indicates that the loading of the domain object should be posted to the
+     * {@link org.apache.isis.applib.services.eventbus.EventBusService event bus} using a custom (subclass of)
+     * {@link org.apache.isis.applib.services.eventbus.ObjectPersistingEvent}.
+     *
+     * <p>
+     * This subclass must provide a no-arg constructor; the fields are set reflectively.
+     * </p>
+     */
+    Class<? extends ObjectPersistingEvent<?>> persistingLifecycleEvent() default ObjectPersistingEvent.Default.class;
+
+    /**
+     * Indicates that the loading of the domain object should be posted to the
+     * {@link org.apache.isis.applib.services.eventbus.EventBusService event bus} using a custom (subclass of)
+     * {@link org.apache.isis.applib.services.eventbus.ObjectPersistedEvent}.
+     *
+     * <p>
+     * This subclass must provide a no-arg constructor; the fields are set reflectively.
+     * </p>
+     */
+    Class<? extends ObjectPersistedEvent<?>> persistedLifecycleEvent() default ObjectPersistedEvent.Default.class;
+
+    /**
+     * Indicates that the loading of the domain object should be posted to the
+     * {@link org.apache.isis.applib.services.eventbus.EventBusService event bus} using a custom (subclass of)
+     * {@link org.apache.isis.applib.services.eventbus.ObjectLoadedEvent}.
+     *
+     * <p>
+     * This subclass must provide a no-arg constructor; the fields are set reflectively.
+     * </p>
+     */
+    Class<? extends ObjectLoadedEvent<?>> loadedLifecycleEvent() default ObjectLoadedEvent.Default.class;
+
+    /**
+     * Indicates that the loading of the domain object should be posted to the
+     * {@link org.apache.isis.applib.services.eventbus.EventBusService event bus} using a custom (subclass of)
+     * {@link org.apache.isis.applib.services.eventbus.ObjectUpdatingEvent}.
+     *
+     * <p>
+     * This subclass must provide a no-arg constructor; the fields are set reflectively.
+     * </p>
+     */
+    Class<? extends ObjectUpdatingEvent<?>> updatingLifecycleEvent() default ObjectUpdatingEvent.Default.class;
+
+    /**
+     * Indicates that the loading of the domain object should be posted to the
+     * {@link org.apache.isis.applib.services.eventbus.EventBusService event bus} using a custom (subclass of)
+     * {@link org.apache.isis.applib.services.eventbus.ObjectUpdatedEvent}.
+     *
+     * <p>
+     * This subclass must provide a no-arg constructor; the fields are set reflectively.
+     * </p>
+     */
+    Class<? extends ObjectUpdatedEvent<?>> updatedLifecycleEvent() default ObjectUpdatedEvent.Default.class;
+
+
+    /**
+     * Indicates that the loading of the domain object should be posted to the
+     * {@link org.apache.isis.applib.services.eventbus.EventBusService event bus} using a custom (subclass of)
+     * {@link org.apache.isis.applib.services.eventbus.ObjectRemovingEvent}.
+     *
+     * <p>
+     * This subclass must provide a no-arg constructor; the fields are set reflectively.
+     * </p>
+     */
+    Class<? extends ObjectRemovingEvent<?>> removingLifecycleEvent() default ObjectRemovingEvent.Default.class;
+
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectCreatedEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectCreatedEvent.java b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectCreatedEvent.java
index 5aceb5b..df5e38f 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectCreatedEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectCreatedEvent.java
@@ -22,6 +22,13 @@ public abstract class ObjectCreatedEvent<S> extends AbstractLifecycleEvent<S> {
 
     private static final long serialVersionUID = 1L;
 
+    //region > Default class
+    /**
+     * This class is the default for the
+     * {@link org.apache.isis.applib.annotation.DomainObject#createdLifecycleEvent()} annotation attribute.  Whether this
+     * raises an event or not depends upon the "isis.reflector.facet.domainObjectAnnotation.createdLifecycleEvent.postForDefault"
+     * configuration property.
+     */
     public static class Default extends ObjectCreatedEvent<Object> {
         private static final long serialVersionUID = 1L;
         public Default() {}
@@ -31,6 +38,29 @@ public abstract class ObjectCreatedEvent<S> extends AbstractLifecycleEvent<S> {
             return "ObjectCreatedEvent$Default{source=" + getSource() + "}";
         }
     }
+    //endregion
+
+    //region > Noop class
+
+    /**
+     * Convenience class to use indicating that an event should <i>not</i> be posted (irrespective of the configuration
+     * property setting for the {@link Default} event.
+     */
+    public static class Noop extends ObjectCreatedEvent<Object> {
+        private static final long serialVersionUID = 1L;
+    }
+    //endregion
+
+    //region > Doop class
+
+    /**
+     * Convenience class meaning that an event <i>should</i> be posted (irrespective of the configuration
+     * property setting for the {@link Default} event..
+     */
+    public static class Doop extends ObjectCreatedEvent<Object> {
+        private static final long serialVersionUID = 1L;
+    }
+    //endregion
 
     public ObjectCreatedEvent() {
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectLoadedEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectLoadedEvent.java b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectLoadedEvent.java
index 85aa91e..7ae28dc 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectLoadedEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectLoadedEvent.java
@@ -22,6 +22,13 @@ public abstract class ObjectLoadedEvent<S> extends AbstractLifecycleEvent<S> {
 
     private static final long serialVersionUID = 1L;
 
+    //region > Default class
+    /**
+     * This class is the default for the
+     * {@link org.apache.isis.applib.annotation.DomainObject#loadedLifecycleEvent()} annotation attribute.  Whether this
+     * raises an event or not depends upon the "isis.reflector.facet.domainObjectAnnotation.loadedLifecycleEvent.postForDefault"
+     * configuration property.
+     */
     public static class Default extends ObjectLoadedEvent<Object> {
         private static final long serialVersionUID = 1L;
         public Default() {}
@@ -31,6 +38,31 @@ public abstract class ObjectLoadedEvent<S> extends AbstractLifecycleEvent<S> {
             return "ObjectLoadedEvent$Default{source=" + getSource() + "}";
         }
     }
+    //endregion
+
+    //region > Noop class
+
+    /**
+     * Convenience class to use indicating that an event should <i>not</i> be posted (irrespective of the configuration
+     * property setting for the {@link Default} event.
+     */
+    public static class Noop extends ObjectLoadedEvent<Object> {
+        private static final long serialVersionUID = 1L;
+    }
+    //endregion
+
+    //region > Doop class
+
+    /**
+     * Convenience class meaning that an event <i>should</i> be posted (irrespective of the configuration
+     * property setting for the {@link Default} event..
+     */
+    public static class Doop extends ObjectLoadedEvent<Object> {
+        private static final long serialVersionUID = 1L;
+    }
+    //endregion
+
+
 
     public ObjectLoadedEvent() {
     }


[5/5] isis git commit: ISIS-803: new annotation attributes allowing suclasses of the lifecycle events to be posted (or disabled altogether). also updated docs.

Posted by da...@apache.org.
ISIS-803: new annotation attributes allowing suclasses of the lifecycle events to be posted (or disabled altogether).  also updated docs.


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

Branch: refs/heads/master
Commit: 8cf480de9371c3ba55a5ca39406ce11a471f3b6e
Parents: 06bbb1e
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Nov 25 18:22:37 2015 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Nov 25 18:22:37 2015 +0000

----------------------------------------------------------------------
 .../main/asciidoc/guides/_cg_ide-templates.adoc |  58 ++-
 .../_rg_annotations_manpage-DomainObject.adoc   |  53 +-
 ...page-DomainObjectLayout_cssClassUiEvent.adoc |   7 +-
 ..._manpage-DomainObjectLayout_iconUiEvent.adoc |   6 +-
 ...manpage-DomainObjectLayout_titleUiEvent.adoc |   5 +-
 ...page-DomainObject_createdLifecycleEvent.adoc | 108 ++++
 ...npage-DomainObject_loadedLifecycleEvent.adoc | 105 ++++
 ...ge-DomainObject_persistedLifecycleEvent.adoc | 111 ++++
 ...e-DomainObject_persistingLifecycleEvent.adoc | 114 ++++
 ...age-DomainObject_removingLifecycleEvent.adoc | 114 ++++
 ...page-DomainObject_updatedLifecycleEvent.adoc | 110 ++++
 ...age-DomainObject_updatingLifecycleEvent.adoc | 114 ++++
 .../guides/_rg_runtime_configuring-core.adoc    | 134 ++++-
 .../intellij-live-templates-for-apache-isis.xml | 522 -------------------
 .../resources/templates/isis-template-idea.xml  | 522 +++++++++++++++++++
 .../isis/applib/annotation/DomainObject.java    |  91 ++++
 .../services/eventbus/ObjectCreatedEvent.java   |  30 ++
 .../services/eventbus/ObjectLoadedEvent.java    |  32 ++
 .../services/eventbus/ObjectPersistedEvent.java |  30 ++
 .../eventbus/ObjectPersistingEvent.java         |  30 ++
 .../services/eventbus/ObjectRemovingEvent.java  |  30 ++
 .../services/eventbus/ObjectUpdatedEvent.java   |  30 ++
 .../services/eventbus/ObjectUpdatingEvent.java  |  30 ++
 .../ActionDomainEventFacetAbstract.java         |   3 -
 .../callbacks/CreatedCallbackFacetAbstract.java |  35 ++
 .../callbacks/CreatedCallbackFacetFactory.java  |  62 +++
 .../CreatedCallbackFacetViaMethod.java          |  65 +++
 .../callbacks/CreatedLifecycleEventFacet.java   |  30 ++
 ...ycleEventFacetForDomainObjectAnnotation.java |  49 ++
 .../object/callbacks/LifecycleEventFacet.java   |  28 +
 .../callbacks/LoadCallbackFacetFactory.java     |  68 +++
 .../callbacks/LoadedCallbackFacetAbstract.java  |  37 ++
 .../callbacks/LoadedCallbackFacetViaMethod.java |  65 +++
 .../callbacks/LoadedLifecycleEventFacet.java    |  30 ++
 ...ycleEventFacetForDomainObjectAnnotation.java |  49 ++
 .../callbacks/LoadingCallbackFacetAbstract.java |  41 ++
 .../LoadingCallbackFacetViaMethod.java          |  69 +++
 .../callbacks/PersistCallbackFacetFactory.java  |  78 +++
 ...ersistCallbackViaSaveMethodFacetFactory.java |  78 +++
 .../PersistedCallbackFacetAbstract.java         |  37 ++
 .../PersistedCallbackFacetViaMethod.java        |  65 +++
 .../callbacks/PersistedLifecycleEventFacet.java |  30 ++
 ...ycleEventFacetForDomainObjectAnnotation.java |  49 ++
 .../PersistingCallbackFacetAbstract.java        |  37 ++
 .../PersistingCallbackFacetViaMethod.java       |  65 +++
 .../PersistingLifecycleEventFacet.java          |  30 ++
 ...ycleEventFacetForDomainObjectAnnotation.java |  50 ++
 .../callbacks/RemoveCallbackFacetFactory.java   |  78 +++
 ...moveCallbackViaDeleteMethodFacetFactory.java |  78 +++
 .../object/callbacks/RemovedCallbackFacet.java  |   2 +
 .../callbacks/RemovedCallbackFacetAbstract.java |  39 ++
 .../RemovedCallbackFacetViaMethod.java          |  69 +++
 .../RemovingCallbackFacetAbstract.java          |  37 ++
 .../RemovingCallbackFacetViaMethod.java         |  65 +++
 .../callbacks/RemovingLifecycleEventFacet.java  |  30 ++
 ...ycleEventFacetForDomainObjectAnnotation.java |  51 ++
 .../callbacks/UpdateCallbackFacetFactory.java   |  68 +++
 .../callbacks/UpdatedCallbackFacetAbstract.java |  37 ++
 .../UpdatedCallbackFacetViaMethod.java          |  65 +++
 .../callbacks/UpdatedLifecycleEventFacet.java   |  30 ++
 ...ycleEventFacetForDomainObjectAnnotation.java |  51 ++
 .../UpdatingCallbackFacetAbstract.java          |  37 ++
 .../UpdatingCallbackFacetViaMethod.java         |  69 +++
 .../callbacks/UpdatingLifecycleEventFacet.java  |  30 ++
 ...ycleEventFacetForDomainObjectAnnotation.java |  51 ++
 .../create/CreatedCallbackFacetAbstract.java    |  37 --
 .../create/CreatedCallbackFacetFactory.java     |  62 ---
 .../create/CreatedCallbackFacetViaMethod.java   |  65 ---
 .../load/LoadCallbackFacetFactory.java          |  68 ---
 .../load/LoadedCallbackFacetAbstract.java       |  37 --
 .../load/LoadedCallbackFacetViaMethod.java      |  65 ---
 .../load/LoadingCallbackFacetAbstract.java      |  41 --
 .../load/LoadingCallbackFacetViaMethod.java     |  69 ---
 .../persist/PersistCallbackFacetFactory.java    |  80 ---
 ...ersistCallbackViaSaveMethodFacetFactory.java |  80 ---
 .../persist/PersistedCallbackFacetAbstract.java |  37 --
 .../PersistedCallbackFacetViaMethod.java        |  65 ---
 .../PersistingCallbackFacetAbstract.java        |  37 --
 .../PersistingCallbackFacetViaMethod.java       |  65 ---
 .../remove/RemoveCallbackFacetFactory.java      |  80 ---
 ...moveCallbackViaDeleteMethodFacetFactory.java |  80 ---
 .../remove/RemovedCallbackFacetAbstract.java    |  37 --
 .../remove/RemovedCallbackFacetViaMethod.java   |  65 ---
 .../remove/RemovingCallbackFacetAbstract.java   |  37 --
 .../remove/RemovingCallbackFacetViaMethod.java  |  65 ---
 .../update/UpdateCallbackFacetFactory.java      |  68 ---
 .../update/UpdatedCallbackFacetAbstract.java    |  37 --
 .../update/UpdatedCallbackFacetViaMethod.java   |  65 ---
 .../update/UpdatingCallbackFacetAbstract.java   |  37 --
 .../update/UpdatingCallbackFacetViaMethod.java  |  69 ---
 .../DomainObjectAnnotationFacetFactory.java     | 156 ++++++
 .../RemoveSubscriberMethodsFacetFactory.java    |  70 +++
 .../dflt/ProgrammingModelFacetsJava5.java       |  14 +-
 .../CreatedCallbackFacetFactoryTest.java        |   4 +-
 .../DeleteCallbackFacetFactoryTest.java         |   6 +-
 .../callback/LoadCallbackFacetFactoryTest.java  |   6 +-
 .../PersistAndSaveCallbackFacetFactoryTest.java |   8 +-
 .../PersistCallbackFacetFactoryTest.java        |   6 +-
 ...RemoveAndDeleteCallbackFacetFactoryTest.java |   8 +-
 .../RemoveCallbackFacetFactoryTest.java         |   6 +-
 .../callback/SaveCallbackFacetFactoryTest.java  |   6 +-
 .../UpdateCallbackFacetFactoryTest.java         |   6 +-
 .../system/persistence/PersistenceSession.java  |  50 +-
 .../src/main/webapp/WEB-INF/isis.properties     |  10 +
 104 files changed, 4150 insertions(+), 2077 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/adocs/documentation/src/main/asciidoc/guides/_cg_ide-templates.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_cg_ide-templates.adoc b/adocs/documentation/src/main/asciidoc/guides/_cg_ide-templates.adoc
index 8cd0784..15fe40c 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_cg_ide-templates.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_cg_ide-templates.adoc
@@ -1,5 +1,5 @@
 [[_cg_ide-templates]]
-= IDE Templates
+= Code and File Templates
 :notice: 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.
 :_basedir: ../
 :_imagesdir: images/
@@ -7,48 +7,61 @@
 
 
 
-We provide IDE templates (for IntelliJ and Eclipse) for writing Apache Isis domain objects, and also for unit tests (JUnit and JMock).  We also provide them for IntelliJ for writing Asciidoc documentation (see also the xref:cg.adoc#_cg_asciidoc-templates[appendix]).
+We provide parameterized templates, for both IntelliJ and Eclipse, to help you write your domain applications.
+
+On IntelliJ we provide both file templates (`File > Settings > Editor > File and Code Templates`) and also live templates (`File > Settings > Editor > Live Templates`).  The former are used to create new classes or files (eg a new domain entity), while the latter are intended to modify an existing file (eg create a new property or add a `toString()` method etc).
+
+On Eclipse we provide only the latter sort of template (Windows > Preferences > Java > Editor > Templates).
+
+There are templates for writing Apache Isis domain objects, for writing unit tests (JUnit and JMock), and also for writing Asciidoc documentation (see also the xref:cg.adoc#_cg_asciidoc-templates[appendix]).
 
 
 == Download
 
 The following table lists the templates available to download:
 
-[cols="1a,1a,1a,1a,1a", options="header"]
+[cols="2a,2a,1a,2a,2a", options="header"]
 |===
 
-|Template
-|Prefix
-|IntelliJ
-|Eclipse
-
 
-|Apache Isis Domain Objects
-|is
+|Purpose
+|IntelliJ +
+file template
+|Prefix
+|IntelliJ +
+live template
+|Eclipse +
+template
+
+|Domain Objects
+|link:../resources/templates/intellij-settings-file-templates-for-apache-isis.jar[Download]
+|`is`
 |link:../resources/templates/isis-templates-idea.xml[Download]
 |link:../resources/templates/isis-templates.xml[Download]
 
-
 |JUnit tests
-|ju
+|(none)
+|`ju`
 |link:../resources/templates/junit4-templates-idea.xml[Download]
 |link:../resources/templates/junit4-templates.xml[Download]
 
 
 |JMock tests
-|jm
+|(none)
+|`jm`
 |link:../resources/templates/jmock2-templates-idea.xml[Download]
 |link:../resources/templates/jmock2-templates.xml[Download]
 
 |Asciidoc
-|ad
+|(none)
+|`ad`
 |link:../resources/templates/isis-asciidoc-templates-idea.xml[Download]
-|(none )
+|(none)
 
 |===
 
 
-The most commonly used Apache Isis domain objects templates are also listed on the link:../cheat-sheet.html[Apache Isis cheat sheet].
+The most commonly used domain objects (live) templates are also listed on the link:../cheat-sheet.html[Apache Isis cheat sheet].
 
 
 
@@ -56,15 +69,18 @@ The most commonly used Apache Isis domain objects templates are also listed on t
 
 === IntelliJ
 
-To install in IntelliJ (Community edition 15), copy to the relevant `config/templates` directory, eg:
+To install in the live templates IntelliJ (Community edition 15), copy to the relevant `config/templates` directory, eg:
 
-* Windows `<User home>\.IdeaIC14\config\templates`
+* Windows `<User home>\.IdeaIC15\config\templates`
 * Linux `~/.IdeaIC14/config/templates`
-* Mac OS `~/Library/Preferences/IdeaIC14/templates`
+* Mac OS `~/Library/Preferences/IdeaIC15/templates`
 
 If using the Ultimate edition, the directory is `.IntelliJIdea15` rather than `IdeaIC15`.
 
 
+To install the file templates, use `File > Import Settings`.
+
+
 === Eclipse
 
 To install in Eclipse, go to `Windows > Preferences > Java > Editor > Templates` and choose `Import`.
@@ -73,5 +89,7 @@ To install in Eclipse, go to `Windows > Preferences > Java > Editor > Templates`
 
 == Usage
 
-Enter the prefix (`is`, `ju`, `jm`) and the IDE will list all available templates in that category.  
+For the live templates, enter the prefix in the editor (`is`, `ju`, `jm`) and the IDE will list all available templates
+in that category.
 
+For the file templates (IntelliJ only), these are available from `File > New`.

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject.adoc
index 49ffa46..93bcae2 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject.adoc
@@ -41,6 +41,12 @@ The table below summarizes the annotation's attributes.
 (`false`)
 |Whether the number of instances of this domain class is relatively small (a "bounded" set), such that instances could be selected from a drop-down list box or similar.
 
+|xref:rg.adoc#_rg_annotations_manpage-DomainObject_createdLifecycleEvent[`created-` +
+`LifecycleEvent()`] +
+(`1.11.0-SNAPSHOT`)
+|subtype of `ObjectCreatedEvent` +
+(`ObjectCreatedEvent.Default`)
+|the event type to be posted to the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] whenever an instance is created
 
 |xref:rg.adoc#_rg_annotations_manpage-DomainObject_editing[`editing()`]
 |`AS_CONFIGURED`, `ENABLED`, `DISABLED` +
@@ -58,6 +64,20 @@ The table below summarizes the annotation's attributes.
 |specify an alias for the domain class used to uniquely identify the object both within the Apache Isis runtime and externally
 
 
+|xref:rg.adoc#_rg_annotations_manpage-DomainObject_persistedLifecycleEvent[`persisted-` +
+`LifecycleEvent()`] +
+(`1.11.0-SNAPSHOT`)
+|subtype of `ObjectPersistedEvent` +
+(`ObjectPersistedEvent.Default`)
+|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] whenever an instance has just been persisted
+
+|xref:rg.adoc#_rg_annotations_manpage-DomainObject_persistingLifecycleEvent[`persisting-` +
+`LifecycleEvent()`] +
+(`1.11.0-SNAPSHOT`)
+|subtype of `ObjectPersistingEvent` +
+(`ObjectPersistingEvent.Default`)
+|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] whenever an instance is about to be persisted
+
 |xref:rg.adoc#_rg_annotations_manpage-DomainObject_publishing[`publishing()`]
 |`AS_CONFIGURED`, `ENABLED`, `DISABLED` +
 (`AS_CONFIGURED`)
@@ -69,6 +89,27 @@ The table below summarizes the annotation's attributes.
 |subtype of `PublishingPayloadFactory-` `ForObject` (none)
 |specifies that a custom implementation of `PublishingPayloadFactoryForObject` be used to create the (payload of the) published event representing the change to the object
 
+|xref:rg.adoc#_rg_annotations_manpage-DomainObject_removingLifecycleEvent[`removing-` +
+`LifecycleEvent()`] +
+(`1.11.0-SNAPSHOT`)
+|subtype of `ObjectRemovingEvent` +
+(`ObjectRemovingEvent.Default`)
+|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] whenever an instance is about to be deleted
+
+|xref:rg.adoc#_rg_annotations_manpage-DomainObject_updatedLifecycleEvent[`updated-` +
+`LifecycleEvent()`] +
+(`1.11.0-SNAPSHOT`)
+|subtype of `ObjectUpdatedEvent` +
+(`ObjectUpdatedEvent.Default`)
+|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] whenever an instance has just been updated
+
+|xref:rg.adoc#_rg_annotations_manpage-DomainObject_updatingLifecycleEvent[`updating-` +
+`LifecycleEvent()`] +
+(`1.11.0-SNAPSHOT`)
+|subtype of `ObjectUpdatingEvent` +
+(`ObjectUpdatingEvent.Default`)
+|the event type to be posted (`1.11.0-SNAPSHOT`) to the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] whenever an instance is about to be updated
+
 |===
 
 
@@ -80,8 +121,9 @@ For example:
 @DomainObject(
     auditing=Auditing.ENABLED,
     autoCompleteRepository=CustomerRepository.class
-    editing=Editing.ENABLED,               // <1>
-    publishing=Publishing.ENABLED
+    editing=Editing.ENABLED,                            // <1>
+    updatedLifecycleEvent=Customer.UpdatedEvent.class
+
 )
 public class Customer {
     ...
@@ -94,10 +136,17 @@ public class Customer {
 include::_rg_annotations_manpage-DomainObject_auditing.adoc[leveloffset=+1]
 include::_rg_annotations_manpage-DomainObject_autoCompleteRepository.adoc[leveloffset=+1]
 include::_rg_annotations_manpage-DomainObject_bounded.adoc[leveloffset=+1]
+include::_rg_annotations_manpage-DomainObject_createdLifecycleEvent.adoc[leveloffset=+1]
 include::_rg_annotations_manpage-DomainObject_editing.adoc[leveloffset=+1]
+include::_rg_annotations_manpage-DomainObject_loadedLifecycleEvent.adoc[leveloffset=+1]
 include::_rg_annotations_manpage-DomainObject_nature.adoc[leveloffset=+1]
+include::_rg_annotations_manpage-DomainObject_persistedLifecycleEvent.adoc[leveloffset=+1]
+include::_rg_annotations_manpage-DomainObject_persistingLifecycleEvent.adoc[leveloffset=+1]
 include::_rg_annotations_manpage-DomainObject_objectType.adoc[leveloffset=+1]
 include::_rg_annotations_manpage-DomainObject_publishing.adoc[leveloffset=+1]
+include::_rg_annotations_manpage-DomainObject_removingLifecycleEvent.adoc[leveloffset=+1]
+include::_rg_annotations_manpage-DomainObject_updatingLifecycleEvent.adoc[leveloffset=+1]
+include::_rg_annotations_manpage-DomainObject_updatedLifecycleEvent.adoc[leveloffset=+1]
 
 
 

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObjectLayout_cssClassUiEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObjectLayout_cssClassUiEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObjectLayout_cssClassUiEvent.adoc
index c79e7a3..2b6a4b2 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObjectLayout_cssClassUiEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObjectLayout_cssClassUiEvent.adoc
@@ -10,8 +10,9 @@ in any wrapping ``<div>``s and ``<span>``s that render the domain object.  This
 xref:rg.adoc#_rg_methods_reserved_manpage-cssClass[`cssClass()`] reserved method.  (If `cssClass()` is present, then
 it will take precedence).
 
-Subscribers subscribe through the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] using either link:https://github.com/google/guava[Guava] or link:http://www.axonframework.org/[Axon Framework] annotations and can
-optionally specify a title.
+Subscribers subscribe through the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] and can
+use obtain a reference to the domain object from the event.  From this they can, if they wish, specify a CSS class for
+the domain object using the event's API.
 
 [NOTE]
 ====
@@ -108,7 +109,7 @@ The framework provides `CssClassUiEvent.Doop` as such a subclass, so setting the
 will ensure that the event to be posted, irrespective of the configuration property setting.
 
 And, conversely, the framework also provides `CssClassUiEvent.Noop`; if `cssClassUiEvent` attribute is set to this class,
-thn no event will be posted.
+then no event will be posted.
 
 
 

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObjectLayout_iconUiEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObjectLayout_iconUiEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObjectLayout_iconUiEvent.adoc
index 600d3da..d88f38b 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObjectLayout_iconUiEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObjectLayout_iconUiEvent.adoc
@@ -10,8 +10,10 @@ object (if possible). This is as an alternative to implementing
 xref:rg.adoc#_rg_methods_reserved_manpage-iconName[`iconName()`] reserved method.  (If `iconName()` is present, then
 it will take precedence).
 
-Subscribers subscribe through the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] using either link:https://github.com/google/guava[Guava] or link:http://www.axonframework.org/[Axon Framework] annotations and can
-optionally specify a title.
+Subscribers subscribe through the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] and can
+use obtain a reference to the domain object from the event.  From this they can, if they wish, specify an icon name for
+the domain object using the event's API.
+
 
 [NOTE]
 ====

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObjectLayout_titleUiEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObjectLayout_titleUiEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObjectLayout_titleUiEvent.adoc
index 6404f3e..899ef9d 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObjectLayout_titleUiEvent.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObjectLayout_titleUiEvent.adoc
@@ -10,8 +10,9 @@ This is as an alternative to implementing xref:rg.adoc#_rg_methods_reserved_manp
 using the xref:rg.adoc#_rg_annotations_manpage-Title[`@Title`] annotation, within the class itself.  (If either
 `title()` or `@Title` are present, then they will take precedence).
 
-Subscribers subscribe through the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] using either link:https://github.com/google/guava[Guava] or link:http://www.axonframework.org/[Axon Framework] annotations and can
-optionally specify a title.
+Subscribers subscribe through the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] and can
+use obtain a reference to the domain object from the event.  From this they can, if they wish, specify a title for
+the domain object using the event's API.
 
 [NOTE]
 ====

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_createdLifecycleEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_createdLifecycleEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_createdLifecycleEvent.adoc
new file mode 100644
index 0000000..88fe74d
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_createdLifecycleEvent.adoc
@@ -0,0 +1,108 @@
+[[_rg_annotations_manpage-DomainObject_createdLifecycleEvent]]
+= createdLifecycleEvent() (`1.11.0-SNAPSHOT`)
+:Notice: 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.
+:_basedir: ../
+:_imagesdir: images/
+
+
+Whenever a domain object is instantiated or otherwise becomes known to the framework, a "created" lifecycle event is fired.  This is typically when the xref:rg.adoc#_rg_services-api_manpage-DomainObjectContainer[`DomainObjectContainer`]'s xref:rg.adoc#_rg_services-api_manpage-DomainObjectContainer_object-creation-api[`newTransientInstance()`] is called;
+it will also happen if the object is simply instantiated with `new(...)`, and then the container's
+xref:rg.adoc#_rg_services-api_manpage-DomainObjectContainer_services-api[`injectServicesInto(...)`] method is called.
+
+Subscribers subscribe through the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] and can
+use the event to obtain a reference to the object just created.  The subscriber could then, for example, update the
+object, eg looking up state from some external datastore.
+
+
+By default the event raised is `ObjectCreatedEvent.Default`. For example:
+
+[source,java]
+----
+@DomainObject
+public class ToDoItemDto {
+    ...
+}
+----
+
+The purpose of the `createdLifecycleEvent()` attribute is to allows a custom subclass to be emitted instead.  A similar
+attribute is available for other lifecycle events.
+
+For example:
+
+[source,java]
+----
+@DomainObjectLayout(
+    createdLifecycleEvent=ToDoItem.CreatedEvent.class
+)
+public class ToDoItem {
+    public static class CreatedEvent
+        extends org.apache.isis.applib.services.eventbus.ObjectCreatedEvent<ToDoItem> { }
+    ...
+}
+----
+
+The benefit is that subscribers can be more targeted as to the events that they subscribe to.
+
+
+
+
+== Subscribers
+
+Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API
+or (if the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] has been appropriately configured)
+using the link:http://www.axonframework.org/[Axon Framework] API.  The examples below use the Guava API.
+
+Subscribers can be either coarse-grained (if they subscribe to the top-level event type):
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN)
+public class SomeSubscriber extends AbstractSubscriber {
+    @com.google.common.eventbus.Subscribe
+    public void on(ObjectCreatedEvent ev) {
+        if(ev.getSource() instanceof ToDoItem) { ... }
+    }
+}
+----
+
+or can be fine-grained (by subscribing to specific event subtypes):
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN)
+public class SomeSubscriber extends AbstractSubscriber {
+    @com.google.common.eventbus.Subscribe
+    public void on(ToDoItem.ObjectCreatedEvent ev) {
+        ...
+    }
+}
+----
+
+
+[TIP]
+====
+If the AxonFramework is being used, replace `@com.google.common.eventbus.Subscribe` with `@org.axonframework.eventhandling.annotation.EventHandler`.
+====
+
+
+
+
+
+== Default, Doop and Noop events
+
+If the `createdLifecycleEvent` attribute is not explicitly specified (is left as its default value, `ObjectCreatedEvent.Default`),
+then the framework will, by default, post an event.
+
+If this is not required, then the `isis.reflector.facet.domainObjectAnnotation.createdLifecycleEvent.postForDefault`
+configuration property can be set to "false"; this will disable posting.
+
+On the other hand, if the `createdLifecycleEvent` has been explicitly specified to some subclass, then an event will be posted.
+The framework provides `ObjectCreatedEvent.Doop` as such a subclass, so setting the `createdLifecycleEvent` attribute to this class
+will ensure that the event to be posted, irrespective of the configuration property setting.
+
+And, conversely, the framework also provides `ObjectCreatedEvent.Noop`; if `createdLifecycleEvent` attribute is set to this class,
+then no event will be posted.
+
+
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_loadedLifecycleEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_loadedLifecycleEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_loadedLifecycleEvent.adoc
new file mode 100644
index 0000000..e861800
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_loadedLifecycleEvent.adoc
@@ -0,0 +1,105 @@
+[[_rg_annotations_manpage-DomainObject_loadedLifecycleEvent]]
+= loadedLifecycleEvent() (`1.11.0-SNAPSHOT`)
+:Notice: 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.
+:_basedir: ../
+:_imagesdir: images/
+
+
+Whenever a persistent domain object is loaded from the database, a "loaded" lifecycle event is fired.
+
+Subscribers subscribe through the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] and can
+use the event to obtain a reference to the domain object just loaded.  The subscriber could then, for example, update
+or default values on the object (eg to support on-the-fly migration scenarios).
+
+By default the event raised is `ObjectLoadedEvent.Default`. For example:
+
+[source,java]
+----
+@DomainObject
+public class ToDoItemDto {
+    ...
+}
+----
+
+The purpose of the `loadedLifecycleEvent()` attribute is to allows a custom subclass to be emitted instead.  A similar
+attribute is available for other lifecycle events.
+
+For example:
+
+[source,java]
+----
+@DomainObjectLayout(
+    loadedLifecycleEvent=ToDoItem.LoadedEvent.class
+)
+public class ToDoItem {
+    public static class LoadedEvent
+        extends org.apache.isis.applib.services.eventbus.ObjectLoadedEvent<ToDoItem> { }
+    ...
+}
+----
+
+The benefit is that subscribers can be more targeted as to the events that they subscribe to.
+
+
+
+
+== Subscribers
+
+Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API
+or (if the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] has been appropriately configured)
+using the link:http://www.axonframework.org/[Axon Framework] API.  The examples below use the Guava API.
+
+Subscribers can be either coarse-grained (if they subscribe to the top-level event type):
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN)
+public class SomeSubscriber extends AbstractSubscriber {
+    @com.google.common.eventbus.Subscribe
+    public void on(ObjectLoadedEvent ev) {
+        if(ev.getSource() instanceof ToDoItem) { ... }
+    }
+}
+----
+
+or can be fine-grained (by subscribing to specific event subtypes):
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN)
+public class SomeSubscriber extends AbstractSubscriber {
+    @com.google.common.eventbus.Subscribe
+    public void on(ToDoItem.ObjectLoadedEvent ev) {
+        ...
+    }
+}
+----
+
+
+[TIP]
+====
+If the AxonFramework is being used, replace `@com.google.common.eventbus.Subscribe` with `@org.axonframework.eventhandling.annotation.EventHandler`.
+====
+
+
+
+
+
+== Default, Doop and Noop events
+
+If the `loadedLifecycleEvent` attribute is not explicitly specified (is left as its default value, `ObjectLoadedEvent.Default`),
+then the framework will, by default, post an event.
+
+If this is not required, then the `isis.reflector.facet.domainObjectAnnotation.loadedLifecycleEvent.postForDefault`
+configuration property can be set to "false"; this will disable posting.
+
+On the other hand, if the `loadedLifecycleEvent` has been explicitly specified to some subclass, then an event will be posted.
+The framework provides `ObjectLoadedEvent.Doop` as such a subclass, so setting the `loadedLifecycleEvent` attribute to this class
+will ensure that the event to be posted, irrespective of the configuration property setting.
+
+And, conversely, the framework also provides `ObjectLoadedEvent.Noop`; if `loadedLifecycleEvent` attribute is set to this class,
+then no event will be posted.
+
+
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_persistedLifecycleEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_persistedLifecycleEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_persistedLifecycleEvent.adoc
new file mode 100644
index 0000000..5330ca3
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_persistedLifecycleEvent.adoc
@@ -0,0 +1,111 @@
+[[_rg_annotations_manpage-DomainObject_persistedLifecycleEvent]]
+= persistedLifecycleEvent() (`1.11.0-SNAPSHOT`)
+:Notice: 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.
+:_basedir: ../
+:_imagesdir: images/
+
+
+Whenever a (just created, still transient) domain object has been saved (INSERTed in)to the database, a "persisted" lifecycle
+event is fired.
+
+Subscribers subscribe through the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] and can
+use the event to obtain a reference to the domain object.  The subscriber could then, for example, maintain an
+external datastore.
+
+[WARNING]
+====
+The object should _not_ be modified during the persisted callback.
+====
+
+By default the event raised is `ObjectPersistedEvent.Default`. For example:
+
+[source,java]
+----
+@DomainObject
+public class ToDoItemDto {
+    ...
+}
+----
+
+The purpose of the `persistedLifecycleEvent()` attribute is to allows a custom subclass to be emitted instead.  A similar
+attribute is available for other lifecycle events.
+
+For example:
+
+[source,java]
+----
+@DomainObjectLayout(
+    persistedLifecycleEvent=ToDoItem.PersistedEvent.class
+)
+public class ToDoItem {
+    public static class PersistedEvent
+        extends org.apache.isis.applib.services.eventbus.ObjectPersistedEvent<ToDoItem> { }
+    ...
+}
+----
+
+The benefit is that subscribers can be more targeted as to the events that they subscribe to.
+
+
+
+
+== Subscribers
+
+Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API
+or (if the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] has been appropriately configured)
+using the link:http://www.axonframework.org/[Axon Framework] API.  The examples below use the Guava API.
+
+Subscribers can be either coarse-grained (if they subscribe to the top-level event type):
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN)
+public class SomeSubscriber extends AbstractSubscriber {
+    @com.google.common.eventbus.Subscribe
+    public void on(ObjectPersistedEvent ev) {
+        if(ev.getSource() instanceof ToDoItem) { ... }
+    }
+}
+----
+
+or can be fine-grained (by subscribing to specific event subtypes):
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN)
+public class SomeSubscriber extends AbstractSubscriber {
+    @com.google.common.eventbus.Subscribe
+    public void on(ToDoItem.ObjectPersistedEvent ev) {
+        ...
+    }
+}
+----
+
+
+[TIP]
+====
+If the AxonFramework is being used, replace `@com.google.common.eventbus.Subscribe` with `@org.axonframework.eventhandling.annotation.EventHandler`.
+====
+
+
+
+
+
+== Default, Doop and Noop events
+
+If the `persistedLifecycleEvent` attribute is not explicitly specified (is left as its default value, `ObjectPersistedEvent.Default`),
+then the framework will, by default, post an event.
+
+If this is not required, then the `isis.reflector.facet.domainObjectAnnotation.persistedLifecycleEvent.postForDefault`
+configuration property can be set to "false"; this will disable posting.
+
+On the other hand, if the `persistedLifecycleEvent` has been explicitly specified to some subclass, then an event will be posted.
+The framework provides `ObjectPersistedEvent.Doop` as such a subclass, so setting the `persistedLifecycleEvent` attribute to this class
+will ensure that the event to be posted, irrespective of the configuration property setting.
+
+And, conversely, the framework also provides `ObjectPersistedEvent.Noop`; if `persistedLifecycleEvent` attribute is set to this class,
+then no event will be posted.
+
+
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_persistingLifecycleEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_persistingLifecycleEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_persistingLifecycleEvent.adoc
new file mode 100644
index 0000000..56c523c
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_persistingLifecycleEvent.adoc
@@ -0,0 +1,114 @@
+[[_rg_annotations_manpage-DomainObject_persistingLifecycleEvent]]
+= persistingLifecycleEvent() (`1.11.0-SNAPSHOT`)
+:Notice: 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.
+:_basedir: ../
+:_imagesdir: images/
+
+
+Whenever a (just created, still transient) domain object is about to be saved (INSERTed in)to the database, a "persisting" lifecycle
+event is fired.
+
+Subscribers subscribe through the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] and can
+use the event to obtain a reference to the domain object.  The subscriber could then, for example, update the object,
+or it could use it maintain an external datastore.  One possible application is to maintain a full-text search database using
+link:https://lucene.apache.org/[Apache Lucene] or similar.
+
+[NOTE]
+====
+Another use case is to maintain "last updated by"/"last updated at" properties.  While you can roll your own, note that
+the framework provides built-in support for this use case through the
+xref:rg.adoc#_rg_classes_roles_manpage-Timestampable[`Timestampable`] role interface.
+====
+
+By default the event raised is `ObjectPersistingEvent.Default`. For example:
+
+[source,java]
+----
+@DomainObject
+public class ToDoItemDto {
+    ...
+}
+----
+
+The purpose of the `persistingLifecycleEvent()` attribute is to allows a custom subclass to be emitted instead.  A similar
+attribute is available for other lifecycle events.
+
+For example:
+
+[source,java]
+----
+@DomainObjectLayout(
+    persistingLifecycleEvent=ToDoItem.PersistingEvent.class
+)
+public class ToDoItem {
+    public static class PersistingEvent
+        extends org.apache.isis.applib.services.eventbus.ObjectPersistingEvent<ToDoItem> { }
+    ...
+}
+----
+
+The benefit is that subscribers can be more targeted as to the events that they subscribe to.
+
+
+
+
+== Subscribers
+
+Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API
+or (if the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] has been appropriately configured)
+using the link:http://www.axonframework.org/[Axon Framework] API.  The examples below use the Guava API.
+
+Subscribers can be either coarse-grained (if they subscribe to the top-level event type):
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN)
+public class SomeSubscriber extends AbstractSubscriber {
+    @com.google.common.eventbus.Subscribe
+    public void on(ObjectPersistingEvent ev) {
+        if(ev.getSource() instanceof ToDoItem) { ... }
+    }
+}
+----
+
+or can be fine-grained (by subscribing to specific event subtypes):
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN)
+public class SomeSubscriber extends AbstractSubscriber {
+    @com.google.common.eventbus.Subscribe
+    public void on(ToDoItem.ObjectPersistingEvent ev) {
+        ...
+    }
+}
+----
+
+
+[TIP]
+====
+If the AxonFramework is being used, replace `@com.google.common.eventbus.Subscribe` with `@org.axonframework.eventhandling.annotation.EventHandler`.
+====
+
+
+
+
+
+== Default, Doop and Noop events
+
+If the `persistingLifecycleEvent` attribute is not explicitly specified (is left as its default value, `ObjectPersistingEvent.Default`),
+then the framework will, by default, post an event.
+
+If this is not required, then the `isis.reflector.facet.domainObjectAnnotation.persistingLifecycleEvent.postForDefault`
+configuration property can be set to "false"; this will disable posting.
+
+On the other hand, if the `persistingLifecycleEvent` has been explicitly specified to some subclass, then an event will be posted.
+The framework provides `ObjectPersistingEvent.Doop` as such a subclass, so setting the `persistingLifecycleEvent` attribute to this class
+will ensure that the event to be posted, irrespective of the configuration property setting.
+
+And, conversely, the framework also provides `ObjectPersistingEvent.Noop`; if `persistingLifecycleEvent` attribute is set to this class,
+then no event will be posted.
+
+
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_removingLifecycleEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_removingLifecycleEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_removingLifecycleEvent.adoc
new file mode 100644
index 0000000..7fefe56
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_removingLifecycleEvent.adoc
@@ -0,0 +1,114 @@
+[[_rg_annotations_manpage-DomainObject_removingLifecycleEvent]]
+= removingLifecycleEvent() (`1.11.0-SNAPSHOT`)
+:Notice: 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.
+:_basedir: ../
+:_imagesdir: images/
+
+
+Whenever a (persistent) domain object is about to be removed (DELETEd) from the database, a "removing"
+lifecycle event is fired.
+
+Subscribers subscribe through the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] and can
+use the event to obtain a reference to the domain object.  The subscriber could then, for example, could use it
+maintain an external datastore.  One possible application is to maintain a full-text search database
+using link:https://lucene.apache.org/[Apache Lucene] or similar.
+
+[NOTE]
+====
+Another use case is to maintain "last updated by"/"last updated at" properties.  While you can roll your own, note that
+the framework provides built-in support for this use case through the
+xref:rg.adoc#_rg_classes_roles_manpage-Timestampable[`Timestampable`] role interface.
+====
+
+By default the event raised is `ObjectRemovingEvent.Default`. For example:
+
+[source,java]
+----
+@DomainObject
+public class ToDoItemDto {
+    ...
+}
+----
+
+The purpose of the `removingLifecycleEvent()` attribute is to allows a custom subclass to be emitted instead.  A similar
+attribute is available for other lifecycle events.
+
+For example:
+
+[source,java]
+----
+@DomainObjectLayout(
+    removingLifecycleEvent=ToDoItem.RemovingEvent.class
+)
+public class ToDoItem {
+    public static class RemovingEvent
+        extends org.apache.isis.applib.services.eventbus.ObjectRemovingEvent<ToDoItem> { }
+    ...
+}
+----
+
+The benefit is that subscribers can be more targeted as to the events that they subscribe to.
+
+
+
+
+== Subscribers
+
+Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API
+or (if the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] has been appropriately configured)
+using the link:http://www.axonframework.org/[Axon Framework] API.  The examples below use the Guava API.
+
+Subscribers can be either coarse-grained (if they subscribe to the top-level event type):
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN)
+public class SomeSubscriber extends AbstractSubscriber {
+    @com.google.common.eventbus.Subscribe
+    public void on(ObjectRemovingEvent ev) {
+        if(ev.getSource() instanceof ToDoItem) { ... }
+    }
+}
+----
+
+or can be fine-grained (by subscribing to specific event subtypes):
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN)
+public class SomeSubscriber extends AbstractSubscriber {
+    @com.google.common.eventbus.Subscribe
+    public void on(ToDoItem.ObjectRemovingEvent ev) {
+        ...
+    }
+}
+----
+
+
+[TIP]
+====
+If the AxonFramework is being used, replace `@com.google.common.eventbus.Subscribe` with `@org.axonframework.eventhandling.annotation.EventHandler`.
+====
+
+
+
+
+
+== Default, Doop and Noop events
+
+If the `removingLifecycleEvent` attribute is not explicitly specified (is left as its default value, `ObjectRemovingEvent.Default`),
+then the framework will, by default, post an event.
+
+If this is not required, then the `isis.reflector.facet.domainObjectAnnotation.removingLifecycleEvent.postForDefault`
+configuration property can be set to "false"; this will disable posting.
+
+On the other hand, if the `removingLifecycleEvent` has been explicitly specified to some subclass, then an event will be posted.
+The framework provides `ObjectRemovingEvent.Doop` as such a subclass, so setting the `removingLifecycleEvent` attribute to this class
+will ensure that the event to be posted, irrespective of the configuration property setting.
+
+And, conversely, the framework also provides `ObjectRemovingEvent.Noop`; if `removingLifecycleEvent` attribute is set to this class,
+then no event will be posted.
+
+
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_updatedLifecycleEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_updatedLifecycleEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_updatedLifecycleEvent.adoc
new file mode 100644
index 0000000..f480dd3
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_updatedLifecycleEvent.adoc
@@ -0,0 +1,110 @@
+[[_rg_annotations_manpage-DomainObject_updatedLifecycleEvent]]
+= updatedLifecycleEvent() (`1.11.0-SNAPSHOT`)
+:Notice: 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.
+:_basedir: ../
+:_imagesdir: images/
+
+
+Whenever a (persistent) domain object has been modified and has been updated in the database, an "updated" lifecycle
+event is fired.
+
+Subscribers subscribe through the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] and can
+use the event to obtain a reference to the domain object.
+
+[WARNING]
+====
+The object should _not_ be modified during the updated callback.
+====
+
+By default the event raised is `ObjectUpdatedEvent.Default`. For example:
+
+[source,java]
+----
+@DomainObject
+public class ToDoItemDto {
+    ...
+}
+----
+
+The purpose of the `updatedLifecycleEvent()` attribute is to allows a custom subclass to be emitted instead.  A similar
+attribute is available for other lifecycle events.
+
+For example:
+
+[source,java]
+----
+@DomainObjectLayout(
+    updatedLifecycleEvent=ToDoItem.UpdatedEvent.class
+)
+public class ToDoItem {
+    public static class UpdatedEvent
+        extends org.apache.isis.applib.services.eventbus.ObjectUpdatedEvent<ToDoItem> { }
+    ...
+}
+----
+
+The benefit is that subscribers can be more targeted as to the events that they subscribe to.
+
+
+
+
+== Subscribers
+
+Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API
+or (if the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] has been appropriately configured)
+using the link:http://www.axonframework.org/[Axon Framework] API.  The examples below use the Guava API.
+
+Subscribers can be either coarse-grained (if they subscribe to the top-level event type):
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN)
+public class SomeSubscriber extends AbstractSubscriber {
+    @com.google.common.eventbus.Subscribe
+    public void on(ObjectUpdatedEvent ev) {
+        if(ev.getSource() instanceof ToDoItem) { ... }
+    }
+}
+----
+
+or can be fine-grained (by subscribing to specific event subtypes):
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN)
+public class SomeSubscriber extends AbstractSubscriber {
+    @com.google.common.eventbus.Subscribe
+    public void on(ToDoItem.ObjectUpdatedEvent ev) {
+        ...
+    }
+}
+----
+
+
+[TIP]
+====
+If the AxonFramework is being used, replace `@com.google.common.eventbus.Subscribe` with `@org.axonframework.eventhandling.annotation.EventHandler`.
+====
+
+
+
+
+
+== Default, Doop and Noop events
+
+If the `updatedLifecycleEvent` attribute is not explicitly specified (is left as its default value, `ObjectUpdatedEvent.Default`),
+then the framework will, by default, post an event.
+
+If this is not required, then the `isis.reflector.facet.domainObjectAnnotation.updatedLifecycleEvent.postForDefault`
+configuration property can be set to "false"; this will disable posting.
+
+On the other hand, if the `updatedLifecycleEvent` has been explicitly specified to some subclass, then an event will be posted.
+The framework provides `ObjectUpdatedEvent.Doop` as such a subclass, so setting the `updatedLifecycleEvent` attribute to this class
+will ensure that the event to be posted, irrespective of the configuration property setting.
+
+And, conversely, the framework also provides `ObjectUpdatedEvent.Noop`; if `updatedLifecycleEvent` attribute is set to this class,
+then no event will be posted.
+
+
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_updatingLifecycleEvent.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_updatingLifecycleEvent.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_updatingLifecycleEvent.adoc
new file mode 100644
index 0000000..6a783f1
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_updatingLifecycleEvent.adoc
@@ -0,0 +1,114 @@
+[[_rg_annotations_manpage-DomainObject_updatingLifecycleEvent]]
+= updatingLifecycleEvent() (`1.11.0-SNAPSHOT`)
+:Notice: 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.
+:_basedir: ../
+:_imagesdir: images/
+
+
+Whenever a (persistent) domain object has been modified and is about to be updated to the database, an "updating"
+lifecycle event is fired.
+
+Subscribers subscribe through the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] and can
+use the event to obtain a reference to the domain object.  The subscriber could then, for example, update the object,
+or it could use it maintain an external datastore.  One possible application is to maintain a full-text search database
+using link:https://lucene.apache.org/[Apache Lucene] or similar.
+
+[NOTE]
+====
+Another use case is to maintain "last updated by"/"last updated at" properties.  While you can roll your own, note that
+the framework provides built-in support for this use case through the
+xref:rg.adoc#_rg_classes_roles_manpage-Timestampable[`Timestampable`] role interface.
+====
+
+By default the event raised is `ObjectUpdatingEvent.Default`. For example:
+
+[source,java]
+----
+@DomainObject
+public class ToDoItemDto {
+    ...
+}
+----
+
+The purpose of the `updatingLifecycleEvent()` attribute is to allows a custom subclass to be emitted instead.  A similar
+attribute is available for other lifecycle events.
+
+For example:
+
+[source,java]
+----
+@DomainObjectLayout(
+    updatingLifecycleEvent=ToDoItem.UpdatingEvent.class
+)
+public class ToDoItem {
+    public static class UpdatingEvent
+        extends org.apache.isis.applib.services.eventbus.ObjectUpdatingEvent<ToDoItem> { }
+    ...
+}
+----
+
+The benefit is that subscribers can be more targeted as to the events that they subscribe to.
+
+
+
+
+== Subscribers
+
+Subscribers (which must be domain services) subscribe using either the link:https://github.com/google/guava[Guava] API
+or (if the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] has been appropriately configured)
+using the link:http://www.axonframework.org/[Axon Framework] API.  The examples below use the Guava API.
+
+Subscribers can be either coarse-grained (if they subscribe to the top-level event type):
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN)
+public class SomeSubscriber extends AbstractSubscriber {
+    @com.google.common.eventbus.Subscribe
+    public void on(ObjectUpdatingEvent ev) {
+        if(ev.getSource() instanceof ToDoItem) { ... }
+    }
+}
+----
+
+or can be fine-grained (by subscribing to specific event subtypes):
+
+[source,java]
+----
+@DomainService(nature=NatureOfService.DOMAIN)
+public class SomeSubscriber extends AbstractSubscriber {
+    @com.google.common.eventbus.Subscribe
+    public void on(ToDoItem.ObjectUpdatingEvent ev) {
+        ...
+    }
+}
+----
+
+
+[TIP]
+====
+If the AxonFramework is being used, replace `@com.google.common.eventbus.Subscribe` with `@org.axonframework.eventhandling.annotation.EventHandler`.
+====
+
+
+
+
+
+== Default, Doop and Noop events
+
+If the `updatingLifecycleEvent` attribute is not explicitly specified (is left as its default value, `ObjectUpdatingEvent.Default`),
+then the framework will, by default, post an event.
+
+If this is not required, then the `isis.reflector.facet.domainObjectAnnotation.updatingLifecycleEvent.postForDefault`
+configuration property can be set to "false"; this will disable posting.
+
+On the other hand, if the `updatingLifecycleEvent` has been explicitly specified to some subclass, then an event will be posted.
+The framework provides `ObjectUpdatingEvent.Doop` as such a subclass, so setting the `updatingLifecycleEvent` attribute to this class
+will ensure that the event to be posted, irrespective of the configuration property setting.
+
+And, conversely, the framework also provides `ObjectUpdatingEvent.Noop`; if `updatingLifecycleEvent` attribute is set to this class,
+then no event will be posted.
+
+
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/adocs/documentation/src/main/asciidoc/guides/_rg_runtime_configuring-core.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_runtime_configuring-core.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_runtime_configuring-core.adoc
index 28d83ee..00505f6 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rg_runtime_configuring-core.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_runtime_configuring-core.adoc
@@ -23,13 +23,15 @@ Configuration properties for the JDO/DataNucleus objectstore can be found in the
 
 |`isis.object.` +
 `editing`
-| `true`,`false` (`true`)
+|`true`,`false` +
+(`true`)
 |Whether objects' properties and collections can be edited directly (for objects annotated with xref:rg.adoc#_rg_annotations_manpage-DomainObject_editing[`@DomainObject#editing()`]); see xref:rg.adoc#_rg_runtime_configuring-core_isis-objects-editing[below] for further discussion.
 
 
 |`isis.persistor.` +
 `disableConcurrencyChecking`
-| `true`,`false` (`false`)
+|`true`,`false` +
+(`false`)
 | Disables concurrency checking globally.  +
 
 Only intended for "emergency use" as a workaround while pending fix/patch to Apache Isis itself.  (Note that there is no "datanucleus" in the property).
@@ -37,18 +39,20 @@ Only intended for "emergency use" as a workaround while pending fix/patch to Apa
 |`isis.reflector.facet.` +
 `actionAnnotation.` +
 `domainEvent.postForDefault`
-|`true`,`false` (`true`)
+|`true`,`false` +
+(`true`)
 |Whether an event should be posted if xref:rg.adoc#_rg_annotations_manpage-Action_domainEvent[`@Action#domainEvent()`] is not specified (is set to `ActionDomainEvent.Default`).
 
 |`isis.reflector.facet.` +
 `collectionAnnotation.` +
 `domainEvent.postForDefault`
-|`true`,`false` (`true`)
+|`true`,`false` +
+(`true`)
 |Whether an event should be posted if xref:rg.adoc#_rg_annotations_manpage-Collection_domainEvent[`@Collection#domainEvent()`] is not specified (is set to `CollectionDomainEvent.Default`).
 
 |`isis.reflector.facet.` +
 `cssClass.patterns`
-|regex:css1,regex2:css2,...
+|regex:css1, regex2:css2,...
 |Comma separated list of key:value pairs, where the key is a regex matching action names (eg `delete.*`) and the value is a link:http://getbootstrap.com/css/[Bootstrap] CSS button class (eg `btn-warning) to be applied (as per `@CssClass()`) to all action members matching the regex. +
 
 See xref:ug.adoc#_ug_how-tos_ui-hints_action-icons-and-css[UI hints] for more details.
@@ -61,26 +65,96 @@ See xref:ug.adoc#_ug_how-tos_ui-hints_action-icons-and-css[UI hints] for more de
 See xref:ug.adoc#_ug_how-tos_ui-hints_action-icons-and-css[UI hints] for more details.
 
 |`isis.reflector.facet.` +
+`domainObjectAnnotation.` +
+`createdLifecycleEvent.` +
+`postForDefault` +
+(`1.11.0-SNAPSHOT`)
+|`true`,`false` +
+(`true`)
+|Whether an event should be posted if xref:rg.adoc#_rg_annotations_manpage-DomainObject_createdLifecycleEvent[`@DomainObject#createdLifecycleEvent()`] is not specified (is set to `ObjectCreatedEvent.Default`).
+
+|`isis.reflector.facet.` +
+`domainObjectAnnotation.` +
+`loadedLifecycleEvent.` +
+`postForDefault` +
+(`1.11.0-SNAPSHOT`)
+|`true`,`false` +
+(`true`)
+|Whether an event should be posted if xref:rg.adoc#_rg_annotations_manpage-DomainObject_loadedLifecycleEvent[`@DomainObject#loadedLifecycleEvent()`] is not specified (is set to `ObjectLoadedEvent.Default`).
+
+|`isis.reflector.facet.` +
+`domainObjectAnnotation.` +
+`persistingLifecycleEvent.` +
+`postForDefault` +
+(`1.11.0-SNAPSHOT`)
+|`true`,`false` +
+(`true`)
+|Whether an event should be posted if xref:rg.adoc#_rg_annotations_manpage-DomainObject_persistingLifecycleEvent[`@DomainObject#persistingLifecycleEvent()`] is not specified (is set to `ObjectPersistingEvent.Default`).
+
+|`isis.reflector.facet.` +
+`domainObjectAnnotation.` +
+`persistedLifecycleEvent.` +
+`postForDefault` +
+(`1.11.0-SNAPSHOT`)
+|`true`,`false` +
+(`true`)
+|Whether an event should be posted if xref:rg.adoc#_rg_annotations_manpage-DomainObject_persistedLifecycleEvent[`@DomainObject#persistedLifecycleEvent()`] is not specified (is set to `ObjectPersistedEvent.Default`).
+
+|`isis.reflector.facet.` +
+`domainObjectAnnotation.` +
+`removingLifecycleEvent.` +
+`postForDefault` +
+(`1.11.0-SNAPSHOT`)
+|`true`,`false` +
+(`true`)
+|Whether an event should be posted if xref:rg.adoc#_rg_annotations_manpage-DomainObject_removingLifecycleEvent[`@DomainObject#removingLifecycleEvent()`] is not specified (is set to `ObjectRemovingEvent.Default`).
+
+|`isis.reflector.facet.` +
+`domainObjectAnnotation.` +
+`updatingLifecycleEvent.` +
+`postForDefault` +
+(`1.11.0-SNAPSHOT`)
+|`true`,`false` +
+(`true`)
+|Whether an event should be posted if xref:rg.adoc#_rg_annotations_manpage-DomainObject_updatingLifecycleEvent[`@DomainObject#updatingLifecycleEvent()`] is not specified (is set to `ObjectUpdatingEvent.Default`).
+
+|`isis.reflector.facet.` +
+`domainObjectAnnotation.` +
+`updatedLifecycleEvent.` +
+`postForDefault` +
+(`1.11.0-SNAPSHOT`)
+|`true`,`false` +
+(`true`)
+|Whether an event should be posted if xref:rg.adoc#_rg_annotations_manpage-DomainObject_updatedLifecycleEvent[`@DomainObject#updatedLifecycleEvent()`] is not specified (is set to `ObjectUpdatedEvent.Default`).
+
+|`isis.reflector.facet.` +
 `domainObjectLayoutAnnotation.` +
-`cssClassUiEvent.postForDefault`
-|`true`,`false` (`true`)
+`cssClassUiEvent.postForDefault` +
+(`1.11.0-SNAPSHOT`)
+|`true`,`false` +
+(`true`)
 |Whether an event should be posted if xref:rg.adoc#_rg_annotations_manpage-DomainObjectLayout_cssClassUiEvent[`@DomainObjectLayout#cssClassUiEvent()`] is not specified (is set to `CssClassUiEvent.Default`).
 
 |`isis.reflector.facet.` +
 `domainObjectLayoutAnnotation.` +
-`iconUiEvent.postForDefault`
-|`true`,`false` (`true`)
+`iconUiEvent.postForDefault` +
+(`1.11.0-SNAPSHOT`)
+|`true`,`false` +
+(`true`)
 |Whether an event should be posted if xref:rg.adoc#_rg_annotations_manpage-DomainObjectLayout_iconUiEvent[`@DomainObjectLayout#iconUiEvent()`] is not specified (is set to `IconUiEvent.Default`).
 
 |`isis.reflector.facet.` +
 `domainObjectLayoutAnnotation.` +
-`titleUiEvent.postForDefault`
-|`true`,`false` (`true`)
+`titleUiEvent.postForDefault` +
+(`1.11.0-SNAPSHOT`)
+|`true`,`false` +
+(`true`)
 |Whether an event should be posted if xref:rg.adoc#_rg_annotations_manpage-DomainObjectLayout_titleUiEvent[`@DomainObjectLayout#titleUiEvent()`] is not specified (is set to `TitleUiEvent.Default`).
 
 |`isis.reflector.facet.` +
 `filterVisibility`
-| `true`,`false` (`true`)
+|`true`,`false` +
+(`true`)
 |Whether objects should be filtered for visibility. +
 
 See xref:rg.adoc#_rg_runtime_configuring-core_filterVisibility[section below] for further discussion.
@@ -88,7 +162,8 @@ See xref:rg.adoc#_rg_runtime_configuring-core_filterVisibility[section below] fo
 |`isis.reflector.facet.` +
 `propertyAnnotation.` +
 `domainEvent.postForDefault`
-|`true`,`false` (`true`)
+|`true`,`false` +
+(`true`)
 |Whether an event should be posted if xref:rg.adoc#_rg_annotations_manpage-Property_domainEvent[`@Property#domainEvent()`] is not specified (is set to `PropertyDomainEvent.Default`).
 
 |`isis.reflector.facets`
@@ -128,7 +203,8 @@ See xref:ug.adoc#_ug_extending_programming-model_custom-validator[Custom Validat
 
 |`isis.reflector.validator.` +
 `allowDeprecated`
-| `true`,`false` (`true`)
+|`true`,`false` +
+(`true`)
 | Whether deprecated annotations or naming conventions are tolerated or not.  If not, then a metamodel validation error will be triggered, meaning the app won't boot (fail-fast).
 
 
@@ -143,7 +219,8 @@ This property is IGNORED if the xref:rg.adoc#_rg_runtime_configuring-components[
 
 |`isis.services.` +
 `audit.objects`
-| `all`, `none` (`all`)
+| `all`, `none` +
+(`all`)
 |Whether the changed properties of objects should be automatically audited (for objects annotated with xref:rg.adoc#_rg_annotations_manpage-DomainObject_auditing[`@DomainObject(auditing=Auditing.AS_CONFIGURED)`].
 
 |`isis.services.` +
@@ -156,12 +233,14 @@ This property is IGNORED if the xref:rg.adoc#_rg_runtime_configuring-components[
 
 |`isis.services.` +
 `container.disableAutoFlush`
-| `true`,`false` (`_false_`)
+|`true`,`false` +
+(`false`)
 |Whether the `DomainObjectContainer` should automatically flush pending changes prior to querying (via `allMatches()`, `firstMatch()` and so on).
 
 |`isis.services.` +
 `container.disableAutoFlush`
-| `true`,`false` (`_false_`)
+|`true`,`false` +
+(`false`)
 |Whether the `DomainObjectContainer` should automatically flush pending changes prior to querying (via `allMatches()`, `firstMatch()` and so on).
 
 
@@ -170,7 +249,8 @@ This property is IGNORED if the xref:rg.adoc#_rg_runtime_configuring-components[
 `ContentNegotiation-` +
 `ServiceXRoDomainType` +
 .prettyPrint
-| `true`,`false` (depends)
+| `true`,`false` +
+(depends)
 |If a domain object has been mapped to the specified JAXB `x-ro-domain-type`, then determines whether the result is pretty-printed or not. +
 +
 If no configuration property is available, then the defaults is determined by the xref:rg.adoc#_rg_runtime_deployment-types[deployment type]: production mode disables pretty printing, while prototype mode enables it.
@@ -179,7 +259,8 @@ If no configuration property is available, then the defaults is determined by th
 
 | `isis.service.` +
 `email.tls.enabled`
-| `true`,`false` (`_true_`)
+|`true`,`false` +
+(`true`)
 |Whether to enable TLS for the email SMTP connection (used by xref:rg.adoc#_rg_services-api_manpage-EmailService[`EmailService`]).  +
 
 NB: note that the key is mis-spelt, (`isis.service.email` rather than `isis.services.email`)
@@ -216,12 +297,14 @@ NB: note that the key is mis-spelt, (`isis.service.email` rather than `isis.serv
 
 | `isis.services.` +
 `eventbus.implementation` +
-| `guava`, `axon`, FQCN (`_guava_`)
+| `guava`, `axon`, +
+FQCN (`_guava_`)
 |which implementation to use by the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] as the underlying event bus.
 
 | `isis.services.` +
 `eventbus.allowLateRegistration` +
-| `true`, `false`, (`_false_`)
+|`true`,`false` +
+(`false`)
 |whether a domain service can register with the xref:rg.adoc#_rg_services-api_manpage-EventBusService[`EventBusService`] after any events have posted. +
 
 Since this almost certainly constitutes a bug in application code, by default this is disallowed.
@@ -229,7 +312,8 @@ Since this almost certainly constitutes a bug in application code, by default th
 
 | `isis.services.` +
 `exceprecog.logRecognizedExceptions` +
-| `true`, `false`, (`_false_`)
+|`true`,`false` +
+(`false`)
 |whether recognized exceptions should also be logged. +
 
 Generally a recognized exception is one that is expected (for example a uniqueness constraint violated in the database) and which does not represent an error condition.  This property logs the exception anyway, useful for debugging.
@@ -238,7 +322,8 @@ Generally a recognized exception is one that is expected (for example a uniquene
 | `isis.services.` +
 `ExceptionRecognizerComposite-` +
 `ForJdoObjectStore.disable` +
-| `true`, `false`, (`_false_`)
+|`true`,`false` +
+(`false`)
 |whether to disable the default recognizers registered by `ExceptionRecognizerCompositeForJdoObjectStore`. +
 
 This implementation provides a default set of recognizers to convert RDBMS constraints into user-friendly messages.  In the (probably remote) chance that this functionality isn't required, they can be disabled through this flag.
@@ -246,7 +331,8 @@ This implementation provides a default set of recognizers to convert RDBMS const
 
 |`isis.services.` +
 `publish.objects`
-| `all`, `none` (`all`)
+| `all`, `none` +
+(`all`)
 |Whether changed objects should be automatically published (for objects annotated with xref:rg.adoc#_rg_annotations_manpage-DomainObject_publishing[`@DomainObject(publishing=Publishing.AS_CONFIGURED)`].
 
 |`isis.services.` +


[3/5] isis git commit: ISIS-803: new annotation attributes allowing suclasses of the lifecycle events to be posted (or disabled altogether). also updated docs.

Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectPersistedEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectPersistedEvent.java b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectPersistedEvent.java
index f585170..de2aa7c 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectPersistedEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectPersistedEvent.java
@@ -22,6 +22,13 @@ public abstract class ObjectPersistedEvent<S> extends AbstractLifecycleEvent<S>
 
     private static final long serialVersionUID = 1L;
 
+    //region > Default class
+    /**
+     * This class is the default for the
+     * {@link org.apache.isis.applib.annotation.DomainObject#persistedLifecycleEvent()} annotation attribute.  Whether this
+     * raises an event or not depends upon the "isis.reflector.facet.domainObjectAnnotation.persistedLifecycleEvent.postForDefault"
+     * configuration property.
+     */
     public static class Default extends ObjectPersistedEvent<Object> {
         private static final long serialVersionUID = 1L;
         public Default() {}
@@ -31,6 +38,29 @@ public abstract class ObjectPersistedEvent<S> extends AbstractLifecycleEvent<S>
             return "ObjectPersistedEvent$Default{source=" + getSource() + "}";
         }
     }
+    //endregion
+
+    //region > Noop class
+
+    /**
+     * Convenience class to use indicating that an event should <i>not</i> be posted (irrespective of the configuration
+     * property setting for the {@link Default} event.
+     */
+    public static class Noop extends ObjectPersistedEvent<Object> {
+        private static final long serialVersionUID = 1L;
+    }
+    //endregion
+
+    //region > Doop class
+
+    /**
+     * Convenience class meaning that an event <i>should</i> be posted (irrespective of the configuration
+     * property setting for the {@link Default} event..
+     */
+    public static class Doop extends ObjectPersistedEvent<Object> {
+        private static final long serialVersionUID = 1L;
+    }
+    //endregion
 
     public ObjectPersistedEvent() {
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectPersistingEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectPersistingEvent.java b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectPersistingEvent.java
index 9d5c985..9d18165 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectPersistingEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectPersistingEvent.java
@@ -22,6 +22,13 @@ public abstract class ObjectPersistingEvent<S> extends AbstractLifecycleEvent<S>
 
     private static final long serialVersionUID = 1L;
 
+    //region > Default class
+    /**
+     * This class is the default for the
+     * {@link org.apache.isis.applib.annotation.DomainObject#persistingLifecycleEvent()} annotation attribute.  Whether this
+     * raises an event or not depends upon the "isis.reflector.facet.domainObjectAnnotation.persistingLifecycleEvent.postForDefault"
+     * configuration property.
+     */
     public static class Default extends ObjectPersistingEvent<Object> {
         private static final long serialVersionUID = 1L;
         public Default() {}
@@ -31,6 +38,29 @@ public abstract class ObjectPersistingEvent<S> extends AbstractLifecycleEvent<S>
             return "ObjectPersistingEvent$Default{source=" + getSource() + "}";
         }
     }
+    //endregion
+
+    //region > Noop class
+
+    /**
+     * Convenience class to use indicating that an event should <i>not</i> be posted (irrespective of the configuration
+     * property setting for the {@link Default} event.
+     */
+    public static class Noop extends ObjectPersistingEvent<Object> {
+        private static final long serialVersionUID = 1L;
+    }
+    //endregion
+
+    //region > Doop class
+
+    /**
+     * Convenience class meaning that an event <i>should</i> be posted (irrespective of the configuration
+     * property setting for the {@link Default} event..
+     */
+    public static class Doop extends ObjectPersistingEvent<Object> {
+        private static final long serialVersionUID = 1L;
+    }
+    //endregion
 
     public ObjectPersistingEvent() {
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectRemovingEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectRemovingEvent.java b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectRemovingEvent.java
index 945156a..b7f8186 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectRemovingEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectRemovingEvent.java
@@ -22,6 +22,13 @@ public abstract class ObjectRemovingEvent<S> extends AbstractLifecycleEvent<S> {
 
     private static final long serialVersionUID = 1L;
 
+    //region > Default class
+    /**
+     * This class is the default for the
+     * {@link org.apache.isis.applib.annotation.DomainObject#removingLifecycleEvent()} annotation attribute.  Whether this
+     * raises an event or not depends upon the "isis.reflector.facet.domainObjectAnnotation.removingLifecycleEvent.postForDefault"
+     * configuration property.
+     */
     public static class Default extends ObjectRemovingEvent<Object> {
         private static final long serialVersionUID = 1L;
         public Default() {}
@@ -31,6 +38,29 @@ public abstract class ObjectRemovingEvent<S> extends AbstractLifecycleEvent<S> {
             return "ObjectRemovingEvent$Default{source=" + getSource() + "}";
         }
     }
+    //endregion
+
+    //region > Noop class
+
+    /**
+     * Convenience class to use indicating that an event should <i>not</i> be posted (irrespective of the configuration
+     * property setting for the {@link Default} event.
+     */
+    public static class Noop extends ObjectRemovingEvent<Object> {
+        private static final long serialVersionUID = 1L;
+    }
+    //endregion
+
+    //region > Doop class
+
+    /**
+     * Convenience class meaning that an event <i>should</i> be posted (irrespective of the configuration
+     * property setting for the {@link Default} event..
+     */
+    public static class Doop extends ObjectRemovingEvent<Object> {
+        private static final long serialVersionUID = 1L;
+    }
+    //endregion
 
     public ObjectRemovingEvent() {
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectUpdatedEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectUpdatedEvent.java b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectUpdatedEvent.java
index 49ceb19..94e763b 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectUpdatedEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectUpdatedEvent.java
@@ -22,6 +22,13 @@ public abstract class ObjectUpdatedEvent<S> extends AbstractLifecycleEvent<S> {
 
     private static final long serialVersionUID = 1L;
 
+    //region > Default class
+    /**
+     * This class is the default for the
+     * {@link org.apache.isis.applib.annotation.DomainObject#updatedLifecycleEvent()} annotation attribute.  Whether this
+     * raises an event or not depends upon the "isis.reflector.facet.domainObjectAnnotation.updatedLifecycleEvent.postForDefault"
+     * configuration property.
+     */
     public static class Default extends ObjectUpdatedEvent<Object> {
         private static final long serialVersionUID = 1L;
         public Default() {}
@@ -31,6 +38,29 @@ public abstract class ObjectUpdatedEvent<S> extends AbstractLifecycleEvent<S> {
             return "ObjectUpdatedEvent$Default{source=" + getSource() + "}";
         }
     }
+    //endregion
+
+    //region > Noop class
+
+    /**
+     * Convenience class to use indicating that an event should <i>not</i> be posted (irrespective of the configuration
+     * property setting for the {@link Default} event.
+     */
+    public static class Noop extends ObjectUpdatedEvent<Object> {
+        private static final long serialVersionUID = 1L;
+    }
+    //endregion
+
+    //region > Doop class
+
+    /**
+     * Convenience class meaning that an event <i>should</i> be posted (irrespective of the configuration
+     * property setting for the {@link Default} event..
+     */
+    public static class Doop extends ObjectUpdatedEvent<Object> {
+        private static final long serialVersionUID = 1L;
+    }
+    //endregion
 
     public ObjectUpdatedEvent() {
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectUpdatingEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectUpdatingEvent.java b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectUpdatingEvent.java
index 88f3775..a7d39b0 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectUpdatingEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ObjectUpdatingEvent.java
@@ -22,6 +22,13 @@ public abstract class ObjectUpdatingEvent<S> extends AbstractLifecycleEvent<S> {
 
     private static final long serialVersionUID = 1L;
 
+    //region > Default class
+    /**
+     * This class is the default for the
+     * {@link org.apache.isis.applib.annotation.DomainObject#updatingLifecycleEvent()} annotation attribute.  Whether this
+     * raises an event or not depends upon the "isis.reflector.facet.domainObjectAnnotation.updatingLifecycleEvent.postForDefault"
+     * configuration property.
+     */
     public static class Default extends ObjectUpdatingEvent<Object> {
         private static final long serialVersionUID = 1L;
         public Default() {}
@@ -31,6 +38,29 @@ public abstract class ObjectUpdatingEvent<S> extends AbstractLifecycleEvent<S> {
             return "ObjectUpdatingEvent$Default{source=" + getSource() + "}";
         }
     }
+    //endregion
+
+    //region > Noop class
+
+    /**
+     * Convenience class to use indicating that an event should <i>not</i> be posted (irrespective of the configuration
+     * property setting for the {@link Default} event.
+     */
+    public static class Noop extends ObjectUpdatingEvent<Object> {
+        private static final long serialVersionUID = 1L;
+    }
+    //endregion
+
+    //region > Doop class
+
+    /**
+     * Convenience class meaning that an event <i>should</i> be posted (irrespective of the configuration
+     * property setting for the {@link Default} event..
+     */
+    public static class Doop extends ObjectUpdatingEvent<Object> {
+        private static final long serialVersionUID = 1L;
+    }
+    //endregion
 
     public ObjectUpdatingEvent() {
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionDomainEventFacetAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionDomainEventFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionDomainEventFacetAbstract.java
index c1f61e3..2c5e6f2 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionDomainEventFacetAbstract.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionDomainEventFacetAbstract.java
@@ -148,9 +148,6 @@ public abstract class ActionDomainEventFacetAbstract
         return value();
     }
 
-    /**
-     * For testing only.
-     */
     public Class<? extends ActionDomainEvent<?>> getEventType() {
         //noinspection unchecked
         return eventType();

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

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/CreatedCallbackFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/CreatedCallbackFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/CreatedCallbackFacetFactory.java
new file mode 100644
index 0000000..3c4ed37
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/CreatedCallbackFacetFactory.java
@@ -0,0 +1,62 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+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.metamodel.facets.MethodFinderUtils;
+import org.apache.isis.core.metamodel.facets.MethodPrefixBasedFacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.MethodPrefixConstants;
+
+public class CreatedCallbackFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
+
+    private static final String[] PREFIXES = { MethodPrefixConstants.CREATED_PREFIX, };
+
+    public CreatedCallbackFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY, OrphanValidation.VALIDATE, PREFIXES);
+    }
+
+    @Override
+    public void process(final ProcessClassContext processClassContext) {
+        final Class<?> cls = processClassContext.getCls();
+        final FacetHolder holder = processClassContext.getFacetHolder();
+
+        final List<Facet> facets = new ArrayList<Facet>();
+        final List<Method> methods = new ArrayList<Method>();
+
+        Method method = null;
+        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.CREATED_PREFIX, void.class, NO_PARAMETERS_TYPES);
+        if (method != null) {
+            methods.add(method);
+            facets.add(new CreatedCallbackFacetViaMethod(method, holder));
+        }
+
+        processClassContext.removeMethods(methods);
+        FacetUtil.addFacets(facets);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/CreatedCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/CreatedCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/CreatedCallbackFacetViaMethod.java
new file mode 100644
index 0000000..8fea409
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/CreatedCallbackFacetViaMethod.java
@@ -0,0 +1,65 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.ImperativeFacet;
+
+public class CreatedCallbackFacetViaMethod extends CreatedCallbackFacetAbstract implements ImperativeFacet {
+
+    private final List<Method> methods = new ArrayList<Method>();
+
+    public CreatedCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
+        super(holder);
+        addMethod(method);
+    }
+
+    @Override
+    public void addMethod(final Method method) {
+        methods.add(method);
+    }
+
+    @Override
+    public Intent getIntent(final Method method) {
+        return Intent.LIFECYCLE;
+    }
+
+    @Override
+    public List<Method> getMethods() {
+        return Collections.unmodifiableList(methods);
+    }
+
+    @Override
+    public void invoke(final ObjectAdapter adapter) {
+        ObjectAdapter.InvokeUtils.invokeAll(methods, adapter);
+    }
+
+    @Override
+    protected String toStringValues() {
+        return "methods=" + methods;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/CreatedLifecycleEventFacet.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/CreatedLifecycleEventFacet.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/CreatedLifecycleEventFacet.java
new file mode 100644
index 0000000..8afa6f1
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/CreatedLifecycleEventFacet.java
@@ -0,0 +1,30 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.core.metamodel.facets.SingleClassValueFacet;
+
+/**
+ * Corresponds to {@link DomainObject#createdLifecycleEvent()}<tt>.
+ */
+public interface CreatedLifecycleEventFacet  extends SingleClassValueFacet, LifecycleEventFacet {
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/CreatedLifecycleEventFacetForDomainObjectAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/CreatedLifecycleEventFacetForDomainObjectAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/CreatedLifecycleEventFacetForDomainObjectAnnotation.java
new file mode 100644
index 0000000..5e3e43d
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/CreatedLifecycleEventFacetForDomainObjectAnnotation.java
@@ -0,0 +1,49 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import org.apache.isis.applib.services.eventbus.AbstractLifecycleEvent;
+import org.apache.isis.applib.services.eventbus.ObjectCreatedEvent;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.SingleClassValueFacetAbstract;
+import org.apache.isis.core.metamodel.spec.SpecificationLoader;
+
+public class CreatedLifecycleEventFacetForDomainObjectAnnotation extends SingleClassValueFacetAbstract implements CreatedLifecycleEventFacet {
+
+    static Class<CreatedLifecycleEventFacet> type() {
+        return CreatedLifecycleEventFacet.class;
+    }
+
+    public CreatedLifecycleEventFacetForDomainObjectAnnotation(
+            final FacetHolder holder,
+            final Class<? extends ObjectCreatedEvent<?>> value,
+            final SpecificationLoader specificationLoader) {
+        super(type(), holder, value, specificationLoader);
+    }
+
+    public Class<? extends AbstractLifecycleEvent<?>> getEventType() {
+        //noinspection unchecked
+        return eventType();
+    }
+
+    Class eventType() {
+        return value();
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LifecycleEventFacet.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LifecycleEventFacet.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LifecycleEventFacet.java
new file mode 100644
index 0000000..689c1d1
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LifecycleEventFacet.java
@@ -0,0 +1,28 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import org.apache.isis.applib.services.eventbus.AbstractLifecycleEvent;
+import org.apache.isis.core.metamodel.facetapi.Facet;
+
+public interface LifecycleEventFacet extends Facet {
+
+    Class<? extends AbstractLifecycleEvent<?>> getEventType();
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LoadCallbackFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LoadCallbackFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LoadCallbackFacetFactory.java
new file mode 100644
index 0000000..44696e6
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LoadCallbackFacetFactory.java
@@ -0,0 +1,68 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+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.metamodel.facets.MethodFinderUtils;
+import org.apache.isis.core.metamodel.facets.MethodPrefixBasedFacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.MethodPrefixConstants;
+
+public class LoadCallbackFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
+
+    private static final String[] PREFIXES = { MethodPrefixConstants.LOADED_PREFIX, MethodPrefixConstants.LOADING_PREFIX, };
+
+    public LoadCallbackFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY, OrphanValidation.VALIDATE, PREFIXES);
+    }
+
+    @Override
+    public void process(final ProcessClassContext processClassContext) {
+        final Class<?> cls = processClassContext.getCls();
+        final FacetHolder facetHolder = processClassContext.getFacetHolder();
+
+        final List<Facet> facets = new ArrayList<Facet>();
+        final List<Method> methods = new ArrayList<Method>();
+
+        Method method = null;
+        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.LOADING_PREFIX, void.class, NO_PARAMETERS_TYPES);
+        if (method != null) {
+            methods.add(method);
+            facets.add(new LoadingCallbackFacetViaMethod(method, facetHolder));
+        }
+
+        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.LOADED_PREFIX, void.class, NO_PARAMETERS_TYPES);
+        if (method != null) {
+            methods.add(method);
+            facets.add(new LoadedCallbackFacetViaMethod(method, facetHolder));
+        }
+
+        processClassContext.removeMethods(methods);
+        FacetUtil.addFacets(facets);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LoadedCallbackFacetAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LoadedCallbackFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LoadedCallbackFacetAbstract.java
new file mode 100644
index 0000000..9389015
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LoadedCallbackFacetAbstract.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.metamodel.facets.object.callbacks;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.object.callbacks.LoadedCallbackFacet;
+import org.apache.isis.core.metamodel.facets.object.callbacks.CallbackFacetAbstract;
+
+public abstract class LoadedCallbackFacetAbstract extends CallbackFacetAbstract implements LoadedCallbackFacet {
+
+    public static Class<? extends Facet> type() {
+        return LoadedCallbackFacet.class;
+    }
+
+    public LoadedCallbackFacetAbstract(final FacetHolder holder) {
+        super(type(), holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LoadedCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LoadedCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LoadedCallbackFacetViaMethod.java
new file mode 100644
index 0000000..8b3ef2a
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LoadedCallbackFacetViaMethod.java
@@ -0,0 +1,65 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.ImperativeFacet;
+
+public class LoadedCallbackFacetViaMethod extends LoadedCallbackFacetAbstract implements ImperativeFacet {
+
+    private final List<Method> methods = new ArrayList<Method>();
+
+    public LoadedCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
+        super(holder);
+        addMethod(method);
+    }
+
+    @Override
+    public void addMethod(final Method method) {
+        methods.add(method);
+    }
+
+    @Override
+    public List<Method> getMethods() {
+        return Collections.unmodifiableList(methods);
+    }
+
+    @Override
+    public Intent getIntent(final Method method) {
+        return Intent.LIFECYCLE;
+    }
+
+    @Override
+    public void invoke(final ObjectAdapter adapter) {
+        ObjectAdapter.InvokeUtils.invokeAll(methods, adapter);
+    }
+
+    @Override
+    protected String toStringValues() {
+        return "methods=" + methods;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LoadedLifecycleEventFacet.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LoadedLifecycleEventFacet.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LoadedLifecycleEventFacet.java
new file mode 100644
index 0000000..bfd8904
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LoadedLifecycleEventFacet.java
@@ -0,0 +1,30 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.core.metamodel.facets.SingleClassValueFacet;
+
+/**
+ * Corresponds to {@link DomainObject#loadedLifecycleEvent()}<tt>.
+ */
+public interface LoadedLifecycleEventFacet extends SingleClassValueFacet, LifecycleEventFacet {
+
+}

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

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

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LoadingCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LoadingCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LoadingCallbackFacetViaMethod.java
new file mode 100644
index 0000000..ad1057a
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/LoadingCallbackFacetViaMethod.java
@@ -0,0 +1,69 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.ImperativeFacet;
+
+/**
+ * @deprecated - THIS CAN NEVER BE CALLED (BY JDO OBJECTSTORE AT LEAST)
+ */
+@Deprecated
+public class LoadingCallbackFacetViaMethod extends LoadingCallbackFacetAbstract implements ImperativeFacet {
+
+    private final List<Method> methods = new ArrayList<Method>();
+
+    public LoadingCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
+        super(holder);
+        addMethod(method);
+    }
+
+    @Override
+    public void addMethod(final Method method) {
+        methods.add(method);
+    }
+
+    @Override
+    public List<Method> getMethods() {
+        return Collections.unmodifiableList(methods);
+    }
+
+    @Override
+    public Intent getIntent(final Method method) {
+        return Intent.LIFECYCLE;
+    }
+
+    @Override
+    public void invoke(final ObjectAdapter adapter) {
+        ObjectAdapter.InvokeUtils.invokeAll(methods, adapter);
+    }
+
+    @Override
+    protected String toStringValues() {
+        return "methods=" + methods;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistCallbackFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistCallbackFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistCallbackFacetFactory.java
new file mode 100644
index 0000000..a6b641a
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistCallbackFacetFactory.java
@@ -0,0 +1,78 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+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.metamodel.facets.MethodFinderUtils;
+import org.apache.isis.core.metamodel.facets.MethodPrefixBasedFacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.MethodPrefixConstants;
+
+public class PersistCallbackFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
+
+    private static final String[] PREFIXES = { MethodPrefixConstants.PERSISTED_PREFIX, MethodPrefixConstants.PERSISTING_PREFIX, };
+
+    public PersistCallbackFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY, OrphanValidation.VALIDATE, PREFIXES);
+    }
+
+    @Override
+    public void process(final ProcessClassContext processClassContext) {
+        final Class<?> cls = processClassContext.getCls();
+        final FacetHolder facetHolder = processClassContext.getFacetHolder();
+
+        final List<Facet> facets = new ArrayList<Facet>();
+        final List<Method> methods = new ArrayList<Method>();
+
+        Method method = null;
+        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.PERSISTING_PREFIX, void.class, NO_PARAMETERS_TYPES);
+        if (method != null) {
+            methods.add(method);
+            final PersistingCallbackFacet facet = facetHolder.getFacet(PersistingCallbackFacet.class);
+            if (facet == null) {
+                facets.add(new PersistingCallbackFacetViaMethod(method, facetHolder));
+            } else {
+                facet.addMethod(method);
+            }
+        }
+
+        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.PERSISTED_PREFIX, void.class, NO_PARAMETERS_TYPES);
+        if (method != null) {
+            methods.add(method);
+            final PersistedCallbackFacet facet = facetHolder.getFacet(PersistedCallbackFacet.class);
+            if (facet == null) {
+                facets.add(new PersistedCallbackFacetViaMethod(method, facetHolder));
+            } else {
+                facet.addMethod(method);
+            }
+        }
+
+        processClassContext.removeMethods(methods);
+        FacetUtil.addFacets(facets);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistCallbackViaSaveMethodFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistCallbackViaSaveMethodFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistCallbackViaSaveMethodFacetFactory.java
new file mode 100644
index 0000000..e1c6c19
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistCallbackViaSaveMethodFacetFactory.java
@@ -0,0 +1,78 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+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.metamodel.facets.MethodFinderUtils;
+import org.apache.isis.core.metamodel.facets.MethodPrefixBasedFacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.MethodPrefixConstants;
+
+public class PersistCallbackViaSaveMethodFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
+
+    private static final String[] PREFIXES = { MethodPrefixConstants.SAVED_PREFIX, MethodPrefixConstants.SAVING_PREFIX, };
+
+    public PersistCallbackViaSaveMethodFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY, OrphanValidation.VALIDATE, PREFIXES);
+    }
+
+    @Override
+    public void process(final ProcessClassContext processClassContext) {
+        final Class<?> cls = processClassContext.getCls();
+        final FacetHolder facetHolder = processClassContext.getFacetHolder();
+
+        final List<Facet> facets = new ArrayList<Facet>();
+        final List<Method> methods = new ArrayList<Method>();
+
+        Method method = null;
+        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.SAVING_PREFIX, void.class, NO_PARAMETERS_TYPES);
+        if (method != null) {
+            methods.add(method);
+            final PersistingCallbackFacet facet = facetHolder.getFacet(PersistingCallbackFacet.class);
+            if (facet == null) {
+                facets.add(new PersistingCallbackFacetViaMethod(method, facetHolder));
+            } else {
+                facet.addMethod(method);
+            }
+        }
+
+        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.SAVED_PREFIX, void.class, NO_PARAMETERS_TYPES);
+        if (method != null) {
+            methods.add(method);
+            final PersistedCallbackFacet facet = facetHolder.getFacet(PersistedCallbackFacet.class);
+            if (facet == null) {
+                facets.add(new PersistedCallbackFacetViaMethod(method, facetHolder));
+            } else {
+                facet.addMethod(method);
+            }
+        }
+
+        processClassContext.removeMethods(methods);
+        FacetUtil.addFacets(facets);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistedCallbackFacetAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistedCallbackFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistedCallbackFacetAbstract.java
new file mode 100644
index 0000000..6a8f651
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistedCallbackFacetAbstract.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.metamodel.facets.object.callbacks;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.object.callbacks.PersistedCallbackFacet;
+import org.apache.isis.core.metamodel.facets.object.callbacks.CallbackFacetAbstract;
+
+public abstract class PersistedCallbackFacetAbstract extends CallbackFacetAbstract implements PersistedCallbackFacet {
+
+    public static Class<? extends Facet> type() {
+        return PersistedCallbackFacet.class;
+    }
+
+    public PersistedCallbackFacetAbstract(final FacetHolder holder) {
+        super(type(), holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistedCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistedCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistedCallbackFacetViaMethod.java
new file mode 100644
index 0000000..0f9988d
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistedCallbackFacetViaMethod.java
@@ -0,0 +1,65 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.ImperativeFacet;
+
+public class PersistedCallbackFacetViaMethod extends PersistedCallbackFacetAbstract implements ImperativeFacet {
+
+    private final List<Method> methods = new ArrayList<Method>();
+
+    public PersistedCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
+        super(holder);
+        addMethod(method);
+    }
+
+    @Override
+    public void addMethod(final Method method) {
+        methods.add(method);
+    }
+
+    @Override
+    public Intent getIntent(final Method method) {
+        return Intent.LIFECYCLE;
+    }
+
+    @Override
+    public List<Method> getMethods() {
+        return Collections.unmodifiableList(methods);
+    }
+
+    @Override
+    public void invoke(final ObjectAdapter adapter) {
+        ObjectAdapter.InvokeUtils.invokeAll(methods, adapter);
+    }
+
+    @Override
+    protected String toStringValues() {
+        return "methods=" + methods;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistedLifecycleEventFacet.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistedLifecycleEventFacet.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistedLifecycleEventFacet.java
new file mode 100644
index 0000000..ac7d973
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistedLifecycleEventFacet.java
@@ -0,0 +1,30 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.core.metamodel.facets.SingleClassValueFacet;
+
+/**
+ * Corresponds to {@link DomainObject#persistedLifecycleEvent()}<tt>.
+ */
+public interface PersistedLifecycleEventFacet extends SingleClassValueFacet, LifecycleEventFacet {
+
+}

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

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistingCallbackFacetAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistingCallbackFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistingCallbackFacetAbstract.java
new file mode 100644
index 0000000..b9f0323
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistingCallbackFacetAbstract.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.metamodel.facets.object.callbacks;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.object.callbacks.PersistingCallbackFacet;
+import org.apache.isis.core.metamodel.facets.object.callbacks.CallbackFacetAbstract;
+
+public abstract class PersistingCallbackFacetAbstract extends CallbackFacetAbstract implements PersistingCallbackFacet {
+
+    public static Class<? extends Facet> type() {
+        return PersistingCallbackFacet.class;
+    }
+
+    public PersistingCallbackFacetAbstract(final FacetHolder holder) {
+        super(type(), holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistingCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistingCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistingCallbackFacetViaMethod.java
new file mode 100644
index 0000000..4adcae8
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistingCallbackFacetViaMethod.java
@@ -0,0 +1,65 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.ImperativeFacet;
+
+public class PersistingCallbackFacetViaMethod extends PersistingCallbackFacetAbstract implements ImperativeFacet {
+
+    private final List<Method> methods = new ArrayList<Method>();
+
+    public PersistingCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
+        super(holder);
+        addMethod(method);
+    }
+
+    @Override
+    public void addMethod(final Method method) {
+        methods.add(method);
+    }
+
+    @Override
+    public List<Method> getMethods() {
+        return Collections.unmodifiableList(methods);
+    }
+
+    @Override
+    public Intent getIntent(final Method method) {
+        return Intent.LIFECYCLE;
+    }
+
+    @Override
+    public void invoke(final ObjectAdapter adapter) {
+        ObjectAdapter.InvokeUtils.invokeAll(methods, adapter);
+    }
+
+    @Override
+    protected String toStringValues() {
+        return "methods=" + methods;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistingLifecycleEventFacet.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistingLifecycleEventFacet.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistingLifecycleEventFacet.java
new file mode 100644
index 0000000..11ac50f
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistingLifecycleEventFacet.java
@@ -0,0 +1,30 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.core.metamodel.facets.SingleClassValueFacet;
+
+/**
+ * Corresponds to {@link DomainObject#persistingLifecycleEvent()}<tt>.
+ */
+public interface PersistingLifecycleEventFacet extends SingleClassValueFacet, LifecycleEventFacet {
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistingLifecycleEventFacetForDomainObjectAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistingLifecycleEventFacetForDomainObjectAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistingLifecycleEventFacetForDomainObjectAnnotation.java
new file mode 100644
index 0000000..6ee15e3
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/PersistingLifecycleEventFacetForDomainObjectAnnotation.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.metamodel.facets.object.callbacks;
+
+import org.apache.isis.applib.services.eventbus.ObjectPersistingEvent;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.SingleClassValueFacetAbstract;
+import org.apache.isis.core.metamodel.spec.SpecificationLoader;
+
+public class PersistingLifecycleEventFacetForDomainObjectAnnotation extends SingleClassValueFacetAbstract implements LoadedLifecycleEventFacet {
+
+    static Class<PersistingLifecycleEventFacet> type() {
+        return PersistingLifecycleEventFacet.class;
+    }
+
+    public PersistingLifecycleEventFacetForDomainObjectAnnotation(
+            final FacetHolder holder,
+            final Class<? extends ObjectPersistingEvent<?>> value,
+            final SpecificationLoader specificationLoader) {
+        super(type(), holder, value, specificationLoader);
+    }
+
+    public Class<? extends ObjectPersistingEvent<?>> getEventType() {
+        //noinspection unchecked
+        return eventType();
+    }
+
+    Class eventType() {
+        return value();
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemoveCallbackFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemoveCallbackFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemoveCallbackFacetFactory.java
new file mode 100644
index 0000000..f084f90
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemoveCallbackFacetFactory.java
@@ -0,0 +1,78 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+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.metamodel.facets.MethodFinderUtils;
+import org.apache.isis.core.metamodel.facets.MethodPrefixBasedFacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.MethodPrefixConstants;
+
+public class RemoveCallbackFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
+
+    private static final String[] PREFIXES = { MethodPrefixConstants.REMOVED_PREFIX, MethodPrefixConstants.REMOVING_PREFIX, };
+
+    public RemoveCallbackFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY, OrphanValidation.VALIDATE, PREFIXES);
+    }
+
+    @Override
+    public void process(final ProcessClassContext processClassContext) {
+        final Class<?> cls = processClassContext.getCls();
+        final FacetHolder facetHolder = processClassContext.getFacetHolder();
+
+        final List<Facet> facets = new ArrayList<Facet>();
+        final List<Method> methods = new ArrayList<Method>();
+
+        Method method = null;
+        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.REMOVING_PREFIX, void.class, NO_PARAMETERS_TYPES);
+        if (method != null) {
+            methods.add(method);
+            final RemovingCallbackFacet facet = facetHolder.getFacet(RemovingCallbackFacet.class);
+            if (facet == null) {
+                facets.add(new RemovingCallbackFacetViaMethod(method, facetHolder));
+            } else {
+                facet.addMethod(method);
+            }
+        }
+
+        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.REMOVED_PREFIX, void.class, NO_PARAMETERS_TYPES);
+        if (method != null) {
+            methods.add(method);
+            final RemovedCallbackFacet facet = facetHolder.getFacet(RemovedCallbackFacet.class);
+            if (facet == null) {
+                facets.add(new RemovedCallbackFacetViaMethod(method, facetHolder));
+            } else {
+                facet.addMethod(method);
+            }
+        }
+
+        processClassContext.removeMethods(methods);
+        FacetUtil.addFacets(facets);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemoveCallbackViaDeleteMethodFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemoveCallbackViaDeleteMethodFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemoveCallbackViaDeleteMethodFacetFactory.java
new file mode 100644
index 0000000..4056797
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemoveCallbackViaDeleteMethodFacetFactory.java
@@ -0,0 +1,78 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+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.metamodel.facets.MethodFinderUtils;
+import org.apache.isis.core.metamodel.facets.MethodPrefixBasedFacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.MethodPrefixConstants;
+
+public class RemoveCallbackViaDeleteMethodFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
+
+    private static final String[] PREFIXES = { MethodPrefixConstants.DELETED_PREFIX, MethodPrefixConstants.DELETING_PREFIX, };
+
+    public RemoveCallbackViaDeleteMethodFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY, OrphanValidation.VALIDATE, PREFIXES);
+    }
+
+    @Override
+    public void process(final ProcessClassContext processClassContext) {
+        final Class<?> cls = processClassContext.getCls();
+        final FacetHolder holder = processClassContext.getFacetHolder();
+
+        final List<Facet> facets = new ArrayList<Facet>();
+        final List<Method> methods = new ArrayList<Method>();
+
+        Method method = null;
+        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.DELETING_PREFIX, void.class, NO_PARAMETERS_TYPES);
+        if (method != null) {
+            methods.add(method);
+            final RemovingCallbackFacet facet = holder.getFacet(RemovingCallbackFacet.class);
+            if (facet == null) {
+                facets.add(new RemovingCallbackFacetViaMethod(method, holder));
+            } else {
+                facet.addMethod(method);
+            }
+        }
+
+        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.DELETED_PREFIX, void.class, NO_PARAMETERS_TYPES);
+        if (method != null) {
+            methods.add(method);
+            final RemovedCallbackFacet facet = holder.getFacet(RemovedCallbackFacet.class);
+            if (facet == null) {
+                facets.add(new RemovedCallbackFacetViaMethod(method, holder));
+            } else {
+                facet.addMethod(method);
+            }
+        }
+
+        processClassContext.removeMethods(methods);
+        FacetUtil.addFacets(facets);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovedCallbackFacet.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovedCallbackFacet.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovedCallbackFacet.java
index 21b6e81..ce70073 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovedCallbackFacet.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovedCallbackFacet.java
@@ -27,7 +27,9 @@ package org.apache.isis.core.metamodel.facets.object.callbacks;
  * <tt>deleted</tt> method.
  * 
  * @see RemovingCallbackFacet
+ * @deprecated - cannot touch a pojo once deleted
  */
+@Deprecated
 public interface RemovedCallbackFacet extends CallbackFacet {
 
 }

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

http://git-wip-us.apache.org/repos/asf/isis/blob/8cf480de/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovedCallbackFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovedCallbackFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovedCallbackFacetViaMethod.java
new file mode 100644
index 0000000..f41a90f
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/callbacks/RemovedCallbackFacetViaMethod.java
@@ -0,0 +1,69 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.callbacks;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.ImperativeFacet;
+
+/**
+ * @deprecated - cannot touch a pojo once deleted
+ */
+@Deprecated
+public class RemovedCallbackFacetViaMethod extends RemovedCallbackFacetAbstract implements ImperativeFacet {
+
+    private final List<Method> methods = new ArrayList<Method>();
+
+    public RemovedCallbackFacetViaMethod(final Method method, final FacetHolder holder) {
+        super(holder);
+        addMethod(method);
+    }
+
+    @Override
+    public void addMethod(final Method method) {
+        methods.add(method);
+    }
+
+    @Override
+    public List<Method> getMethods() {
+        return Collections.unmodifiableList(methods);
+    }
+
+    @Override
+    public Intent getIntent(final Method method) {
+        return Intent.LIFECYCLE;
+    }
+
+    @Override
+    public void invoke(final ObjectAdapter adapter) {
+        ObjectAdapter.InvokeUtils.invokeAll(methods, adapter);
+    }
+
+    @Override
+    protected String toStringValues() {
+        return "methods=" + methods;
+    }
+
+}