tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r819786 - in /tuscany/java/sca/modules: ./ core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/ core/src/main/resources/ core/src/main/resources/META-INF/services/ domain-node/ endpoint-tribes/src/main/resources/META-INF/services/ ...
Date Tue, 29 Sep 2009 00:31:16 GMT
Author: rfeng
Date: Tue Sep 29 00:31:15 2009
New Revision: 819786

URL: http://svn.apache.org/viewvc?rev=819786&view=rev
Log:
Refactor tuscany-endpoint module into tuscany-core

Added:
    tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointReferenceBuilderImpl.java
      - copied, changed from r819744, tuscany/java/sca/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointReferenceBuilderImpl.java
    tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointRegistryImpl.java
      - copied, changed from r819744, tuscany/java/sca/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointRegistryImpl.java
    tuscany/java/sca/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.EndpointReferenceBuilder
      - copied, changed from r819744, tuscany/java/sca/modules/endpoint/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.EndpointReferenceBuilder
    tuscany/java/sca/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.EndpointRegistry
      - copied, changed from r819744, tuscany/java/sca/modules/endpoint/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.EndpointRegistry
    tuscany/java/sca/modules/core/src/main/resources/endpoint-validation-messages.properties
      - copied unchanged from r819744, tuscany/java/sca/modules/endpoint/src/main/resources/endpoint-validation-messages.properties
Removed:
    tuscany/java/sca/modules/endpoint/
Modified:
    tuscany/java/sca/modules/domain-node/pom.xml
    tuscany/java/sca/modules/endpoint-tribes/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.EndpointRegistry
    tuscany/java/sca/modules/endpoint-wrapper/META-INF/MANIFEST.MF
    tuscany/java/sca/modules/endpoint-wrapper/pom.xml
    tuscany/java/sca/modules/endpoint-wrapper/src/main/java/org/apache/tuscany/sca/endpoint/wrapper/EndpointRegistryWrapper.java
    tuscany/java/sca/modules/endpoint-wrapper/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.EndpointRegistry
    tuscany/java/sca/modules/node-impl/pom.xml
    tuscany/java/sca/modules/pom.xml

Copied: tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointReferenceBuilderImpl.java
(from r819744, tuscany/java/sca/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointReferenceBuilderImpl.java)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointReferenceBuilderImpl.java?p2=tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointReferenceBuilderImpl.java&p1=tuscany/java/sca/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointReferenceBuilderImpl.java&r1=819744&r2=819786&rev=819786&view=diff
==============================================================================
--- tuscany/java/sca/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointReferenceBuilderImpl.java
(original)
+++ tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointReferenceBuilderImpl.java
Tue Sep 29 00:31:15 2009
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.tuscany.sca.endpoint.impl;
+package org.apache.tuscany.sca.core.assembly.impl;
 
 import java.util.List;
 

Copied: tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointRegistryImpl.java
(from r819744, tuscany/java/sca/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointRegistryImpl.java)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointRegistryImpl.java?p2=tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointRegistryImpl.java&p1=tuscany/java/sca/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointRegistryImpl.java&r1=819744&r2=819786&rev=819786&view=diff
==============================================================================
--- tuscany/java/sca/modules/endpoint/src/main/java/org/apache/tuscany/sca/endpoint/impl/EndpointRegistryImpl.java
(original)
+++ tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointRegistryImpl.java
Tue Sep 29 00:31:15 2009
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.tuscany.sca.endpoint.impl;
+package org.apache.tuscany.sca.core.assembly.impl;
 
 import java.util.ArrayList;
 import java.util.List;

Copied: tuscany/java/sca/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.EndpointReferenceBuilder
(from r819744, tuscany/java/sca/modules/endpoint/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.EndpointReferenceBuilder)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.EndpointReferenceBuilder?p2=tuscany/java/sca/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.EndpointReferenceBuilder&p1=tuscany/java/sca/modules/endpoint/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.EndpointReferenceBuilder&r1=819744&r2=819786&rev=819786&view=diff
==============================================================================
--- tuscany/java/sca/modules/endpoint/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.EndpointReferenceBuilder
(original)
+++ tuscany/java/sca/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.EndpointReferenceBuilder
Tue Sep 29 00:31:15 2009
@@ -15,4 +15,4 @@
 # specific language governing permissions and limitations
 # under the License. 
 
-org.apache.tuscany.sca.endpoint.impl.EndpointReferenceBuilderImpl
\ No newline at end of file
+org.apache.tuscany.sca.core.assembly.impl.EndpointReferenceBuilderImpl
\ No newline at end of file

Copied: tuscany/java/sca/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.EndpointRegistry
(from r819744, tuscany/java/sca/modules/endpoint/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.EndpointRegistry)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.EndpointRegistry?p2=tuscany/java/sca/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.EndpointRegistry&p1=tuscany/java/sca/modules/endpoint/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.EndpointRegistry&r1=819744&r2=819786&rev=819786&view=diff
==============================================================================
--- tuscany/java/sca/modules/endpoint/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.EndpointRegistry
(original)
+++ tuscany/java/sca/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.EndpointRegistry
Tue Sep 29 00:31:15 2009
@@ -15,4 +15,4 @@
 # specific language governing permissions and limitations
 # under the License.
 
-org.apache.tuscany.sca.endpoint.impl.EndpointRegistryImpl;ranking=100
\ No newline at end of file
+org.apache.tuscany.sca.core.assembly.impl.EndpointRegistryImpl;ranking=100,scheme=vm
\ No newline at end of file

Modified: tuscany/java/sca/modules/domain-node/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/domain-node/pom.xml?rev=819786&r1=819785&r2=819786&view=diff
==============================================================================
--- tuscany/java/sca/modules/domain-node/pom.xml (original)
+++ tuscany/java/sca/modules/domain-node/pom.xml Tue Sep 29 00:31:15 2009
@@ -40,13 +40,6 @@
         
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-sca-api</artifactId>
-            <version>2.0-SNAPSHOT</version>
-            <scope>test</scope>
-        </dependency>
-        
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-sca-client-impl</artifactId>
             <version>2.0-SNAPSHOT</version>
             <scope>test</scope>

Modified: tuscany/java/sca/modules/endpoint-tribes/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.EndpointRegistry
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/endpoint-tribes/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.EndpointRegistry?rev=819786&r1=819785&r2=819786&view=diff
==============================================================================
--- tuscany/java/sca/modules/endpoint-tribes/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.EndpointRegistry
(original)
+++ tuscany/java/sca/modules/endpoint-tribes/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.EndpointRegistry
Tue Sep 29 00:31:15 2009
@@ -14,4 +14,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-org.apache.tuscany.sca.endpoint.tribes.ReplicatedEndpointRegistry;ranking=150,address=228.0.0.100,port=50000,timeout=50
\ No newline at end of file
+org.apache.tuscany.sca.endpoint.tribes.ReplicatedEndpointRegistry;ranking=150,address=228.0.0.100,port=50000,timeout=50,scheme=tribes
\ No newline at end of file

Modified: tuscany/java/sca/modules/endpoint-wrapper/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/endpoint-wrapper/META-INF/MANIFEST.MF?rev=819786&r1=819785&r2=819786&view=diff
==============================================================================
--- tuscany/java/sca/modules/endpoint-wrapper/META-INF/MANIFEST.MF (original)
+++ tuscany/java/sca/modules/endpoint-wrapper/META-INF/MANIFEST.MF Tue Sep 29 00:31:15 2009
@@ -10,10 +10,8 @@
 Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
 Bundle-Description: Apache Tuscany SCA Default Endpoint Wrapper
 Import-Package: org.apache.tuscany.sca.assembly;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.assembly.builder;version="2.0.0";resolution:=optional,
  org.apache.tuscany.sca.core;version="2.0.0";resolution:=optional,
- org.apache.tuscany.sca.endpoint.impl;version="2.0.0",
- org.apache.tuscany.sca.endpoint.tribes;version="2.0.0",
+ org.apache.tuscany.sca.extensibility;version="2.0.0",
  org.apache.tuscany.sca.management;version="2.0.0",
  org.apache.tuscany.sca.runtime;version="2.0.0"
 Bundle-SymbolicName: org.apache.tuscany.sca.endpoint.wrapper

Modified: tuscany/java/sca/modules/endpoint-wrapper/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/endpoint-wrapper/pom.xml?rev=819786&r1=819785&r2=819786&view=diff
==============================================================================
--- tuscany/java/sca/modules/endpoint-wrapper/pom.xml (original)
+++ tuscany/java/sca/modules/endpoint-wrapper/pom.xml Tue Sep 29 00:31:15 2009
@@ -40,50 +40,41 @@
         
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-endpoint</artifactId>
+            <artifactId>tuscany-assembly-xml</artifactId>
             <version>2.0-SNAPSHOT</version>
+            <scope>test</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-endpoint-tribes</artifactId>
+            <artifactId>tuscany-core-spi</artifactId>
             <version>2.0-SNAPSHOT</version>
         </dependency>
-
+        
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-assembly-xml</artifactId>
+            <artifactId>tuscany-monitor</artifactId>
             <version>2.0-SNAPSHOT</version>
-            <scope>test</scope>
         </dependency>
+                
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-core</artifactId>
             <version>2.0-SNAPSHOT</version>
             <scope>test</scope>
         </dependency>
+
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-extensibility</artifactId>
             <version>2.0-SNAPSHOT</version>
         </dependency>
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-monitor</artifactId>
-            <version>2.0-SNAPSHOT</version>
-            <scope>test</scope>
-        </dependency>
+
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-contribution</artifactId>
             <version>2.0-SNAPSHOT</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-sca-api</artifactId>
-            <version>2.0-SNAPSHOT</version>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 </project>

Modified: tuscany/java/sca/modules/endpoint-wrapper/src/main/java/org/apache/tuscany/sca/endpoint/wrapper/EndpointRegistryWrapper.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/endpoint-wrapper/src/main/java/org/apache/tuscany/sca/endpoint/wrapper/EndpointRegistryWrapper.java?rev=819786&r1=819785&r2=819786&view=diff
==============================================================================
--- tuscany/java/sca/modules/endpoint-wrapper/src/main/java/org/apache/tuscany/sca/endpoint/wrapper/EndpointRegistryWrapper.java
(original)
+++ tuscany/java/sca/modules/endpoint-wrapper/src/main/java/org/apache/tuscany/sca/endpoint/wrapper/EndpointRegistryWrapper.java
Tue Sep 29 00:31:15 2009
@@ -19,7 +19,10 @@
 
 package org.apache.tuscany.sca.endpoint.wrapper;
 
+import java.lang.reflect.Constructor;
+import java.util.Collection;
 import java.util.List;
+import java.util.Map;
 import java.util.logging.Logger;
 
 import org.apache.tuscany.sca.assembly.Endpoint;
@@ -27,8 +30,8 @@
 import org.apache.tuscany.sca.core.ExtensionPointRegistry;
 import org.apache.tuscany.sca.core.LifeCycleListener;
 import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.endpoint.impl.EndpointRegistryImpl;
-import org.apache.tuscany.sca.endpoint.tribes.ReplicatedEndpointRegistry;
+import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
+import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
 import org.apache.tuscany.sca.management.ConfigAttributes;
 import org.apache.tuscany.sca.runtime.EndpointListener;
 import org.apache.tuscany.sca.runtime.EndpointRegistry;
@@ -38,7 +41,7 @@
  */
 public class EndpointRegistryWrapper implements EndpointRegistry, LifeCycleListener {
     private final Logger logger = Logger.getLogger(EndpointRegistryWrapper.class.getName());
-    
+
     private ExtensionPointRegistry extensionPoints;
     private EndpointRegistry delegateEndpointRegistry;
 
@@ -49,12 +52,34 @@
     public void start() {
         UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
         ConfigAttributes domainConfig = utilities.getUtility(ConfigAttributes.class);
-        if (domainConfig != null && "tribes".equals(domainConfig.getAttributes().get("domainScheme")))
{
-            logger.info("Using Tribes based EndpointRegistry");
-            delegateEndpointRegistry = new ReplicatedEndpointRegistry(extensionPoints, null);
-        } else {
-            logger.info("Using in-VM EndpointRegistry");
-            delegateEndpointRegistry = new EndpointRegistryImpl(extensionPoints);
+        String scheme = null;
+        if (domainConfig != null) {
+            scheme = domainConfig.getAttributes().get("domainScheme");
+        }
+        if (scheme == null) {
+            scheme = "vm";
+        }
+        try {
+            Collection<ServiceDeclaration> sds =
+                ServiceDiscovery.getInstance().getServiceDeclarations(EndpointRegistry.class);
+            for (ServiceDeclaration sd : sds) {
+                if (scheme.equals(sd.getAttributes().get("scheme"))) {
+                    logger.info("EndpointRegistry found: " + sd.getClassName());
+                    Class<?> implClass = sd.loadClass();
+                    Constructor<?> constructor = null;
+                    try {
+                        constructor = implClass.getConstructor(ExtensionPointRegistry.class);
+                        delegateEndpointRegistry = (EndpointRegistry)constructor.newInstance(extensionPoints);
+                    } catch (NoSuchMethodException e) {
+                        constructor = implClass.getConstructor(ExtensionPointRegistry.class,
Map.class);
+                        delegateEndpointRegistry =
+                            (EndpointRegistry)constructor.newInstance(extensionPoints, sd.getAttributes());
+                    }
+                    break;
+                }
+            }
+        } catch (Exception e) {
+            throw new IllegalStateException(e);
         }
         if (delegateEndpointRegistry instanceof LifeCycleListener) {
             ((LifeCycleListener)delegateEndpointRegistry).start();

Modified: tuscany/java/sca/modules/endpoint-wrapper/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.EndpointRegistry
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/endpoint-wrapper/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.EndpointRegistry?rev=819786&r1=819785&r2=819786&view=diff
==============================================================================
--- tuscany/java/sca/modules/endpoint-wrapper/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.EndpointRegistry
(original)
+++ tuscany/java/sca/modules/endpoint-wrapper/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.EndpointRegistry
Tue Sep 29 00:31:15 2009
@@ -15,4 +15,4 @@
 # specific language governing permissions and limitations
 # under the License.
 
-org.apache.tuscany.sca.endpoint.wrapper.EndpointRegistryWrapper;ranking=200
+org.apache.tuscany.sca.endpoint.wrapper.EndpointRegistryWrapper;ranking=200,scheme=wrapper

Modified: tuscany/java/sca/modules/node-impl/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl/pom.xml?rev=819786&r1=819785&r2=819786&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl/pom.xml (original)
+++ tuscany/java/sca/modules/node-impl/pom.xml Tue Sep 29 00:31:15 2009
@@ -103,13 +103,6 @@
             <version>2.0-SNAPSHOT</version>
             <scope>runtime</scope>
         </dependency>
-        
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-endpoint</artifactId>
-            <version>2.0-SNAPSHOT</version>
-            <scope>runtime</scope>
-        </dependency> 
                
        <dependency>
             <groupId>org.apache.tuscany.sca</groupId>

Modified: tuscany/java/sca/modules/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/pom.xml?rev=819786&r1=819785&r2=819786&view=diff
==============================================================================
--- tuscany/java/sca/modules/pom.xml (original)
+++ tuscany/java/sca/modules/pom.xml Tue Sep 29 00:31:15 2009
@@ -59,7 +59,6 @@
         <module>databinding-jaxb-axiom</module>
         <module>definitions-xml</module>
         <module>domain-node</module>
-        <module>endpoint</module>
         <module>endpoint-tribes</module>
         <module>endpoint-wrapper</module>
         <module>extensibility</module>



Mime
View raw message