[java-opensaml COMMIT] in /trunk/opensaml-messaging-api/src: main/java/org/opensaml/messaging/context/InOutOperationC...

noreply at shibboleth.net noreply at shibboleth.net
Fri Oct 30 16:04:36 EDT 2015


Author: putmanb
Date: Fri Oct 30 16:04:36 2015
New Revision: 4367

URL: http://svn.shibboleth.net/view/java-opensaml?rev=4367&view=rev
Log:
OSJ-138: Enhance InOutOperationContext to be the getParent() of its inbound/outbound message contexts

Added:
    trunk/opensaml-messaging-api/src/test/java/org/opensaml/messaging/context/InOutOperationContextText.java   (with props)
Modified:
    trunk/opensaml-messaging-api/src/main/java/org/opensaml/messaging/context/InOutOperationContext.java

Modified: trunk/opensaml-messaging-api/src/main/java/org/opensaml/messaging/context/InOutOperationContext.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-messaging-api/src/main/java/org/opensaml/messaging/context/InOutOperationContext.java?rev=4367&r1=4366&r2=4367&view=diff
==============================================================================
--- trunk/opensaml-messaging-api/src/main/java/org/opensaml/messaging/context/InOutOperationContext.java	(original)
+++ trunk/opensaml-messaging-api/src/main/java/org/opensaml/messaging/context/InOutOperationContext.java	Fri Oct 30 16:04:36 2015
@@ -49,8 +49,8 @@
             MessageContext<OutboundMessageType> outbound) {
         this();
 
-        inboundContext = inbound;
-        outboundContext = outbound;
+        setInboundMessageContext(inbound);
+        setOutboundMessageContext(outbound);
 
     }
 
@@ -69,7 +69,17 @@
      * @param context inbound message context, may be null
      */
     public void setInboundMessageContext(MessageContext<InboundMessageType> context) {
+        // Unlink the old context from this parent
+        if (inboundContext != null) {
+            inboundContext.setParent(null);
+        }
+        
         inboundContext = context;
+        
+        // Link the new context to this parent
+        if (inboundContext != null) {
+            inboundContext.setParent(this);
+        }
     }
 
     /**
@@ -87,7 +97,17 @@
      * @param context outbound message context, may be null
      */
     public void setOutboundMessageContext(MessageContext<OutboundMessageType> context) {
+        // Unlink the old context from this parent
+        if (outboundContext != null) {
+            outboundContext.setParent(null);
+        }
+        
         outboundContext = context;
+        
+        // Link the new context to this parent
+        if (outboundContext != null) {
+            outboundContext.setParent(this);
+        }
     }
 
 }



More information about the commits mailing list