tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramku...@apache.org
Subject svn commit: r787589 - in /tuscany/branches/sca-java-1.x/modules: ./ implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/ implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spri...
Date Tue, 23 Jun 2009 09:11:37 GMT
Author: ramkumar
Date: Tue Jun 23 09:11:37 2009
New Revision: 787589

URL: http://svn.apache.org/viewvc?rev=787589&view=rev
Log:
Fixes for TUSCANY-3096

Added:
    tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/AnnotationProcessorExtensionPoint.java
    tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/DefaultAnnotationProcessorExtensionPoint.java
    tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.spring.AnnotationProcessorExtensionPoint
Modified:
    tuscany/branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
    tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringContextStub.java
    tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProvider.java
    tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProviderFactory.java
    tuscany/branches/sca-java-1.x/modules/pom.xml

Modified: tuscany/branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java?rev=787589&r1=787588&r2=787589&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
(original)
+++ tuscany/branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
Tue Jun 23 09:11:37 2009
@@ -55,12 +55,14 @@
 
     private AbstractApplicationContext springContext;
     private SpringImplementationStub implementation;
+    private boolean isAnnotationSupported;
     
-    public SpringContextTie(SpringImplementationStub implementation, URL resource) throws
Exception {
+    public SpringContextTie(SpringImplementationStub implementation, URL resource, boolean
annotationSupport) throws Exception {
         this.implementation = implementation;
+        this.isAnnotationSupported = annotationSupport;
         if ((SpringVersion.getVersion()!= null) && (! SpringVersion.getVersion().equals("2.5.5")))
{
         	throw new RuntimeException("Unsupported version: Use only Spring Framework Version
2.5.5");
-        }
+        }        
         SCAParentApplicationContext scaParentContext = new SCAParentApplicationContext(implementation);
         springContext = createApplicationContext(scaParentContext, resource);  
     }
@@ -120,19 +122,22 @@
                         if (beanClassName.indexOf(".ClassPathXmlApplicationContext") != -1)
{                                                                   
                                 appContext = new ClassPathXmlApplicationContext(listValues,
false, scaParentContext);                                   
                                 appContext.refresh();
-                                includeAnnotationProcessors(appContext.getBeanFactory());
+                                if (isAnnotationSupported)
+                                	includeAnnotationProcessors(appContext.getBeanFactory());
                                 return appContext;
                         } else {
                                 appContext = new FileSystemXmlApplicationContext(listValues,
false, scaParentContext);                                  
                                 appContext.refresh();
-                                includeAnnotationProcessors(appContext.getBeanFactory());
+                                if (isAnnotationSupported)
+                                	includeAnnotationProcessors(appContext.getBeanFactory());
                                 return appContext;
                         }
                 }               
         }
         
         // use the generic application context as default 
-        includeAnnotationProcessors(beanFactory);
+        if (isAnnotationSupported)
+        	includeAnnotationProcessors(beanFactory);
         appContext = new GenericApplicationContext(beanFactory, scaParentContext);
         return appContext;
     }

Added: tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/AnnotationProcessorExtensionPoint.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/AnnotationProcessorExtensionPoint.java?rev=787589&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/AnnotationProcessorExtensionPoint.java
(added)
+++ tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/AnnotationProcessorExtensionPoint.java
Tue Jun 23 09:11:37 2009
@@ -0,0 +1,7 @@
+package org.apache.tuscany.sca.implementation.spring.invocation;
+
+public interface AnnotationProcessorExtensionPoint {
+	
+	boolean isAnnotationSupported();
+
+}

Added: tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/DefaultAnnotationProcessorExtensionPoint.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/DefaultAnnotationProcessorExtensionPoint.java?rev=787589&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/DefaultAnnotationProcessorExtensionPoint.java
(added)
+++ tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/DefaultAnnotationProcessorExtensionPoint.java
Tue Jun 23 09:11:37 2009
@@ -0,0 +1,15 @@
+package org.apache.tuscany.sca.implementation.spring.invocation;
+
+public class DefaultAnnotationProcessorExtensionPoint implements AnnotationProcessorExtensionPoint
{
+	
+	// Contructor
+	public DefaultAnnotationProcessorExtensionPoint() {
+		
+	}
+	
+	// By default SCA annotations for implementation.spring
+	// will be supproted.
+	public boolean isAnnotationSupported() {
+		return true;
+	}
+}

Modified: tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringContextStub.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringContextStub.java?rev=787589&r1=787588&r2=787589&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringContextStub.java
(original)
+++ tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringContextStub.java
Tue Jun 23 09:11:37 2009
@@ -45,15 +45,17 @@
     public SpringContextStub(RuntimeComponent component,
                                SpringImplementation implementation,
                                ProxyFactory proxyService,
-                               JavaPropertyValueObjectFactory propertyValueObjectFactory)
{
+                               JavaPropertyValueObjectFactory propertyValueObjectFactory,
+                               boolean annotationSupport) {
 
-        initTie(component, implementation, propertyValueObjectFactory);        
+        initTie(component, implementation, propertyValueObjectFactory, annotationSupport);
       
 
     }
 
     private void initTie(RuntimeComponent component,
                          SpringImplementation implementation,
-                         JavaPropertyValueObjectFactory propertyValueObjectFactory) {
+                         JavaPropertyValueObjectFactory propertyValueObjectFactory,
+                         boolean annotationSupport) {
 
         // TODO: what class loader to use?
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
@@ -65,8 +67,8 @@
             Object stub = stubConstructor.newInstance(new SpringImplementationTie(implementation,
component, propertyValueObjectFactory));
 
             Class<?> tieClass = Class.forName("org.apache.tuscany.sca.implementation.spring.runtime.context.SpringContextTie",
true, cl);
-            Constructor<?> tieConstructor = tieClass.getConstructor(new Class<?>[]{stubClass,
URL.class});
-            this.tie = tieConstructor.newInstance(stub, implementation.getResource());
+            Constructor<?> tieConstructor = tieClass.getConstructor(new Class<?>[]{stubClass,
URL.class, boolean.class});
+            this.tie = tieConstructor.newInstance(stub, implementation.getResource(), annotationSupport);
             
             this.startMethod = tieClass.getMethod("start");
             this.closeMethod = tieClass.getMethod("close");

Modified: tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProvider.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProvider.java?rev=787589&r1=787588&r2=787589&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProvider.java
(original)
+++ tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProvider.java
Tue Jun 23 09:11:37 2009
@@ -50,13 +50,14 @@
     public SpringImplementationProvider(RuntimeComponent component,
                                         SpringImplementation implementation,
                                         ProxyFactory proxyService,
-                                        JavaPropertyValueObjectFactory propertyValueObjectFactory)
{
+                                        JavaPropertyValueObjectFactory propertyValueObjectFactory,
+                                        boolean annotationSupport) {
         super();
         this.implementation = implementation;
         this.component = component;
         this.propertyValueObjectFactory = propertyValueObjectFactory;
 
-        springContext = new SpringContextStub(component, implementation, proxyService, propertyValueObjectFactory);
       
+        springContext = new SpringContextStub(component, implementation, proxyService, propertyValueObjectFactory,
annotationSupport);        
         
     } // end constructor
 

Modified: tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProviderFactory.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProviderFactory.java?rev=787589&r1=787588&r2=787589&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProviderFactory.java
(original)
+++ tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProviderFactory.java
Tue Jun 23 09:11:37 2009
@@ -38,6 +38,8 @@
 
     private ProxyFactory proxyFactory;
     private JavaPropertyValueObjectFactory propertyFactory;
+    private AnnotationProcessorExtensionPoint annotationProcessor;
+    private boolean annotationSupport;
 
     /**
      * Simple constructor
@@ -47,8 +49,14 @@
         super();
         
         ProxyFactoryExtensionPoint proxyFactories = extensionPoints.getExtensionPoint(ProxyFactoryExtensionPoint.class);

-        proxyFactory = new ExtensibleProxyFactory(proxyFactories); 
-
+        proxyFactory = new ExtensibleProxyFactory(proxyFactories);
+        
+        annotationProcessor = extensionPoints.getExtensionPoint(AnnotationProcessorExtensionPoint.class);
+        if (annotationProcessor == null) {
+        	annotationProcessor = new DefaultAnnotationProcessorExtensionPoint();
+        }
+        annotationSupport = annotationProcessor.isAnnotationSupported();
+        
         // TODO: could the runtime have a default PropertyValueObjectFactory?
         propertyFactory = new JavaPropertyValueObjectFactory(new MediatorImpl(extensionPoints));
     }
@@ -65,7 +73,8 @@
         return new SpringImplementationProvider(component, 
                                                 implementation, 
                                                 proxyFactory, 
-                                                propertyFactory);
+                                                propertyFactory,
+                                                annotationSupport);
     }
 
     /**

Added: tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.spring.AnnotationProcessorExtensionPoint
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.spring.AnnotationProcessorExtensionPoint?rev=787589&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.spring.AnnotationProcessorExtensionPoint
(added)
+++ tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.spring.AnnotationProcessorExtensionPoint
Tue Jun 23 09:11:37 2009
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License. 
+
+org.apache.tuscany.sca.implementation.spring.invocation.DefaultAnnotationProcessorExtensionPoint

Modified: tuscany/branches/sca-java-1.x/modules/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/pom.xml?rev=787589&r1=787588&r2=787589&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/pom.xml (original)
+++ tuscany/branches/sca-java-1.x/modules/pom.xml Tue Jun 23 09:11:37 2009
@@ -176,7 +176,7 @@
                 <module>policy-logging</module>
                 <module>policy-reliability</module>
                 <module>policy-security</module>
-                <module>policy-security-http</module>
+                <!--module>policy-security-http</module-->
                 <module>policy-security-jsr250</module>
                 <module>policy-transaction</module>
                 <module>sca-api</module>



Mime
View raw message