You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2015/03/23 22:19:27 UTC
svn commit: r1668737 -
/isis/site/trunk/content/reference/recognized-annotations/Action.md
Author: danhaywood
Date: Mon Mar 23 21:19:27 2015
New Revision: 1668737
URL: http://svn.apache.org/r1668737
Log:
minor updates
Modified:
isis/site/trunk/content/reference/recognized-annotations/Action.md
Modified: isis/site/trunk/content/reference/recognized-annotations/Action.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/reference/recognized-annotations/Action.md?rev=1668737&r1=1668736&r2=1668737&view=diff
==============================================================================
--- isis/site/trunk/content/reference/recognized-annotations/Action.md (original)
+++ isis/site/trunk/content/reference/recognized-annotations/Action.md Mon Mar 23 21:19:27 2015
@@ -267,14 +267,31 @@ the `Command` itself is persisted.
If the `BackgroundService` is configured, then commands can be invoked by means of a separate background process. If an appropriate `BackgroundCommandService` service is configured (for example, the [BackgroundCommandServiceJdo](../../../components/objectstores/jdo/services/background-command-service-jdo.html) JDO implementation), then the background command is persisted.
+#### `command()`
+
+The `command()` attribute determines whether the action invocation should be reified into a `Command` object.
+
+The default is `AS_CONFIGURED`, meaning that the configuration property:
+
+ isis.services.command.actions
+
+is used to determine the whether the action is reified:
+
+* `all` - all actions are reified
+* `ignoreSafe` (or `ignoreQueryOnly`) - actions with safe (read-only) semantics are ignored, but actions which may modify data are not ignored
+* `none` - no actions are reifired.
+
+This default can be overridden on an action-by-action basis; if `command()` is set to `ENABLED` then the action is reified irrespective of the configured value; if set to `DISABLED` then the action is NOT reified irrespective of the configured value.
+
+
The `@Action(command=...)` annotation can be annotated on action methods, to influence this behaviour:
public class Order {
@Action(
- command=CommandReified.ENABLED,
- commandExecuteIn=ExecuteIn.FOREGROUND,
- persistence=Persistence.PERSISTED)
+ command=CommandReification.ENABLED,
+ commandExecuteIn=CommandExecuteIn.FOREGROUND,
+ commandPersistence=CommandPersistence.PERSISTED)
public Invoice generateInvoice(...) { ... }
}
@@ -283,20 +300,25 @@ or alternatively just:
public class Order {
- @Command
+ @Action(command=CommandReification.ENABLED)
public Invoice generateInvoice(...) { ... }
}
corresponds to the behaviour described above; the `Command` object is persisted (assuming an appropriate `CommandService` is defined, and executed immediately in the foreground).
-As a variation:
+#### `commandPersistence()`
+
+If the action has been reified, then the `commandPersistence()` attribute determines whether that `Command` object
+should then also be persisted (the default), or not persisted, or only if hinted.
+
+To explain this last alternative:
public class Order {
- @Command(
- executeIn=ExecuteIn.FOREGROUND,
- persistence=Persistence.IF_HINTED)
+ @Action(
+ command=CommandReification.ENABLED,
+ commandPersistence=CommandPersistence.IF_HINTED)
public Invoice generateInvoice(...) { ... }
}
@@ -308,8 +330,9 @@ Next:
public class Order {
@Command(
- executeIn=ExecuteIn.FOREGROUND,
- persistence=Persistence.NOT_PERSISTED)
+ command=CommandReification.ENABLED,
+ commandExecuteIn=CommandExecuteIn.FOREGROUND,
+ commandPersistence=CommandPersistence.NOT_PERSISTED)
public Invoice generateInvoice(...) { ... }
}
@@ -317,52 +340,32 @@ Next:
will prevent the parent `Command` object from being persisted, *even if* a child background `Command` is created.
-Turning to the `executeIn` attribute:
-
- public class Order {
-
- @Command(
- executeIn=ExecuteIn.BACKGROUND)
- public Invoice generateInvoice(...) { ... }
-
- }
-
-will result in the `Command` being persisted but its execution deferred to a background execution mechanism. The returned object from this action is the persisted `Command` itself.
-
-
-
-#### `command()`
-
-The `command()` attribute determines whether the action invocation should be reified into a `Command` object.
-
-The default is `AS_CONFIGURED`, meaning that the configuration property:
-
- isis.services.command.actions
-
-is used to determine the whether the action is reified:
+#### `commandExecuteIn()`
-* `all` - all actions are reified
-* `ignoreSafe` (or `ignoreQueryOnly`) - actions with safe (read-only) semantics are ignored, but actions which may modify data are not ignored
-* `none` - no actions are reifired.
+For persisted commands, the `commandExecuteIn()` attribute determines whether the `Command` should be executed in the
+foreground (the default) or executed in the background.
-This default can be overridden on an action-by-action basis; if `command()` is set to `ENABLED` then the action is reified irrespective of the configured value; if set to `DISABLED` then the action is NOT reified irrespective of the configured value.
+Background execution means that the command is not executed immediately, but is available for a configured
+[background service](../services/background-service.html) to execute, eg by way of an in-memory scheduler such as Quartz.
-#### `commandPersistence()`
+For example:
-If the action has been reified, then the `commandPersistence()` attribute determines whether that `Command` object
-should then also be persisted (the default) or not persisted.
+ public class Order {
+ @Action(
+ command=CommandReification.ENABLED,
+ commandExecuteIn=CommandExecuteIn.BACKGROUND)
+ public Invoice generateInvoice(...) { ... }
-#### `commandExecuteIn()`
+ }
-For persisted commands, the `commandExecuteIn()` attribute determines whether the `Command` should be executed in the
-foreground (the default) or executed in the background.
+will result in the `Command` being persisted but its execution deferred to a background execution mechanism. The
+returned object from this action is the persisted `Command` itself.
-Background execution means that the command is not executed immediately, but is available for a configured
-[background service](../services/background-service.html) to execute, eg by way of an in-memory scheduler such as Quartz.
## Publishing
+Publishing is managed by the `publishing()` and `publishingPayloadFactory()` attributes.
#### `publishing()`