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 2018/01/19 16:01:53 UTC

[isis] 02/04: ISIS-1569: adds in 'REPLAYABLE' as a new Command#ExecuteIn

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

danhaywood pushed a commit to branch ISIS-1569-replay-commands
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 448fd546cd7a617acdaa88524f86c2c20ea7dac3
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Jan 19 14:20:33 2018 +0000

    ISIS-1569: adds in 'REPLAYABLE' as a new Command#ExecuteIn
---
 .../java/org/apache/isis/applib/annotation/Command.java     | 11 ++++++++---
 .../org/apache/isis/applib/annotation/CommandExecuteIn.java | 13 ++++++++++++-
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Command.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Command.java
index a8e208c..58bafbb 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Command.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Command.java
@@ -80,9 +80,14 @@ public @interface Command {
          * @deprecated - use {@link CommandExecuteIn#BACKGROUND}
          */
         @Deprecated
-        BACKGROUND;
-
-
+        BACKGROUND,
+        /**
+         * For framework use, not intended to be used in application code.
+         *
+         * @deprecated - use {@link CommandExecuteIn#REPLAYABLE}
+         */
+        @Deprecated
+        REPLAYABLE
 
     }
 
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/CommandExecuteIn.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/CommandExecuteIn.java
index ddd557d..4be71af 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/CommandExecuteIn.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/CommandExecuteIn.java
@@ -38,13 +38,23 @@ public enum CommandExecuteIn {
      * persisted {@link org.apache.isis.applib.services.command.Command command} object as a placeholder to the
      * result.
      */
-    BACKGROUND;
+    BACKGROUND,
+    /**
+     * For commands that are replicated from a master onto a slave and are to be replayed (typically using the same
+     * mechanism as "regular" background commands, eg a background job).
+     *
+     * <p>
+     *     For framework use, not intended to be used in application code.
+     * </p>
+     */
+    REPLAYABLE;
 
     @Deprecated
     public static CommandExecuteIn from(final Command.ExecuteIn executeIn) {
         if(executeIn == null) return null;
         if(executeIn == Command.ExecuteIn.FOREGROUND) return FOREGROUND;
         if(executeIn == Command.ExecuteIn.BACKGROUND) return BACKGROUND;
+        if(executeIn == Command.ExecuteIn.REPLAYABLE) return REPLAYABLE;
         // shouldn't happen
         throw new IllegalArgumentException("Unrecognized : executeIn" + executeIn);
     }
@@ -54,6 +64,7 @@ public enum CommandExecuteIn {
         if(commandExecuteIn == null) return null;
         if(commandExecuteIn == FOREGROUND) return Command.ExecuteIn.FOREGROUND;
         if(commandExecuteIn == BACKGROUND) return Command.ExecuteIn.BACKGROUND;
+        if(commandExecuteIn == REPLAYABLE) return Command.ExecuteIn.REPLAYABLE;
         // shouldn't happen
         throw new IllegalArgumentException("Unrecognized : executeIn" + commandExecuteIn);
     }

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