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/16 13:37:09 UTC

[isis] 03/08: ISIS-1742: removes ActionInvocationMemento, and simplifies BackgroundCommandService. Now use CommandDto. Remove support for legacy persisted commands (beginning "...")

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 63f6dee44fda743d16583e7bb89369ab0411dad5
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Oct 16 14:26:47 2017 +0100

    ISIS-1742: removes ActionInvocationMemento, and simplifies BackgroundCommandService.  Now use CommandDto.  Remove support for legacy persisted commands (beginning "<memento>...")
---
 .../asciidoc/guides/rgcms/_rgcms_schema-aim.adoc   | 107 ---------------
 .../guides/rgcms/_rgcms_schema-common.adoc         |   5 +-
 .../main/asciidoc/guides/rgcms/_rgcms_schema.adoc  |   4 -
 ...pplication-layer_CommandDtoServiceInternal.adoc |  21 ++-
 ...ication-layer-spi_BackgroundCommandService.adoc |  32 +----
 ...amming-model_view-models_dto_dto-consumers.adoc |   2 +-
 .../background/ActionInvocationMemento.java        | 145 ---------------------
 .../background/BackgroundCommandService.java       |  18 +--
 .../background/BackgroundCommandService2.java      |  13 +-
 .../services/background/BackgroundService.java     |  10 --
 .../command/CommandDtoServiceInternal.java         |   9 --
 .../background/BackgroundCommandExecution.java     | 113 ++++++++--------
 .../background/BackgroundServiceDefault.java       |  26 +---
 .../command/CommandDtoServiceInternalDefault.java  |  38 ------
 todo-deprecation-list.txt                          |  24 ++--
 15 files changed, 97 insertions(+), 470 deletions(-)

diff --git a/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_schema-aim.adoc b/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_schema-aim.adoc
deleted file mode 100644
index 8964c63..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_schema-aim.adoc
+++ /dev/null
@@ -1,107 +0,0 @@
-[[_rgcms_schema-aim]]
-= Action Invocation Memento
-: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 ag [...]
-:_basedir: ../../
-:_imagesdir: images/
-
-
-
-The "aim" schema defines the serialized form (or memento) of an action invocation.
-
-[WARNING]
-====
-This schema has been removed in `1.13.0`, replaced with xref:../rgcms/rgcms.adoc#_rgcms_schema-ixn[ixn.xsd] (for action
-invocations/property edits) and with xref:../rgcms/rgcms.adoc#_rgcms_schema-cmd[cmd.xsd] (commands, ie the __intention__ to
-invoke an action/edit a property).
-
-The remaining content on this page describes how `CommandContext` works up to v1.12.x.  However, as of `1.13.0` the `CommandContext` uses its own `cmd.xsd` schema).
-====
-
-Action invocations are captured (in memory rather than in serialized form) when the end-user invokes the action
-"through" the UI, by way of the xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-api_CommandContext[CommandContext] service. Using the
-`ActionInvocationMementoDtoUtils` utility class, a service can instantiate `ActionInvocationMementoDto` which can then
-be serialized to/from using the same `ActionInvocationMementoDtoUtils` class.
-
-[source,xml]
-----
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema targetNamespace="http://isis.apache.org/schema/aim"                              <!--1-->
-           elementFormDefault="qualified"
-           xmlns:xs="http://www.w3.org/2001/XMLSchema"
-           xmlns="http://isis.apache.org/schema/aim"
-           xmlns:common="http://isis.apache.org/schema/common">
-
-    <xs:import namespace="http://isis.apache.org/schema/common"                             <!--2-->
-               schemaLocation="http://isis.apache.org/schema/common/common-1.0.xsd"/>
-
-    <xs:element name="actionInvocationMementoDto">                                          <!--3-->
-        <xs:complexType>
-            <xs:sequence>
-                <xs:element name="metadata">
-                    <xs:complexType>
-                        <xs:sequence>
-                            <xs:element name="transactionId" type="xs:string"/>             <!--4-->
-                            <xs:element name="sequence" type="xs:int"/>                     <!--5-->
-                            <xs:element name="timestamp" type="xs:dateTime"/>               <!--6-->
-                            <xs:element name="target" type="common:oidDto"/>                <!--7-->
-                            <xs:element name="targetClass" type="xs:string"/>               <!--8-->
-                            <xs:element name="targetAction" type="xs:string"/>              <!--9-->
-                            <xs:element name="actionIdentifier" type="xs:string"/>          <!--10-->
-                            <xs:element name="user" type="xs:string"/>                      <!--11-->
-                            <xs:element name="title" type="xs:string"/>                     <!--12-->
-                        </xs:sequence>
-                    </xs:complexType>
-                </xs:element>
-                <xs:element name="payload">
-                    <xs:complexType>
-                        <xs:sequence>
-                            <xs:element name="parameters">                                  <!--13-->
-                                <xs:complexType>
-                                    <xs:sequence maxOccurs="unbounded">
-                                        <xs:element name="param" type="paramDto"/>
-                                    </xs:sequence>
-                                    <xs:attribute name="num" use="required" type="xs:int"/>
-                                </xs:complexType>
-                            </xs:element>
-                            <xs:element name="return" type="common:valueDto"                <!--14-->
-                                        minOccurs="0" maxOccurs="1"/>
-                        </xs:sequence>
-                    </xs:complexType>
-                </xs:element>
-            </xs:sequence>
-        </xs:complexType>
-    </xs:element>
-
-    <xs:complexType name="paramDto">                                                        <!--15-->
-        <xs:sequence>
-            <xs:element name="value" type="common:valueDto"/>                               <!--16-->
-        </xs:sequence>
-        <xs:attribute name="parameterName" use="required" type="xs:string"/>                <!--17-->
-        <xs:attribute name="parameterType" use="required" type="common:valueType"/>
-        <xs:attribute name="null" use="optional" type="xs:boolean"/>
-    </xs:complexType>
-</xs:schema>
-----
-<1> the aim schema has a namespace URI of "http://isis.apache.org/schema/aim".  Although URIs are not the same as URLs, you will find that the schemas are also downloadable from this location.
-<2> reuses the xref:../rgcms/rgcms.adoc#_rgcms_schema-common[common] schema
-<3> definition of the `actionInvocationMementoDto` complex type. This consists of metadata (the transaction identifier, the target object, the initiating user) and the payload (the action parameter/arguments, the return value if known).
-<4> the unique transaction Id (a guid) allocated by the framework for each and every transaction
-<5> a sequence number within the transaction.  It is possible for there to be more than one action invocation to be
-<6> when the action was invoked
-<7> target object, as an OID (using `oidDto` from the xref:../rgcms/rgcms.adoc#_rgcms_schema-common[common] schema)
-<8> fully qualified class name of the target object, for information only
-<9> name of the action, for information only
-<10> Javadoc style unique identifier for the action.
-<11> User that invoked the action
-<12> title of the target object, for information only
-<13> Collection of parameter/arguments, defined in terms of the `paramDto` complex type (discussed just below)
-<14> The return value of the action, if known (and not void)
-<15> The `paramDto` defines both an action parameter and its corresponding argument values
-<16> The value of the parameter, in other words an argument value
-<17> Metadata about the parameter itself: its name, type, optionality.
-
-[NOTE]
-====
-As of `1.11.0` through `1.12.2` this schema is not used directly by the framework; in particular
-`Command#setMemento(...)` sets a similar but less formal XML structure.  This may change in the future.
-====
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_schema-common.adoc b/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_schema-common.adoc
index 9e2a9dc..35acf2b 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_schema-common.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_schema-common.adoc
@@ -130,9 +130,8 @@ The common schema also defines two types representing values: the `valueDto` com
 Used for the return value of action invocations, and for the new value in property edits.
 
 
-These type definitions are just building blocks, also used within the xref:../rgcms/rgcms.adoc#_rgcms_schema-aim[action iInvocation memento] schema.
-The first, `valueDto` is The second, `valueType`, enumerates the different types of vales, eg of a
-formal parameter to an action.
+These type definitions are just building blocks.
+The first, `valueDto` is The second, `valueType`, enumerates the different types of vales, eg of a formal parameter to an action.
 
 
 
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_schema.adoc b/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_schema.adoc
index 359ce8f..a49eb22 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_schema.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_schema.adoc
@@ -17,9 +17,6 @@ to invoke an action or edit a property
 * the xref:../rgcms/rgcms.adoc#_rgcms_schema-chg[changes] schema, which captures which objects have been
 created, updated or deleted as the result of an execution of an action invocation/property edit
 
-* the xref:../rgcms/rgcms.adoc#_rgcms_schema-aim[action memento invocation] schema (deprecated in `1.13.0`, replaced by
-either "cmd" or "ixn"), which allows action invocations to be captured and reified.
-
 These each use XSD types defined by the xref:../rgcms/rgcms.adoc#_rgcms_schema-common[common schema] (most notably the `oidDto`
 complex type which identifies a domain object).
 
@@ -31,5 +28,4 @@ The sections below discuss these schemas in more detail.
 include::_rgcms_schema-cmd.adoc[leveloffset=+1]
 include::_rgcms_schema-ixn.adoc[leveloffset=+1]
 include::_rgcms_schema-chg.adoc[leveloffset=+1]
-include::_rgcms_schema-aim.adoc[leveloffset=+1]
 include::_rgcms_schema-common.adoc[leveloffset=+1]
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgfis/_rgfis_application-layer_CommandDtoServiceInternal.adoc b/adocs/documentation/src/main/asciidoc/guides/rgfis/_rgfis_application-layer_CommandDtoServiceInternal.adoc
index 1f00cc3..729ea18 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgfis/_rgfis_application-layer_CommandDtoServiceInternal.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgfis/_rgfis_application-layer_CommandDtoServiceInternal.adoc
@@ -20,36 +20,31 @@ The SPI of the service is:
 [source,java]
 ----
 public interface CommandDtoServiceInternal {
-    @Deprecated
-    ActionInvocationMemento asActionInvocationMemento(      // <1>
-            Method m,
-            Object domainObject, Object[] args);
-    CommandDto asCommandDto(                                // <2>
+    CommandDto asCommandDto(                                // <1>
             List<ObjectAdapter> targetAdapters,
             ObjectAction objectAction,
             ObjectAdapter[] argAdapters);
-    CommandDto asCommandDto(                                // <3>
+    CommandDto asCommandDto(                                // <2>
             final List<ObjectAdapter> targetAdapters,
             final OneToOneAssociation association,
             final ObjectAdapter valueAdapterOrNull);
-    void addActionArgs(                                     // <4>
+    void addActionArgs(                                     // <3>
             final ObjectAction objectAction,
             final ActionDto actionDto,
             final ObjectAdapter[] argAdapters);
-    void addPropertyValue(                                  // <5>
+    void addPropertyValue(                                  // <4>
             final OneToOneAssociation property,
             final PropertyDto propertyDto,
             final ObjectAdapter valueAdapter);
 }
 ----
-<1> Note that this method (more precisely, `ActionInvocationMemento`) does __not__ support mixins.
-<2> Returns a JAXB DTO being an instance of the xref:../rgcms/rgcms.adoc#_rgcms_schema-cmd["cmd" schema] (hence convertible to
+<1> Returns a JAXB DTO being an instance of the xref:../rgcms/rgcms.adoc#_rgcms_schema-cmd["cmd" schema] (hence convertible to
 XML) that represents the __intention__ to invoke an action on a target object (or possibly many targets, for
 bulk actions).  If an action, it can also be either mixin action or a contributed action.
-<3> Returns a JAXB DTO that represents the intention to edit (set or clear) a property on a target (or possibly many
+<2> Returns a JAXB DTO that represents the intention to edit (set or clear) a property on a target (or possibly many
 targets, for symmetry with actions).
-<4> add the arguments of an action to an `ActionDto`.  This is used when the command is actually executed (per xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-api_InteractionContext[`InteractionContext`]) to populate the parameters of the equivalent `ActionInvocationDto`.
-<5> add the new value argument of a property to a `PropertyDto`.  This is used when the command is actually executed (per xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-api_InteractionContext[`InteractionContext`]) to set the the new value of the equivalent `PropertyEditDto`.
+<3> add the arguments of an action to an `ActionDto`.  This is used when the command is actually executed (per xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-api_InteractionContext[`InteractionContext`]) to populate the parameters of the equivalent `ActionInvocationDto`.
+<4> add the new value argument of a property to a `PropertyDto`.  This is used when the command is actually executed (per xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-api_InteractionContext[`InteractionContext`]) to set the the new value of the equivalent `PropertyEditDto`.
 
 
 The SPI is implemented by `o.a.i.c.r.s.command.CommandDtoServiceInternalServiceDefault`.
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-spi_BackgroundCommandService.adoc b/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-spi_BackgroundCommandService.adoc
index 83678b7..d4eb268 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-spi_BackgroundCommandService.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-spi_BackgroundCommandService.adoc
@@ -1,12 +1,12 @@
 [[_rgsvc_application-layer-spi_BackgroundCommandService]]
-= `BackgroundCommandService`
+= `BackgroundCommandService2`
 :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 ag [...]
 :_basedir: ../../
 :_imagesdir: images/
 
 
 
-The `BackgroundCommandService` (SPI) service supports the xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-api_BackgroundService[`BackgroundService`] (API) service, persisting action invocations as commands such that they can subsequently be invoked in the background.
+The `BackgroundCommandService2` (SPI) service supports the xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-api_BackgroundService[`BackgroundService`] (API) service, persisting action invocations as commands such that they can subsequently be invoked in the background.
 
 The `BackgroundService` is responsible for capturing a memento representing the action invocation, and then hands off to the xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-spi_BackgroundCommandService[`BackgroundCommandService`] `BackgroundCommandService` to actually persist it.
 
@@ -17,41 +17,23 @@ The persisting of commands is only half the story; there needs to be a separate
 
 == SPI
 
-The SPI of the `BackgroundCommandService` is:
+The SPI of the `BackgroundCommandService2` is:
 
 [source,java]
 ----
-public interface BackgroundCommandService {
+public interface BackgroundCommandService2 {
     void schedule(
-            ActionInvocationMemento aim,        // <1>
-            Command parentCommand,              // <2>
+            CommandDto dto,             // <1>
+            Command parentCommand,      // <2>
             String targetClassName,
             String targetActionName,
             String targetArgs);
 
 }
 ----
-<1> is a wrapper around a xref:../rgsvc/rgsvc.adoc#_rgsvc_integration-api_MementoService[`MementoService`]'s `Memento`, capturing the details of the action invocation to be retained (eg persisted to a database) so that it can be executed at a later time
+<1> an instance of a xref:../rgcms/rgcms.adoc#_rgcms_schema-cmd[`CommandDto`] capturing the details of the action invocation or property edit to be retained (eg persisted to a database) so that it can be executed at a later time
 <2> reference to the parent `Command` requesting the action be performed as a background command.  This allows information such as the initiating user to be obtained.
 
-The API of `ActionInvocationMemento` in turn is:
-
-[source,java]
-----
-public class ActionInvocationMemento {
-    public String getActionId() { ... }
-    public String getTargetClassName() { ... }
-    public String getTargetActionName() { ... }
-    public Bookmark getTarget() { ... }
-    public int getNumArgs() { ... }
-    public Class<?> getArgType(int num) throws ClassNotFoundException { ... }
-    public <T> T getArg(int num, Class<T> type) { ... }
-
-    public String asMementoString() { ... }     // <1>
-}
-----
-<1> lets the `BackgroundCommandService` implementation convert the action invocation into a simple string.
-
 
 
 == "Internal" SPI
diff --git a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_view-models_dto_dto-consumers.adoc b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_view-models_dto_dto-consumers.adoc
index e1767ff..7843f31 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_view-models_dto_dto-consumers.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_view-models_dto_dto-consumers.adoc
@@ -23,7 +23,7 @@ In our case we focus on the validation (to determine the nature of the inbound m
 ====
 
 The (non-ASF) link:http://platform.incode.org[Incode Platform^]'s publishmq module provides an out-of-the-box solution of this design.
-It provides an implementation of the xref:../rgsvc/rgsvc.adoc#_rgsvc_persistence-layer-spi_PublisherService[`PublisherService`], but which simply publishes instances of xref:../rgcms/rgcms.adoc#_rgcms_schema-aim[`ActionInvocationMemento`] to an ActiveMQ queue.
+It provides an implementation of the xref:../rgsvc/rgsvc.adoc#_rgsvc_persistence-layer-spi_PublisherService[`PublisherService`], but which simply publishes instances of xref:../rgcms/rgcms.adoc#_rgcms_schema-ixn[`InteractionDto`] to an ActiveMQ queue.
 Camel (or similar) can then be hooked up to consume these events from this queue, and use a processor to parse the action memento to determine what has changed on the source system.
 Thereafter, a subsequent Camel processor can then call back to the source - via the xref:../ugvro/ugvro.adoc#[Restful Objects viewer] - to enrich the message with additional details using a DTO.
 
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/background/ActionInvocationMemento.java b/core/applib/src/main/java/org/apache/isis/applib/services/background/ActionInvocationMemento.java
deleted file mode 100644
index 08286da..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/services/background/ActionInvocationMemento.java
+++ /dev/null
@@ -1,145 +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.background;
-
-import java.util.Iterator;
-import java.util.List;
-import org.apache.isis.applib.services.bookmark.Bookmark;
-import org.apache.isis.applib.services.memento.MementoService;
-import org.apache.isis.applib.services.memento.MementoService.Memento;
-import org.apache.isis.schema.cmd.v1.CommandDto;
-
-/**
- * A memento for an action invocation, to allow the details of an action invocation
- * to be captured and stored, then executed later.
- * 
- * <p>
- * Provided as a mechanism by which implementations of {@link BackgroundService} can 
- * hand-off work to the {@link BackgroundCommandService}.  This is used by the
- * default implementation of <tt>BackgroundServiceDefault</tt> in the <tt>isis-module-background</tt> module.
- * </p>
- *
- * <p>
- * Implementation-wise this is a wrapper around {@link MementoService.Memento},
- * and abstracts away the details of the keys used to store the various pieces of
- * information stored in the underlying memento.
- * </p>
- *
- * <p>
- * Note that this class - unlike {@link CommandDto} does <i>not</i> support mixins.
- * </p>
- *
- * @deprecated - use {@link CommandDto} instead.
- */
-@Deprecated
-public class ActionInvocationMemento {
-
-    private final Memento memento;
-
-    public ActionInvocationMemento(
-            final MementoService mementoService, 
-            final String actionId, 
-            final Bookmark target,
-            final List<Class<?>> argTypes,
-            final List<Object> args) {
-        
-        if(argTypes.size() != args.size()) {
-            throw new IllegalArgumentException("argTypes and args must be same size");
-        }
-        
-        this.memento = mementoService.create();
-        memento.set("actionId", actionId);
-        memento.set("target", target);
-        memento.set("numArgs", args.size());
-        
-        final Iterator<Class<?>> iterArgTypes = argTypes.iterator();
-        final Iterator<Object> iterArgs = args.iterator();
-        int i=0;
-        while(iterArgTypes.hasNext() && iterArgs.hasNext()) {
-            memento.set("arg" + i + "Type", iterArgTypes.next().getName());
-            memento.set("arg" + i         , iterArgs.next());
-            i++;
-        }
-    }
-    
-    public ActionInvocationMemento(final MementoService mementoService, final String mementoStr) {
-        this.memento = mementoService.parse(mementoStr);
-    }
-    
-    // //////////////////////////////////////
-
-    
-    public String getActionId() {
-        return memento.get("actionId", String.class);
-    }
-
-    /**
-     * @deprecated - always returns <tt>null</tt>; use {@link #getActionId()} instead.
-     */
-    @Deprecated
-    public String getTargetClassName() {
-        return memento.get("targetClassName", String.class);
-    }
-
-    /**
-     * @deprecated - always returns <tt>null</tt>; use {@link #getActionId()} instead.
-     */
-    @Deprecated
-    public String getTargetActionName() {
-        return memento.get("targetActionName", String.class);
-    }
-    
-    public Bookmark getTarget() {
-        return memento.get("target", Bookmark.class);
-    }
-    
-    public int getNumArgs() {
-        return memento.get("numArgs", Integer.class);
-    }
-
-    public Class<?> getArgType(final int num) throws ClassNotFoundException {
-        String className = memento.get("arg" + num + "Type", String.class);
-        if(className.equals("byte")) return byte.class;
-        if(className.equals("short")) return short.class;
-        if(className.equals("int")) return int.class;
-        if(className.equals("long")) return long.class;
-        if(className.equals("float")) return float.class;
-        if(className.equals("double")) return double.class;
-        if(className.equals("char")) return char.class;
-        if(className.equals("boolean")) return boolean.class;
-        return className != null? Thread.currentThread().getContextClassLoader().loadClass(className): null;
-    }
-    
-    public <T> T getArg(final int num, final Class<T> type) {
-        return memento.get("arg" + num, type);
-    }
-    
-    // //////////////////////////////////////
-
-    public String asMementoString() {
-        return memento.asString();
-    }
-
-    // //////////////////////////////////////
-    
-    @Override
-    public String toString() {
-        return asMementoString();
-    }
-
-
-}
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundCommandService.java b/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundCommandService.java
index 919a700..11621d8 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundCommandService.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundCommandService.java
@@ -16,11 +16,8 @@
  */
 package org.apache.isis.applib.services.background;
 
-import org.apache.isis.applib.services.command.Command;
-
-
 /**
- * Persists a {@link ActionInvocationMemento memento-ized} action such that it can be executed asynchronously,
+ * Persists a {@link org.apache.isis.schema.cmd.v1.CommandDto command-reified} action such that it can be executed asynchronously,
  * for example through a Quartz scheduler.
  *
  * <p>
@@ -35,20 +32,7 @@ import org.apache.isis.applib.services.command.Command;
  * annotated with {@link org.apache.isis.applib.annotation.DomainService} so that it is automatically registered as
  * a service.
  *
- * <p>
- *     If an implementation also implements {@link BackgroundCommandService2}, then
- *     {@link BackgroundCommandService2#schedule(ActionInvocationMemento, Command, String, String, String)} will be
- *     called rather than {@link BackgroundCommandService#schedule(ActionInvocationMemento, Command, String, String, String)}.
- * </p>
  */
 public interface BackgroundCommandService {
 
-    /**
-     * @deprecated - replaced by {@link BackgroundCommandService2#schedule(ActionInvocationMemento, Command, String, String, String)}
-     */
-    @Deprecated
-    void schedule(
-            final ActionInvocationMemento aim, 
-            final Command command, 
-            final String targetClassName, final String targetActionName, final String targetArgs);
 }
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundCommandService2.java b/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundCommandService2.java
index c79a1fa..e693592 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundCommandService2.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundCommandService2.java
@@ -20,21 +20,12 @@ import org.apache.isis.applib.services.command.Command;
 import org.apache.isis.schema.cmd.v1.CommandDto;
 
 /**
- * Persists a {@link org.apache.isis.schema.cmd.v1.CommandDto memento-ized} command such that it can be executed asynchronously,
- * for example through a Quartz scheduler.
- *
- * <p>
- *     If an implementation of {@link BackgroundCommandService} also implements this interface, then its version of {@link #schedule(ActionInvocationMemento, Command, String, String, String)}  will be used instead.
- * </p>
+ * Persists a {@link org.apache.isis.schema.cmd.v1.CommandDto memento-ized} command such that it can be
+ * executed asynchronously, for example through a Quartz scheduler.
  *
  */
 public interface BackgroundCommandService2 extends BackgroundCommandService {
 
-    /**
-     * Will be called instead of
-     * {@link BackgroundCommandService#schedule(ActionInvocationMemento, Command, String, String, String)}
-     * (ie if the implementation implements this interface rather than simply {@link BackgroundCommandService}).
-     */
     void schedule(
             final CommandDto dto,
             final Command parentCommand,
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundService.java b/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundService.java
index 9a5a486..158a86a 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundService.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundService.java
@@ -16,8 +16,6 @@
  */
 package org.apache.isis.applib.services.background;
 
-import java.lang.reflect.Method;
-
 import org.apache.isis.applib.annotation.Programmatic;
 
 /**
@@ -49,13 +47,5 @@ public interface BackgroundService {
     @Programmatic
     <T> T execute(final T object);
 
-    /**
-     * Not API: for framework use only.
-     *
-     * @deprecated - no longer called by the framework (moved to <tt>InteractionDtoServiceInternal</tt>, an internal SPI service).
-     */
-    @Deprecated
-    @Programmatic
-    ActionInvocationMemento asActionInvocationMemento(Method m, Object domainObject, Object[] args);
 
 }
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/command/CommandDtoServiceInternal.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/command/CommandDtoServiceInternal.java
index 40321ab..c1bb4a3 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/command/CommandDtoServiceInternal.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/command/CommandDtoServiceInternal.java
@@ -20,7 +20,6 @@ import java.lang.reflect.Method;
 import java.util.List;
 
 import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.services.background.ActionInvocationMemento;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
 import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
@@ -34,14 +33,6 @@ import org.apache.isis.schema.cmd.v1.PropertyDto;
  */
 public interface CommandDtoServiceInternal {
 
-    /**
-     * Note that this method (more precisely, {@link ActionInvocationMemento}) does <i>not</i> support mixins.
-     *
-     * @deprecated - use {@link #asCommandDto(List, ObjectAction, ObjectAdapter[])} instead.
-     */
-    @Deprecated
-    @Programmatic
-    ActionInvocationMemento asActionInvocationMemento(Method m, Object domainObject, Object[] args);
 
     /**
      * Returns a JAXB DTO (hence convertible to XML) that represents the intention to invoke an action on a
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundCommandExecution.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundCommandExecution.java
index 6787c25..2b9303d 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundCommandExecution.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundCommandExecution.java
@@ -25,7 +25,6 @@ import com.google.common.base.Throwables;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
 
-import org.apache.isis.applib.services.background.ActionInvocationMemento;
 import org.apache.isis.applib.services.bookmark.Bookmark;
 import org.apache.isis.applib.services.bookmark.BookmarkService2;
 import org.apache.isis.applib.services.clock.ClockService;
@@ -123,40 +122,40 @@ public abstract class BackgroundCommandExecution extends AbstractIsisSessionTemp
                 try {
                     backgroundCommand.setExecutor(Executor.BACKGROUND);
 
-                    final boolean legacy = memento.startsWith("<memento");
+                    final boolean legacy = false; // memento.startsWith("<memento");
                     if(legacy) {
 
-                        final ActionInvocationMemento aim = new ActionInvocationMemento(mementoService, memento);
-
-                        final String actionId = aim.getActionId();
-
-                        final Bookmark targetBookmark = aim.getTarget();
-                        final Object targetObject = bookmarkService.lookup(
-                                                        targetBookmark, BookmarkService2.FieldResetPolicy.RESET);
-
-                        final ObjectAdapter targetAdapter = adapterFor(targetObject);
-                        final ObjectSpecification specification = targetAdapter.getSpecification();
-
-                        final ObjectAction objectAction = findActionElseNull(specification, actionId);
-                        if(objectAction == null) {
-                            throw new RuntimeException(String.format("Unknown action '%s'", actionId));
-                        }
-
-                        // TODO: background commands won't work for mixin actions...
-                        // ... we obtain the target from the bookmark service (above), which will
-                        // simply fail for a mixin.  Instead we would need to serialize out the mixedInAdapter
-                        // and also capture the mixinType within the aim memento.
-                        final ObjectAdapter mixedInAdapter = null;
-
-                        final ObjectAdapter[] argAdapters = argAdaptersFor(aim);
-                        final ObjectAdapter resultAdapter = objectAction.execute(
-                                targetAdapter, mixedInAdapter, argAdapters, InteractionInitiatedBy.FRAMEWORK);
-
-                        if(resultAdapter != null) {
-                            Bookmark resultBookmark = CommandUtil.bookmarkFor(resultAdapter);
-                            backgroundCommand.setResult(resultBookmark);
-                            backgroundInteraction.getCurrentExecution().setReturned(resultAdapter.getObject());
-                        }
+//                        final ActionInvocationMemento aim = new ActionInvocationMemento(mementoService, memento);
+//
+//                        final String actionId = aim.getActionId();
+//
+//                        final Bookmark targetBookmark = aim.getTarget();
+//                        final Object targetObject = bookmarkService.lookup(
+//                                                        targetBookmark, BookmarkService2.FieldResetPolicy.RESET);
+//
+//                        final ObjectAdapter targetAdapter = adapterFor(targetObject);
+//                        final ObjectSpecification specification = targetAdapter.getSpecification();
+//
+//                        final ObjectAction objectAction = findActionElseNull(specification, actionId);
+//                        if(objectAction == null) {
+//                            throw new RuntimeException(String.format("Unknown action '%s'", actionId));
+//                        }
+//
+//                        // TODO: background commands won't work for mixin actions...
+//                        // ... we obtain the target from the bookmark service (above), which will
+//                        // simply fail for a mixin.  Instead we would need to serialize out the mixedInAdapter
+//                        // and also capture the mixinType within the aim memento.
+//                        final ObjectAdapter mixedInAdapter = null;
+//
+//                        final ObjectAdapter[] argAdapters = argAdaptersFor(aim);
+//                        final ObjectAdapter resultAdapter = objectAction.execute(
+//                                targetAdapter, mixedInAdapter, argAdapters, InteractionInitiatedBy.FRAMEWORK);
+//
+//                        if(resultAdapter != null) {
+//                            Bookmark resultBookmark = CommandUtil.bookmarkFor(resultAdapter);
+//                            backgroundCommand.setResult(resultBookmark);
+//                            backgroundInteraction.getCurrentExecution().setReturned(resultAdapter.getObject());
+//                        }
 
                     } else {
 
@@ -306,30 +305,30 @@ public abstract class BackgroundCommandExecution extends AbstractIsisSessionTemp
         return null;
     }
 
-    private ObjectAdapter[] argAdaptersFor(final ActionInvocationMemento aim)  {
-        final int numArgs = aim.getNumArgs();
-        final List<ObjectAdapter> argumentAdapters = Lists.newArrayList();
-        for(int i=0; i<numArgs; i++) {
-            final ObjectAdapter argAdapter = argAdapterFor(aim, i);
-            argumentAdapters.add(argAdapter);
-        }
-        return argumentAdapters.toArray(new ObjectAdapter[]{});
-    }
-
-    private ObjectAdapter argAdapterFor(final ActionInvocationMemento aim, int num) {
-        final Class<?> argType;
-        try {
-            argType = aim.getArgType(num);
-            final Object arg = aim.getArg(num, argType);
-            if(arg == null) {
-                return null;
-            }
-            return argAdapterFor(argType, arg);
-
-        } catch (ClassNotFoundException e) {
-            throw new RuntimeException(e);
-        }
-    }
+//    private ObjectAdapter[] argAdaptersFor(final ActionInvocationMemento aim)  {
+//        final int numArgs = aim.getNumArgs();
+//        final List<ObjectAdapter> argumentAdapters = Lists.newArrayList();
+//        for(int i=0; i<numArgs; i++) {
+//            final ObjectAdapter argAdapter = argAdapterFor(aim, i);
+//            argumentAdapters.add(argAdapter);
+//        }
+//        return argumentAdapters.toArray(new ObjectAdapter[]{});
+//    }
+//
+//    private ObjectAdapter argAdapterFor(final ActionInvocationMemento aim, int num) {
+//        final Class<?> argType;
+//        try {
+//            argType = aim.getArgType(num);
+//            final Object arg = aim.getArg(num, argType);
+//            if(arg == null) {
+//                return null;
+//            }
+//            return argAdapterFor(argType, arg);
+//
+//        } catch (ClassNotFoundException e) {
+//            throw new RuntimeException(e);
+//        }
+//    }
 
     protected ObjectAdapter targetAdapterFor(final OidDto targetOidDto) {
 
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundServiceDefault.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundServiceDefault.java
index 8282ae8..8b279d6 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundServiceDefault.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundServiceDefault.java
@@ -29,7 +29,6 @@ import javax.annotation.PreDestroy;
 import org.apache.isis.applib.annotation.DomainService;
 import org.apache.isis.applib.annotation.NatureOfService;
 import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.services.background.ActionInvocationMemento;
 import org.apache.isis.applib.services.background.BackgroundCommandService;
 import org.apache.isis.applib.services.background.BackgroundCommandService2;
 import org.apache.isis.applib.services.background.BackgroundService2;
@@ -224,21 +223,14 @@ public class BackgroundServiceDefault implements BackgroundService2 {
 
                 final Command command = commandContext.getCommand();
 
-                if(backgroundCommandService instanceof BackgroundCommandService2) {
-                    final BackgroundCommandService2 bcs2 = (BackgroundCommandService2) backgroundCommandService;
+                final BackgroundCommandService2 bcs2 = (BackgroundCommandService2) backgroundCommandService;
 
-                    final List<ObjectAdapter> targetList = Collections.singletonList(domainObjectAdapter);
-                    final CommandDto dto =
-                            commandDtoServiceInternal.asCommandDto(targetList, action, argAdapters);
+                final List<ObjectAdapter> targetList = Collections.singletonList(domainObjectAdapter);
+                final CommandDto dto =
+                        commandDtoServiceInternal.asCommandDto(targetList, action, argAdapters);
 
-                    bcs2.schedule(dto, command, domainObjectClassName, targetActionName, targetArgs);
-                } else {
-                    // fallback
-                    final ActionInvocationMemento aim =
-                            commandDtoServiceInternal.asActionInvocationMemento(proxyMethod, target, args);
+                bcs2.schedule(dto, command, domainObjectClassName, targetActionName, targetArgs);
 
-                    backgroundCommandService.schedule(aim, command, domainObjectClassName, targetActionName, targetArgs);
-                }
 
                 return null;
             }
@@ -268,14 +260,6 @@ public class BackgroundServiceDefault implements BackgroundService2 {
         };
     }
 
-    // //////////////////////////////////////
-
-    @Programmatic
-    @Override
-    public ActionInvocationMemento asActionInvocationMemento(Method method, Object domainObject, Object[] args) {
-        throw new RuntimeException("Replaced by InteractionDtoServiceInternal");
-    }
-
 
     // //////////////////////////////////////
 
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/command/CommandDtoServiceInternalDefault.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/command/CommandDtoServiceInternalDefault.java
index cafbf2f..781b67a 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/command/CommandDtoServiceInternalDefault.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/command/CommandDtoServiceInternalDefault.java
@@ -28,7 +28,6 @@ import com.google.common.collect.Lists;
 import org.apache.isis.applib.annotation.DomainService;
 import org.apache.isis.applib.annotation.NatureOfService;
 import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.services.background.ActionInvocationMemento;
 import org.apache.isis.applib.services.bookmark.Bookmark;
 import org.apache.isis.applib.services.bookmark.BookmarkService;
 import org.apache.isis.applib.services.command.Command;
@@ -106,43 +105,6 @@ public class CommandDtoServiceInternalDefault implements CommandDtoServiceIntern
 
     // //////////////////////////////////////
 
-    @Deprecated
-    @Programmatic
-    @Override
-    public ActionInvocationMemento asActionInvocationMemento(
-            final Method method,
-            final Object domainObject,
-            final Object[] args) {
-        
-        final ObjectSpecificationDefault targetObjSpec = getJavaSpecificationOfOwningClass(method);
-        final ObjectMember member = targetObjSpec.getMember(method);
-        if(member == null) {
-            return null;
-        }
-
-        if(!(member instanceof ObjectAction)) {
-            throw new UnsupportedOperationException(String.format(
-                    "Method %s does not correspond to an action.", method.getName()));
-        }
-
-        final ObjectAction action = (ObjectAction) member;
-        final String actionIdentifier = CommandUtil.memberIdentifierFor(action);
-        
-        final Bookmark domainObjectBookmark = bookmarkService.bookmarkFor(domainObject);
-
-        final List<Class<?>> argTypes = Lists.newArrayList();
-        final List<Object> argObjs = Lists.newArrayList();
-        CommandUtil.buildMementoArgLists(mementoService, bookmarkService, method, args, argTypes, argObjs);
-
-        final ActionInvocationMemento aim = 
-                new ActionInvocationMemento(mementoService, 
-                        actionIdentifier, 
-                        domainObjectBookmark,
-                        argTypes,
-                        argObjs);
-       
-        return aim;
-    }
 
     @Override
     public CommandDto asCommandDto(
diff --git a/todo-deprecation-list.txt b/todo-deprecation-list.txt
index 66a7764..3d71494 100644
--- a/todo-deprecation-list.txt
+++ b/todo-deprecation-list.txt
@@ -18,17 +18,8 @@ org.apache.isis.applib.clock
     Clock
 
 
-
-org.apache.isis.applib.services.actinvoc
-    ActionInvocationContext.java -remove unused constructors
-
 org.apache.isis.applib.services.audit  (2 usages found)
     AuditingService3.java - remove entire service, use AuditerService instead
-org.apache.isis.applib.services.background  (10 usages found)
-    ActionInvocationMemento.java - remove entire class, use InteractionDto and CommandDto are used internally instead
-    BackgroundCommandService.java - remove methods using AIM, instead keep those using CommandDto (in BackgroundCommandService2)
-    BackgroundService.java
-        asActionInvocationMemento(Method, Object, Object[]) - remove this internal API, no longer called by framework
 
 org.apache.isis.applib.services.bookmark  (8 usages found)
     BookmarkService.java - deprecated methods, have overloads in BookmarkService2 subtype [suggest we retain these for now]
@@ -428,6 +419,21 @@ org.apache.isis.applib.fixturescripts
 
     FixtureScripts.MultipleExecutionStrategy#IGNORE removed, replaced by EXECUTE_ONCE_BY_CLASS
 
+
+org.apache.isis.applib.services.actinvoc
+    ActionInvocationContext.java -remove unused constructors
+
+
+org.apache.isis.applib.services.background  (10 usages found)
+    ActionInvocationMemento.java - remove entire class, use InteractionDto and CommandDto are used internally instead
+    BackgroundCommandService.java - remove methods using AIM, instead keep those using CommandDto (in BackgroundCommandService2)
+    BackgroundService.java
+        asActionInvocationMemento(Method, Object, Object[]) - remove this internal API, no longer called by framework
+
+    Remove support for legacy persisted commands (beginning "<memento>...")
+
+
+
 org.apache.isis.viewer.restfulobjects.rendering.service.conmap.ContentMappingService
     - replaced by non-applib
 

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