Author: slaws
Date: Wed Aug 29 07:23:21 2007
New Revision: 570820

URL: http://svn.apache.org/viewvc?rev=570820&view=rev
Log:
TUSCANY-1590
Remove cast to ConversationalScopeContainer from JDKInvocationHandler

Modified:
    
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKInvocationHandler.java
    
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/AbstractScopeContainer.java
    
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ConversationalScopeContainer.java
    
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeContainer.java

Modified: 
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKInvocationHandler.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKInvocationHandler.java?rev=570820&r1=570819&r2=570820&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKInvocationHandler.java
 (original)
+++ 
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKInvocationHandler.java
 Wed Aug 29 07:23:21 2007
@@ -179,7 +179,7 @@
         // outgoing messages.        
         if (conversational) {
             if (conversation == null) {
-                // this call via an automatic proxy rather than a
+                // this call is via an automatic proxy rather than a
                 // callable/service reference so no conversation object 
                 // will have been constructed yet
                 conversation = new ConversationImpl();
@@ -195,17 +195,17 @@
                 // create a new conversation Id
                 conversationId = createConversationID();
                 
+                // If we are passing out a callback target
                 // register the calling component instance against this 
                 // new conversation id so that stateful callbacks will be
                 // able to find it
-                if (msgContextConversationId != null) {
+                if (wire.getSource().getCallbackEndpoint()!= null ) {
                     // the component instance is already registered
                     // so add another registration
                     ScopeContainer<Object> scopeContainer = 
getConversationalScopeContainer(wire);
                        
                     if ( scopeContainer != null){
-                        // TODO - SPI needs extending to remove this cast
-                        
((ConversationalScopeContainer)scopeContainer).addWrapperReference(msgContextConversationId,
 conversationId);
+                        
scopeContainer.addWrapperReference(msgContextConversationId, conversationId);
                     }
                 }
 

Modified: 
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/AbstractScopeContainer.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/AbstractScopeContainer.java?rev=570820&r1=570819&r2=570820&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/AbstractScopeContainer.java
 (original)
+++ 
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/AbstractScopeContainer.java
 Wed Aug 29 07:23:21 2007
@@ -78,6 +78,12 @@
     public InstanceWrapper getWrapper(KEY contextId) throws 
TargetResolutionException {
         return wrappers.get(contextId);
     }
+    
+    public void addWrapperReference(KEY existingContextId, KEY newContextId) 
+      throws TargetResolutionException 
+    {
+        // do nothing here. the conversational scope container implements this
+    }
 
     public void onEvent(Event event) {
     }

Modified: 
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ConversationalScopeContainer.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ConversationalScopeContainer.java?rev=570820&r1=570819&r2=570820&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ConversationalScopeContainer.java
 (original)
+++ 
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ConversationalScopeContainer.java
 Wed Aug 29 07:23:21 2007
@@ -172,15 +172,6 @@
         return getInstanceWrapper(true,contextId);
     } 
     
-    /**
-     * Allows a component to be registered against more than on context id. 
This is required in the
-     * case of stateful callbacks where we want to identify the originating 
client component instance 
-     * as the callback target but we don't want to reuse the clients original 
conversation id
-     * 
-     * @param existingContextId  an id that identifies an existing component 
instance
-     * @param newContextId a new id against which this component will also be 
registered
-     * @throws TargetResolutionException
-     */
     public void addWrapperReference(Object existingContextId, Object 
newContextId) throws TargetResolutionException {
         // get the instance wrapper via the existing id
         InstanceLifeCycleWrapper anInstanceWrapper = 
this.instanceLifecycleCollection.get(existingContextId);

Modified: 
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeContainer.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeContainer.java?rev=570820&r1=570819&r2=570820&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeContainer.java
 (original)
+++ 
incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeContainer.java
 Wed Aug 29 07:23:21 2007
@@ -62,6 +62,18 @@
      * @throws TargetResolutionException if there was a problem instantiating 
the target instance
      */
      InstanceWrapper getWrapper(KEY contextId) throws 
TargetResolutionException;
+     
+     /**
+      * Allows a component to be registered against more than one context id. 
This is required in the
+      * case of stateful callbacks where we want to identify the originating 
client component instance 
+      * as the callback target but we don't want to reuse the clients original 
conversation id
+      * 
+      * @param existingContextId  an id that identifies an existing component 
instance
+      * @param newContextId a new id against which this component will also be 
registered
+      * @throws TargetResolutionException
+      */
+     public void addWrapperReference(KEY existingContextId, KEY newContextId) 
+       throws TargetResolutionException;   
 
     /**
      * Returns an implementation instance associated with the current scope 
context.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to