tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r1211945 - in /tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core: assembly/impl/RuntimeEndpointReferenceImpl.java context/impl/ServiceReferenceImpl.java
Date Thu, 08 Dec 2011 16:16:13 GMT
Author: antelder
Date: Thu Dec  8 16:16:13 2011
New Revision: 1211945

URL: http://svn.apache.org/viewvc?rev=1211945&view=rev
Log:
Add a strawman approach to enable setting the binding uri on a ServiceReference

Modified:
    tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java
    tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ServiceReferenceImpl.java

Modified: tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java?rev=1211945&r1=1211944&r2=1211945&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java
Thu Dec  8 16:16:13 2011
@@ -71,6 +71,7 @@ import org.apache.tuscany.sca.invocation
 import org.apache.tuscany.sca.invocation.Message;
 import org.apache.tuscany.sca.invocation.MessageFactory;
 import org.apache.tuscany.sca.invocation.Phase;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
 import org.apache.tuscany.sca.provider.BindingProviderFactory;
 import org.apache.tuscany.sca.provider.EndpointReferenceProvider;
 import org.apache.tuscany.sca.provider.ImplementationAsyncProvider;
@@ -127,6 +128,7 @@ public class RuntimeEndpointReferenceImp
     private boolean started;
     
     private RuntimeEndpointReference delegateEndpointReference;
+    private boolean bindingURIaltered;
     
     /**
      * No-arg constructor for Java serilization
@@ -352,6 +354,9 @@ public class RuntimeEndpointReferenceImp
         chains = chainList;
         wireProcessor.process(this);
         
+        // reset the binding uri altered flag 
+        bindingURIaltered = false;
+        
         if (isAsyncInvocation()){
             // Fix up all of the operation chain response paths to point back to the implementation
provided
             // async response handler
@@ -546,7 +551,7 @@ public class RuntimeEndpointReferenceImp
 
     public boolean isOutOfDate() {
         resolve();
-        return eprBinder.isOutOfDate(domainRegistry, this);
+        return bindingURIaltered || eprBinder.isOutOfDate(domainRegistry, this);
     }
 
     public synchronized ReferenceBindingProvider getBindingProvider() {
@@ -819,5 +824,15 @@ public class RuntimeEndpointReferenceImp
         }
         return null;
     }
+    
+    public void setBindingURI(String uri) {
+        binding.setURI(uri);
+        bindingURIaltered = true;
+        BindingBuilder builder = builders.getBindingBuilder(binding.getType());
+        if (builder != null) {
+            BuilderContext builderContext = new BuilderContext(null, null, null);
+            builder.build(component, reference, binding, builderContext, true);
+        }
+    }
 
 }

Modified: tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ServiceReferenceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ServiceReferenceImpl.java?rev=1211945&r1=1211944&r2=1211945&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ServiceReferenceImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ServiceReferenceImpl.java
Thu Dec  8 16:16:13 2011
@@ -47,6 +47,7 @@ import org.apache.tuscany.sca.contributi
 import org.apache.tuscany.sca.core.ExtensionPointRegistry;
 import org.apache.tuscany.sca.core.FactoryExtensionPoint;
 import org.apache.tuscany.sca.core.assembly.RuntimeAssemblyFactory;
+import org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointReferenceImpl;
 import org.apache.tuscany.sca.core.context.ServiceReferenceExt;
 import org.apache.tuscany.sca.core.factory.ObjectCreationException;
 import org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory;
@@ -421,4 +422,9 @@ public class ServiceReferenceImpl<B> imp
         return xmlReader;
     }
     */
+    
+    public void setBindingURI(String uri) {
+        ((RuntimeEndpointReferenceImpl)endpointReference).setBindingURI(uri);
+    }
+    
 }



Mime
View raw message