You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by is...@apache.org on 2007/09/11 22:41:17 UTC

svn commit: r574691 - /incubator/tuscany/java/sca/modules/implementation-notification/src/main/java/org/apache/tuscany/sca/implementation/notification/NotificationComponentInvoker.java

Author: isilval
Date: Tue Sep 11 13:41:17 2007
New Revision: 574691

URL: http://svn.apache.org/viewvc?rev=574691&view=rev
Log:
Slight refactor

Modified:
    incubator/tuscany/java/sca/modules/implementation-notification/src/main/java/org/apache/tuscany/sca/implementation/notification/NotificationComponentInvoker.java

Modified: incubator/tuscany/java/sca/modules/implementation-notification/src/main/java/org/apache/tuscany/sca/implementation/notification/NotificationComponentInvoker.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-notification/src/main/java/org/apache/tuscany/sca/implementation/notification/NotificationComponentInvoker.java?rev=574691&r1=574690&r2=574691&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-notification/src/main/java/org/apache/tuscany/sca/implementation/notification/NotificationComponentInvoker.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-notification/src/main/java/org/apache/tuscany/sca/implementation/notification/NotificationComponentInvoker.java Tue Sep 11 13:41:17 2007
@@ -49,6 +49,22 @@
     }
     
     public Message invoke(Message msg) {
+        addSubscriberInvocationChains();
+
+        // REVIEW Should this be done in separate thread(s)?
+        // REVIEW Should separate copies of message be used?
+        Object msgBody = msg.getBody();
+        
+        for (InvocationChain subscriberInvocationChain : subscriberInvocationChains) {
+            Invoker chainInvoker = subscriberInvocationChain.getHeadInvoker();
+            msg.setBody(msgBody);
+            chainInvoker.invoke(msg);
+        }
+        
+        return RESPONSE;
+    }
+    
+    private void addSubscriberInvocationChains() {
         if (subscriberInvocationChains == null) {
             subscriberInvocationChains = new ArrayList<InvocationChain>();
             for (ComponentReference reference : component.getReferences()) {
@@ -70,18 +86,6 @@
                 }
             }
         }
-        
-        // REVIEW Should this be done in separate thread(s)?
-        // REVIEW Should separate copies of message be used?
-        Object msgBody = msg.getBody();
-        
-        for (InvocationChain subscriberInvocationChain : subscriberInvocationChains) {
-            Invoker chainInvoker = subscriberInvocationChain.getHeadInvoker();
-            msg.setBody(msgBody);
-            chainInvoker.invoke(msg);
-        }
-        
-        return RESPONSE;
     }
     
     private InvocationChain getInvocationChain(List<InvocationChain> chains, Operation operation) {



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org