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 2017/10/01 13:17:09 UTC

[isis] 02/10: ISIS-1742: removes @ActionInteraction + related events. Also Command2 methods removed.

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch dev/2.0.0/ISIS-1742-remove-deprecations
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 607cd2216c639e05d0c64a1a25445ebeb728cf9a
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sat Sep 30 11:21:27 2017 +0200

    ISIS-1742: removes @ActionInteraction + related events.  Also Command2 methods removed.
    
    Command2 methods replaced by equivalent in Command3 subtype.
    
    related events removed are ActionInteractionEvent, PostsActionInvokedEvent etc.
---
 .../isis/applib/annotation/ActionInteraction.java  | 42 ------------
 .../applib/annotation/PostsActionInvokedEvent.java | 44 -------------
 .../isis/applib/services/command/Command2.java     | 35 ----------
 .../applib/services/command/CommandDefault.java    | 46 +------------
 .../services/eventbus/AbstractDomainEvent.java     |  4 +-
 .../services/eventbus/ActionDomainEvent.java       | 11 +---
 .../services/eventbus/ActionInteractionEvent.java  | 77 ----------------------
 .../services/eventbus/ActionInvokedEvent.java      | 55 ----------------
 .../command/Command2ContractTestAbstract.java      | 64 +++++++++---------
 .../services/command/CommandDefaultTest.java       |  2 +-
 .../core/metamodel/facets/DomainEventHelper.java   |  6 --
 .../action/ActionAnnotationFacetFactory.java       | 49 +-------------
 ...ctionInvocationFacetForDomainEventAbstract.java |  5 +-
 ...nEventHelperTest_newActionInteractionEvent.java | 22 +++----
 .../action/ActionAnnotationFacetFactoryTest.java   | 18 ++---
 .../system/persistence/PersistenceSession.java     |  5 --
 16 files changed, 60 insertions(+), 425 deletions(-)

diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionInteraction.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionInteraction.java
deleted file mode 100644
index c9e1b31..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/ActionInteraction.java
+++ /dev/null
@@ -1,42 +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.applib.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import org.apache.isis.applib.services.eventbus.ActionInteractionEvent;
-
-/**
- * @deprecated - see {@link Action#domainEvent()}.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Deprecated
-public @interface ActionInteraction {
-
-    /**
-     * @deprecated - see {@link Action#domainEvent()}.
-     */
-    @Deprecated
-    Class<? extends ActionInteractionEvent<?>> value() default ActionInteractionEvent.Default.class;
-
-}
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsActionInvokedEvent.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsActionInvokedEvent.java
deleted file mode 100644
index 67daa9a..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsActionInvokedEvent.java
+++ /dev/null
@@ -1,44 +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.applib.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import org.apache.isis.applib.services.eventbus.ActionInvokedEvent;
-
-/**
- * @deprecated - use instead {@link org.apache.isis.applib.annotation.Action#domainEvent()}.
- */
-@Deprecated
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.TYPE, ElementType.METHOD})
-public @interface PostsActionInvokedEvent {
-
-    /**
-     * The subclass of {@link ActionInvokedEvent} to be instantiated and posted.
-     * 
-     * <p>
-     * This subclass must provide a no-arg constructor; the fields are set reflectively.
-     */
-    Class<? extends ActionInvokedEvent<?>> value() default ActionInvokedEvent.Default.class;
-
-}
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/command/Command2.java b/core/applib/src/main/java/org/apache/isis/applib/services/command/Command2.java
index 77bdc69..8944e55 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/command/Command2.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/command/Command2.java
@@ -16,10 +16,6 @@
  */
 package org.apache.isis.applib.services.command;
 
-import java.util.List;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.services.eventbus.ActionInteractionEvent;
-import org.apache.isis.applib.services.iactn.Interaction;
 import org.apache.isis.applib.services.iactn.InteractionContext;
 
 /**
@@ -28,36 +24,5 @@ import org.apache.isis.applib.services.iactn.InteractionContext;
 @Deprecated
 public interface Command2 extends Command {
 
-    /**
-     * @deprecated - use {@link Interaction#getCurrentExecution()}, {@link Interaction#getPriorExecution()}  and {@link Interaction#getExecutions()} instead.  NB: this method will in any case throw an exception if the most recently pushed event was a {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent} but not a {@link org.apache.isis.applib.services.eventbus.ActionInteractionEvent}
-     */
-    @Programmatic
-    @Deprecated
-    ActionInteractionEvent<?> peekActionInteractionEvent();
-
-    /**
-     * <b>NOT API</b>: intended to be called only by the framework.
-     *
-     * @deprecated - replaced by equivalent functionality in {@link Interaction}.
-     */
-    @Deprecated
-    @Programmatic
-    void pushActionInteractionEvent(ActionInteractionEvent<?> event);
-
-    /**
-     * <b>NOT API</b>: intended to be called only by the framework.
-     *
-     * @deprecated - replaced by equivalent functionality in {@link Interaction}.  NB: this method will in any case throw an exception if the most recently pushed event was a {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent} but not a {@link org.apache.isis.applib.services.eventbus.ActionInteractionEvent}
-     */
-    @Deprecated
-    @Programmatic
-    ActionInteractionEvent<?> popActionInteractionEvent();
-
-    /**
-     * @deprecated - use {@link Interaction#getCurrentExecution()}, {@link Interaction#getPriorExecution()}  and {@link Interaction#getExecutions()} instead.  NB: this method will in any case throw an exception if any of the list are {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent} but not a {@link org.apache.isis.applib.services.eventbus.ActionInteractionEvent}
-     */
-    @Deprecated
-    @Programmatic
-    List<ActionInteractionEvent<?>> flushActionInteractionEvents();
 
 }
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/command/CommandDefault.java b/core/applib/src/main/java/org/apache/isis/applib/services/command/CommandDefault.java
index 48cc7cd..b5b2e7b 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/command/CommandDefault.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/command/CommandDefault.java
@@ -23,14 +23,15 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 import java.util.concurrent.atomic.AtomicInteger;
+
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+
 import org.apache.isis.applib.annotation.Command.ExecuteIn;
 import org.apache.isis.applib.annotation.Command.Persistence;
 import org.apache.isis.applib.annotation.Programmatic;
 import org.apache.isis.applib.services.bookmark.Bookmark;
 import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
-import org.apache.isis.applib.services.eventbus.ActionInteractionEvent;
 import org.apache.isis.applib.util.ObjectContracts;
 
 public class CommandDefault implements Command3 {
@@ -185,49 +186,6 @@ public class CommandDefault implements Command3 {
 
     //endregion
 
-    //region > actionInteractionEvent (peek/pop/flush)
-
-    @Deprecated
-    @Override
-    public ActionInteractionEvent<?> peekActionInteractionEvent() {
-        final ActionDomainEvent<?> actionDomainEvent = peekActionDomainEvent();
-        if (actionDomainEvent != null && !(actionDomainEvent instanceof ActionInteractionEvent)) {
-            throw new IllegalStateException("Most recently pushed event was not an instance of ActionInteractionEvent; use either ActionDomainEvent or the (deprecated) ActionInteractionEvent consistently");
-        }
-        return (ActionInteractionEvent<?>) actionDomainEvent;
-    }
-
-    @Deprecated
-    @Override
-    public void pushActionInteractionEvent(ActionInteractionEvent<?> event) {
-        pushActionDomainEvent(event);
-    }
-
-    @Deprecated
-    @Override
-    public ActionInteractionEvent popActionInteractionEvent() {
-        final ActionDomainEvent<?> actionDomainEvent = popActionDomainEvent();
-        if (actionDomainEvent != null  && !(actionDomainEvent instanceof ActionInteractionEvent)) {
-            throw new IllegalStateException("Most recently pushed event was not an instance of ActionInteractionEvent; use either ActionDomainEvent or the (deprecated) ActionInteractionEvent consistently");
-        }
-        return (ActionInteractionEvent<?>) actionDomainEvent;
-    }
-
-    @Deprecated
-    @Programmatic
-    public List<ActionInteractionEvent<?>> flushActionInteractionEvents() {
-        final List<ActionDomainEvent<?>> actionDomainEvents = flushActionDomainEvents();
-        for (ActionDomainEvent<?> actionDomainEvent : actionDomainEvents) {
-            if (!(actionDomainEvent instanceof ActionInteractionEvent)) {
-                throw new IllegalStateException("List of events includes at least one event that is not an instance of ActionInteractionEvent; use either ActionDomainEvent or the (deprecated) ActionInteractionEvent consistently");
-            }
-        }
-        return (List)actionDomainEvents;
-    }
-
-
-    //endregion
-
     //region > actionDomainEvent (peek/pop/flush)
 
     private final LinkedList<ActionDomainEvent<?>> actionDomainEvents = Lists.newLinkedList();
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/AbstractDomainEvent.java b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/AbstractDomainEvent.java
index 5f56f74..e5728cd 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/AbstractDomainEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/AbstractDomainEvent.java
@@ -70,8 +70,8 @@ public abstract class AbstractDomainEvent<S> extends java.util.EventObject {
         }
 
         /**
-         * When the {@link org.apache.isis.applib.services.command.Command} is made available on the {@link org.apache.isis.applib.services.eventbus.ActionInteractionEvent}
-         * via {@link org.apache.isis.applib.services.eventbus.ActionInteractionEvent#getCommand()}.
+         * When the {@link org.apache.isis.applib.services.command.Command} is made available on the {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent}
+         * via {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent#getCommand()}.
          */
         public boolean isExecutingOrLater() {
             return isExecuting() || isExecuted();
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ActionDomainEvent.java b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ActionDomainEvent.java
index 1129c4f..e127603 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ActionDomainEvent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ActionDomainEvent.java
@@ -39,13 +39,8 @@ public abstract class ActionDomainEvent<S> extends AbstractDomainEvent<S> {
      * raises an event or not depends upon the "isis.reflector.facet.actionAnnotation.domainEvent.postForDefault"
      * configuration property.
      */
-    public static class Default extends ActionInteractionEvent<Object> {
+    public static class Default extends ActionDomainEvent<Object> {
         private static final long serialVersionUID = 1L;
-        public Default(){}
-        @Deprecated
-        public Default(Object source, Identifier identifier, Object... arguments) {
-            super(source, identifier, arguments);
-        }
     }
     //endregion
 
@@ -55,7 +50,7 @@ public abstract class ActionDomainEvent<S> extends AbstractDomainEvent<S> {
      * 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 ActionInteractionEvent<Object> {
+    public static class Noop extends ActionDomainEvent<Object> {
         private static final long serialVersionUID = 1L;
     }
     //endregion
@@ -66,7 +61,7 @@ public abstract class ActionDomainEvent<S> extends AbstractDomainEvent<S> {
      * 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 ActionInteractionEvent<Object> {
+    public static class Doop extends ActionDomainEvent<Object> {
         private static final long serialVersionUID = 1L;
     }
     //endregion
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ActionInteractionEvent.java b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ActionInteractionEvent.java
deleted file mode 100644
index 05d6621..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ActionInteractionEvent.java
+++ /dev/null
@@ -1,77 +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.applib.services.eventbus;
-
-import java.util.List;
-import org.apache.isis.applib.Identifier;
-
-/**
- * @deprecated - use {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent} instead.
- */
-@Deprecated
-public abstract class ActionInteractionEvent<S> extends ActionDomainEvent<S> {
-
-    private static final long serialVersionUID = 1L;
-
-    //region > Default class
-
-    /**
-     * @deprecated - use {@link org.apache.isis.applib.services.eventbus.ActionDomainEvent.Default} instead.
-     */
-    @Deprecated
-    public static class Default extends ActionDomainEvent.Default {
-        private static final long serialVersionUID = 1L;
-        public Default() {}
-        @Deprecated
-        public Default(Object source, Identifier identifier, Object... arguments) {
-            super(source, identifier, arguments);
-        }
-    }
-    //endregion
-
-    //region > constructors
-
-    public ActionInteractionEvent(){}
-
-    @Deprecated
-    public ActionInteractionEvent(
-            final S source,
-            final Identifier identifier) {
-        super(source, identifier);
-    }
-
-    @Deprecated
-    public ActionInteractionEvent(
-            final S source,
-            final Identifier identifier,
-            final Object... arguments) {
-        super(source, identifier, arguments);
-    }
-
-    @Deprecated
-    public ActionInteractionEvent(
-            final S source,
-            final Identifier identifier,
-            final List<Object> arguments) {
-        super(source, identifier, arguments);
-    }
-    //endregion
-
-
-}
\ No newline at end of file
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ActionInvokedEvent.java b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ActionInvokedEvent.java
deleted file mode 100644
index 9e24593..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/ActionInvokedEvent.java
+++ /dev/null
@@ -1,55 +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.applib.services.eventbus;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.apache.isis.applib.Identifier;
-
-/**
- * @deprecated - use instead {@link ActionInteractionEvent}
- */
-@Deprecated
-public abstract class ActionInvokedEvent<S> extends ActionInteractionEvent<S> {
-    
-    private static final long serialVersionUID = 1L;
-
-    @Deprecated
-    public static class Default extends ActionInvokedEvent<Object> {
-        private static final long serialVersionUID = 1L;
-        public Default(Object source, Identifier identifier, Object... arguments) {
-            super(source, identifier, arguments);
-        }
-    }
-
-    public ActionInvokedEvent(
-            final S source, 
-            final Identifier identifier, 
-            final Object... arguments) {
-        this(source, identifier, arguments != null? Arrays.asList(arguments): Collections.emptyList());
-    }
-    
-    public ActionInvokedEvent(
-            final S source, 
-            final Identifier identifier, 
-            final List<Object> arguments) {
-        super(source, identifier, arguments);
-    }
-}
\ No newline at end of file
diff --git a/core/applib/src/test/java/org/apache/isis/applib/services/command/Command2ContractTestAbstract.java b/core/applib/src/test/java/org/apache/isis/applib/services/command/Command2ContractTestAbstract.java
index 83948ab..daadc0f 100644
--- a/core/applib/src/test/java/org/apache/isis/applib/services/command/Command2ContractTestAbstract.java
+++ b/core/applib/src/test/java/org/apache/isis/applib/services/command/Command2ContractTestAbstract.java
@@ -19,90 +19,94 @@
 package org.apache.isis.applib.services.command;
 
 import java.util.List;
+
 import org.junit.Before;
 import org.junit.Test;
-import org.apache.isis.applib.services.eventbus.ActionInteractionEvent;
+
+import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 
 public abstract class Command2ContractTestAbstract {
 
-    Command2 command;
+    Command3 command;
 
-    ActionInteractionEvent<?> ev1;
-    ActionInteractionEvent<?> ev2;
+    ActionDomainEvent<Object> ev1;
+    ActionDomainEvent<Object> ev2;
 
     @Before
     public void setUp() throws Exception {
 
         final Object source = new Object();
-        ev1 = new ActionInteractionEvent.Default(source, null);
-        ev2 = new ActionInteractionEvent.Default(source, null);
+        ev1 = new ActionDomainEvent.Default();
+        ev1.setSource(source);
+        ev2 = new ActionDomainEvent.Default();
+        ev2.setSource(source);
         command = newCommand();
     }
 
-    protected abstract Command2 newCommand();
+    protected abstract Command3 newCommand();
 
     @Test
     public void givenEmpty() throws Exception {
         // then
-        assertNull(command.peekActionInteractionEvent());
-        assertNull(command.popActionInteractionEvent());
+        assertNull(command.peekActionDomainEvent());
+        assertNull(command.popActionDomainEvent());
     }
 
     @Test
     public void givenOne() throws Exception {
         // given
-        command.pushActionInteractionEvent(ev1);
+        command.pushActionDomainEvent(ev1);
 
         // then
-        assertEquals(ev1, command.peekActionInteractionEvent());
+        assertEquals(ev1, command.peekActionDomainEvent());
 
         // and when
-        assertEquals(ev1, command.popActionInteractionEvent());
+        assertEquals(ev1, command.popActionDomainEvent());
 
         // then
-        assertNull(command.peekActionInteractionEvent());
+        assertNull(command.peekActionDomainEvent());
     }
 
     @Test
     public void givenTwo() throws Exception {
         // given
-        command.pushActionInteractionEvent(ev1);
-        command.pushActionInteractionEvent(ev2);
+        command.pushActionDomainEvent(ev1);
+        command.pushActionDomainEvent(ev2);
 
         // then
-        assertEquals(ev2, command.peekActionInteractionEvent());
+        assertEquals(ev2, command.peekActionDomainEvent());
 
         // and when
-        assertEquals(ev2, command.popActionInteractionEvent());
+        assertEquals(ev2, command.popActionDomainEvent());
 
         // then
-        assertEquals(ev1, command.peekActionInteractionEvent());
+        assertEquals(ev1, command.peekActionDomainEvent());
 
         // and when
-        assertEquals(ev1, command.popActionInteractionEvent());
+        assertEquals(ev1, command.popActionDomainEvent());
 
         // then
-        assertNull(command.peekActionInteractionEvent());
+        assertNull(command.peekActionDomainEvent());
     }
 
     @Test
     public void pushSame() throws Exception {
 
         // given
-        command.pushActionInteractionEvent(ev1);
-        command.pushActionInteractionEvent(ev1);
+        command.pushActionDomainEvent(ev1);
+        command.pushActionDomainEvent(ev1);
 
         // then
-        assertEquals(ev1, command.peekActionInteractionEvent());
+        assertEquals(ev1, command.peekActionDomainEvent());
 
         // and when
-        assertEquals(ev1, command.popActionInteractionEvent());
+        assertEquals(ev1, command.popActionDomainEvent());
 
         // then
-        assertNull(command.peekActionInteractionEvent());
+        assertNull(command.peekActionDomainEvent());
     }
 
 
@@ -110,19 +114,19 @@ public abstract class Command2ContractTestAbstract {
     public void clear() throws Exception {
 
         // given
-        command.pushActionInteractionEvent(ev1);
-        command.pushActionInteractionEvent(ev2);
+        command.pushActionDomainEvent(ev1);
+        command.pushActionDomainEvent(ev2);
 
         // then
-        assertEquals(ev2, command.peekActionInteractionEvent());
+        assertEquals(ev2, command.peekActionDomainEvent());
 
         // and when
-        final List<ActionInteractionEvent<?>> events = command.flushActionInteractionEvents();
+        final List<ActionDomainEvent<?>> events = command.flushActionDomainEvents();
 
         // then
         assertEquals(ev1, events.get(0));
         assertEquals(ev2, events.get(1));
-        assertNull(command.peekActionInteractionEvent());
+        assertNull(command.peekActionDomainEvent());
 
     }
 
diff --git a/core/applib/src/test/java/org/apache/isis/applib/services/command/CommandDefaultTest.java b/core/applib/src/test/java/org/apache/isis/applib/services/command/CommandDefaultTest.java
index f890dae..975a9fb 100644
--- a/core/applib/src/test/java/org/apache/isis/applib/services/command/CommandDefaultTest.java
+++ b/core/applib/src/test/java/org/apache/isis/applib/services/command/CommandDefaultTest.java
@@ -20,7 +20,7 @@ package org.apache.isis.applib.services.command;
 
 public class CommandDefaultTest extends Command2ContractTestAbstract {
 
-    protected Command2 newCommand() {
+    protected Command3 newCommand() {
         return new CommandDefault();
     }
 
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/DomainEventHelper.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/DomainEventHelper.java
index 2e2dd3b..605c827 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/DomainEventHelper.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/DomainEventHelper.java
@@ -31,11 +31,9 @@ import com.google.common.collect.Lists;
 import org.apache.isis.applib.FatalException;
 import org.apache.isis.applib.Identifier;
 import org.apache.isis.applib.services.command.Command;
-import org.apache.isis.applib.services.command.Command2;
 import org.apache.isis.applib.services.command.Command3;
 import org.apache.isis.applib.services.eventbus.AbstractDomainEvent;
 import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
-import org.apache.isis.applib.services.eventbus.ActionInteractionEvent;
 import org.apache.isis.applib.services.eventbus.CollectionDomainEvent;
 import org.apache.isis.applib.services.eventbus.EventBusService;
 import org.apache.isis.applib.services.eventbus.PropertyDomainEvent;
@@ -112,10 +110,6 @@ public class DomainEventHelper {
                     if(command instanceof Command3) {
                         final Command3 command3 = (Command3) command;
                         command3.pushActionDomainEvent(event);
-                    } else if(command instanceof Command2 && event instanceof ActionInteractionEvent) {
-                        final Command2 command2 = (Command3) command;
-                        final ActionInteractionEvent<?> aie = (ActionInteractionEvent<?>) event;
-                        command2.pushActionInteractionEvent(aie);
                     }
                 }
             }
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/ActionAnnotationFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/ActionAnnotationFacetFactory.java
index b181bee..4153589 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/ActionAnnotationFacetFactory.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/ActionAnnotationFacetFactory.java
@@ -22,21 +22,18 @@ package org.apache.isis.core.metamodel.facets.actions.action;
 import java.lang.reflect.Method;
 
 import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionInteraction;
 import org.apache.isis.applib.annotation.ActionSemantics;
 import org.apache.isis.applib.annotation.Bulk;
 import org.apache.isis.applib.annotation.Command;
 import org.apache.isis.applib.annotation.Disabled;
 import org.apache.isis.applib.annotation.Hidden;
 import org.apache.isis.applib.annotation.Idempotent;
-import org.apache.isis.applib.annotation.PostsActionInvokedEvent;
 import org.apache.isis.applib.annotation.Prototype;
 import org.apache.isis.applib.annotation.PublishedAction;
 import org.apache.isis.applib.annotation.QueryOnly;
 import org.apache.isis.applib.annotation.TypeOf;
 import org.apache.isis.applib.services.HasTransactionId;
 import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
-import org.apache.isis.applib.services.eventbus.ActionInvokedEvent;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
@@ -57,12 +54,9 @@ import org.apache.isis.core.metamodel.facets.actions.action.hidden.HiddenFacetFo
 import org.apache.isis.core.metamodel.facets.actions.action.invocation.ActionDomainEventFacetAbstract;
 import org.apache.isis.core.metamodel.facets.actions.action.invocation.ActionDomainEventFacetDefault;
 import org.apache.isis.core.metamodel.facets.actions.action.invocation.ActionDomainEventFacetForActionAnnotation;
-import org.apache.isis.core.metamodel.facets.actions.action.invocation.ActionDomainEventFacetForActionInteractionAnnotation;
 import org.apache.isis.core.metamodel.facets.actions.action.invocation.ActionInvocationFacetForDomainEventAbstract;
 import org.apache.isis.core.metamodel.facets.actions.action.invocation.ActionInvocationFacetForDomainEventFromActionAnnotation;
-import org.apache.isis.core.metamodel.facets.actions.action.invocation.ActionInvocationFacetForDomainEventFromActionInteractionAnnotation;
 import org.apache.isis.core.metamodel.facets.actions.action.invocation.ActionInvocationFacetForDomainEventFromDefault;
-import org.apache.isis.core.metamodel.facets.actions.action.invocation.ActionInvocationFacetForPostsActionInvokedEventAnnotation;
 import org.apache.isis.core.metamodel.facets.actions.action.prototype.PrototypeFacetForActionAnnotation;
 import org.apache.isis.core.metamodel.facets.actions.action.prototype.PrototypeFacetForPrototypeAnnotation;
 import org.apache.isis.core.metamodel.facets.actions.action.publishing.PublishedActionFacetForActionAnnotation;
@@ -92,8 +86,6 @@ public class ActionAnnotationFacetFactory extends FacetFactoryAbstract
             implements MetaModelValidatorRefiner {
 
     private final MetaModelValidatorForDeprecatedAnnotation actionSemanticsValidator = new MetaModelValidatorForDeprecatedAnnotation(ActionSemantics.class);
-    private final MetaModelValidatorForDeprecatedAnnotation actionInteractionValidator = new MetaModelValidatorForDeprecatedAnnotation(ActionInteraction.class);
-    private final MetaModelValidatorForDeprecatedAnnotation postsActionInvokedEventValidator = new MetaModelValidatorForDeprecatedAnnotation(PostsActionInvokedEvent.class);
     private final MetaModelValidatorForDeprecatedAnnotation bulkValidator = new MetaModelValidatorForDeprecatedAnnotation(Bulk.class);
     private final MetaModelValidatorForDeprecatedAnnotation commandValidator = new MetaModelValidatorForDeprecatedAnnotation(Command.class);
     private final MetaModelValidatorForDeprecatedAnnotation queryOnlyValidator = new MetaModelValidatorForDeprecatedAnnotation(QueryOnly.class);
@@ -147,32 +139,15 @@ public class ActionAnnotationFacetFactory extends FacetFactoryAbstract
             //
             // Set up ActionDomainEventFacet, which will act as the hiding/disabling/validating advisor
             //
-            final PostsActionInvokedEvent postsActionInvokedEvent = Annotations.getAnnotation(actionMethod, PostsActionInvokedEvent.class);
-            final ActionInteraction actionInteraction =Annotations.getAnnotation(actionMethod, ActionInteraction.class);
             final Action action = Annotations.getAnnotation(actionMethod, Action.class);
             final Class<? extends ActionDomainEvent<?>> actionDomainEventType;
 
             final ActionDomainEventFacetAbstract actionDomainEventFacet;
 
 
-            // can't really do this, because would result in the event being fired for the
-            // hidden/disable/validate phases, most likely breaking existing code.
 
-//            // search for @PostsActionInvoked(value=...)
-//            if(postsActionInvokedEvent != null) {
-//                actionDomainEventType = postsActionInvokedEvent.value();
-//                actionDomainEventFacet = new ActionDomainEventFacetForPostsActionInvokedEventAnnotation(
-//                        actionDomainEventType, servicesInjector, getSpecificationLoader(), holder);
-//            } else
-
-            // search for @ActionInteraction(value=...)
-            if(actionInteraction != null) {
-                actionDomainEventType = actionInteraction.value();
-                actionDomainEventFacet = new ActionDomainEventFacetForActionInteractionAnnotation(
-                        actionDomainEventType, servicesInjector, getSpecificationLoader(), holder);
-            } else
             // search for @Action(domainEvent=...)
-            if(action != null && action.domainEvent() != null) {
+            if(action != null) {
                 actionDomainEventType = action.domainEvent();
                 actionDomainEventFacet = new ActionDomainEventFacetForActionAnnotation(
                         actionDomainEventType, servicesInjector, getSpecificationLoader(), holder);
@@ -195,24 +170,6 @@ public class ActionAnnotationFacetFactory extends FacetFactoryAbstract
             // emit the appropriate domain event and then delegate onto the underlying
 
             final ActionInvocationFacetForDomainEventAbstract actionInvocationFacet;
-            // deprecated
-            if (postsActionInvokedEvent != null) {
-                final Class<? extends ActionInvokedEvent<?>> actionInvokedEventType = postsActionInvokedEvent.value();
-                actionInvocationFacet = actionInteractionValidator.flagIfPresent(
-                        new ActionInvocationFacetForPostsActionInvokedEventAnnotation(
-                                actionInvokedEventType, actionMethod, typeSpec, returnSpec, holder,
-                                servicesInjector
-                        ), processMethodContext);
-            } else
-            // deprecated (but more recently)
-            if (actionInteraction != null) {
-                actionInvocationFacet = actionInteractionValidator.flagIfPresent(
-                        new ActionInvocationFacetForDomainEventFromActionInteractionAnnotation(
-                                actionDomainEventType, actionMethod, typeSpec, returnSpec, holder,
-                                servicesInjector
-                        ), processMethodContext);
-            } else
-            // current
             if (action != null) {
                 actionInvocationFacet = new ActionInvocationFacetForDomainEventFromActionAnnotation(
                         actionDomainEventType, actionMethod, typeSpec, returnSpec, holder,
@@ -457,8 +414,6 @@ public class ActionAnnotationFacetFactory extends FacetFactoryAbstract
     @Override
     public void refineMetaModelValidator(final MetaModelValidatorComposite metaModelValidator, final IsisConfiguration configuration) {
         metaModelValidator.add(actionSemanticsValidator);
-        metaModelValidator.add(actionInteractionValidator);
-        metaModelValidator.add(postsActionInvokedEventValidator);
         metaModelValidator.add(bulkValidator);
         metaModelValidator.add(commandValidator);
         metaModelValidator.add(queryOnlyValidator);
@@ -479,8 +434,6 @@ public class ActionAnnotationFacetFactory extends FacetFactoryAbstract
         final IsisConfiguration configuration = getConfiguration();
 
         actionSemanticsValidator.setConfiguration(configuration);
-        actionInteractionValidator.setConfiguration(configuration);
-        postsActionInvokedEventValidator.setConfiguration(configuration);
         bulkValidator.setConfiguration(configuration);
         commandValidator.setConfiguration(configuration);
         queryOnlyValidator.setConfiguration(configuration);
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventAbstract.java
index 53f6e34..2092f68 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventAbstract.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventAbstract.java
@@ -532,9 +532,8 @@ public abstract class ActionInvocationFacetForDomainEventAbstract
 
 
     /**
-     * Optional hook to allow the facet implementation for the deprecated {@link org.apache.isis.applib.annotation.PostsActionInvokedEvent} annotation
-     * to discard the event if the domain event is of a different type (specifically if was installed by virtue of a no
-     * @{@link org.apache.isis.applib.annotation.Action} or @{@link org.apache.isis.applib.annotation.ActionInteraction} annotations.
+     * Optional hook, previously added to allow (now removed) annotations to to discard the event if the domain event
+     * was incompatible.
      */
     protected ActionDomainEvent<?> verify(final ActionDomainEvent<?> event) {
         return event;
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/DomainEventHelperTest_newActionInteractionEvent.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/DomainEventHelperTest_newActionInteractionEvent.java
index 2d69a0c..959a554 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/DomainEventHelperTest_newActionInteractionEvent.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/DomainEventHelperTest_newActionInteractionEvent.java
@@ -17,9 +17,9 @@
 package org.apache.isis.core.metamodel.facets;
 
 import org.junit.Test;
+
 import org.apache.isis.applib.Identifier;
 import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
-import org.apache.isis.applib.services.eventbus.ActionInvokedEvent;
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.not;
@@ -49,11 +49,11 @@ public class DomainEventHelperTest_newActionInteractionEvent {
 
         final ActionDomainEvent<Object> ev = new DomainEventHelper(null).newActionDomainEvent(
                 ActionDomainEvent.Default.class, identifier, sdo, new Object[]{1, "bar"});
-        assertThat(ev.getSource(), is((Object)sdo));
+        assertThat(ev.getSource(), is(sdo));
         assertThat(ev.getIdentifier(), is(identifier));
         assertThat(ev.getArguments(), is(not(nullValue())));
-        assertThat(ev.getArguments().get(0), is((Object)Integer.valueOf(1)));
-        assertThat(ev.getArguments().get(1), is((Object)"bar"));
+        assertThat(ev.getArguments().get(0), is(Integer.valueOf(1)));
+        assertThat(ev.getArguments().get(1), is("bar"));
     }
 
     @Test
@@ -62,12 +62,12 @@ public class DomainEventHelperTest_newActionInteractionEvent {
         final Identifier identifier = Identifier.actionIdentifier(SomeDomainObject.class, "foo", new Class[]{int.class, String.class});
 
         final ActionDomainEvent<Object> ev = new DomainEventHelper(null).newActionDomainEvent(
-                ActionInvokedEvent.Default.class, identifier, sdo, new Object[]{1, "bar"});
-        assertThat(ev.getSource(), is((Object)sdo));
+                ActionDomainEvent.Default.class, identifier, sdo, new Object[]{1, "bar"});
+        assertThat(ev.getSource(), is(sdo));
         assertThat(ev.getIdentifier(), is(identifier));
         assertThat(ev.getArguments(), is(not(nullValue())));
-        assertThat(ev.getArguments().get(0), is((Object)Integer.valueOf(1)));
-        assertThat(ev.getArguments().get(1), is((Object)"bar"));
+        assertThat(ev.getArguments().get(0), is(Integer.valueOf(1)));
+        assertThat(ev.getArguments().get(1), is("bar"));
     }
 
     @Test
@@ -77,11 +77,11 @@ public class DomainEventHelperTest_newActionInteractionEvent {
         
         final ActionDomainEvent<SomeDomainObject> ev = new DomainEventHelper(null).newActionDomainEvent(
                 SomeDomainObjectFooInvokedDomainEvent.class, identifier, sdo, new Object[]{1, "bar"});
-        assertThat((SomeDomainObject)ev.getSource(), is(sdo));
+        assertThat(ev.getSource(), is(sdo));
         assertThat(ev.getIdentifier(), is(identifier));
         assertThat(ev.getArguments(), is(not(nullValue())));
-        assertThat(ev.getArguments().get(0), is((Object)Integer.valueOf(1)));
-        assertThat(ev.getArguments().get(1), is((Object)"bar"));
+        assertThat(ev.getArguments().get(0), is(Integer.valueOf(1)));
+        assertThat(ev.getArguments().get(1), is("bar"));
     }
     
 }
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/actions/action/ActionAnnotationFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/actions/action/ActionAnnotationFacetFactoryTest.java
index cac11d7..4233f26 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/actions/action/ActionAnnotationFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/actions/action/ActionAnnotationFacetFactoryTest.java
@@ -33,7 +33,6 @@ import org.junit.Test;
 
 import org.apache.isis.applib.Identifier;
 import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionInteraction;
 import org.apache.isis.applib.annotation.ActionSemantics;
 import org.apache.isis.applib.annotation.ActionSemantics.Of;
 import org.apache.isis.applib.annotation.CommandExecuteIn;
@@ -41,7 +40,6 @@ import org.apache.isis.applib.annotation.CommandPersistence;
 import org.apache.isis.applib.annotation.CommandReification;
 import org.apache.isis.applib.annotation.Idempotent;
 import org.apache.isis.applib.annotation.InvokeOn;
-import org.apache.isis.applib.annotation.PostsActionInvokedEvent;
 import org.apache.isis.applib.annotation.PublishedAction;
 import org.apache.isis.applib.annotation.PublishingPayloadFactoryForAction;
 import org.apache.isis.applib.annotation.QueryOnly;
@@ -49,8 +47,6 @@ import org.apache.isis.applib.annotation.SemanticsOf;
 import org.apache.isis.applib.annotation.Where;
 import org.apache.isis.applib.services.HasTransactionId;
 import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
-import org.apache.isis.applib.services.eventbus.ActionInteractionEvent;
-import org.apache.isis.applib.services.eventbus.ActionInvokedEvent;
 import org.apache.isis.applib.services.publish.EventPayload;
 import org.apache.isis.core.commons.authentication.AuthenticationSessionProvider;
 import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
@@ -179,7 +175,7 @@ public class ActionAnnotationFacetFactoryTest extends AbstractFacetFactoryJUnit4
 
             class Customer {
 
-                class SomeActionInvokedDomainEvent extends ActionInvokedEvent<Customer> {
+                class SomeActionInvokedDomainEvent extends ActionDomainEvent<Customer> {
                     public SomeActionInvokedDomainEvent(
                             final Customer source,
                             final Identifier identifier,
@@ -188,7 +184,7 @@ public class ActionAnnotationFacetFactoryTest extends AbstractFacetFactoryJUnit4
                     }
                 }
 
-                @PostsActionInvokedEvent(SomeActionInvokedDomainEvent.class)
+                @Action(domainEvent = SomeActionInvokedDomainEvent.class)
                 public void someAction() {
                 }
             }
@@ -230,16 +226,10 @@ public class ActionAnnotationFacetFactoryTest extends AbstractFacetFactoryJUnit4
 
             class Customer {
 
-                class SomeActionInvokedDomainEvent extends ActionInteractionEvent<Customer> {
-                    public SomeActionInvokedDomainEvent(
-                            final Customer source,
-                            final Identifier identifier,
-                            final Object... arguments) {
-                        super(source, identifier, arguments);
-                    }
+                class SomeActionInvokedDomainEvent extends ActionDomainEvent<Customer> {
                 }
 
-                @ActionInteraction(SomeActionInvokedDomainEvent.class)
+                @Action(domainEvent = SomeActionInvokedDomainEvent.class)
                 public void someAction() {
                 }
             }
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 2c090f7..308508b 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
@@ -45,7 +45,6 @@ import org.apache.isis.applib.services.bookmark.Bookmark;
 import org.apache.isis.applib.services.bookmark.BookmarkService2;
 import org.apache.isis.applib.services.clock.ClockService;
 import org.apache.isis.applib.services.command.Command;
-import org.apache.isis.applib.services.command.Command2;
 import org.apache.isis.applib.services.command.Command3;
 import org.apache.isis.applib.services.command.CommandContext;
 import org.apache.isis.applib.services.command.spi.CommandService;
@@ -512,10 +511,6 @@ public class PersistenceSession implements
         if(command instanceof Command3) {
             final Command3 command3 = (Command3) command;
             command3.flushActionDomainEvents();
-        } else
-        if(command instanceof Command2) {
-            final Command2 command2 = (Command2) command;
-            command2.flushActionInteractionEvents();
         }
 
         interaction.clear();

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.