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 2014/01/31 16:34:05 UTC
[1/3] ISIS-671, ISIS-672: renames, also @Reified annotation
Updated Branches:
refs/heads/master 49c7c05dd -> 2463dc18c
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties b/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties
index c62a5a6..6ab096e 100644
--- a/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties
+++ b/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -181,14 +181,14 @@ isis.services = \
org.apache.isis.core.runtime.services.memento.MementoServiceDefault,\
org.apache.isis.core.runtime.services.xmlsnapshot.XmlSnapshotServiceDefault,\
\
- # Core implementation of the various 'interaction' services, \
- org.apache.isis.applib.services.interaction.InteractionContext,\
+ # Core implementation of the various (inter)action services, \
+ org.apache.isis.applib.services.reifiableaction.ReifiableActionContext,\
org.apache.isis.applib.annotation.Bulk$InteractionContext,\
org.apache.isis.applib.services.scratchpad.Scratchpad,\
\
- # JDO implementation of the InteractionService, \
- org.apache.isis.objectstore.jdo.applib.service.interaction.InteractionServiceJdo,\
- org.apache.isis.objectstore.jdo.applib.service.interaction.InteractionServiceJdoRepository,\
+ # JDO implementation of the ReifiableActionService, \
+ org.apache.isis.objectstore.jdo.applib.service.reifiableaction.ReifiableActionServiceJdo,\
+ org.apache.isis.objectstore.jdo.applib.service.reifiableaction.ReifiableActionServiceJdoRepository,\
\
# JDO implementation of the AuditingService, \
org.apache.isis.objectstore.jdo.applib.service.audit.AuditingServiceJdo,\
@@ -198,7 +198,7 @@ isis.services = \
# Core implementation of BackgroundService (depends on: MementoService & BackgroundTaskService), \
org.apache.isis.core.runtime.services.background.BackgroundServiceDefault,\
\
- # JDO implementation of the BackgroundTaskService (depends on: InteractionContext service), \
+ # JDO implementation of the BackgroundTaskService (depends on: ReifiableActionContext service), \
org.apache.isis.objectstore.jdo.applib.service.background.BackgroundTaskServiceJdo,\
org.apache.isis.objectstore.jdo.applib.service.background.BackgroundTaskServiceJdoContributions,\
org.apache.isis.objectstore.jdo.applib.service.background.BackgroundTaskServiceJdoRepository,\
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/example/application/simple_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/example/application/simple_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties b/example/application/simple_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties
index 1d9782e..95a3c7a1 100644
--- a/example/application/simple_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties
+++ b/example/application/simple_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -174,14 +174,14 @@ isis.services = \
org.apache.isis.core.runtime.services.memento.MementoServiceDefault,\
org.apache.isis.core.runtime.services.xmlsnapshot.XmlSnapshotServiceDefault,\
\
- # Core implementation of the various 'interaction' services, \
- org.apache.isis.applib.services.interaction.InteractionContext,\
+ # Core implementation of the various (inter)action services, \
+ org.apache.isis.applib.services.reifiableaction.ReifiableActionContext,\
org.apache.isis.applib.annotation.Bulk$InteractionContext,\
org.apache.isis.applib.services.scratchpad.Scratchpad,\
\
- # JDO implementation of the InteractionService, \
- # org.apache.isis.objectstore.jdo.applib.service.interaction.InteractionServiceJdo,\
- # org.apache.isis.objectstore.jdo.applib.service.interaction.InteractionServiceJdoRepository,\
+ # JDO implementation of the ReifiableActionService, \
+ # org.apache.isis.objectstore.jdo.applib.service.reifiableaction.ReifiableActionServiceJdo,\
+ # org.apache.isis.objectstore.jdo.applib.service.reifiableaction.ReifiableActionServiceJdoRepository,\
\
# JDO implementation of the AuditingService, \
# org.apache.isis.objectstore.jdo.applib.service.audit.AuditingServiceJdo,\
@@ -191,7 +191,7 @@ isis.services = \
# Core implementation of BackgroundService (depends on: MementoService & BackgroundTaskService), \
# org.apache.isis.core.runtime.services.background.BackgroundServiceDefault,\
\
- # JDO implementation of the BackgroundTaskService (depends on: InteractionContext service), \
+ # JDO implementation of the BackgroundTaskService (depends on: ReifiableActionContext service), \
# org.apache.isis.objectstore.jdo.applib.service.background.BackgroundTaskServiceJdo,\
# org.apache.isis.objectstore.jdo.applib.service.background.BackgroundTaskServiceJdoContributions,\
# org.apache.isis.objectstore.jdo.applib.service.background.BackgroundTaskServiceJdoRepository,\
[3/3] git commit: ISIS-671, ISIS-672: renames,
also @Reified annotation
Posted by da...@apache.org.
ISIS-671, ISIS-672: renames, also @Reified annotation
ISIS-671:
- @Reified annotation and facet
ISIS-672:
- renamed InteractionContext to ReifiableActionContext
- renamed InteractionService to ReifiableActionService
- corresponding renames for JDO impls.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/2463dc18
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/2463dc18
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/2463dc18
Branch: refs/heads/master
Commit: 2463dc18c53cb13e3a3c1a0c3b6dc2f40b000268
Parents: 49c7c05
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Jan 31 15:33:50 2014 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Jan 31 15:33:50 2014 +0000
----------------------------------------------------------------------
.../objectstore/jdo/applib/service/Util.java | 68 +++
.../jdo/applib/service/audit/AuditEntryJdo.java | 2 +-
.../service/background/BackgroundTaskJdo.java | 2 +-
.../background/BackgroundTaskServiceJdo.java | 11 +-
.../service/interaction/InteractionJdo.java | 541 ------------------
.../interaction/InteractionServiceJdo.java | 90 ---
.../InteractionServiceJdoRepository.java | 72 ---
.../jdo/applib/service/interaction/Util.java | 68 ---
.../service/publish/PublishedEventJdo.java | 2 +-
.../reifiableaction/ReifiableActionJdo.java | 562 +++++++++++++++++++
.../ReifiableActionServiceJdo.java | 93 +++
.../ReifiableActionServiceJdoRepository.java | 75 +++
.../interaction/InteractionJdoTest_next.java | 41 --
.../ReifiableActionJdoTest_next.java | 43 ++
.../ui/components/actions/ActionPanel.java | 12 +-
.../apache/isis/applib/annotation/Reified.java | 40 ++
.../background/BackgroundTaskService.java | 4 +-
.../services/interaction/Interaction.java | 224 --------
.../interaction/InteractionContext.java | 50 --
.../interaction/InteractionDefault.java | 228 --------
.../interaction/spi/InteractionService.java | 55 --
.../reifiableaction/ReifiableAction.java | 245 ++++++++
.../reifiableaction/ReifiableActionContext.java | 50 ++
.../reifiableaction/ReifiableActionDefault.java | 233 ++++++++
.../spi/ReifiableActionService.java | 55 ++
.../applib/services/scratchpad/Scratchpad.java | 6 -
.../InteractionDefaultTest_next.java | 4 +-
.../actions/invoke/ActionInvocationFacet.java | 6 +-
.../actions/reified/ReifiedActionFacet.java | 35 ++
.../invoke/ActionInvocationFacetViaMethod.java | 34 +-
.../reified/ReifiedActionFacetAbstract.java | 37 ++
.../ReifiedActionAnnotationFacetFactory.java | 51 ++
.../ReifiedActionFacetAnnotation.java | 31 +
.../dflt/ProgrammingModelFacetsJava5.java | 2 +
...ReifiedActionAnnotationFacetFactoryTest.java | 66 +++
.../background/BackgroundServiceDefault.java | 21 +-
.../system/persistence/PersistenceSession.java | 36 +-
.../system/transaction/IsisTransaction.java | 30 +-
.../transaction/IsisTransactionManager.java | 8 +-
.../BackgroundServiceDefaultTest_execute.java | 29 +-
.../system/transaction/IsisTransactionTest.java | 8 +-
.../dom/src/main/java/dom/todo/ToDoItem.java | 7 +-
.../src/main/java/webapp/admin/Admin.java | 12 +-
.../src/main/webapp/WEB-INF/isis.properties | 12 +-
.../src/main/webapp/WEB-INF/isis.properties | 12 +-
45 files changed, 1820 insertions(+), 1493 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/Util.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/Util.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/Util.java
new file mode 100644
index 0000000..21350d0
--- /dev/null
+++ b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/Util.java
@@ -0,0 +1,68 @@
+/**
+ * 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.objectstore.jdo.applib.service;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.sql.Timestamp;
+
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.services.HasTransactionId;
+import org.apache.isis.applib.services.bookmark.Bookmark;
+import org.apache.isis.applib.services.bookmark.BookmarkService;
+import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
+
+public class Util {
+
+ private Util() {}
+
+ public static Bookmark bookmarkFor(final String str) {
+ return str != null? new Bookmark(str): null;
+ }
+
+ public static String asString(Bookmark bookmark) {
+ return bookmark != null? bookmark.toString(): null;
+ }
+
+ public static Object lookupBookmark(Bookmark bookmark, final BookmarkService bookmarkService, DomainObjectContainer container) {
+ try {
+ return bookmarkService != null
+ ? bookmarkService.lookup(bookmark)
+ : null;
+ } catch(RuntimeException ex) {
+ if(ex.getClass().getName().contains("ObjectNotFoundException")) {
+ container.warnUser("Object not found - has it since been deleted?");
+ return null;
+ }
+ throw ex;
+ }
+ }
+
+
+ public static String abbreviated(final String str, final int maxLength) {
+ return str != null? (str.length() < maxLength ? str : str.substring(0, maxLength - 3) + "..."): null;
+ }
+
+ public static BigDecimal durationBetween(Timestamp startedAt, Timestamp completedAt) {
+ if(completedAt == null) {
+ return null;
+ }
+ long millis = completedAt.getTime() - startedAt.getTime();
+ return new BigDecimal(millis).divide(new BigDecimal(1000)).setScale(3, RoundingMode.HALF_EVEN);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditEntryJdo.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditEntryJdo.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditEntryJdo.java
index fa80985..f816997 100644
--- a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditEntryJdo.java
+++ b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/audit/AuditEntryJdo.java
@@ -44,7 +44,7 @@ import org.apache.isis.applib.services.bookmark.Bookmark;
import org.apache.isis.applib.services.bookmark.BookmarkService;
import org.apache.isis.applib.util.TitleBuffer;
import org.apache.isis.objectstore.jdo.applib.service.JdoColumnLength;
-import org.apache.isis.objectstore.jdo.applib.service.interaction.Util;
+import org.apache.isis.objectstore.jdo.applib.service.Util;
@javax.jdo.annotations.PersistenceCapable(
identityType=IdentityType.DATASTORE,
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundTaskJdo.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundTaskJdo.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundTaskJdo.java
index 105fab1..ffaa45d 100644
--- a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundTaskJdo.java
+++ b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundTaskJdo.java
@@ -46,7 +46,7 @@ import org.apache.isis.applib.services.bookmark.Bookmark;
import org.apache.isis.applib.services.bookmark.BookmarkService;
import org.apache.isis.applib.util.ObjectContracts;
import org.apache.isis.objectstore.jdo.applib.service.JdoColumnLength;
-import org.apache.isis.objectstore.jdo.applib.service.interaction.Util;
+import org.apache.isis.objectstore.jdo.applib.service.Util;
@javax.jdo.annotations.PersistenceCapable(
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundTaskServiceJdo.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundTaskServiceJdo.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundTaskServiceJdo.java
index 03eda70..7954fa1 100644
--- a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundTaskServiceJdo.java
+++ b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/background/BackgroundTaskServiceJdo.java
@@ -27,6 +27,7 @@ import org.apache.isis.applib.annotation.Programmatic;
import org.apache.isis.applib.clock.Clock;
import org.apache.isis.applib.services.background.ActionInvocationMemento;
import org.apache.isis.applib.services.background.BackgroundTaskService;
+import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
@Named("Background Tasks")
public class BackgroundTaskServiceJdo extends AbstractService implements BackgroundTaskService {
@@ -36,7 +37,11 @@ public class BackgroundTaskServiceJdo extends AbstractService implements Backgro
@Programmatic
@Override
- public void execute(final ActionInvocationMemento aim, final UUID transactionId, final int sequence) {
+ public void execute(final ActionInvocationMemento aim, final ReifiableAction reifiableAction) {
+
+ final UUID transactionId = reifiableAction.getTransactionId();
+ Integer sequence = reifiableAction.next("backgroundTaskServiceSequence");
+
final BackgroundTaskJdo backgroundTask = newTransientInstance(BackgroundTaskJdo.class);
backgroundTask.setActionIdentifier(aim.getActionId());
@@ -44,9 +49,11 @@ public class BackgroundTaskServiceJdo extends AbstractService implements Backgro
backgroundTask.setMemento(aim.asMementoString());
backgroundTask.setUser(aim.getUser());
backgroundTask.setTargetStr(aim.getTarget().toString());
-
backgroundTask.setTransactionId(transactionId);
backgroundTask.setSequence(sequence);
+
+ reifiableAction.setReify(true);
+
persist(backgroundTask);
}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/interaction/InteractionJdo.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/interaction/InteractionJdo.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/interaction/InteractionJdo.java
deleted file mode 100644
index 1c82c5a..0000000
--- a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/interaction/InteractionJdo.java
+++ /dev/null
@@ -1,541 +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.objectstore.jdo.applib.service.interaction;
-
-import java.math.BigDecimal;
-import java.sql.Timestamp;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import javax.jdo.annotations.IdentityType;
-
-import com.google.common.collect.Maps;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.annotation.ActionSemantics;
-import org.apache.isis.applib.annotation.ActionSemantics.Of;
-import org.apache.isis.applib.annotation.Disabled;
-import org.apache.isis.applib.annotation.Hidden;
-import org.apache.isis.applib.annotation.MemberGroupLayout;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.MultiLine;
-import org.apache.isis.applib.annotation.Named;
-import org.apache.isis.applib.annotation.ObjectType;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.annotation.Title;
-import org.apache.isis.applib.annotation.TypicalLength;
-import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.applib.services.HasTransactionId;
-import org.apache.isis.applib.services.bookmark.Bookmark;
-import org.apache.isis.applib.services.bookmark.BookmarkService;
-import org.apache.isis.applib.services.interaction.Interaction;
-import org.apache.isis.applib.services.interaction.spi.InteractionService;
-import org.apache.isis.applib.util.ObjectContracts;
-import org.apache.isis.objectstore.jdo.applib.service.JdoColumnLength;
-
-
-@javax.jdo.annotations.PersistenceCapable(
- identityType=IdentityType.APPLICATION,
- table="IsisInteraction")
-@javax.jdo.annotations.Queries( {
- @javax.jdo.annotations.Query(
- name="findByTransactionId", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.interaction.InteractionJdo "
- + "WHERE transactionId == :transactionId"),
- @javax.jdo.annotations.Query(
- name="findCurrent", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.interaction.InteractionJdo "
- + "WHERE completedAt == null "
- + "ORDER BY timestamp DESC"),
- @javax.jdo.annotations.Query(
- name="findCompleted", language="JDOQL",
- value="SELECT "
- + "FROM org.apache.isis.objectstore.jdo.applib.service.interaction.InteractionJdo "
- + "WHERE completedAt != null "
- + "ORDER BY timestamp DESC")
-})
-@ObjectType("IsisInteration")
-@MemberGroupLayout(
- columnSpans={6,0,6},
- left={"Identifiers","Target","Notes"},
- right={"Detail","Timings","Results"})
-@Named("Interaction")
-public class InteractionJdo implements Interaction {
-
- @SuppressWarnings("unused")
- private static final Logger LOG = LoggerFactory.getLogger(InteractionJdo.class);
-
-
- // //////////////////////////////////////
- // transactionId (property)
- // //////////////////////////////////////
-
-
- private UUID transactionId;
-
- /**
- * The unique identifier (a GUID) of the transaction in which this interaction occurred.
- */
- @javax.jdo.annotations.PrimaryKey
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.TRANSACTION_ID)
- @TypicalLength(JdoColumnLength.TRANSACTION_ID)
- @MemberOrder(name="Identifiers",sequence = "10")
- @Disabled
- @Override
- public UUID getTransactionId() {
- return transactionId;
- }
-
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- *
- * <p>
- * Implementation notes: copied over from the Isis transaction when the interaction is persisted.
- */
- @Override
- public void setTransactionId(final UUID transactionId) {
- this.transactionId = transactionId;
- }
-
- // //////////////////////////////////////
- // user (property)
- // //////////////////////////////////////
-
- private String user;
-
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.USER_NAME)
- @Title(sequence="2", prepend=", ")
- @MemberOrder(name="Identifiers", sequence = "20")
- public String getUser() {
- return user;
- }
-
- public void setUser(final String user) {
- this.user = user;
- }
-
-
-
- // //////////////////////////////////////
- // timestamp (property)
- // //////////////////////////////////////
-
- private Timestamp timestamp;
-
- /**
- * The date/time at which this interaction started.
- */
- @javax.jdo.annotations.Persistent
- @javax.jdo.annotations.Column(allowsNull="false")
- @MemberOrder(name="Timings", sequence = "30")
- public Timestamp getTimestamp() {
- return timestamp;
- }
-
- public void setTimestamp(final Timestamp timestamp) {
- this.timestamp = timestamp;
- }
-
-
-
-
- // //////////////////////////////////////
- // targetClass (property)
- // //////////////////////////////////////
-
- private String targetClass;
-
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.Interaction.TARGET_CLASS)
- @TypicalLength(30)
- @MemberOrder(name="Target", sequence = "10")
- @Named("Class")
- public String getTargetClass() {
- return targetClass;
- }
-
- public void setTargetClass(final String targetClass) {
- this.targetClass = Util.abbreviated(targetClass, JdoColumnLength.Interaction.TARGET_CLASS);
- }
-
-
- // //////////////////////////////////////
- // targetAction (property)
- // //////////////////////////////////////
-
- private String targetAction;
-
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.Interaction.TARGET_ACTION)
- @TypicalLength(30)
- @MemberOrder(name="Target", sequence = "20")
- @Named("Action")
- public String getTargetAction() {
- return targetAction;
- }
-
- public void setTargetAction(final String targetAction) {
- this.targetAction = Util.abbreviated(targetAction, JdoColumnLength.Interaction.TARGET_ACTION);
- }
-
-
- // //////////////////////////////////////
- // target (property)
- // openTargetObject (action)
- // //////////////////////////////////////
-
- @Programmatic
- @Override
- public Bookmark getTarget() {
- return Util.bookmarkFor(getTargetStr());
- }
-
- @Programmatic
- @Override
- public void setTarget(Bookmark target) {
- setTargetStr(Util.asString(target));
- }
-
- // //////////////////////////////////////
-
- private String targetStr;
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.BOOKMARK, name="target")
- @Named("Target Bookmark")
- @Hidden(where=Where.ALL_TABLES)
- @MemberOrder(name="Target", sequence="3")
- @Disabled
- public String getTargetStr() {
- return targetStr;
- }
-
- public void setTargetStr(final String targetStr) {
- this.targetStr = targetStr;
- }
-
- // //////////////////////////////////////
-
- @ActionSemantics(Of.SAFE)
- @MemberOrder(name="TargetStr", sequence="1")
- @Named("Open")
- public Object openTargetObject() {
- return Util.lookupBookmark(getTarget(), bookmarkService, container);
- }
- public boolean hideOpenTargetObject() {
- return getTarget() == null;
- }
-
-
- // //////////////////////////////////////
- // actionIdentifier (property)
- // //////////////////////////////////////
-
- private String actionIdentifier;
-
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.ACTION_IDENTIFIER)
- @Title(sequence="1")
- @TypicalLength(60)
- @Hidden(where=Where.ALL_TABLES)
- @MemberOrder(name="Detail",sequence = "1")
- public String getActionIdentifier() {
- return actionIdentifier;
- }
-
- public void setActionIdentifier(final String actionIdentifier) {
- this.actionIdentifier = Util.abbreviated(actionIdentifier, JdoColumnLength.ACTION_IDENTIFIER);
- }
-
-
-
- // //////////////////////////////////////
- // arguments (property)
- // //////////////////////////////////////
-
- private String arguments;
-
- @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.Interaction.ARGUMENTS)
- @MultiLine(numberOfLines=6)
- @Hidden(where=Where.ALL_TABLES)
- @MemberOrder(name="Detail",sequence = "4")
- @Disabled
- public String getArguments() {
- return arguments;
- }
-
- public void setArguments(final String arguments) {
- this.arguments = Util.abbreviated(arguments, JdoColumnLength.Interaction.ARGUMENTS);
- }
-
-
- // //////////////////////////////////////
- // startedAt (derived property)
- // //////////////////////////////////////
-
- /**
- * The date/time at which this interaction started.
- */
- @javax.jdo.annotations.NotPersistent
- @MemberOrder(name="Timings", sequence = "3")
- @Disabled
- public Timestamp getStartedAt() {
- return getTimestamp();
- }
-
-
-
- // //////////////////////////////////////
- // completedAt (property)
- // //////////////////////////////////////
-
- private Timestamp completedAt;
-
- /**
- * The date/time at which this interaction completed.
- *
- * <p>
- * Not part of the applib API, because the default implementation is not persistent
- * and so cannot be queried "after the fact". This JDO-specific class is persistent,
- * and so we can gather this information.
- */
- @javax.jdo.annotations.Persistent
- @javax.jdo.annotations.Column(allowsNull="true")
- @MemberOrder(name="Timings", sequence = "4")
- @Disabled
- public Timestamp getCompletedAt() {
- return completedAt;
- }
-
- public void setCompletedAt(final Timestamp completed) {
- this.completedAt = completed;
- }
-
-
- // //////////////////////////////////////
- // duration (derived property)
- // //////////////////////////////////////
-
- /**
- * The number of seconds (to 3 decimal places) that this interaction lasted.
- *
- * <p>
- * Populated only if it has {@link #getCompletedAt() completed}.
- */
- @javax.validation.constraints.Digits(integer=5, fraction=3)
- @Named("Duration")
- @MemberOrder(name="Timings", sequence = "7")
- public BigDecimal getDuration() {
- return Util.durationBetween(getStartedAt(), getCompletedAt());
- }
-
-
-
- // //////////////////////////////////////
- // notes (property)
- // //////////////////////////////////////
-
- private String notes;
-
- /**
- * Provides the ability for the end-user to annotate a (potentially long-running)
- * interaction.
- *
- * <p>
- * Not part of the applib API, because the default implementation is not persistent
- * and so there's no object that can be accessed to be annotated.
- */
- @javax.jdo.annotations.Column(allowsNull="true", length=JdoColumnLength.Interaction.NOTES)
- @MultiLine(numberOfLines=10)
- @Hidden(where=Where.ALL_TABLES)
- @MemberOrder(name="Notes", sequence = "6")
- public String getNotes() {
- return notes;
- }
-
- public void setNotes(final String notes) {
- this.notes = notes;
- }
-
-
- // //////////////////////////////////////
- // nature (property)
- // //////////////////////////////////////
-
- private Nature nature;
-
- /**
- * Not persisted, used as a hint that an action was invoked explicitly by the user
- * (rather than as a side-effect, eg of rendering an object due to get-after-post).
- */
- @javax.jdo.annotations.NotPersistent
- @Programmatic
- @Override
- public Nature getNature() {
- return nature;
- }
-
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- *
- * <p>
- * Implementation notes: populated by the viewer as hint to {@link InteractionService} implementation.
- */
- @Override
- public void setNature(Nature nature) {
- this.nature = nature;
- }
-
-
- // //////////////////////////////////////
- // result (property)
- // openResultObject (action)
- // //////////////////////////////////////
-
- @Programmatic
- @Override
- public Bookmark getResult() {
- return Util.bookmarkFor(getResultStr());
- }
-
- @Programmatic
- @Override
- public void setResult(Bookmark result) {
- setResultStr(Util.asString(result));
- }
-
- // //////////////////////////////////////
-
- private String resultStr;
-
- @javax.jdo.annotations.Column(allowsNull="true", length=JdoColumnLength.BOOKMARK, name="result")
- @Hidden(where=Where.ALL_TABLES)
- @Named("Result Bookmark")
- @MemberOrder(name="Results", sequence="25")
- @Disabled
- public String getResultStr() {
- return resultStr;
- }
-
- public void setResultStr(final String resultStr) {
- this.resultStr = resultStr;
- }
-
- // //////////////////////////////////////
-
- @ActionSemantics(Of.SAFE)
- @MemberOrder(name="ResultStr", sequence="1")
- @Named("Open")
- public Object openResultObject() {
- return Util.lookupBookmark(getResult(), bookmarkService, container);
- }
- public boolean hideOpenResultObject() {
- return getResult() == null;
- }
-
-
- // //////////////////////////////////////
- // exception (property)
- // causedException (derived property)
- // showException (associated action)
- // //////////////////////////////////////
-
- private String exception;
-
- /**
- * Stack trace of any exception that might have occurred if this interaction/transaction aborted.
- *
- * <p>
- * Not visible in the UI, but accessible
- * <p>
- * Not part of the applib API, because the default implementation is not persistent
- * and so there's no object that can be accessed to be annotated.
- */
- @javax.jdo.annotations.Column(allowsNull="true", length=JdoColumnLength.Interaction.EXCEPTION)
- @Hidden
- @Override
- public String getException() {
- return exception;
- }
-
- @Override
- public void setException(final String exception) {
- this.exception = Util.abbreviated(exception, JdoColumnLength.Interaction.EXCEPTION);
- }
-
-
- // //////////////////////////////////////
-
- @javax.jdo.annotations.NotPersistent
- @MemberOrder(name="Results",sequence = "30")
- @Hidden(where=Where.ALL_TABLES)
- public boolean isCausedException() {
- return getException() != null;
- }
-
-
- // //////////////////////////////////////
-
- @ActionSemantics(Of.SAFE)
- @MemberOrder(name="causedException", sequence = "1")
- public String showException() {
- return getException();
- }
- public boolean hideShowException() {
- return !isCausedException();
- }
-
-
- // //////////////////////////////////////
- // next(...) impl
- // //////////////////////////////////////
-
- private final Map<String, AtomicInteger> sequenceByName = Maps.newHashMap();
-
- @Programmatic
- @Override
- public int next(String sequenceName) {
- AtomicInteger next = sequenceByName.get(sequenceName);
- if(next == null) {
- next = new AtomicInteger(0);
- sequenceByName.put(sequenceName, next);
- } else {
- next.incrementAndGet();
- }
- return next.get();
- }
-
- // //////////////////////////////////////
- // toString
- // //////////////////////////////////////
-
-
- @Override
- public String toString() {
- return ObjectContracts.toString(this, "startedAt,user,actionIdentifier,target,completedAt,duration,transactionId");
- }
-
-
- // //////////////////////////////////////
-
- @javax.inject.Inject
- private BookmarkService bookmarkService;
-
- @javax.inject.Inject
- private DomainObjectContainer container;
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/interaction/InteractionServiceJdo.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/interaction/InteractionServiceJdo.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/interaction/InteractionServiceJdo.java
deleted file mode 100644
index 1e58d11..0000000
--- a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/interaction/InteractionServiceJdo.java
+++ /dev/null
@@ -1,90 +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.objectstore.jdo.applib.service.interaction;
-
-import java.util.UUID;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.applib.AbstractService;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.clock.Clock;
-import org.apache.isis.applib.services.interaction.Interaction;
-import org.apache.isis.applib.services.interaction.spi.InteractionService;
-
-public class InteractionServiceJdo extends AbstractService implements InteractionService {
-
- @SuppressWarnings("unused")
- private static final Logger LOG = LoggerFactory.getLogger(InteractionServiceJdo.class);
-
- /**
- * Creates an {@link InteractionJdo}, initializing its
- * {@link Interaction#setNature(Interaction.Nature) nature} to be
- * {@link Interaction.Nature#RENDERING rendering}.
- */
- @Programmatic
- @Override
- public Interaction create() {
- InteractionJdo interaction = newTransientInstance(InteractionJdo.class);
- interaction.setNature(Interaction.Nature.RENDERING);
- return interaction;
- }
-
- @Programmatic
- @Override
- public void startTransaction(final Interaction interaction, final UUID transactionId) {
- if(interaction instanceof InteractionJdo) {
- // should be the case, since this service created the object in the #create() method
- final InteractionJdo interactionJdo = (InteractionJdo) interaction;
- final UUID currentTransactionId = interactionJdo.getTransactionId();
- if(currentTransactionId != null && !currentTransactionId.equals(transactionId)) {
- // the logic in IsisTransaction means that any subsequent transactions within a given interaction
- // should reuse the xactnId of the first transaction created within that interaction.
- throw new IllegalStateException("Attempting to set a different transactionId on interaction");
- }
- interactionJdo.setTransactionId(transactionId);
- }
- }
-
- @Programmatic
- @Override
- public void complete(final Interaction interaction) {
- InteractionJdo interactionJdo = asPersistableInteractionJdo(interaction);
- if(interactionJdo == null) {
- return;
- }
-
- interactionJdo.setCompletedAt(Clock.getTimeAsJavaSqlTimestamp());
-
- persistIfNotAlready(interactionJdo);
- }
-
- /**
- * Not API, factored out from {@link InteractionServiceJdoRepository}.
- */
- InteractionJdo asPersistableInteractionJdo(final Interaction interaction) {
- if(interaction.getNature() == Interaction.Nature.ACTION_INVOCATION) {
- if(interaction instanceof InteractionJdo) {
- // should be the case, since this service created the object in the #create() method
- return (InteractionJdo)interaction;
- }
- }
- // else, don't care
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/interaction/InteractionServiceJdoRepository.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/interaction/InteractionServiceJdoRepository.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/interaction/InteractionServiceJdoRepository.java
deleted file mode 100644
index 8fea1c3..0000000
--- a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/interaction/InteractionServiceJdoRepository.java
+++ /dev/null
@@ -1,72 +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.objectstore.jdo.applib.service.interaction;
-
-import java.util.List;
-import java.util.UUID;
-
-import org.apache.isis.applib.AbstractFactoryAndRepository;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.query.QueryDefault;
-import org.apache.isis.applib.services.interaction.Interaction;
-import org.apache.isis.applib.services.interaction.InteractionContext;
-
-
-public class InteractionServiceJdoRepository extends AbstractFactoryAndRepository {
-
- @Programmatic
- public InteractionJdo findByTransactionId(final UUID transactionId) {
- persistCurrentInteractionIfRequired();
- return firstMatch(
- new QueryDefault<InteractionJdo>(InteractionJdo.class,
- "findByTransactionId",
- "transactionId", transactionId.toString()));
- }
-
- private void persistCurrentInteractionIfRequired() {
- if(interactionContext != null && interactionService != null) {
- Interaction interaction = interactionContext.getInteraction();
- final InteractionJdo interactionJdo = interactionService.asPersistableInteractionJdo(interaction);
- persistIfNotAlready(interactionJdo);
- }
- }
-
-
- @Programmatic
- public List<InteractionJdo> findCurrent() {
- persistCurrentInteractionIfRequired();
- return allMatches(
- new QueryDefault<InteractionJdo>(InteractionJdo.class, "findCurrent"));
- }
-
- @Programmatic
- public List<InteractionJdo> findCompleted() {
- persistCurrentInteractionIfRequired();
- return allMatches(
- new QueryDefault<InteractionJdo>(InteractionJdo.class, "findCompleted"));
- }
-
- // //////////////////////////////////////
-
-
- @javax.inject.Inject
- private InteractionServiceJdo interactionService;
-
- @javax.inject.Inject
- private InteractionContext interactionContext;
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/interaction/Util.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/interaction/Util.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/interaction/Util.java
deleted file mode 100644
index 031817a..0000000
--- a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/interaction/Util.java
+++ /dev/null
@@ -1,68 +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.objectstore.jdo.applib.service.interaction;
-
-import java.math.BigDecimal;
-import java.math.RoundingMode;
-import java.sql.Timestamp;
-
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.services.HasTransactionId;
-import org.apache.isis.applib.services.bookmark.Bookmark;
-import org.apache.isis.applib.services.bookmark.BookmarkService;
-import org.apache.isis.applib.services.interaction.Interaction;
-
-public class Util {
-
- private Util() {}
-
- public static Bookmark bookmarkFor(final String str) {
- return str != null? new Bookmark(str): null;
- }
-
- public static String asString(Bookmark bookmark) {
- return bookmark != null? bookmark.toString(): null;
- }
-
- public static Object lookupBookmark(Bookmark bookmark, final BookmarkService bookmarkService, DomainObjectContainer container) {
- try {
- return bookmarkService != null
- ? bookmarkService.lookup(bookmark)
- : null;
- } catch(RuntimeException ex) {
- if(ex.getClass().getName().contains("ObjectNotFoundException")) {
- container.warnUser("Object not found - has it since been deleted?");
- return null;
- }
- throw ex;
- }
- }
-
-
- public static String abbreviated(final String str, final int maxLength) {
- return str != null? (str.length() < maxLength ? str : str.substring(0, maxLength - 3) + "..."): null;
- }
-
- public static BigDecimal durationBetween(Timestamp startedAt, Timestamp completedAt) {
- if(completedAt == null) {
- return null;
- }
- long millis = completedAt.getTime() - startedAt.getTime();
- return new BigDecimal(millis).divide(new BigDecimal(1000)).setScale(3, RoundingMode.HALF_EVEN);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/publish/PublishedEventJdo.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/publish/PublishedEventJdo.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/publish/PublishedEventJdo.java
index b7a9542..9fde6fc 100644
--- a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/publish/PublishedEventJdo.java
+++ b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/publish/PublishedEventJdo.java
@@ -44,7 +44,7 @@ import org.apache.isis.applib.services.HasTransactionId;
import org.apache.isis.applib.services.bookmark.BookmarkService;
import org.apache.isis.applib.services.publish.EventType;
import org.apache.isis.objectstore.jdo.applib.service.JdoColumnLength;
-import org.apache.isis.objectstore.jdo.applib.service.interaction.Util;
+import org.apache.isis.objectstore.jdo.applib.service.Util;
@javax.jdo.annotations.PersistenceCapable(
identityType=IdentityType.APPLICATION,
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionJdo.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionJdo.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionJdo.java
new file mode 100644
index 0000000..8d92b32
--- /dev/null
+++ b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionJdo.java
@@ -0,0 +1,562 @@
+/**
+ * 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.objectstore.jdo.applib.service.reifiableaction;
+
+import java.math.BigDecimal;
+import java.sql.Timestamp;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import javax.jdo.annotations.IdentityType;
+
+import com.google.common.collect.Maps;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.annotation.ActionSemantics;
+import org.apache.isis.applib.annotation.ActionSemantics.Of;
+import org.apache.isis.applib.annotation.Disabled;
+import org.apache.isis.applib.annotation.Hidden;
+import org.apache.isis.applib.annotation.MemberGroupLayout;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.MultiLine;
+import org.apache.isis.applib.annotation.Named;
+import org.apache.isis.applib.annotation.ObjectType;
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.annotation.Title;
+import org.apache.isis.applib.annotation.TypicalLength;
+import org.apache.isis.applib.annotation.Where;
+import org.apache.isis.applib.services.bookmark.Bookmark;
+import org.apache.isis.applib.services.bookmark.BookmarkService;
+import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
+import org.apache.isis.applib.services.reifiableaction.spi.ReifiableActionService;
+import org.apache.isis.applib.util.ObjectContracts;
+import org.apache.isis.objectstore.jdo.applib.service.JdoColumnLength;
+import org.apache.isis.objectstore.jdo.applib.service.Util;
+
+
+@javax.jdo.annotations.PersistenceCapable(
+ identityType=IdentityType.APPLICATION,
+ table="IsisReifiableAction")
+@javax.jdo.annotations.Queries( {
+ @javax.jdo.annotations.Query(
+ name="findByTransactionId", language="JDOQL",
+ value="SELECT "
+ + "FROM org.apache.isis.objectstore.jdo.applib.service.reifiableaction.ReifiableActionJdo "
+ + "WHERE transactionId == :transactionId"),
+ @javax.jdo.annotations.Query(
+ name="findCurrent", language="JDOQL",
+ value="SELECT "
+ + "FROM org.apache.isis.objectstore.jdo.applib.service.reifiableaction.ReifiableActionJdo "
+ + "WHERE completedAt == null "
+ + "ORDER BY timestamp DESC"),
+ @javax.jdo.annotations.Query(
+ name="findCompleted", language="JDOQL",
+ value="SELECT "
+ + "FROM org.apache.isis.objectstore.jdo.applib.service.reifiableaction.ReifiableActionJdo "
+ + "WHERE completedAt != null "
+ + "ORDER BY timestamp DESC")
+})
+@ObjectType("IsisReifiableAction")
+@MemberGroupLayout(
+ columnSpans={6,0,6},
+ left={"Identifiers","Target","Notes"},
+ right={"Detail","Timings","Results"})
+@Named("Interaction")
+public class ReifiableActionJdo implements ReifiableAction {
+
+ @SuppressWarnings("unused")
+ private static final Logger LOG = LoggerFactory.getLogger(ReifiableActionJdo.class);
+
+
+ // //////////////////////////////////////
+ // transactionId (property)
+ // //////////////////////////////////////
+
+
+ private UUID transactionId;
+
+ /**
+ * The unique identifier (a GUID) of the transaction in which this action occurred.
+ */
+ @javax.jdo.annotations.PrimaryKey
+ @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.TRANSACTION_ID)
+ @TypicalLength(JdoColumnLength.TRANSACTION_ID)
+ @MemberOrder(name="Identifiers",sequence = "10")
+ @Disabled
+ @Override
+ public UUID getTransactionId() {
+ return transactionId;
+ }
+
+ /**
+ * <b>NOT API</b>: intended to be called only by the framework.
+ *
+ * <p>
+ * Implementation notes: copied over from the Isis transaction when the action is persisted.
+ */
+ @Override
+ public void setTransactionId(final UUID transactionId) {
+ this.transactionId = transactionId;
+ }
+
+ // //////////////////////////////////////
+ // user (property)
+ // //////////////////////////////////////
+
+ private String user;
+
+ @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.USER_NAME)
+ @Title(sequence="2", prepend=", ")
+ @MemberOrder(name="Identifiers", sequence = "20")
+ public String getUser() {
+ return user;
+ }
+
+ public void setUser(final String user) {
+ this.user = user;
+ }
+
+
+
+ // //////////////////////////////////////
+ // timestamp (property)
+ // //////////////////////////////////////
+
+ private Timestamp timestamp;
+
+ /**
+ * The date/time at which this interaction started.
+ */
+ @javax.jdo.annotations.Persistent
+ @javax.jdo.annotations.Column(allowsNull="false")
+ @MemberOrder(name="Timings", sequence = "30")
+ public Timestamp getTimestamp() {
+ return timestamp;
+ }
+
+ public void setTimestamp(final Timestamp timestamp) {
+ this.timestamp = timestamp;
+ }
+
+
+
+
+ // //////////////////////////////////////
+ // targetClass (property)
+ // //////////////////////////////////////
+
+ private String targetClass;
+
+ @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.Interaction.TARGET_CLASS)
+ @TypicalLength(30)
+ @MemberOrder(name="Target", sequence = "10")
+ @Named("Class")
+ public String getTargetClass() {
+ return targetClass;
+ }
+
+ public void setTargetClass(final String targetClass) {
+ this.targetClass = Util.abbreviated(targetClass, JdoColumnLength.Interaction.TARGET_CLASS);
+ }
+
+
+ // //////////////////////////////////////
+ // targetAction (property)
+ // //////////////////////////////////////
+
+ private String targetAction;
+
+ @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.Interaction.TARGET_ACTION)
+ @TypicalLength(30)
+ @MemberOrder(name="Target", sequence = "20")
+ @Named("Action")
+ public String getTargetAction() {
+ return targetAction;
+ }
+
+ public void setTargetAction(final String targetAction) {
+ this.targetAction = Util.abbreviated(targetAction, JdoColumnLength.Interaction.TARGET_ACTION);
+ }
+
+
+ // //////////////////////////////////////
+ // target (property)
+ // openTargetObject (action)
+ // //////////////////////////////////////
+
+ @Programmatic
+ @Override
+ public Bookmark getTarget() {
+ return Util.bookmarkFor(getTargetStr());
+ }
+
+ @Programmatic
+ @Override
+ public void setTarget(Bookmark target) {
+ setTargetStr(Util.asString(target));
+ }
+
+ // //////////////////////////////////////
+
+ private String targetStr;
+ @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.BOOKMARK, name="target")
+ @Named("Target Bookmark")
+ @Hidden(where=Where.ALL_TABLES)
+ @MemberOrder(name="Target", sequence="3")
+ @Disabled
+ public String getTargetStr() {
+ return targetStr;
+ }
+
+ public void setTargetStr(final String targetStr) {
+ this.targetStr = targetStr;
+ }
+
+ // //////////////////////////////////////
+
+ @ActionSemantics(Of.SAFE)
+ @MemberOrder(name="TargetStr", sequence="1")
+ @Named("Open")
+ public Object openTargetObject() {
+ return Util.lookupBookmark(getTarget(), bookmarkService, container);
+ }
+ public boolean hideOpenTargetObject() {
+ return getTarget() == null;
+ }
+
+
+ // //////////////////////////////////////
+ // actionIdentifier (property)
+ // //////////////////////////////////////
+
+ private String actionIdentifier;
+
+ @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.ACTION_IDENTIFIER)
+ @Title(sequence="1")
+ @TypicalLength(60)
+ @Hidden(where=Where.ALL_TABLES)
+ @MemberOrder(name="Detail",sequence = "1")
+ public String getActionIdentifier() {
+ return actionIdentifier;
+ }
+
+ public void setActionIdentifier(final String actionIdentifier) {
+ this.actionIdentifier = Util.abbreviated(actionIdentifier, JdoColumnLength.ACTION_IDENTIFIER);
+ }
+
+
+
+ // //////////////////////////////////////
+ // arguments (property)
+ // //////////////////////////////////////
+
+ private String arguments;
+
+ @javax.jdo.annotations.Column(allowsNull="false", length=JdoColumnLength.Interaction.ARGUMENTS)
+ @MultiLine(numberOfLines=6)
+ @Hidden(where=Where.ALL_TABLES)
+ @MemberOrder(name="Detail",sequence = "4")
+ @Disabled
+ public String getArguments() {
+ return arguments;
+ }
+
+ public void setArguments(final String arguments) {
+ this.arguments = Util.abbreviated(arguments, JdoColumnLength.Interaction.ARGUMENTS);
+ }
+
+
+ // //////////////////////////////////////
+ // startedAt (derived property)
+ // //////////////////////////////////////
+
+ /**
+ * The date/time at which this interaction started.
+ */
+ @javax.jdo.annotations.NotPersistent
+ @MemberOrder(name="Timings", sequence = "3")
+ @Disabled
+ public Timestamp getStartedAt() {
+ return getTimestamp();
+ }
+
+
+
+ // //////////////////////////////////////
+ // completedAt (property)
+ // //////////////////////////////////////
+
+ private Timestamp completedAt;
+
+ /**
+ * The date/time at which this interaction completed.
+ *
+ * <p>
+ * Not part of the applib API, because the default implementation is not persistent
+ * and so cannot be queried "after the fact". This JDO-specific class is persistent,
+ * and so we can gather this information.
+ */
+ @javax.jdo.annotations.Persistent
+ @javax.jdo.annotations.Column(allowsNull="true")
+ @MemberOrder(name="Timings", sequence = "4")
+ @Disabled
+ public Timestamp getCompletedAt() {
+ return completedAt;
+ }
+
+ public void setCompletedAt(final Timestamp completed) {
+ this.completedAt = completed;
+ }
+
+
+ // //////////////////////////////////////
+ // duration (derived property)
+ // //////////////////////////////////////
+
+ /**
+ * The number of seconds (to 3 decimal places) that this interaction lasted.
+ *
+ * <p>
+ * Populated only if it has {@link #getCompletedAt() completed}.
+ */
+ @javax.validation.constraints.Digits(integer=5, fraction=3)
+ @Named("Duration")
+ @MemberOrder(name="Timings", sequence = "7")
+ public BigDecimal getDuration() {
+ return Util.durationBetween(getStartedAt(), getCompletedAt());
+ }
+
+
+
+ // //////////////////////////////////////
+ // notes (property)
+ // //////////////////////////////////////
+
+ private String notes;
+
+ /**
+ * Provides the ability for the end-user to annotate a (potentially long-running)
+ * interaction.
+ *
+ * <p>
+ * Not part of the applib API, because the default implementation is not persistent
+ * and so there's no object that can be accessed to be annotated.
+ */
+ @javax.jdo.annotations.Column(allowsNull="true", length=JdoColumnLength.Interaction.NOTES)
+ @MultiLine(numberOfLines=10)
+ @Hidden(where=Where.ALL_TABLES)
+ @MemberOrder(name="Notes", sequence = "6")
+ public String getNotes() {
+ return notes;
+ }
+
+ public void setNotes(final String notes) {
+ this.notes = notes;
+ }
+
+
+ // //////////////////////////////////////
+ // nature (property)
+ // //////////////////////////////////////
+
+ private Nature nature;
+
+ /**
+ * Not persisted, used as a hint that an action was invoked explicitly by the user
+ * (rather than as a side-effect, eg of rendering an object due to get-after-post).
+ */
+ @javax.jdo.annotations.NotPersistent
+ @Programmatic
+ @Override
+ public Nature getNature() {
+ return nature;
+ }
+
+ /**
+ * <b>NOT API</b>: intended to be called only by the framework.
+ *
+ * <p>
+ * Implementation notes: populated by the viewer as hint to {@link ReifiableActionService} implementation.
+ */
+ @Override
+ public void setNature(Nature nature) {
+ this.nature = nature;
+ }
+
+
+ // //////////////////////////////////////
+ // result (property)
+ // openResultObject (action)
+ // //////////////////////////////////////
+
+ @Programmatic
+ @Override
+ public Bookmark getResult() {
+ return Util.bookmarkFor(getResultStr());
+ }
+
+ @Programmatic
+ @Override
+ public void setResult(Bookmark result) {
+ setResultStr(Util.asString(result));
+ }
+
+ // //////////////////////////////////////
+
+ private String resultStr;
+
+ @javax.jdo.annotations.Column(allowsNull="true", length=JdoColumnLength.BOOKMARK, name="result")
+ @Hidden(where=Where.ALL_TABLES)
+ @Named("Result Bookmark")
+ @MemberOrder(name="Results", sequence="25")
+ @Disabled
+ public String getResultStr() {
+ return resultStr;
+ }
+
+ public void setResultStr(final String resultStr) {
+ this.resultStr = resultStr;
+ }
+
+ // //////////////////////////////////////
+
+ @ActionSemantics(Of.SAFE)
+ @MemberOrder(name="ResultStr", sequence="1")
+ @Named("Open")
+ public Object openResultObject() {
+ return Util.lookupBookmark(getResult(), bookmarkService, container);
+ }
+ public boolean hideOpenResultObject() {
+ return getResult() == null;
+ }
+
+
+ // //////////////////////////////////////
+ // exception (property)
+ // causedException (derived property)
+ // showException (associated action)
+ // //////////////////////////////////////
+
+ private String exception;
+
+ /**
+ * Stack trace of any exception that might have occurred if this interaction/transaction aborted.
+ *
+ * <p>
+ * Not visible in the UI, but accessible
+ * <p>
+ * Not part of the applib API, because the default implementation is not persistent
+ * and so there's no object that can be accessed to be annotated.
+ */
+ @javax.jdo.annotations.Column(allowsNull="true", length=JdoColumnLength.Interaction.EXCEPTION)
+ @Hidden
+ @Override
+ public String getException() {
+ return exception;
+ }
+
+ @Override
+ public void setException(final String exception) {
+ this.exception = Util.abbreviated(exception, JdoColumnLength.Interaction.EXCEPTION);
+ }
+
+
+ // //////////////////////////////////////
+
+ @javax.jdo.annotations.NotPersistent
+ @MemberOrder(name="Results",sequence = "30")
+ @Hidden(where=Where.ALL_TABLES)
+ public boolean isCausedException() {
+ return getException() != null;
+ }
+
+
+ // //////////////////////////////////////
+
+ @ActionSemantics(Of.SAFE)
+ @MemberOrder(name="causedException", sequence = "1")
+ public String showException() {
+ return getException();
+ }
+ public boolean hideShowException() {
+ return !isCausedException();
+ }
+
+
+ // //////////////////////////////////////
+ // next(...) impl
+ // //////////////////////////////////////
+
+ private final Map<String, AtomicInteger> sequenceByName = Maps.newHashMap();
+
+
+
+ @Programmatic
+ @Override
+ public int next(String sequenceName) {
+ AtomicInteger next = sequenceByName.get(sequenceName);
+ if(next == null) {
+ next = new AtomicInteger(0);
+ sequenceByName.put(sequenceName, next);
+ } else {
+ next.incrementAndGet();
+ }
+ return next.get();
+ }
+
+ // //////////////////////////////////////
+ // reifyIfPossible (SPI impl)
+ // //////////////////////////////////////
+
+ private boolean reify;
+
+ @Programmatic
+ public boolean isReify() {
+ return reify;
+ }
+
+ @Programmatic
+ @Override
+ public void setReify(boolean reify) {
+ this.reify = reify;
+ }
+
+ // //////////////////////////////////////
+ // toString
+ // //////////////////////////////////////
+
+
+ @Override
+ public String toString() {
+ return ObjectContracts.toString(this, "startedAt,user,actionIdentifier,target,completedAt,duration,transactionId");
+ }
+
+
+ // //////////////////////////////////////
+
+ @javax.inject.Inject
+ private BookmarkService bookmarkService;
+
+ @javax.inject.Inject
+ private DomainObjectContainer container;
+
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionServiceJdo.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionServiceJdo.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionServiceJdo.java
new file mode 100644
index 0000000..e64b6eb
--- /dev/null
+++ b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionServiceJdo.java
@@ -0,0 +1,93 @@
+/**
+ * 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.objectstore.jdo.applib.service.reifiableaction;
+
+import java.util.UUID;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.isis.applib.AbstractService;
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.clock.Clock;
+import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
+import org.apache.isis.applib.services.reifiableaction.spi.ReifiableActionService;
+
+public class ReifiableActionServiceJdo extends AbstractService implements ReifiableActionService {
+
+ @SuppressWarnings("unused")
+ private static final Logger LOG = LoggerFactory.getLogger(ReifiableActionServiceJdo.class);
+
+ /**
+ * Creates an {@link ReifiableActionJdo}, initializing its
+ * {@link ReifiableAction#setNature(ReifiableAction.Nature) nature} to be
+ * {@link ReifiableAction.Nature#INDIRECT rendering}.
+ */
+ @Programmatic
+ @Override
+ public ReifiableAction create() {
+ ReifiableActionJdo reifiableAction = newTransientInstance(ReifiableActionJdo.class);
+ reifiableAction.setNature(ReifiableAction.Nature.INDIRECT);
+ return reifiableAction;
+ }
+
+ @Programmatic
+ @Override
+ public void startTransaction(final ReifiableAction reifiableAction, final UUID transactionId) {
+ if(reifiableAction instanceof ReifiableActionJdo) {
+ // should be the case, since this service created the object in the #create() method
+ final ReifiableActionJdo interactionJdo = (ReifiableActionJdo) reifiableAction;
+ final UUID currentTransactionId = interactionJdo.getTransactionId();
+ if(currentTransactionId != null && !currentTransactionId.equals(transactionId)) {
+ // the logic in IsisTransaction means that any subsequent transactions within a given reifiable action
+ // should reuse the xactnId of the first transaction created within that interaction.
+ throw new IllegalStateException("Attempting to set a different transactionId on reifiable action");
+ }
+ interactionJdo.setTransactionId(transactionId);
+ }
+ }
+
+ @Programmatic
+ @Override
+ public void complete(final ReifiableAction reifiableAction) {
+ ReifiableActionJdo reifiableActionJdo = asUserInitiatedReifiedReifiableActionJdo(reifiableAction);
+ if(reifiableActionJdo == null) {
+ return;
+ }
+
+ reifiableActionJdo.setCompletedAt(Clock.getTimeAsJavaSqlTimestamp());
+ persistIfNotAlready(reifiableActionJdo);
+ }
+
+ /**
+ * Not API, factored out from {@link ReifiableActionServiceJdoRepository}.
+ */
+ ReifiableActionJdo asUserInitiatedReifiedReifiableActionJdo(final ReifiableAction reifiableAction) {
+ if(!(reifiableAction instanceof ReifiableActionJdo)) {
+ // ought not to be the case, since this service created the object in the #create() method
+ return null;
+ }
+ if(reifiableAction.getNature() != ReifiableAction.Nature.USER_INITIATED) {
+ return null;
+ }
+ final ReifiableActionJdo reifiableActionJdo = (ReifiableActionJdo) reifiableAction;
+ if(!reifiableActionJdo.isReify()) {
+ return null;
+ }
+ return reifiableActionJdo;
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionServiceJdoRepository.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionServiceJdoRepository.java b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionServiceJdoRepository.java
new file mode 100644
index 0000000..4c30841
--- /dev/null
+++ b/component/objectstore/jdo/jdo-applib/src/main/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionServiceJdoRepository.java
@@ -0,0 +1,75 @@
+/**
+ * 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.objectstore.jdo.applib.service.reifiableaction;
+
+import java.util.List;
+import java.util.UUID;
+
+import org.apache.isis.applib.AbstractFactoryAndRepository;
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.query.QueryDefault;
+import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
+import org.apache.isis.applib.services.reifiableaction.ReifiableActionContext;
+
+
+public class ReifiableActionServiceJdoRepository extends AbstractFactoryAndRepository {
+
+ @Programmatic
+ public ReifiableActionJdo findByTransactionId(final UUID transactionId) {
+ persistCurrentReifiableActionIfRequired();
+ return firstMatch(
+ new QueryDefault<ReifiableActionJdo>(ReifiableActionJdo.class,
+ "findByTransactionId",
+ "transactionId", transactionId.toString()));
+ }
+
+ @Programmatic
+ public List<ReifiableActionJdo> findCurrent() {
+ persistCurrentReifiableActionIfRequired();
+ return allMatches(
+ new QueryDefault<ReifiableActionJdo>(ReifiableActionJdo.class, "findCurrent"));
+ }
+
+ @Programmatic
+ public List<ReifiableActionJdo> findCompleted() {
+ persistCurrentReifiableActionIfRequired();
+ return allMatches(
+ new QueryDefault<ReifiableActionJdo>(ReifiableActionJdo.class, "findCompleted"));
+ }
+
+ private void persistCurrentReifiableActionIfRequired() {
+ if(reifiableActionContext == null || reifiableActionService == null) {
+ return;
+ }
+ final ReifiableAction reifiableAction = reifiableActionContext.getReifiableAction();
+ final ReifiableActionJdo reifiableActionJdo = reifiableActionService.asUserInitiatedReifiedReifiableActionJdo(reifiableAction);
+ if(reifiableActionJdo == null) {
+ return;
+ }
+ persistIfNotAlready(reifiableActionJdo);
+ }
+
+ // //////////////////////////////////////
+
+
+ @javax.inject.Inject
+ private ReifiableActionServiceJdo reifiableActionService;
+
+ @javax.inject.Inject
+ private ReifiableActionContext reifiableActionContext;
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/component/objectstore/jdo/jdo-applib/src/test/java/org/apache/isis/objectstore/jdo/applib/service/interaction/InteractionJdoTest_next.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/test/java/org/apache/isis/objectstore/jdo/applib/service/interaction/InteractionJdoTest_next.java b/component/objectstore/jdo/jdo-applib/src/test/java/org/apache/isis/objectstore/jdo/applib/service/interaction/InteractionJdoTest_next.java
deleted file mode 100644
index 9b7b2ba..0000000
--- a/component/objectstore/jdo/jdo-applib/src/test/java/org/apache/isis/objectstore/jdo/applib/service/interaction/InteractionJdoTest_next.java
+++ /dev/null
@@ -1,41 +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.objectstore.jdo.applib.service.interaction;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import org.junit.Test;
-
-public class InteractionJdoTest_next {
-
- @Test
- public void test() {
- InteractionJdo interaction = new InteractionJdo();
- assertThat(interaction.next("foo"), is(0));
- assertThat(interaction.next("foo"), is(1));
- assertThat(interaction.next("bar"), is(0));
- assertThat(interaction.next("bar"), is(1));
- assertThat(interaction.next("foo"), is(2));
- assertThat(interaction.next("bar"), is(2));
- assertThat(interaction.next("bar"), is(3));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/component/objectstore/jdo/jdo-applib/src/test/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionJdoTest_next.java
----------------------------------------------------------------------
diff --git a/component/objectstore/jdo/jdo-applib/src/test/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionJdoTest_next.java b/component/objectstore/jdo/jdo-applib/src/test/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionJdoTest_next.java
new file mode 100644
index 0000000..72bd939
--- /dev/null
+++ b/component/objectstore/jdo/jdo-applib/src/test/java/org/apache/isis/objectstore/jdo/applib/service/reifiableaction/ReifiableActionJdoTest_next.java
@@ -0,0 +1,43 @@
+/*
+ * 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.objectstore.jdo.applib.service.reifiableaction;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Test;
+
+import org.apache.isis.objectstore.jdo.applib.service.reifiableaction.ReifiableActionJdo;
+
+public class ReifiableActionJdoTest_next {
+
+ @Test
+ public void test() {
+ ReifiableActionJdo raj = new ReifiableActionJdo();
+ assertThat(raj.next("foo"), is(0));
+ assertThat(raj.next("foo"), is(1));
+ assertThat(raj.next("bar"), is(0));
+ assertThat(raj.next("bar"), is(1));
+ assertThat(raj.next("foo"), is(2));
+ assertThat(raj.next("bar"), is(2));
+ assertThat(raj.next("bar"), is(3));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actions/ActionPanel.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actions/ActionPanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actions/ActionPanel.java
index 1ba602e..a79649a 100644
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actions/ActionPanel.java
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actions/ActionPanel.java
@@ -33,8 +33,8 @@ import org.apache.isis.applib.services.bookmark.Bookmark;
import org.apache.isis.applib.services.bookmark.BookmarkService;
import org.apache.isis.applib.services.exceprecog.ExceptionRecognizer;
import org.apache.isis.applib.services.exceprecog.ExceptionRecognizerComposite;
-import org.apache.isis.applib.services.interaction.Interaction;
-import org.apache.isis.applib.services.interaction.InteractionContext;
+import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
+import org.apache.isis.applib.services.reifiableaction.ReifiableActionContext;
import org.apache.isis.core.commons.authentication.MessageBroker;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.adapter.oid.Oid;
@@ -183,11 +183,11 @@ public class ActionPanel extends PanelAbstract<ActionModel> implements ActionExe
return false;
}
- final InteractionContext interactionContext = getServicesInjector().lookupService(InteractionContext.class);
- final Interaction interaction;
+ final ReifiableActionContext interactionContext = getServicesInjector().lookupService(ReifiableActionContext.class);
+ final ReifiableAction interaction;
if (interactionContext != null) {
- interaction = interactionContext.getInteraction();
- interaction.setNature(Interaction.Nature.ACTION_INVOCATION);
+ interaction = interactionContext.getReifiableAction();
+ interaction.setNature(ReifiableAction.Nature.USER_INITIATED);
} else {
interaction = null;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/applib/src/main/java/org/apache/isis/applib/annotation/Reified.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/Reified.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/Reified.java
new file mode 100644
index 0000000..c940ae6
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/Reified.java
@@ -0,0 +1,40 @@
+/*
+ * 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;
+
+import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
+import org.apache.isis.applib.services.reifiableaction.spi.ReifiableActionService;
+
+/**
+ * Indicates that an action invocation should be reified as a persisted {@link ReifiableAction},
+ * (if supported by the configured {@link ReifiableActionService}).
+ */
+@Inherited
+@Target({ ElementType.METHOD })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Reified {
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundTaskService.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundTaskService.java b/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundTaskService.java
index 783afc6..e1c6ffe 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundTaskService.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/background/BackgroundTaskService.java
@@ -1,6 +1,6 @@
package org.apache.isis.applib.services.background;
-import java.util.UUID;
+import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
/**
@@ -14,5 +14,5 @@ import java.util.UUID;
*/
public interface BackgroundTaskService {
- void execute(final ActionInvocationMemento actionInvocationMemento, final UUID transactionId, final int sequence);
+ void execute(final ActionInvocationMemento aim, final ReifiableAction reifiableAction);
}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/applib/src/main/java/org/apache/isis/applib/services/interaction/Interaction.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/interaction/Interaction.java b/core/applib/src/main/java/org/apache/isis/applib/services/interaction/Interaction.java
deleted file mode 100644
index 00a7fa3..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/services/interaction/Interaction.java
+++ /dev/null
@@ -1,224 +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.interaction;
-
-import java.sql.Timestamp;
-
-import org.apache.isis.applib.Identifier;
-import org.apache.isis.applib.annotation.Disabled;
-import org.apache.isis.applib.clock.Clock;
-import org.apache.isis.applib.services.HasTransactionId;
-import org.apache.isis.applib.services.bookmark.Bookmark;
-import org.apache.isis.applib.services.bookmark.BookmarkService;
-import org.apache.isis.applib.services.interaction.spi.InteractionService;
-
-public interface Interaction extends HasTransactionId {
-
- /**
- * The user that initiated the interaction.
- */
- @Disabled
- public abstract String getUser();
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- *
- * <p>
- * Implementation notes: set when the Isis PersistenceSession is opened.
- */
- public abstract void setUser(String user);
-
- // //////////////////////////////////////
-
- /**
- * The date/time at which the interaction started.
- */
- @Disabled
- public abstract Timestamp getTimestamp();
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- *
- * <p>
- * Implementation notes: set when the Isis PersistenceSession is opened. Uses the applib {@link Clock}.
- */
- public abstract void setTimestamp(Timestamp startedAt);
-
-
- // //////////////////////////////////////
-
-
- /**
- * {@link Bookmark} of the target object (entity or service) on which this interaction was performed.
- *
- * <p>
- * Will only be populated if a {@link BookmarkService} has been configured.
- */
- @Disabled
- public abstract Bookmark getTarget();
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- *
- * <p>
- * Implementation notes: set when the action is invoked (in the ActionInvocationFacet).
- */
- public abstract void setTarget(Bookmark target);
-
- // //////////////////////////////////////
-
- /**
- * If this interaction is an action invocation (as opposed to updating an object),
- * then holds a string representation of that action, equivalent to
- * {@link Identifier#toClassAndNameIdentityString()}.
- *
- * <p>
- * Returns <tt>null</tt> otherwise.
- */
- @Disabled
- public abstract String getActionIdentifier();
-
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- *
- * <p>
- * Implementation notes: set when the action is invoked (in the ActionInvocationFacet).
- */
- public abstract void setActionIdentifier(String actionIdentifier);
-
- // //////////////////////////////////////
-
- /**
- * A human-friendly description of the class of the target object.
- */
- @Disabled
- public abstract String getTargetClass();
-
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- *
- * <p>
- * Implementation notes: set when the action is invoked (in the ActionInvocationFacet).
- */
- public abstract void setTargetClass(String targetClass);
-
- // //////////////////////////////////////
-
- /**
- * The human-friendly name of the action invoked on the target object.
- */
- @Disabled
- public abstract String getTargetAction();
-
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- *
- * <p>
- * Implementation notes: set when the action is invoked (in the ActionInvocationFacet).
- */
- public abstract void setTargetAction(String targetAction);
-
- // //////////////////////////////////////
-
- /**
- * A human-friendly description of the arguments passed to this interaction (action invocation).
- */
- public String getArguments();
-
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- *
- * <p>
- * Implementation notes: set when the action is invoked (in the ActionInvocationFacet).
- */
- public void setArguments(final String arguments);
-
- // //////////////////////////////////////
-
- /**
- * The nature of this interaction, for example whether as the result of an
- * {@link #ACTION_INVOCATION explicit action invocation} on the part of the user, or merely as
- * a side-effect of {@link #RENDERING re-rendering} an entity, eg for a viewer (such as the
- * Wicket viewer) that uses the <a href="http://en.wikipedia.org/wiki/Post/Redirect/Get">post/redirect/get</a>
- * to avoid duplicate submissions.
- *
- * <p>
- * The Isis implementations uses this field as to a hint as to whether to populate the interaction's
- * {@link Interaction#setActionIdentifier(String) action identifier} and related properties. The expectation
- * is that implementations of {@link InteractionService} will only persist interactions that were explicitly started
- * by the user.
- */
- public static enum Nature {
- /**
- * Indicates that the {@link Interaction} has occurred as the result of an explicit action invocation
- * on the part of the user.
- */
- ACTION_INVOCATION,
- RENDERING
- }
-
- public Nature getNature();
-
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- */
- public void setNature(final Nature nature);
-
-
- // //////////////////////////////////////
-
- @Disabled
- public String getException();
-
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- */
- public void setException(String stackTrace);
-
- // //////////////////////////////////////
-
-
- /**
- * A {@link Bookmark} to the object returned by the action.
- *
- * <p>
- * If the action returned either a domain entity or a simple value (and did not throw an
- * exception) then this object is provided here.
- *
- * <p>
- * For <tt>void</tt> methods and for actions returning collections, the value
- * will be <tt>null</tt>.
- */
- public Bookmark getResult();
-
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- */
- public void setResult(Bookmark resultBookmark);
-
-
- // //////////////////////////////////////
-
-
- /**
- * Generates numbers in a named sequence
- *
- * <p>
- * Used to support <tt>BackgroundTaskServiceJdo</tt> and <tt>PublishingServiceJdo</tt> implementations whose
- * persisted entities are uniquely identified by a ({@link #getTransactionId() transactionId}, <tt>sequence</tt>)
- * tuple.
- */
- public int next(final String sequenceName);
-
-}
[2/3] ISIS-671, ISIS-672: renames, also @Reified annotation
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/applib/src/main/java/org/apache/isis/applib/services/interaction/InteractionContext.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/interaction/InteractionContext.java b/core/applib/src/main/java/org/apache/isis/applib/services/interaction/InteractionContext.java
deleted file mode 100644
index b2ae710..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/services/interaction/InteractionContext.java
+++ /dev/null
@@ -1,50 +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.interaction;
-
-import javax.enterprise.context.RequestScoped;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.applib.annotation.Programmatic;
-
-/**
- * Register this as a service in order to access context information about any {@link Interaction}.
- */
-@RequestScoped
-public class InteractionContext {
-
- @SuppressWarnings("unused")
- private static final Logger LOG = LoggerFactory.getLogger(InteractionContext.class);
-
- private Interaction interaction;
-
- @Programmatic
- public Interaction getInteraction() {
- return interaction;
- }
-
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- * @param interaction
- */
- public void setInteraction(Interaction interaction) {
- this.interaction = interaction;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/applib/src/main/java/org/apache/isis/applib/services/interaction/InteractionDefault.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/interaction/InteractionDefault.java b/core/applib/src/main/java/org/apache/isis/applib/services/interaction/InteractionDefault.java
deleted file mode 100644
index 2396ca2..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/services/interaction/InteractionDefault.java
+++ /dev/null
@@ -1,228 +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.interaction;
-
-import java.sql.Timestamp;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import com.google.common.collect.Maps;
-
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.services.bookmark.Bookmark;
-import org.apache.isis.applib.services.interaction.spi.InteractionService;
-import org.apache.isis.applib.util.ObjectContracts;
-
-public class InteractionDefault implements Interaction {
-
- public InteractionDefault() {
- setNature(Interaction.Nature.RENDERING);
- }
-
- // //////////////////////////////////////
- // actionIdentifier (property)
- // //////////////////////////////////////
-
- private String actionIdentifier;
- public String getActionIdentifier() {
- return actionIdentifier;
- }
- @Override
- public void setActionIdentifier(String actionIdentifier) {
- this.actionIdentifier = actionIdentifier;
- }
-
- // //////////////////////////////////////
- // targetClass (property)
- // //////////////////////////////////////
-
- private String targetClass;
- public String getTargetClass() {
- return targetClass;
- }
-
- @Override
- public void setTargetClass(String targetClass) {
- this.targetClass = targetClass;
- }
-
- // //////////////////////////////////////
- // targetAction (property)
- // //////////////////////////////////////
-
- private String targetAction;
- public String getTargetAction() {
- return targetAction;
- }
-
- @Override
- public void setTargetAction(String targetAction) {
- this.targetAction = targetAction;
- }
-
- // //////////////////////////////////////
- // arguments (property)
- // //////////////////////////////////////
-
- private String arguments;
- public String getArguments() {
- return arguments;
- }
-
- @Override
- public void setArguments(String arguments) {
- this.arguments = arguments;
- }
-
- // //////////////////////////////////////
- // target (property)
- // //////////////////////////////////////
-
- private Bookmark target;
- public Bookmark getTarget() {
- return target;
- }
- @Override
- public void setTarget(Bookmark target) {
- this.target = target;
- }
-
-
- // //////////////////////////////////////
- // startedAt (property)
- // //////////////////////////////////////
-
- private Timestamp startedAt;
- public Timestamp getTimestamp() {
- return startedAt;
- }
-
- @Override
- public void setTimestamp(Timestamp startedAt) {
- this.startedAt = startedAt;
- }
-
- // //////////////////////////////////////
- // user (property)
- // //////////////////////////////////////
-
- private String user;
- public String getUser() {
- return user;
- }
-
- @Override
- public void setUser(String user) {
- this.user = user;
- }
-
-
- // //////////////////////////////////////
- // nature (property)
- // //////////////////////////////////////
-
- private Nature nature;
-
- @Override
- public Nature getNature() {
- return nature;
- }
-
- /**
- * <b>NOT API</b>: intended to be called only by the framework.
- *
- * <p>
- * Implementation notes: populated by the viewer as hint to {@link InteractionService} implementation.
- */
- @Override
- public void setNature(Nature nature) {
- this.nature = nature;
- }
-
- // //////////////////////////////////////
- // result (property)
- // //////////////////////////////////////
-
- private Bookmark result;
-
- @Override
- public Bookmark getResult() {
- return result;
- }
- @Override
- public void setResult(final Bookmark result) {
- this.result = result;
- }
-
-
- // //////////////////////////////////////
- // exceptionStackTrace (property)
- // //////////////////////////////////////
-
- private String exceptionStackTrace;
-
- @Override
- public String getException() {
- return exceptionStackTrace;
- }
- @Override
- public void setException(final String exceptionStackTrace) {
- this.exceptionStackTrace = exceptionStackTrace;
- }
-
- // //////////////////////////////////////
-
- @Override
- public String toString() {
- return ObjectContracts.toString(this, "startedAt,user,actionIdentifier,target,guid");
- }
-
-
- // //////////////////////////////////////
-
- private UUID transactionId;
-
- @Override
- public UUID getTransactionId() {
- return transactionId;
- }
- @Override
- public void setTransactionId(UUID transactionId) {
- this.transactionId = transactionId;
- }
-
-
- // //////////////////////////////////////
-
- private final Map<String, AtomicInteger> sequenceByName = Maps.newHashMap();
-
- @Programmatic
- @Override
- public int next(String sequenceName) {
- AtomicInteger next = sequenceByName.get(sequenceName);
- if(next == null) {
- next = new AtomicInteger(0);
- sequenceByName.put(sequenceName, next);
- } else {
- next.incrementAndGet();
- }
- return next.get();
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/applib/src/main/java/org/apache/isis/applib/services/interaction/spi/InteractionService.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/interaction/spi/InteractionService.java b/core/applib/src/main/java/org/apache/isis/applib/services/interaction/spi/InteractionService.java
deleted file mode 100644
index 749b162..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/services/interaction/spi/InteractionService.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.interaction.spi;
-
-import java.util.UUID;
-
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.services.interaction.Interaction;
-
-/**
- * Intended for service to implement, providing a different implementation of
- * {@link Interaction}.
- *
- * <p>
- * The default implementation (provided automatically by the framework) will
- * instantiate an in-memory implementation of {@link Interaction}. However, other
- * services (eg as provided by the JDO objectstore) might provide a persistable
- * {@link Interaction} object.
- */
-public interface InteractionService {
-
- @Programmatic
- Interaction create();
-
- /**
- * Although the transactionId is also provided via {@link InteractionOutcome} in the
- * {@link #complete(Interaction)} callback, it is passed in here as well
- * so that an implementation can ensure that the {@link Interaction} is fully populated in order
- * to persist if required.
- *
- * <p>
- * One case where this may be supported (for example, by the <tt>InteractionServiceJdo</tt> implementation)
- * is to flush still-running {@link Interaction}s to the database on-demand.
- */
- @Programmatic
- void startTransaction(final Interaction interaction, final UUID transactionId);
-
- @Programmatic
- void complete(final Interaction interaction);
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableAction.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableAction.java b/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableAction.java
new file mode 100644
index 0000000..70af531
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableAction.java
@@ -0,0 +1,245 @@
+/**
+ * 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.reifiableaction;
+
+import java.sql.Timestamp;
+
+import org.apache.isis.applib.Identifier;
+import org.apache.isis.applib.annotation.Disabled;
+import org.apache.isis.applib.annotation.Reified;
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.clock.Clock;
+import org.apache.isis.applib.services.HasTransactionId;
+import org.apache.isis.applib.services.background.BackgroundTaskService;
+import org.apache.isis.applib.services.bookmark.Bookmark;
+import org.apache.isis.applib.services.bookmark.BookmarkService;
+import org.apache.isis.applib.services.reifiableaction.spi.ReifiableActionService;
+
+public interface ReifiableAction extends HasTransactionId {
+
+ /**
+ * The user that initiated the action.
+ */
+ @Disabled
+ public abstract String getUser();
+ /**
+ * <b>NOT API</b>: intended to be called only by the framework.
+ *
+ * <p>
+ * Implementation notes: set when the Isis PersistenceSession is opened.
+ */
+ public abstract void setUser(String user);
+
+ // //////////////////////////////////////
+
+ /**
+ * The date/time at which the action was invoked.
+ */
+ @Disabled
+ public abstract Timestamp getTimestamp();
+ /**
+ * <b>NOT API</b>: intended to be called only by the framework.
+ *
+ * <p>
+ * Implementation notes: set when the Isis PersistenceSession is opened. Uses the applib {@link Clock}.
+ */
+ public abstract void setTimestamp(Timestamp startedAt);
+
+
+ // //////////////////////////////////////
+
+
+ /**
+ * {@link Bookmark} of the target object (entity or service) on which this action was performed.
+ *
+ * <p>
+ * Will only be populated if a {@link BookmarkService} has been configured.
+ */
+ @Disabled
+ public abstract Bookmark getTarget();
+ /**
+ * <b>NOT API</b>: intended to be called only by the framework.
+ *
+ * <p>
+ * Implementation notes: set when the action is invoked (in the ActionInvocationFacet).
+ */
+ public abstract void setTarget(Bookmark target);
+
+ // //////////////////////////////////////
+
+ /**
+ * Holds a string representation of the invoked action, equivalent to
+ * {@link Identifier#toClassAndNameIdentityString()}.
+ *
+ * <p>
+ * Returns <tt>null</tt> otherwise.
+ */
+ @Disabled
+ public abstract String getActionIdentifier();
+
+ /**
+ * <b>NOT API</b>: intended to be called only by the framework.
+ *
+ * <p>
+ * Implementation notes: set when the action is invoked (in the <tt>ActionInvocationFacet</tt>).
+ */
+ public abstract void setActionIdentifier(String actionIdentifier);
+
+ // //////////////////////////////////////
+
+ /**
+ * A human-friendly description of the class of the target object.
+ */
+ @Disabled
+ public abstract String getTargetClass();
+
+ /**
+ * <b>NOT API</b>: intended to be called only by the framework.
+ *
+ * <p>
+ * Implementation notes: set when the action is invoked (in the <tt>ActionInvocationFacet</t>).
+ */
+ public abstract void setTargetClass(String targetClass);
+
+ // //////////////////////////////////////
+
+ /**
+ * The human-friendly name of the action invoked on the target object.
+ */
+ @Disabled
+ public abstract String getTargetAction();
+
+ /**
+ * <b>NOT API</b>: intended to be called only by the framework.
+ *
+ * <p>
+ * Implementation notes: set when the action is invoked (in the <tt>ActionInvocationFacet</tt>).
+ */
+ public abstract void setTargetAction(String targetAction);
+
+ // //////////////////////////////////////
+
+ /**
+ * A human-friendly description of the arguments with which the action was invoked.
+ */
+ public String getArguments();
+
+ /**
+ * <b>NOT API</b>: intended to be called only by the framework.
+ *
+ * <p>
+ * Implementation notes: set when the action is invoked (in the ActionInvocationFacet).
+ */
+ public void setArguments(final String arguments);
+
+ // //////////////////////////////////////
+
+ public static enum Nature {
+ /**
+ * Indicates that the {@link UserAction} has occurred as the result of an explicit action invocation
+ * on the part of the user.
+ */
+ USER_INITIATED,
+ INDIRECT
+ }
+
+ /**
+ * The nature of this action, for example whether it was
+ * {@link #USER_INITIATED user initiated} on the part of the user, or merely as
+ * a {@link #INDIRECT indirect} side-effect, eg the re-rendering of an entity in a viewer (such as the
+ * Wicket viewer) that uses the <a href="http://en.wikipedia.org/wiki/Post/Redirect/Get">post/redirect/get</a>
+ * to avoid duplicate submissions.
+ *
+ * <p>
+ * The Isis implementations uses this field as to a hint as to whether to populate the interaction's
+ * {@link ReifiableAction#setActionIdentifier(String) action identifier} and related properties. The expectation
+ * is that implementations of {@link ReifiableActionService} will only persist interactions that were explicitly started
+ * by the user.
+ */
+ public Nature getNature();
+
+ /**
+ * <b>NOT API</b>: intended to be called only by the framework.
+ */
+ public void setNature(final Nature nature);
+
+
+ // //////////////////////////////////////
+
+ @Disabled
+ public String getException();
+
+ /**
+ * <b>NOT API</b>: intended to be called only by the framework.
+ */
+ public void setException(String stackTrace);
+
+ // //////////////////////////////////////
+
+
+ /**
+ * A {@link Bookmark} to the object returned by the action.
+ *
+ * <p>
+ * If the action returned either a domain entity or a simple value (and did not throw an
+ * exception) then this object is provided here.
+ *
+ * <p>
+ * For <tt>void</tt> methods and for actions returning collections, the value
+ * will be <tt>null</tt>.
+ */
+ public Bookmark getResult();
+
+ /**
+ * <b>NOT API</b>: intended to be called only by the framework.
+ */
+ public void setResult(Bookmark resultBookmark);
+
+
+ // //////////////////////////////////////
+
+
+ /**
+ * Hint that this {@link ReifiableAction} should be persisted.
+ *
+ * <p>
+ * This is most commonly done if the action being invoked has been explicitly annotated to be reified, eg
+ * using the {@link Reified} annotation. But it might also happen as a hint from another domain service.
+ * For example, a {@link BackgroundTaskService} implementations that creates persisted background tasks ought to be
+ * associated (via the {@link ReifiableAction#getTransactionId() transactionId}) to a persisted
+ * {@link ReifiableAction}. The app can then provide a mechanism for the end-user to query for their
+ * running background actions from this original {@link ReifiableAction}.
+ *
+ * <p>
+ * <b>NOT API</b>: intended to be called only by the framework.
+ */
+ @Programmatic
+ public void setReify(boolean reifyHint);
+
+ // //////////////////////////////////////
+
+ /**
+ * Generates numbers in a named sequence
+ *
+ * <p>
+ * Used to support <tt>BackgroundTaskServiceJdo</tt> and <tt>PublishingServiceJdo</tt> implementations whose
+ * persisted entities are uniquely identified by a ({@link #getTransactionId() transactionId}, <tt>sequence</tt>)
+ * tuple.
+ */
+ @Programmatic
+ public int next(final String sequenceName);
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableActionContext.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableActionContext.java b/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableActionContext.java
new file mode 100644
index 0000000..27ad878
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableActionContext.java
@@ -0,0 +1,50 @@
+/**
+ * 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.reifiableaction;
+
+import javax.enterprise.context.RequestScoped;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.isis.applib.annotation.Programmatic;
+
+/**
+ * Register this as a service in order to access context information about any {@link ReifiableAction}.
+ */
+@RequestScoped
+public class ReifiableActionContext {
+
+ @SuppressWarnings("unused")
+ private static final Logger LOG = LoggerFactory.getLogger(ReifiableActionContext.class);
+
+ private ReifiableAction reifiableAction;
+
+ @Programmatic
+ public ReifiableAction getReifiableAction() {
+ return reifiableAction;
+ }
+
+ /**
+ * <b>NOT API</b>: intended to be called only by the framework.
+ * @param interaction
+ */
+ public void setReifiableAction(ReifiableAction interaction) {
+ this.reifiableAction = interaction;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableActionDefault.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableActionDefault.java b/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableActionDefault.java
new file mode 100644
index 0000000..bb8b64f
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/ReifiableActionDefault.java
@@ -0,0 +1,233 @@
+/**
+ * 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.reifiableaction;
+
+import java.sql.Timestamp;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import com.google.common.collect.Maps;
+
+import org.apache.isis.applib.services.bookmark.Bookmark;
+import org.apache.isis.applib.services.reifiableaction.spi.ReifiableActionService;
+import org.apache.isis.applib.util.ObjectContracts;
+
+public class ReifiableActionDefault implements ReifiableAction {
+
+ public ReifiableActionDefault() {
+ setNature(ReifiableAction.Nature.INDIRECT);
+ }
+
+ // //////////////////////////////////////
+ // actionIdentifier (property)
+ // //////////////////////////////////////
+
+ private String actionIdentifier;
+ public String getActionIdentifier() {
+ return actionIdentifier;
+ }
+ @Override
+ public void setActionIdentifier(String actionIdentifier) {
+ this.actionIdentifier = actionIdentifier;
+ }
+
+ // //////////////////////////////////////
+ // targetClass (property)
+ // //////////////////////////////////////
+
+ private String targetClass;
+ public String getTargetClass() {
+ return targetClass;
+ }
+
+ @Override
+ public void setTargetClass(String targetClass) {
+ this.targetClass = targetClass;
+ }
+
+ // //////////////////////////////////////
+ // targetAction (property)
+ // //////////////////////////////////////
+
+ private String targetAction;
+ public String getTargetAction() {
+ return targetAction;
+ }
+
+ @Override
+ public void setTargetAction(String targetAction) {
+ this.targetAction = targetAction;
+ }
+
+ // //////////////////////////////////////
+ // arguments (property)
+ // //////////////////////////////////////
+
+ private String arguments;
+ public String getArguments() {
+ return arguments;
+ }
+
+ @Override
+ public void setArguments(String arguments) {
+ this.arguments = arguments;
+ }
+
+ // //////////////////////////////////////
+ // target (property)
+ // //////////////////////////////////////
+
+ private Bookmark target;
+ public Bookmark getTarget() {
+ return target;
+ }
+ @Override
+ public void setTarget(Bookmark target) {
+ this.target = target;
+ }
+
+
+ // //////////////////////////////////////
+ // startedAt (property)
+ // //////////////////////////////////////
+
+ private Timestamp startedAt;
+ public Timestamp getTimestamp() {
+ return startedAt;
+ }
+
+ @Override
+ public void setTimestamp(Timestamp startedAt) {
+ this.startedAt = startedAt;
+ }
+
+ // //////////////////////////////////////
+ // user (property)
+ // //////////////////////////////////////
+
+ private String user;
+ public String getUser() {
+ return user;
+ }
+
+ @Override
+ public void setUser(String user) {
+ this.user = user;
+ }
+
+
+ // //////////////////////////////////////
+ // nature (property)
+ // //////////////////////////////////////
+
+ private Nature nature;
+
+ @Override
+ public Nature getNature() {
+ return nature;
+ }
+
+ /**
+ * <b>NOT API</b>: intended to be called only by the framework.
+ *
+ * <p>
+ * Implementation notes: populated by the viewer as hint to {@link ReifiableActionService} implementation.
+ */
+ @Override
+ public void setNature(Nature nature) {
+ this.nature = nature;
+ }
+
+ // //////////////////////////////////////
+ // result (property)
+ // //////////////////////////////////////
+
+ private Bookmark result;
+
+ @Override
+ public Bookmark getResult() {
+ return result;
+ }
+ @Override
+ public void setResult(final Bookmark result) {
+ this.result = result;
+ }
+
+
+ // //////////////////////////////////////
+ // exceptionStackTrace (property)
+ // //////////////////////////////////////
+
+ private String exceptionStackTrace;
+
+ @Override
+ public String getException() {
+ return exceptionStackTrace;
+ }
+ @Override
+ public void setException(final String exceptionStackTrace) {
+ this.exceptionStackTrace = exceptionStackTrace;
+ }
+
+ // //////////////////////////////////////
+
+ @Override
+ public String toString() {
+ return ObjectContracts.toString(this, "startedAt,user,actionIdentifier,target,guid");
+ }
+
+
+ // //////////////////////////////////////
+
+ private UUID transactionId;
+
+ @Override
+ public UUID getTransactionId() {
+ return transactionId;
+ }
+ @Override
+ public void setTransactionId(UUID transactionId) {
+ this.transactionId = transactionId;
+ }
+
+
+ // //////////////////////////////////////
+
+ private final Map<String, AtomicInteger> sequenceByName = Maps.newHashMap();
+
+ @Override
+ public int next(String sequenceName) {
+ AtomicInteger next = sequenceByName.get(sequenceName);
+ if(next == null) {
+ next = new AtomicInteger(0);
+ sequenceByName.put(sequenceName, next);
+ } else {
+ next.incrementAndGet();
+ }
+ return next.get();
+ }
+
+
+ // //////////////////////////////////////
+
+ public void setReify(boolean reifyHint) {
+ // no-op
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/spi/ReifiableActionService.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/spi/ReifiableActionService.java b/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/spi/ReifiableActionService.java
new file mode 100644
index 0000000..4eaee48
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/reifiableaction/spi/ReifiableActionService.java
@@ -0,0 +1,55 @@
+/**
+ * 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.reifiableaction.spi;
+
+import java.util.UUID;
+
+import org.apache.isis.applib.annotation.Programmatic;
+import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
+
+/**
+ * Intended for service to implement, providing a different implementation of
+ * {@link ReifiableAction}.
+ *
+ * <p>
+ * The default implementation (provided automatically by the framework) will
+ * instantiate an in-memory implementation of {@link ReifiableAction}. However, other
+ * services (eg as provided by the JDO objectstore) might provide a persistable
+ * {@link ReifiableAction} object.
+ */
+public interface ReifiableActionService {
+
+ @Programmatic
+ ReifiableAction create();
+
+ /**
+ * Although the transactionId is also provided in the
+ * {@link #complete(ReifiableAction)} callback, it is passed in here as well
+ * so that an implementation can ensure that the {@link ReifiableAction} is fully populated in order
+ * to persist if required.
+ *
+ * <p>
+ * One case where this may be supported (for example, by the <tt>ReifiableActionServiceJdo</tt> implementation)
+ * is to flush still-running {@link ReifiableAction}s to the database on-demand.
+ */
+ @Programmatic
+ void startTransaction(final ReifiableAction reifiableAction, final UUID transactionId);
+
+ @Programmatic
+ void complete(final ReifiableAction reifiableAction);
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/applib/src/main/java/org/apache/isis/applib/services/scratchpad/Scratchpad.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/scratchpad/Scratchpad.java b/core/applib/src/main/java/org/apache/isis/applib/services/scratchpad/Scratchpad.java
index d3b351a..a736397 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/scratchpad/Scratchpad.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/scratchpad/Scratchpad.java
@@ -24,7 +24,6 @@ import javax.enterprise.context.RequestScoped;
import com.google.common.collect.Maps;
-import org.apache.isis.applib.annotation.Bulk.InteractionContext;
import org.apache.isis.applib.annotation.Programmatic;
@RequestScoped
@@ -53,11 +52,6 @@ public class Scratchpad {
/**
* Clear any user data.
- *
- * <p>
- * Note that a new instance of {@link InteractionContext} is created for
- * any given bulk action, and so it isn't required for the user data to be
- * cleared down.
*/
@Programmatic
public void clear() {
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/applib/src/test/java/org/apache/isis/applib/services/interaction/InteractionDefaultTest_next.java
----------------------------------------------------------------------
diff --git a/core/applib/src/test/java/org/apache/isis/applib/services/interaction/InteractionDefaultTest_next.java b/core/applib/src/test/java/org/apache/isis/applib/services/interaction/InteractionDefaultTest_next.java
index ca27ad9..68ecee8 100644
--- a/core/applib/src/test/java/org/apache/isis/applib/services/interaction/InteractionDefaultTest_next.java
+++ b/core/applib/src/test/java/org/apache/isis/applib/services/interaction/InteractionDefaultTest_next.java
@@ -24,11 +24,13 @@ import static org.junit.Assert.assertThat;
import org.junit.Test;
+import org.apache.isis.applib.services.reifiableaction.ReifiableActionDefault;
+
public class InteractionDefaultTest_next {
@Test
public void test() {
- InteractionDefault interaction = new InteractionDefault();
+ ReifiableActionDefault interaction = new ReifiableActionDefault();
assertThat(interaction.next("foo"), is(0));
assertThat(interaction.next("foo"), is(1));
assertThat(interaction.next("bar"), is(0));
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/invoke/ActionInvocationFacet.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/invoke/ActionInvocationFacet.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/invoke/ActionInvocationFacet.java
index 8943f3a..297fa7a 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/invoke/ActionInvocationFacet.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/invoke/ActionInvocationFacet.java
@@ -24,8 +24,8 @@ import java.util.List;
import java.util.UUID;
import org.apache.isis.applib.services.HasTransactionId;
-import org.apache.isis.applib.services.interaction.InteractionContext;
-import org.apache.isis.applib.services.interaction.spi.InteractionService;
+import org.apache.isis.applib.services.reifiableaction.ReifiableActionContext;
+import org.apache.isis.applib.services.reifiableaction.spi.ReifiableActionService;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.facetapi.Facet;
import org.apache.isis.core.metamodel.facetapi.IdentifiedHolder;
@@ -89,7 +89,7 @@ public interface ActionInvocationFacet extends Facet {
/**
* TODO...
- * @deprecated - should instead use the InteractionContext request.
+ * @deprecated - should instead use the {@link ReifiableActionContext} request.
*/
@Deprecated
public static ThreadLocal<CurrentInvocation> currentInvocation = new ThreadLocal<CurrentInvocation>();
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/reified/ReifiedActionFacet.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/reified/ReifiedActionFacet.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/reified/ReifiedActionFacet.java
new file mode 100644
index 0000000..0c5cb0b
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/reified/ReifiedActionFacet.java
@@ -0,0 +1,35 @@
+/*
+ * 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.core.metamodel.facets.actions.reified;
+
+import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
+import org.apache.isis.core.metamodel.facetapi.Facet;
+
+/**
+ * Indicates that details of the action should be reified as a persistent
+ * {@link ReifiableAction}, if possible.
+ *
+ * <p>
+ * In the standard Apache Isis Programming Model, corresponds to annotating the
+ * action method using <tt>@PersistedInteraction</tt>.
+ */
+public interface ReifiedActionFacet extends Facet {
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetViaMethod.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetViaMethod.java
index 08eb2aa..ddf7efb 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetViaMethod.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetViaMethod.java
@@ -30,8 +30,8 @@ import org.slf4j.LoggerFactory;
import org.apache.isis.applib.annotation.Bulk;
import org.apache.isis.applib.annotation.Bulk.InteractionContext.InvokedAs;
import org.apache.isis.applib.services.bookmark.Bookmark;
-import org.apache.isis.applib.services.interaction.Interaction;
-import org.apache.isis.applib.services.interaction.InteractionContext;
+import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
+import org.apache.isis.applib.services.reifiableaction.ReifiableActionContext;
import org.apache.isis.core.commons.lang.StringExtensions;
import org.apache.isis.core.commons.lang.ThrowableExtensions;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -43,6 +43,7 @@ import org.apache.isis.core.metamodel.facets.ImperativeFacet;
import org.apache.isis.core.metamodel.facets.actions.invoke.ActionInvocationFacet;
import org.apache.isis.core.metamodel.facets.actions.invoke.ActionInvocationFacetAbstract;
import org.apache.isis.core.metamodel.facets.actions.publish.PublishedActionFacet;
+import org.apache.isis.core.metamodel.facets.actions.reified.ReifiedActionFacet;
import org.apache.isis.core.metamodel.facets.object.viewmodel.ViewModelFacet;
import org.apache.isis.core.metamodel.facets.typeof.ElementSpecificationProviderFromTypeOfFacet;
import org.apache.isis.core.metamodel.facets.typeof.TypeOfFacet;
@@ -112,8 +113,8 @@ public class ActionInvocationFacetViaMethod extends ActionInvocationFacetAbstrac
}
final Bulk.InteractionContext bulkInteractionContext = getServicesInjector().lookupService(Bulk.InteractionContext.class);
- final InteractionContext interactionContext = getServicesInjector().lookupService(InteractionContext.class);
- final Interaction interaction = interactionContext != null ? interactionContext.getInteraction() : null;
+ final ReifiableActionContext reifiableActionContext = getServicesInjector().lookupService(ReifiableActionContext.class);
+ final ReifiableAction reifiableAction = reifiableActionContext != null ? reifiableActionContext.getReifiableAction() : null;
try {
final Object[] executionParameters = new Object[arguments.length];
@@ -127,20 +128,22 @@ public class ActionInvocationFacetViaMethod extends ActionInvocationFacetAbstrac
if (bulkFacet != null &&
bulkInteractionContext != null &&
bulkInteractionContext.getInvokedAs() == null) {
+
bulkInteractionContext.setInvokedAs(InvokedAs.REGULAR);
bulkInteractionContext.setDomainObjects(Collections.singletonList(object));
}
-
- if(interaction != null) {
- if(interaction.getNature() == Interaction.Nature.ACTION_INVOCATION && owningAction != null) {
+
+
+ if(reifiableAction != null) {
+ if(reifiableAction.getNature() == ReifiableAction.Nature.USER_INITIATED && owningAction != null) {
final String actionIdentifier = owningAction.getIdentifier().toClassAndNameIdentityString();
- interaction.setActionIdentifier(actionIdentifier);
+ reifiableAction.setActionIdentifier(actionIdentifier);
String targetClassName = StringExtensions.asNaturalName2(targetAdapter.getSpecification().getSingularName());
String actionName = owningAction.getName();
- interaction.setTargetClass(targetClassName);
- interaction.setTargetAction(actionName);
+ reifiableAction.setTargetClass(targetClassName);
+ reifiableAction.setTargetAction(actionName);
final StringBuilder argsBuf = new StringBuilder();
List<ObjectActionParameter> parameters = owningAction.getParameters();
@@ -151,11 +154,14 @@ public class ActionInvocationFacetViaMethod extends ActionInvocationFacetAbstrac
appendParamArg(argsBuf, param, arguments[i++]);
}
}
- interaction.setArguments(argsBuf.toString());
+ reifiableAction.setArguments(argsBuf.toString());
+
+ final boolean reifiable = getFacetHolder().containsDoOpFacet(ReifiedActionFacet.class);
+ reifiableAction.setReify(reifiable);
}
final Bookmark bookmark = bookmarkFor(targetAdapter);
- interaction.setTarget(bookmark);
+ reifiableAction.setTarget(bookmark);
}
final Object result = method.invoke(object, executionParameters);
@@ -174,10 +180,10 @@ public class ActionInvocationFacetViaMethod extends ActionInvocationFacetAbstrac
resultAdapter.setElementSpecificationProvider(ElementSpecificationProviderFromTypeOfFacet.createFrom(typeOfFacet));
- if(interaction != null) {
+ if(reifiableAction != null) {
if(!resultAdapter.getSpecification().containsDoOpFacet(ViewModelFacet.class)) {
final Bookmark bookmark = bookmarkFor(resultAdapter);
- interaction.setResult(bookmark);
+ reifiableAction.setResult(bookmark);
}
}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/reified/ReifiedActionFacetAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/reified/ReifiedActionFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/reified/ReifiedActionFacetAbstract.java
new file mode 100644
index 0000000..aafcacc
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/reified/ReifiedActionFacetAbstract.java
@@ -0,0 +1,37 @@
+/*
+ * 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.core.progmodel.facets.actions.reified;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.MarkerFacetAbstract;
+import org.apache.isis.core.metamodel.facets.actions.reified.ReifiedActionFacet;
+
+public abstract class ReifiedActionFacetAbstract extends MarkerFacetAbstract implements ReifiedActionFacet {
+
+ public static Class<? extends Facet> type() {
+ return ReifiedActionFacet.class;
+ }
+
+ public ReifiedActionFacetAbstract(final FacetHolder holder) {
+ super(type(), holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/reified/annotation/ReifiedActionAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/reified/annotation/ReifiedActionAnnotationFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/reified/annotation/ReifiedActionAnnotationFacetFactory.java
new file mode 100644
index 0000000..014b3e7
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/reified/annotation/ReifiedActionAnnotationFacetFactory.java
@@ -0,0 +1,51 @@
+/*
+ * 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.core.progmodel.facets.actions.reified.annotation;
+
+import org.apache.isis.applib.annotation.Reified;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.Annotations;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.actions.reified.ReifiedActionFacet;
+import org.apache.isis.core.progmodel.facets.actions.invoke.ActionInvocationFacetFactory;
+
+/**
+ * {@link ReifiableFacet} can also be installed via a naming convention, see
+ * {@link ActionInvocationFacetFactory}.
+ */
+public class ReifiedActionAnnotationFacetFactory extends FacetFactoryAbstract {
+
+ public ReifiedActionAnnotationFacetFactory() {
+ super(FeatureType.ACTIONS_ONLY);
+ }
+
+ @Override
+ public void process(final ProcessMethodContext processMethodContext) {
+ final Reified annotation = Annotations.getAnnotation(processMethodContext.getMethod(), Reified.class);
+ FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
+ }
+
+ private ReifiedActionFacet create(final Reified annotation, final FacetHolder holder) {
+ return annotation == null ? null : new ReifiedActionFacetAnnotation(holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/reified/annotation/ReifiedActionFacetAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/reified/annotation/ReifiedActionFacetAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/reified/annotation/ReifiedActionFacetAnnotation.java
new file mode 100644
index 0000000..0669417
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/reified/annotation/ReifiedActionFacetAnnotation.java
@@ -0,0 +1,31 @@
+/*
+ * 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.core.progmodel.facets.actions.reified.annotation;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.progmodel.facets.actions.reified.ReifiedActionFacetAbstract;
+
+public class ReifiedActionFacetAnnotation extends ReifiedActionFacetAbstract {
+
+ public ReifiedActionFacetAnnotation(final FacetHolder holder) {
+ super(holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java b/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
index f3fc8f8..f6c79e8 100644
--- a/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
+++ b/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
@@ -33,6 +33,7 @@ import org.apache.isis.core.progmodel.facets.actions.notinservicemenu.annotation
import org.apache.isis.core.progmodel.facets.actions.notinservicemenu.method.NotInServiceMenuMethodFacetFactory;
import org.apache.isis.core.progmodel.facets.actions.prototype.annotation.PrototypeAnnotationFacetFactory;
import org.apache.isis.core.progmodel.facets.actions.publish.PublishedActionAnnotationFacetFactory;
+import org.apache.isis.core.progmodel.facets.actions.reified.annotation.ReifiedActionAnnotationFacetFactory;
import org.apache.isis.core.progmodel.facets.actions.semantics.ActionSemanticsAnnotationFacetFactory;
import org.apache.isis.core.progmodel.facets.actions.semantics.ActionSemanticsFallbackFacetFactory;
import org.apache.isis.core.progmodel.facets.actions.semantics.IdempotentAnnotationFacetFactory;
@@ -345,6 +346,7 @@ public final class ProgrammingModelFacetsJava5 extends ProgrammingModelAbstract
addFactory(NotInServiceMenuAnnotationFacetFactory.class);
addFactory(NotInServiceMenuMethodFacetFactory.class);
addFactory(BulkAnnotationFacetFactory.class);
+ addFactory(ReifiedActionAnnotationFacetFactory.class);
addFactory(HiddenAnnotationForTypeFacetFactory.class);
// must come after the TitleAnnotationFacetFactory, because can act as an override
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/metamodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/reified/ReifiedActionAnnotationFacetFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/reified/ReifiedActionAnnotationFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/reified/ReifiedActionAnnotationFacetFactoryTest.java
new file mode 100644
index 0000000..07b5180
--- /dev/null
+++ b/core/metamodel/src/test/java/org/apache/isis/core/progmodel/facets/actions/reified/ReifiedActionAnnotationFacetFactoryTest.java
@@ -0,0 +1,66 @@
+/*
+ * 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.core.progmodel.facets.actions.reified;
+
+import java.lang.reflect.Method;
+
+import org.apache.isis.applib.annotation.Reified;
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessMethodContext;
+import org.apache.isis.core.metamodel.facets.actions.reified.ReifiedActionFacet;
+import org.apache.isis.core.progmodel.facets.AbstractFacetFactoryTest;
+import org.apache.isis.core.progmodel.facets.actions.reified.ReifiedActionFacetAbstract;
+import org.apache.isis.core.progmodel.facets.actions.reified.annotation.ReifiedActionAnnotationFacetFactory;
+
+public class ReifiedActionAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
+
+ private ReifiedActionAnnotationFacetFactory facetFactory;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ facetFactory = new ReifiedActionAnnotationFacetFactory();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ facetFactory = null;
+ super.tearDown();
+ }
+
+ public void testExplorationAnnotationPickedUp() {
+ class Customer {
+ @Reified
+ public void someAction() {
+ }
+ }
+ final Method actionMethod = findMethod(Customer.class, "someAction");
+
+ facetFactory.process(new ProcessMethodContext(Customer.class, null, null, actionMethod, methodRemover, facetedMethod));
+
+ final Facet facet = facetedMethod.getFacet(ReifiedActionFacet.class);
+ assertNotNull(facet);
+ assertTrue(facet instanceof ReifiedActionFacetAbstract);
+
+ assertNoMethodsRemoved();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundServiceDefault.java
----------------------------------------------------------------------
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 39e0491..b247ddf 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
@@ -25,8 +25,8 @@ import org.apache.isis.applib.services.background.BackgroundService;
import org.apache.isis.applib.services.background.BackgroundTaskService;
import org.apache.isis.applib.services.bookmark.Bookmark;
import org.apache.isis.applib.services.bookmark.BookmarkService;
-import org.apache.isis.applib.services.interaction.Interaction;
-import org.apache.isis.applib.services.interaction.InteractionContext;
+import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
+import org.apache.isis.applib.services.reifiableaction.ReifiableActionContext;
import org.apache.isis.core.commons.ensure.Ensure;
import org.apache.isis.core.commons.exceptions.IsisException;
import org.apache.isis.core.commons.lang.ArrayExtensions;
@@ -63,7 +63,7 @@ public class BackgroundServiceDefault implements BackgroundService {
private void ensureDependenciesInjected() {
Ensure.ensureThatState(this.bookmarkService, is(not(nullValue())), "bookmark service required");
Ensure.ensureThatState(this.backgroundTaskService, is(not(nullValue())), "background task service required");
- Ensure.ensureThatState(this.interactionContext, is(not(nullValue())), "interaction context service required");
+ Ensure.ensureThatState(this.reifiableActionContext, is(not(nullValue())), "reifiable action context service required");
}
@@ -166,15 +166,14 @@ public class BackgroundServiceDefault implements BackgroundService {
}
}
- final Interaction interaction = interactionContext.getInteraction();
+ final ReifiableAction reifiableAction = reifiableActionContext.getReifiableAction();
final ActionInvocationMemento aim =
- new ActionInvocationMemento(mementoService, interaction.getUser(),
+ new ActionInvocationMemento(mementoService, reifiableAction.getUser(),
actionId, domainObjectBookmark, argTypes, argObjs);
- final UUID transactionId = interaction.getTransactionId();
- Integer sequence = interaction.next("backgroundTaskServiceSequence");
- backgroundTaskService.execute(aim, transactionId, sequence);
+
+ backgroundTaskService.execute(aim, reifiableAction);
return null;
}
@@ -199,12 +198,12 @@ public class BackgroundServiceDefault implements BackgroundService {
this.backgroundTaskService = backgroundTaskService;
}
- private InteractionContext interactionContext;
+ private ReifiableActionContext reifiableActionContext;
/**
* Mandatory service.
*/
- public void injectInteractionContext(InteractionContext interactionContext) {
- this.interactionContext = interactionContext;
+ public void injectReifiableActionContext(ReifiableActionContext reifiableActionContext) {
+ this.reifiableActionContext = reifiableActionContext;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java
----------------------------------------------------------------------
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 e59ed38..080f4a7 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
@@ -41,10 +41,10 @@ import org.apache.isis.applib.clock.Clock;
import org.apache.isis.applib.query.Query;
import org.apache.isis.applib.query.QueryDefault;
import org.apache.isis.applib.query.QueryFindAllInstances;
-import org.apache.isis.applib.services.interaction.Interaction;
-import org.apache.isis.applib.services.interaction.InteractionContext;
-import org.apache.isis.applib.services.interaction.InteractionDefault;
-import org.apache.isis.applib.services.interaction.spi.InteractionService;
+import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
+import org.apache.isis.applib.services.reifiableaction.ReifiableActionContext;
+import org.apache.isis.applib.services.reifiableaction.ReifiableActionDefault;
+import org.apache.isis.applib.services.reifiableaction.spi.ReifiableActionService;
import org.apache.isis.core.commons.authentication.AuthenticationSession;
import org.apache.isis.core.commons.components.ApplicationScopedComponent;
import org.apache.isis.core.commons.components.SessionScopedComponent;
@@ -302,13 +302,13 @@ public class PersistenceSession implements Persistor, EnlistedObjectDirtying, To
}
private void createInteractionIfConfigured() {
- final InteractionContext ic = getServiceOrNull(InteractionContext.class);
+ final ReifiableActionContext ic = getServiceOrNull(ReifiableActionContext.class);
if(ic == null) {
return;
}
- final InteractionService interactionFactory = getServiceOrNull(InteractionService.class);
- final Interaction interaction = interactionFactory != null ? interactionFactory.create() : new InteractionDefault();
- ic.setInteraction(interaction);
+ final ReifiableActionService interactionFactory = getServiceOrNull(ReifiableActionService.class);
+ final ReifiableAction interaction = interactionFactory != null ? interactionFactory.create() : new ReifiableActionDefault();
+ ic.setReifiableAction(interaction);
if(interaction.getTimestamp() == null) {
interaction.setTimestamp(Clock.getTimeAsJavaSqlTimestamp());
@@ -330,16 +330,16 @@ public class PersistenceSession implements Persistor, EnlistedObjectDirtying, To
* Called by IsisTransactionManager on start
*/
public void startInteractionIfConfigured(final UUID transactionId) {
- final InteractionContext interactionContext = getServiceOrNull(InteractionContext.class);
- if(interactionContext == null) {
+ final ReifiableActionContext reifiableActionContext = getServiceOrNull(ReifiableActionContext.class);
+ if(reifiableActionContext == null) {
return;
}
- final InteractionService interactionFactory = getServiceOrNull(InteractionService.class);
- if(interactionFactory == null) {
+ final ReifiableActionService reifiableActionService = getServiceOrNull(ReifiableActionService.class);
+ if(reifiableActionService == null) {
return;
}
- final Interaction interaction = interactionContext.getInteraction();
- interactionFactory.startTransaction(interaction, transactionId);
+ final ReifiableAction reifiableAction = reifiableActionContext.getReifiableAction();
+ reifiableActionService.startTransaction(reifiableAction, transactionId);
}
@@ -415,11 +415,11 @@ public class PersistenceSession implements Persistor, EnlistedObjectDirtying, To
}
private void completeInteractionIfConfigured() {
- final InteractionContext interactionContext = getServiceOrNull(InteractionContext.class);
- if(interactionContext != null) {
- final InteractionService interactionFactory = getServiceOrNull(InteractionService.class);
+ final ReifiableActionContext reifiableActionContext = getServiceOrNull(ReifiableActionContext.class);
+ if(reifiableActionContext != null) {
+ final ReifiableActionService interactionFactory = getServiceOrNull(ReifiableActionService.class);
if(interactionFactory != null) {
- final Interaction interaction = interactionContext.getInteraction();
+ final ReifiableAction interaction = reifiableActionContext.getReifiableAction();
interactionFactory.complete(interaction);
}
}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransaction.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransaction.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransaction.java
index 25c21e2..55abdc5 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransaction.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransaction.java
@@ -49,11 +49,11 @@ import org.apache.isis.applib.clock.Clock;
import org.apache.isis.applib.services.HasTransactionId;
import org.apache.isis.applib.services.audit.AuditingService3;
import org.apache.isis.applib.services.bookmark.Bookmark;
-import org.apache.isis.applib.services.interaction.Interaction;
-import org.apache.isis.applib.services.interaction.InteractionContext;
import org.apache.isis.applib.services.publish.EventMetadata;
import org.apache.isis.applib.services.publish.EventType;
import org.apache.isis.applib.services.publish.ObjectStringifier;
+import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
+import org.apache.isis.applib.services.reifiableaction.ReifiableActionContext;
import org.apache.isis.core.commons.authentication.AuthenticationSession;
import org.apache.isis.core.commons.components.TransactionScopedComponent;
import org.apache.isis.core.commons.ensure.Ensure;
@@ -191,7 +191,7 @@ public class IsisTransaction implements TransactionScopedComponent {
/**
* the 'owning' interaction, if configured.
*/
- private final Interaction interaction;
+ private final ReifiableAction reifiableAction;
/**
* could be null if none has been registered.
@@ -203,11 +203,11 @@ public class IsisTransaction implements TransactionScopedComponent {
private final PublishingServiceWithDefaultPayloadFactories publishingService;
/**
- * Will be that of the {@link #interaction} if not <tt>null</tt>, otherwise will be randomly created.
+ * Will be that of the {@link #reifiableAction} if not <tt>null</tt>, otherwise will be randomly created.
*/
private final UUID transactionId;
/**
- * Only used if {@link #interaction} is <tt>null</tt>; generates sequence within the {@link #transactionId}
+ * Only used if {@link #reifiableAction} is <tt>null</tt>; generates sequence within the {@link #transactionId}
*/
private int publishedEventSequence;
@@ -220,7 +220,7 @@ public class IsisTransaction implements TransactionScopedComponent {
final org.apache.isis.core.commons.authentication.MessageBroker messageBroker,
final UpdateNotifier updateNotifier,
final TransactionalResource objectStore,
- final InteractionContext interactionContext,
+ final ReifiableActionContext reifiableActionContext,
final AuditingService3 auditingService3,
final PublishingServiceWithDefaultPayloadFactories publishingService) {
@@ -237,15 +237,15 @@ public class IsisTransaction implements TransactionScopedComponent {
// determine whether this xactn is taking place in the context of an
// existing interaction in which a previous xactn has already occurred.
// if so, reuse that transactionId.
- UUID previousTransactionIdWithinSameInteraction = null;
- if(interactionContext != null) {
- interaction = interactionContext.getInteraction();
- previousTransactionIdWithinSameInteraction = interaction.getTransactionId();
+ UUID previousTransactionId = null;
+ if(reifiableActionContext != null) {
+ reifiableAction = reifiableActionContext.getReifiableAction();
+ previousTransactionId = reifiableAction.getTransactionId();
} else {
- interaction = null;
+ reifiableAction = null;
}
- this.transactionId = previousTransactionIdWithinSameInteraction != null
- ? previousTransactionIdWithinSameInteraction
+ this.transactionId = previousTransactionId != null
+ ? previousTransactionId
: UUID.randomUUID();
this.state = State.IN_PROGRESS;
@@ -561,8 +561,8 @@ public class IsisTransaction implements TransactionScopedComponent {
}
private int nextEventSequence() {
- if(interaction != null) {
- return interaction.next("publishedEvent");
+ if(reifiableAction != null) {
+ return reifiableAction.next("publishedEvent");
} else {
return publishedEventSequence++;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransactionManager.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransactionManager.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransactionManager.java
index 195f712..068f890 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransactionManager.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransactionManager.java
@@ -36,12 +36,12 @@ import org.apache.isis.applib.annotation.PublishedAction;
import org.apache.isis.applib.annotation.PublishedObject;
import org.apache.isis.applib.annotation.PublishedObject.ChangeKind;
import org.apache.isis.applib.services.audit.AuditingService3;
-import org.apache.isis.applib.services.interaction.InteractionContext;
import org.apache.isis.applib.services.publish.EventPayload;
import org.apache.isis.applib.services.publish.EventPayloadForActionInvocation;
import org.apache.isis.applib.services.publish.EventPayloadForObjectChanged;
import org.apache.isis.applib.services.publish.EventSerializer;
import org.apache.isis.applib.services.publish.PublishingService;
+import org.apache.isis.applib.services.reifiableaction.ReifiableActionContext;
import org.apache.isis.core.commons.authentication.AuthenticationSession;
import org.apache.isis.core.commons.components.SessionScopedComponent;
import org.apache.isis.core.commons.debug.DebugBuilder;
@@ -67,7 +67,7 @@ public class IsisTransactionManager implements SessionScopedComponent {
/**
* Could be null if not configured as a domain service.
*/
- private final InteractionContext interactionContext;
+ private final ReifiableActionContext reifiableActionContext;
/**
* Could be null if not configured as a domain service.
*/
@@ -95,7 +95,7 @@ public class IsisTransactionManager implements SessionScopedComponent {
this.persistenceSession = persistenceSession;
this.transactionalResource = transactionalResource;
- this.interactionContext = servicesInjectorSpi.lookupService(InteractionContext.class);
+ this.reifiableActionContext = servicesInjectorSpi.lookupService(ReifiableActionContext.class);
this.auditingService3 = servicesInjectorSpi.lookupService(AuditingService3.class);
this.publishingService = getPublishingServiceIfAny(servicesInjectorSpi);
}
@@ -270,7 +270,7 @@ public class IsisTransactionManager implements SessionScopedComponent {
ensureThatArg(messageBroker, is(not(nullValue())));
ensureThatArg(updateNotifier, is(not(nullValue())));
- return new IsisTransaction(this, messageBroker, updateNotifier, transactionalResource, interactionContext, auditingService3, publishingService);
+ return new IsisTransaction(this, messageBroker, updateNotifier, transactionalResource, reifiableActionContext, auditingService3, publishingService);
}
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/runtime/src/test/java/org/apache/isis/core/runtime/services/background/BackgroundServiceDefaultTest_execute.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/isis/core/runtime/services/background/BackgroundServiceDefaultTest_execute.java b/core/runtime/src/test/java/org/apache/isis/core/runtime/services/background/BackgroundServiceDefaultTest_execute.java
index 57a3a2f..c1df087 100644
--- a/core/runtime/src/test/java/org/apache/isis/core/runtime/services/background/BackgroundServiceDefaultTest_execute.java
+++ b/core/runtime/src/test/java/org/apache/isis/core/runtime/services/background/BackgroundServiceDefaultTest_execute.java
@@ -37,9 +37,9 @@ import org.apache.isis.applib.services.background.ActionInvocationMemento;
import org.apache.isis.applib.services.background.BackgroundTaskService;
import org.apache.isis.applib.services.bookmark.Bookmark;
import org.apache.isis.applib.services.bookmark.BookmarkService;
-import org.apache.isis.applib.services.interaction.Interaction;
-import org.apache.isis.applib.services.interaction.InteractionContext;
-import org.apache.isis.applib.services.interaction.InteractionDefault;
+import org.apache.isis.applib.services.reifiableaction.ReifiableAction;
+import org.apache.isis.applib.services.reifiableaction.ReifiableActionContext;
+import org.apache.isis.applib.services.reifiableaction.ReifiableActionDefault;
import org.apache.isis.core.commons.matchers.IsisMatchers;
import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
@@ -64,11 +64,10 @@ public class BackgroundServiceDefaultTest_execute {
private Identifier actionIdentifier;
@Mock
- private InteractionContext mockInteractionContext;
+ private ReifiableActionContext mockReifiableActionContext;
- private Interaction interaction;
- private UUID transactionId = UUID.fromString("1231231231");
- private int sequence = 2;
+ private ReifiableAction reifiableAction;
+ private UUID transactionId = UUID.randomUUID();
@Mock
private BackgroundTaskService mockBackgroundTaskService;
@@ -105,12 +104,13 @@ public class BackgroundServiceDefaultTest_execute {
}
};
backgroundService.injectBookmarkService(mockBookmarkService);
- backgroundService.injectInteractionContext(mockInteractionContext);
+ backgroundService.injectReifiableActionContext(mockReifiableActionContext);
backgroundService.injectBackgroundTaskService(mockBackgroundTaskService);
- interaction = new InteractionDefault();
- interaction.setTransactionId(transactionId);
- interaction.setUser("fbloggs");
+ reifiableAction = new ReifiableActionDefault();
+ reifiableAction.setTransactionId(transactionId);
+ reifiableAction.setUser("fbloggs");
+ reifiableAction.setTransactionId(transactionId);
context.checking(new Expectations() {
{
@@ -120,8 +120,8 @@ public class BackgroundServiceDefaultTest_execute {
allowing(mockSpec).getFullIdentifier();
will(returnValue(Customer.class.getName()));
- allowing(mockInteractionContext).getInteraction();
- will(returnValue(interaction));
+ allowing(mockReifiableActionContext).getReifiableAction();
+ will(returnValue(reifiableAction));
}
});
customer = new Customer();
@@ -150,8 +150,7 @@ public class BackgroundServiceDefaultTest_execute {
oneOf(mockBackgroundTaskService).execute(
with(x()),
- with(equalTo(transactionId)),
- with(equalTo(sequence)));
+ with(equalTo(reifiableAction)));
}
protected Matcher<ActionInvocationMemento> x() {
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/core/runtime/src/test/java/org/apache/isis/core/runtime/system/transaction/IsisTransactionTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/isis/core/runtime/system/transaction/IsisTransactionTest.java b/core/runtime/src/test/java/org/apache/isis/core/runtime/system/transaction/IsisTransactionTest.java
index 2ccfb64..41f2986 100644
--- a/core/runtime/src/test/java/org/apache/isis/core/runtime/system/transaction/IsisTransactionTest.java
+++ b/core/runtime/src/test/java/org/apache/isis/core/runtime/system/transaction/IsisTransactionTest.java
@@ -30,7 +30,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.apache.isis.applib.services.audit.AuditingService3;
-import org.apache.isis.applib.services.interaction.InteractionContext;
+import org.apache.isis.applib.services.reifiableaction.ReifiableActionContext;
import org.apache.isis.core.commons.authentication.AuthenticationSession;
import org.apache.isis.core.commons.matchers.IsisMatchers;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -72,7 +72,7 @@ public class IsisTransactionTest {
@Mock
private UpdateNotifier mockUpdateNotifier;
@Mock
- private InteractionContext mockInteractionContext;
+ private ReifiableActionContext mockReifiableActionContext;
@Mock
private AuditingService3 mockAuditingService3;
@Mock
@@ -161,7 +161,7 @@ public class IsisTransactionTest {
public void setUp() throws Exception {
org.apache.log4j.Logger.getRootLogger().setLevel(org.apache.log4j.Level.OFF);
- context.ignoring(mockInteractionContext);
+ context.ignoring(mockReifiableActionContext);
context.ignoring(mockAuditingService3);
context.checking(new Expectations(){{
@@ -174,7 +174,7 @@ public class IsisTransactionTest {
will(returnValue("sven"));
}});
- transaction = new IsisTransaction(mockTransactionManager, mockMessageBroker, mockUpdateNotifier, mockObjectStore, mockInteractionContext, mockAuditingService3, mockPublishingService);
+ transaction = new IsisTransaction(mockTransactionManager, mockMessageBroker, mockUpdateNotifier, mockObjectStore, mockReifiableActionContext, mockAuditingService3, mockPublishingService);
transientAdapter1 = PojoAdapterBuilder.create().with(Persistence.TRANSIENT).withIdentifier("1").build();
transientAdapter2 = PojoAdapterBuilder.create().with(Persistence.TRANSIENT).withIdentifier("2").build();
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/example/application/quickstart_wicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItem.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItem.java b/example/application/quickstart_wicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItem.java
index f165b9f..a416a21 100644
--- a/example/application/quickstart_wicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItem.java
+++ b/example/application/quickstart_wicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItem.java
@@ -60,11 +60,12 @@ import org.apache.isis.applib.annotation.Prototype;
import org.apache.isis.applib.annotation.PublishedAction;
import org.apache.isis.applib.annotation.PublishedObject;
import org.apache.isis.applib.annotation.RegEx;
+import org.apache.isis.applib.annotation.Reified;
import org.apache.isis.applib.annotation.SortedBy;
import org.apache.isis.applib.annotation.TypicalLength;
import org.apache.isis.applib.clock.Clock;
import org.apache.isis.applib.services.background.BackgroundService;
-import org.apache.isis.applib.services.interaction.InteractionContext;
+import org.apache.isis.applib.services.reifiableaction.ReifiableActionContext;
import org.apache.isis.applib.services.scratchpad.Scratchpad;
import org.apache.isis.applib.util.ObjectContracts;
import org.apache.isis.applib.util.TitleBuffer;
@@ -309,6 +310,7 @@ public class ToDoItem implements Comparable<ToDoItem> /*, Locatable*/ { // GMAP3
this.complete = complete;
}
+ @Reified
@PublishedAction
@Bulk
public ToDoItem completed() {
@@ -335,6 +337,7 @@ public class ToDoItem implements Comparable<ToDoItem> /*, Locatable*/ { // GMAP3
return isComplete() ? "Already completed" : null;
}
+ @Reified
@PublishedAction
@Bulk
public ToDoItem notYetCompleted() {
@@ -807,7 +810,7 @@ public class ToDoItem implements Comparable<ToDoItem> /*, Locatable*/ { // GMAP3
@SuppressWarnings("unused")
@javax.inject.Inject
- private InteractionContext interactionContext;
+ private ReifiableActionContext reifiableActionContext;
@javax.inject.Inject
http://git-wip-us.apache.org/repos/asf/isis/blob/2463dc18/example/application/quickstart_wicket_restful_jdo/webapp/src/main/java/webapp/admin/Admin.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/webapp/src/main/java/webapp/admin/Admin.java b/example/application/quickstart_wicket_restful_jdo/webapp/src/main/java/webapp/admin/Admin.java
index 9422758..1d50dd4 100644
--- a/example/application/quickstart_wicket_restful_jdo/webapp/src/main/java/webapp/admin/Admin.java
+++ b/example/application/quickstart_wicket_restful_jdo/webapp/src/main/java/webapp/admin/Admin.java
@@ -30,10 +30,10 @@ import org.apache.isis.objectstore.jdo.applib.service.audit.AuditEntryJdo;
import org.apache.isis.objectstore.jdo.applib.service.audit.AuditingServiceJdoRepository;
import org.apache.isis.objectstore.jdo.applib.service.background.BackgroundTaskJdo;
import org.apache.isis.objectstore.jdo.applib.service.background.BackgroundTaskServiceJdoRepository;
-import org.apache.isis.objectstore.jdo.applib.service.interaction.InteractionJdo;
-import org.apache.isis.objectstore.jdo.applib.service.interaction.InteractionServiceJdoRepository;
import org.apache.isis.objectstore.jdo.applib.service.publish.PublishedEventJdo;
import org.apache.isis.objectstore.jdo.applib.service.publish.PublishingServiceJdoRepository;
+import org.apache.isis.objectstore.jdo.applib.service.reifiableaction.ReifiableActionJdo;
+import org.apache.isis.objectstore.jdo.applib.service.reifiableaction.ReifiableActionServiceJdoRepository;
public class Admin extends AbstractService {
@@ -41,7 +41,7 @@ public class Admin extends AbstractService {
@MemberOrder(sequence="10.1")
@ActionSemantics(Of.SAFE)
@Prototype
- public InteractionJdo lookup(final @Named("Transaction Id") UUID transactionId) {
+ public ReifiableActionJdo lookup(final @Named("Transaction Id") UUID transactionId) {
return interactionRepository.findByTransactionId(transactionId);
}
public boolean hideLookup() {
@@ -51,7 +51,7 @@ public class Admin extends AbstractService {
@ActionSemantics(Of.SAFE)
@Bookmarkable
@MemberOrder(sequence="10.2")
- public List<InteractionJdo> currentlyRunning() {
+ public List<ReifiableActionJdo> currentlyRunning() {
return interactionRepository.findCurrent();
}
public boolean hideCurrentlyRunning() {
@@ -60,7 +60,7 @@ public class Admin extends AbstractService {
@ActionSemantics(Of.SAFE)
@MemberOrder(sequence="10.3")
- public List<InteractionJdo> previouslyRan() {
+ public List<ReifiableActionJdo> previouslyRan() {
return interactionRepository.findCompleted();
}
public boolean hidePreviouslyRan() {
@@ -125,7 +125,7 @@ public class Admin extends AbstractService {
// //////////////////////////////////////
@javax.inject.Inject
- private InteractionServiceJdoRepository interactionRepository;
+ private ReifiableActionServiceJdoRepository interactionRepository;
@javax.inject.Inject
private BackgroundTaskServiceJdoRepository backgroundTaskRepository;