You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2021/03/26 11:16:48 UTC

[isis] branch master updated: ISIS-2573: xray: fully integrate command publishing

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

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new 9187990  ISIS-2573: xray: fully integrate command publishing
9187990 is described below

commit 9187990e15bb5aa8caa7722143e5b30ab65e0c7e
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Mar 26 12:16:32 2021 +0100

    ISIS-2573: xray: fully integrate command publishing
---
 .../isis/core/runtimeservices/publish/_Xray.java       | 18 ++++++++----------
 .../publishing/jdo/JdoCommandPublishingTest.java       |  4 +++-
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/core/runtimeservices/src/main/java/org/apache/isis/core/runtimeservices/publish/_Xray.java b/core/runtimeservices/src/main/java/org/apache/isis/core/runtimeservices/publish/_Xray.java
index 7c53f6f..6169dbe 100644
--- a/core/runtimeservices/src/main/java/org/apache/isis/core/runtimeservices/publish/_Xray.java
+++ b/core/runtimeservices/src/main/java/org/apache/isis/core/runtimeservices/publish/_Xray.java
@@ -50,19 +50,19 @@ final class _Xray {
         final int authStackSize = iaTracker.getAuthenticationLayerCount();
         val conversationId = iaTracker.getConversationId().orElseThrow(_Exceptions::unexpectedCodeReach);
         
-        val handle = createHandle(conversationId, authStackSize, null, null);
-        val enteringLabel = "publishing";
+        val handle = createHandle(conversationId, authStackSize, "command-publisher");
+        val enteringLabel = canPublish 
+                ? String.format("publishing command to %d subscriber(s)", enabledSubscribers.size())
+                : "not publishing command";
         
         XrayUi.updateModel(model->{
             model.lookupSequence(handle.sequenceId)
             .ifPresent(sequence->{
                 val sequenceData = sequence.getData();
                 
-                sequenceData.alias("command-publisher", "Command-\nPublisher-\n(Default)");
+                sequenceData.alias(handle.callee, "Command-\nPublisher-\n(Default)");
+                sequenceData.enter(handle.caller, handle.callee, enteringLabel);
                 
-                sequenceData.enter(handle.caller, "command-publisher");
-                
-                sequenceData.enter("executor", handle.callee, enteringLabel);
             });
         });
         
@@ -80,8 +80,7 @@ final class _Xray {
             model.lookupSequence(handle.sequenceId)
             .ifPresent(sequence->{
                 val sequenceData = sequence.getData();
-                sequenceData.exit(handle.callee, "command-publisher");
-                sequenceData.exit("executor", handle.caller);
+                sequenceData.exit(handle.callee, handle.caller);
             });
         });
         
@@ -92,8 +91,7 @@ final class _Xray {
     private static Handle createHandle(
             final UUID interactionId,
             final int authStackSize,
-            final String participantLabel,
-            final String enteringLabel) {
+            final String participantLabel) {
 
         val handle = Handle.builder()
                 .sequenceId(XrayUtil.sequenceId(interactionId))
diff --git a/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/applayer/publishing/jdo/JdoCommandPublishingTest.java b/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/applayer/publishing/jdo/JdoCommandPublishingTest.java
index d0470a9..c5c09e6 100644
--- a/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/applayer/publishing/jdo/JdoCommandPublishingTest.java
+++ b/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/applayer/publishing/jdo/JdoCommandPublishingTest.java
@@ -32,6 +32,7 @@ import org.springframework.test.context.TestPropertySource;
 
 import org.apache.isis.applib.services.command.Command;
 import org.apache.isis.commons.collections.Can;
+import org.apache.isis.commons.internal.debug.xray.XrayEnable;
 import org.apache.isis.core.config.presets.IsisPresets;
 import org.apache.isis.schema.cmd.v2.CommandDto;
 import org.apache.isis.schema.cmd.v2.PropertyDto;
@@ -49,7 +50,8 @@ import lombok.val;
         classes = {
                 Configuration_usingJdo.class,
                 Configuration_usingCommandPublishing.class,
-                ApplicationLayerTestFactory.class
+                ApplicationLayerTestFactory.class,
+                XrayEnable.class
         },
         properties = {
                 "logging.level.org.apache.isis.persistence.jdo.datanucleus5.persistence.IsisTransactionJdo=DEBUG",