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

[isis] 05/10: ISIS-1742: removes @Ignore annotation, update facet factory and updates .adoc

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 ee32a8a85a5eae06dcaf27c15cd15af1476e49ea
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Oct 9 15:37:00 2017 +0100

    ISIS-1742: removes @Ignore annotation, update facet factory and updates .adoc
---
 .../guides/rgant/_rgant_aaa_deprecated.adoc        |  8 ----
 ...vc_application-layer-api_BackgroundService.adoc | 46 +++++++++-------------
 .../org/apache/isis/applib/annotation/Ignore.java  | 37 -----------------
 .../RemoveAnnotatedMethodsFacetFactory.java        |  4 +-
 todo-deprecation-list.txt                          |  3 +-
 5 files changed, 22 insertions(+), 76 deletions(-)

diff --git a/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant_aaa_deprecated.adoc b/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant_aaa_deprecated.adoc
index 2e8f645..4594680 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant_aaa_deprecated.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant_aaa_deprecated.adoc
@@ -29,14 +29,6 @@ The annotations listed in the table below are still supported by Apache Isis, bu
 |
 
 
-|`@Ignore`
-|Exclude this method from the metamodel.
-|xref:../rgant/rgant.adoc#_rgant-Programmatic[`@Programmatic`]. +
-
-`@Ignore` was deprecated because it can easily clash with `@org.junit.Ignore`.
-|Domain
-|
-
 |`@Immutable`
 |An object's state cannot be changed (properties cannot be edited, collections cannot be added to or removed from).
 Actions can still be invoked.
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api_BackgroundService.adoc b/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api_BackgroundService.adoc
index 9382728..8d9cacf 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api_BackgroundService.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api_BackgroundService.adoc
@@ -5,25 +5,18 @@
 :_imagesdir: images/
 
 
-The `BackgroundService2` domain service, and also the companion
-xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-spi_BackgroundCommandService[`BackgroundCommandService2`] SPI service, enable commands
-to be persisted such that they may be invoked in the background.
+The `BackgroundService2` domain service, and also the companion xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-spi_BackgroundCommandService[`BackgroundCommandService2`] SPI service, enable commands to be persisted such that they may be invoked in the background.
 
-The `BackgroundService2` is responsible for capturing a memento representing the command in a typesafe way,
-and persisting it rather than executing it directly.
+The `BackgroundService2` is responsible for capturing a memento representing the command in a typesafe way, and persisting it rather than executing it directly.
 
-The default `BackgroundServiceDefault` implementation works by using a proxy wrapper around the target so that it can
-capture the action to invoke and its arguments.  (As of `1.13.0`), this is done using xref:../rgfis/rgfis.adoc#_rgfis_application-layer_CommandDtoServiceInternal[`CommandDtoServiceInternal`] (in previous releases it used (a private copy of) xref:../rgsvc/rgsvc.adoc#_rgsvc_integration-api_MementoService[`MementoService`]).
+The default `BackgroundServiceDefault` implementation works by using a proxy wrapper around the target so that it can capture the action to invoke and its arguments.
+(As of `1.13.0`), this is done using xref:../rgfis/rgfis.adoc#_rgfis_application-layer_CommandDtoServiceInternal[`CommandDtoServiceInternal`] (in previous releases it used (a private copy of) xref:../rgsvc/rgsvc.adoc#_rgsvc_integration-api_MementoService[`MementoService`]).
 
-The persistence delegates the persistence of the memento to an appropriate implementation of the companion
-`BackgroundCommandService2`.  One such implementation of `BackgroundCommandService` is provided by (non-ASF)
-http://github.com/isisaddons/isis-module-command[Isis addons' command] module.
+The persistence delegates the persistence of the memento to an appropriate implementation of the companion `BackgroundCommandService2`.
+One such implementation of `BackgroundCommandService` is provided by (non-ASF) link:http://platform.incode.org/spi/command/command.html[Incode Platform's command] module.
 
-The persisting of commands is only half the story; there needs to be a separate process to read the commands and
-execute them. The `BackgroundCommandExecution` abstract class (discussed
-xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-api_BackgroundService_BackgroundCommandExecution[below]) provides infrastructure to do this;
-the concrete implementation of this class depends on the configured `BackgroundCommandService` (in order to query for
-the persisted (background) ``Command``s.
+The persisting of commands is only half the story; there needs to be a separate process to read the commands and execute them.
+The `BackgroundCommandExecution` abstract class (discussed xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-api_BackgroundService_BackgroundCommandExecution[below]) provides infrastructure to do this; the concrete implementation of this class depends on the configured `BackgroundCommandService` (in order to query for the persisted (background) ``Command``s.
 
 
 
@@ -63,7 +56,8 @@ public void submitCustomerInvoices() {
 
 This will create a bunch of background commands executing the `submitInvoice()` action for each of the customers returned from the customer repository.
 
-The action method invoked must be part of the Apache Isis metamodel, which is to say it must be public, accept only scalar arguments, and must not be annotated with xref:../rgant/rgant.adoc#_rgant-Programmatic[`@Programmatic`] or `@Ignore`. However, it may be annotated with xref:../rgant/rgant.adoc#_rgant-Action_hidden[`@Action#hidden()`] or xref:../rgant/rgant.adoc#_rgant-ActionLayout_hidden[`@ActionLayout#hidden()`] and it will still be invoked.
+The action method invoked must be part of the Apache Isis metamodel, which is to say it must be public, accept only scalar arguments, and must not be annotated with xref:../rgant/rgant.adoc#_rgant-Programmatic[`@Programmatic`].
+However, it may be annotated with xref:../rgant/rgant.adoc#_rgant-Action_hidden[`@Action#hidden()`] or xref:../rgant/rgant.adoc#_rgant-ActionLayout_hidden[`@ActionLayout#hidden()`] and it will still be invoked.
 
 In fact, when invoked by the background service, no business rules (hidden, disabled, validation) are enforced; the action method must take responsibility for performing appropriate validation and error checking.
 
@@ -78,7 +72,9 @@ If you want to check business rules, you can use xref:../rgant/rgant.adoc#_rgant
 
 For the end-user, executing an action that delegates work off to the `BackgroundService` raises the problem of how does the user know the work is complete?
 
-One option is for the background jobs to take responsibility to notify the user themselves. In the above example, this would be the `submitInvoice()` method called upon each customer. One could imagine more complex designs where only the final command executed notifies the user.
+One option is for the background jobs to take responsibility to notify the user themselves.
+In the above example, this would be the `submitInvoice()` method called upon each customer.
+One could imagine more complex designs where only the final command executed notifies the user.
 
 However, an alternative is to rely on the fact that the `BackgroundService` will automatically hint that the `Command` representing the original interaction (to `submitCustomerInvoices()` in the example above) should be persisted.
 This will be available if the related xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-api_CommandContext[`CommandContext`] and xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-spi_CommandService[`CommandService`] domain services are configured, and the `CommandService` supports persistent commands.
@@ -109,24 +105,20 @@ The user would be returned a domain object representing their action invocation.
 
 == Registering the Services
 
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:../rgcms/rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `BackgroundService` is automatically registered (it is annotated with `@DomainService`) so no
-further configuration is required.
-
-To use an alternative implementation, use
-xref:../rgant/rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-in the xref:../rgsvc/rgsvc.adoc#__rgsvc_intro_overriding-the-services[introduction] to this guide).
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the `AppManifest` to xref:../rgcms/rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core implementation of `BackgroundService` is automatically registered (it is annotated with `@DomainService`) so no further configuration is required.
 
+To use an alternative implementation, use xref:../rgant/rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained in the xref:../rgsvc/rgsvc.adoc#__rgsvc_intro_overriding-the-services[introduction] to this guide).
 
 
 == Related Services
 
 This service is closely related to the xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-api_CommandContext[`CommandContext`] and also that service's supporting xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-spi_CommandService[`CommandService`] service.
 
-The `CommandContext` service is responsible for providing a parent `Command` with which the background ``Command``s can then be associated as children, while the `CommandService` is responsible for persisting those parent `Command`s. The latter is analogous to the way in which the `BackgroundCommandService` persists the child background `Command`s.
+The `CommandContext` service is responsible for providing a parent `Command` with which the background ``Command``s can then be associated as children, while the `CommandService` is responsible for persisting those parent `Command`s.
+The latter is analogous to the way in which the `BackgroundCommandService` persists the child background `Command`s.
 
-The implementations of `CommandService` and `BackgroundCommandService` go together; typically both parent `Command`s and child background `Command`s will be persisted in the same way. The (non-ASF) link:http://platform.incode.org[Incode Platform^]'s command module provides implementations of both (see xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-spi_CommandService[`CommandService`] and xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-spi_BackgroundCommandService[`BackgroundCommandS [...]
+The implementations of `CommandService` and `BackgroundCommandService` go together; typically both parent `Command`s and child background `Command`s will be persisted in the same way.
+The (non-ASF) link:http://platform.incode.org[Incode Platform^]'s command module provides implementations of both (see xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-spi_CommandService[`CommandService`] and xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-spi_BackgroundCommandService[`BackgroundCommandService`]).
 
 The xref:../rgfis/rgfis.adoc#_rgfis_application-layer_CommandDtoServiceInternal[`CommandDtoServiceInternal`] is used to obtain a memento of the command such that it can be persisted.
 (In earlier versions, xref:../rgsvc/rgsvc.adoc#_rgsvc_integration-api_MementoService[`MementoService`] was used for this purpose).
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Ignore.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Ignore.java
deleted file mode 100644
index b58d5ac..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/Ignore.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.applib.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * @deprecated - use {@link org.apache.isis.applib.annotation.Programmatic} instead.
- */
-@Deprecated
-@Inherited
-@Target({ ElementType.METHOD })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Ignore {
-
-}
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/ignore/annotation/RemoveAnnotatedMethodsFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/ignore/annotation/RemoveAnnotatedMethodsFacetFactory.java
index 209a55c..6d456e6 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/ignore/annotation/RemoveAnnotatedMethodsFacetFactory.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/ignore/annotation/RemoveAnnotatedMethodsFacetFactory.java
@@ -27,7 +27,6 @@ import javax.annotation.PreDestroy;
 
 import com.google.common.eventbus.Subscribe;
 
-import org.apache.isis.applib.annotation.Ignore;
 import org.apache.isis.applib.annotation.Programmatic;
 import org.apache.isis.core.commons.lang.ClassUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
@@ -68,8 +67,7 @@ public class RemoveAnnotatedMethodsFacetFactory extends FacetFactoryAbstract {
         for (final Method method : methods) {
             removeAnnotatedMethods(methodRemover, method, PreDestroy.class);
             removeAnnotatedMethods(methodRemover, method, PostConstruct.class);
-            removeAnnotatedMethods(methodRemover, method, Ignore.class);
-            removeAnnotatedMethods(methodRemover, method, Programmatic.class);
+                removeAnnotatedMethods(methodRemover, method, Programmatic.class);
             removeAnnotatedMethods(methodRemover, method, Subscribe.class);
             if(eventHandlerClass != null) {
                 removeAnnotatedMethods(methodRemover, method, eventHandlerClass);
diff --git a/todo-deprecation-list.txt b/todo-deprecation-list.txt
index 0061956..8ff1a6a 100644
--- a/todo-deprecation-list.txt
+++ b/todo-deprecation-list.txt
@@ -16,7 +16,6 @@ org.apache.isis.applib.annotation
     InvokedOn.java - entire enum, along with @Bulk annotation.
 
 
-    Ignore.java - entire annotation, use @Programmatic instead.
     Immutable.java - entire annotation, use @DomainObject(editing=...) instead
 
     Mandatory.java - entire annotation, use @Property(optionality=...) and @Parameter(optionality=...), or @javax.annotations.Nullable
@@ -358,6 +357,8 @@ org.apache.isis.applib.annotation
 
     DescribedAs.java - entire annotation, use @XxxLayout(describedAs=...) instead
 
+    Ignore.java - entire annotation, use @Programmatic instead.
+
     Mask.java - entire annotation, not supported by either Wicket viewer or RO viewer
     MaxLength.java - entire annotation, use @Property(maxLength=...) and @Parameter(maxLength=...)
     MultiLine.java - entire annotation, use @PropertyLayout(multiLine=...) and @ParameterLayout(multiLine=...) instead.

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