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/07/08 07:43:35 UTC

[isis] branch master updated: ISIS-2573: some debug logging for InteractionScope

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 ac687e5  ISIS-2573: some debug logging for InteractionScope
ac687e5 is described below

commit ac687e51d8a9c533d308a4595b39b3e36d7608c9
Author: andi-huber <ah...@apache.org>
AuthorDate: Thu Jul 8 09:43:22 2021 +0200

    ISIS-2573: some debug logging for InteractionScope
---
 .../isis/core/interaction/scope/InteractionScope.java  | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/core/interaction/src/main/java/org/apache/isis/core/interaction/scope/InteractionScope.java b/core/interaction/src/main/java/org/apache/isis/core/interaction/scope/InteractionScope.java
index 964c1ea..c895d66 100644
--- a/core/interaction/src/main/java/org/apache/isis/core/interaction/scope/InteractionScope.java
+++ b/core/interaction/src/main/java/org/apache/isis/core/interaction/scope/InteractionScope.java
@@ -95,6 +95,14 @@ implements
 
         val existingScopedObject = scopedObjects.get().get(name);
         if(existingScopedObject!=null) {
+
+            if(log.isDebugEnabled()) {
+                log.debug("INTERACTION_SCOPE [{}:{}] reuse existing {}",
+                        _Probe.currentThreadId(),
+                        getConversationId(),
+                        Integer.toHexString(existingScopedObject.hashCode()));
+            }
+
             return existingScopedObject.getInstance();
         }
 
@@ -104,6 +112,13 @@ implements
         log.debug("create new isis-interaction scoped {}", name);
         newScopedObject.setInstance(objectFactory.getObject()); // triggers call to registerDestructionCallback
 
+        if(log.isDebugEnabled()) {
+            log.debug("INTERACTION_SCOPE [{}:{}] create new {}",
+                _Probe.currentThreadId(),
+                getConversationId(),
+                Integer.toHexString(newScopedObject.hashCode()));
+        }
+
         return newScopedObject.getInstance();
     }
 
@@ -138,10 +153,12 @@ implements
     @Override
     public void onTopLevelInteractionOpened() {
         // nothing to do
+        log.debug("INTERACTION_SCOPE opened");
     }
 
     @Override
     public void onTopLevelInteractionPreDestroy() {
+        log.debug("INTERACTION_SCOPE pre-destroy");
         scopedObjects.get().values()
         .forEach(scopedObject->{
             try {
@@ -154,6 +171,7 @@ implements
 
     @Override
     public void onTopLevelInteractionClosed() {
+        log.debug("INTERACTION_SCOPE closed");
         scopedObjects.remove();
     }