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 2020/12/04 12:41:54 UTC

[isis] branch master updated: ISIS-2464: fixes names and java-doc

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 cb6edeb  ISIS-2464: fixes names and java-doc
cb6edeb is described below

commit cb6edebaff68041c6f4f5c5ce5741a5060bfb0a8
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Dec 4 13:41:42 2020 +0100

    ISIS-2464: fixes names and java-doc
---
 .../applib/services/iactn/ExecutionContext.java    |  2 +-
 .../core/runtime/iactn/InteractionTracker.java     |  8 +++----
 .../session/InteractionFactoryDefault.java         | 28 +++++++++++-----------
 3 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/api/applib/src/main/java/org/apache/isis/applib/services/iactn/ExecutionContext.java b/api/applib/src/main/java/org/apache/isis/applib/services/iactn/ExecutionContext.java
index 01f7ac6..a4ec5d7 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/services/iactn/ExecutionContext.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/services/iactn/ExecutionContext.java
@@ -68,7 +68,7 @@ public final class ExecutionContext {
     // -- FACTORIES
     
     /**
-     * Creates a new ExecutionEnvironment with the specified user and 
+     * Creates a new {@link ExecutionContext} with the specified user and 
      * system defaults for clock, locale and time-zone.
      */
     public static ExecutionContext ofUserWithSystemDefaults(
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/iactn/InteractionTracker.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/iactn/InteractionTracker.java
index 1d72cd0..60a1c90 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/iactn/InteractionTracker.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/iactn/InteractionTracker.java
@@ -39,18 +39,18 @@ extends
 
     boolean isInInteractionSession();
     
-    /** @return the InteractionClosure that sits on top of the current 
+    /** @return the InteractionLayer that sits on top of the current 
      * request- or test-scoped InteractionSession*/
-    Optional<InteractionLayer> currentInteractionEnvironment();
+    Optional<InteractionLayer> currentInteractionLayer();
     
     /** @return the current request- or test-scoped InteractionSession*/
     default Optional<InteractionSession> currentInteractionSession() {
-    	return currentInteractionEnvironment().map(InteractionLayer::getInteractionSession);
+    	return currentInteractionLayer().map(InteractionLayer::getInteractionSession);
     }
     
     @Override
     default Optional<AuthenticationSession> currentAuthenticationSession() {
-        return currentInteractionEnvironment().map(InteractionLayer::getAuthenticationSession);
+        return currentInteractionLayer().map(InteractionLayer::getAuthenticationSession);
     }
     
     default Optional<ExecutionContext> currentExecutionEnvironment() {
diff --git a/core/runtimeservices/src/main/java/org/apache/isis/core/runtimeservices/session/InteractionFactoryDefault.java b/core/runtimeservices/src/main/java/org/apache/isis/core/runtimeservices/session/InteractionFactoryDefault.java
index 752852f..c245e4c 100644
--- a/core/runtimeservices/src/main/java/org/apache/isis/core/runtimeservices/session/InteractionFactoryDefault.java
+++ b/core/runtimeservices/src/main/java/org/apache/isis/core/runtimeservices/session/InteractionFactoryDefault.java
@@ -154,7 +154,7 @@ implements InteractionFactory, InteractionTracker {
 
     }
 
-    private final ThreadLocal<Stack<InteractionLayer>> interactionClosureStack = 
+    private final ThreadLocal<Stack<InteractionLayer>> interactionLayerStack = 
             ThreadLocal.withInitial(Stack::new);
     
     @Override
@@ -163,7 +163,7 @@ implements InteractionFactory, InteractionTracker {
         val interactionSession = getOrCreateInteractionSession(authSessionToUse);
         val newInteractionClosure = new InteractionLayer(interactionSession, authSessionToUse);
         
-        interactionClosureStack.get().push(newInteractionClosure);
+        interactionLayerStack.get().push(newInteractionClosure);
 
         if(isInTopLevelClosure()) {
         	postSessionOpened(interactionSession);
@@ -172,7 +172,7 @@ implements InteractionFactory, InteractionTracker {
         if(log.isDebugEnabled()) {
             log.debug("new InteractionClosure created (conversation-id={}, total-sessions-on-stack={}, {})", 
                     conversationId.get(), 
-                    interactionClosureStack.get().size(),
+                    interactionLayerStack.get().size(),
                     _Probe.currentThreadId());
         }
         
@@ -182,30 +182,30 @@ implements InteractionFactory, InteractionTracker {
     private InteractionSession getOrCreateInteractionSession(
     		final @NonNull AuthenticationSession authSessionToUse) {
     	
-    	return interactionClosureStack.get().isEmpty()
+    	return interactionLayerStack.get().isEmpty()
     			? new InteractionSession(metaModelContext, authSessionToUse)
-				: interactionClosureStack.get().firstElement().getInteractionSession();
+				: interactionLayerStack.get().firstElement().getInteractionSession();
     }
 
     @Override
     public void closeSessionStack() {
         log.debug("about to close IsisInteraction stack (conversation-id={}, total-sessions-on-stack={}, {})", 
                 conversationId.get(), 
-                interactionClosureStack.get().size(),
+                interactionLayerStack.get().size(),
                 _Probe.currentThreadId());
 
         closeInteractionStackDownToStackSize(0);
     }
 
 	@Override
-    public Optional<InteractionLayer> currentInteractionEnvironment() {
-    	val stack = interactionClosureStack.get();
+    public Optional<InteractionLayer> currentInteractionLayer() {
+    	val stack = interactionLayerStack.get();
     	return stack.isEmpty() ? Optional.empty() : Optional.of(stack.lastElement());
     }
 
     @Override
     public boolean isInInteractionSession() {
-        return !interactionClosureStack.get().isEmpty();
+        return !interactionLayerStack.get().isEmpty();
     }
 
     @Override
@@ -229,7 +229,7 @@ implements InteractionFactory, InteractionTracker {
             @NonNull final AuthenticationSession authenticationSession, 
             @NonNull final Callable<R> callable) {
         
-        final int stackSizeWhenEntering = interactionClosureStack.get().size();
+        final int stackSizeWhenEntering = interactionLayerStack.get().size();
         openInteraction(authenticationSession);
         
         try {
@@ -275,7 +275,7 @@ implements InteractionFactory, InteractionTracker {
     // -- HELPER
     
     private boolean isInTopLevelClosure() {
-    	return interactionClosureStack.get().size()==1; 
+    	return interactionLayerStack.get().size()==1; 
     }
     
     private void postSessionOpened(InteractionSession newIsisInteraction) {
@@ -295,10 +295,10 @@ implements InteractionFactory, InteractionTracker {
         log.debug("about to close IsisInteraction stack down to size {} (conversation-id={}, total-sessions-on-stack={}, {})",
                 downToStackSize,
                 conversationId.get(), 
-                interactionClosureStack.get().size(),
+                interactionLayerStack.get().size(),
                 _Probe.currentThreadId());
         
-        val stack = interactionClosureStack.get();
+        val stack = interactionLayerStack.get();
         while(stack.size()>downToStackSize) {
         	if(isInTopLevelClosure()) {
         		// keep the stack unmodified yet, to allow for callbacks to properly operate
@@ -308,7 +308,7 @@ implements InteractionFactory, InteractionTracker {
         }
         if(downToStackSize == 0) {
             // cleanup thread-local
-            interactionClosureStack.remove();
+            interactionLayerStack.remove();
             conversationId.remove();
         }
     }