You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2010/08/21 01:42:10 UTC
svn commit: r987670 [3/4] - in /tuscany/sca-java-2.x/trunk/modules:
implementation-spring-runtime/ implementation-spring-runtime/META-INF/
implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/
implementation-...
Added: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SCAGenericApplicationContext.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SCAGenericApplicationContext.java?rev=987670&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SCAGenericApplicationContext.java (added)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SCAGenericApplicationContext.java Fri Aug 20 23:42:07 2010
@@ -0,0 +1,176 @@
+/*
+ * 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.
+ */
+package org.apache.tuscany.sca.implementation.spring.context.tie;
+
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tuscany.sca.implementation.spring.elements.tie.SpringBeanElement;
+import org.apache.tuscany.sca.implementation.spring.elements.tie.SpringConstructorArgElement;
+import org.apache.tuscany.sca.implementation.spring.elements.tie.SpringElementTie;
+import org.apache.tuscany.sca.implementation.spring.elements.tie.SpringPropertyElement;
+import org.apache.tuscany.sca.implementation.spring.elements.tie.SpringSCAPropertyElement;
+import org.apache.tuscany.sca.implementation.spring.elements.tie.SpringSCAReferenceElement;
+import org.apache.tuscany.sca.implementation.spring.elements.tie.SpringSCAServiceElement;
+import org.springframework.beans.MutablePropertyValues;
+import org.springframework.beans.PropertyValue;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.config.BeanReference;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.config.ConstructorArgumentValues;
+import org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder;
+import org.springframework.beans.factory.config.TypedStringValue;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.GenericApplicationContext;
+
+public class SCAGenericApplicationContext extends GenericApplicationContext {
+
+ private ClassLoader classloader = null;
+ private List<SpringSCAPropertyElement> propertyElements = new ArrayList<SpringSCAPropertyElement>();
+ private List<SpringSCAServiceElement> serviceElements = new ArrayList<SpringSCAServiceElement>();
+ private List<SpringSCAReferenceElement> referenceElements = new ArrayList<SpringSCAReferenceElement>();
+ private List<SpringBeanElement> beanElements;
+
+ public SCAGenericApplicationContext(DefaultListableBeanFactory beanFactory,
+ ApplicationContext parent,
+ ClassLoader classloader) {
+ super(beanFactory, parent);
+ this.classloader = classloader;
+ }
+
+ public SCAGenericApplicationContext(ApplicationContext parent, ClassLoader classloader) {
+ super(parent);
+ this.classloader = classloader;
+ }
+
+ @Override
+ protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
+ beanFactory.setBeanClassLoader(classloader);
+ }
+
+ public void addSCAPropertyElement(SpringSCAPropertyElement propertyElement) {
+ propertyElements.add(propertyElement);
+ }
+
+ public void addSCAServiceElement(SpringSCAServiceElement serviceElement) {
+ serviceElements.add(serviceElement);
+ }
+
+ public void addSCAReferenceElement(SpringSCAReferenceElement referenceElement) {
+ referenceElements.add(referenceElement);
+ }
+
+ public synchronized List<SpringBeanElement> getBeanElements() {
+ if (beanElements == null) {
+ beanElements = new ArrayList<SpringBeanElement>();
+ for (String name : getBeanDefinitionNames()) {
+ BeanDefinition def = getBeanDefinition(name);
+ SpringBeanElement beanElement = new SpringBeanElement(name, def.getBeanClassName());
+ beanElements.add(beanElement);
+ beanElement.setAbstractBean(def.isAbstract());
+ beanElement.setFactoryBeanAttribute(def.getFactoryBeanName() != null);
+ beanElement.setFactoryMethodAttribute(def.getFactoryMethodName() != null);
+ beanElement.setParentAttribute(def.getParentName() != null);
+ beanElement.setInnerBean(beanElement.getId() == null);
+
+ ConstructorArgumentValues args = def.getConstructorArgumentValues();
+ for (Map.Entry<Integer, ValueHolder> e: args.getIndexedArgumentValues().entrySet()) {
+ ValueHolder holder = e.getValue();
+ SpringConstructorArgElement arg = new SpringConstructorArgElement(holder.getType());
+ arg.setIndex(e.getKey());
+ beanElement.addCustructorArgs(arg);
+ }
+
+ MutablePropertyValues values = def.getPropertyValues();
+ for (PropertyValue p : values.getPropertyValueList()) {
+ SpringPropertyElement propertyElement = new SpringPropertyElement(p.getName());
+ Object value = p.getValue();
+ configurePropertyElement(propertyElement, value);
+ beanElement.getProperties().add(propertyElement);
+ }
+ }
+ }
+ return beanElements;
+ }
+
+ public void configurePropertyElement(SpringPropertyElement propertyElement, Object value) {
+ if (value instanceof BeanReference) {
+ BeanReference beanRef = (BeanReference)value;
+ propertyElement.addRef(beanRef.getBeanName());
+ } else if (value instanceof Collection) {
+ Collection collection = (Collection)value;
+ for (Object item : collection) {
+ configurePropertyElement(propertyElement, item);
+ }
+ } else if (value instanceof TypedStringValue) {
+ TypedStringValue stringValue = (TypedStringValue)value;
+ propertyElement.addValue(stringValue.getValue());
+ } else {
+ if (value != null) {
+ propertyElement.addValue(value.toString());
+ }
+ }
+ }
+
+ public List<SpringSCAPropertyElement> getPropertyElements() {
+ return propertyElements;
+ }
+
+ public List<SpringSCAServiceElement> getServiceElements() {
+ return serviceElements;
+ }
+
+ public List<SpringSCAReferenceElement> getReferenceElements() {
+ return referenceElements;
+ }
+
+ public <T> T[] getElements(Class<T> type) {
+ if (type.getSimpleName().equals(SpringSCAPropertyElement.class.getSimpleName())) {
+ T[] elements = (T[])Array.newInstance(type, getPropertyElements().size());
+ for (int i = 0; i < elements.length; i++) {
+ elements[i] = SpringElementTie.copy(getPropertyElements().get(i), type, type);
+ }
+ return elements;
+ } else if (type.getSimpleName().equals(SpringSCAReferenceElement.class.getSimpleName())) {
+ T[] elements = (T[])Array.newInstance(type, getReferenceElements().size());
+ for (int i = 0; i < elements.length; i++) {
+ elements[i] = SpringElementTie.copy(getReferenceElements().get(i), type, type);
+ }
+ return elements;
+ } else if (type.getSimpleName().equals(SpringSCAServiceElement.class.getSimpleName())) {
+ T[] elements = (T[])Array.newInstance(type, getServiceElements().size());
+ for (int i = 0; i < elements.length; i++) {
+ elements[i] = SpringElementTie.copy(getServiceElements().get(i), type, type);
+ }
+ return elements;
+ } else if (type.getSimpleName().equals(SpringBeanElement.class.getSimpleName())) {
+ T[] elements = (T[])Array.newInstance(type, getBeanElements().size());
+ for (int i = 0; i < elements.length; i++) {
+ elements[i] = SpringElementTie.copy(getBeanElements().get(i), type, type);
+ }
+ return elements;
+ } else {
+ throw new IllegalArgumentException(type + " is not supported");
+ }
+ }
+}
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SCAGenericApplicationContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SCAGenericApplicationContext.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SCAParentApplicationContext.java (from r987669, tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SCAParentApplicationContext.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SCAParentApplicationContext.java?p2=tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SCAParentApplicationContext.java&p1=tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SCAParentApplicationContext.java&r1=987669&r2=987670&rev=987670&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SCAParentApplicationContext.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SCAParentApplicationContext.java Fri Aug 20 23:42:07 2010
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tuscany.sca.implementation.spring.runtime.context;
+package org.apache.tuscany.sca.implementation.spring.context.tie;
import java.io.IOException;
import java.lang.annotation.Annotation;
@@ -46,7 +46,7 @@ import org.springframework.core.io.Resou
*
* @version $Rev$ $Date$
*/
-class SCAParentApplicationContext implements ApplicationContext {
+public class SCAParentApplicationContext implements ApplicationContext {
// The Spring implementation for which this is the parent application context
private SpringImplementationStub implementation;
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SCAParentApplicationContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SCAParentApplicationContext.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SpringContextTie.java (from r987669, tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SpringContextTie.java?p2=tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SpringContextTie.java&p1=tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java&r1=987669&r2=987670&rev=987670&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SpringContextTie.java Fri Aug 20 23:42:07 2010
@@ -17,22 +17,23 @@
* under the License.
*/
-package org.apache.tuscany.sca.implementation.spring.runtime.context;
+package org.apache.tuscany.sca.implementation.spring.context.tie;
import java.net.URL;
import java.util.List;
-import org.apache.tuscany.sca.implementation.spring.processor.ComponentNameAnnotationProcessor;
-import org.apache.tuscany.sca.implementation.spring.processor.ComponentStub;
-import org.apache.tuscany.sca.implementation.spring.processor.ConstructorAnnotationProcessor;
-import org.apache.tuscany.sca.implementation.spring.processor.InitDestroyAnnotationProcessor;
-import org.apache.tuscany.sca.implementation.spring.processor.PropertyAnnotationProcessor;
-import org.apache.tuscany.sca.implementation.spring.processor.PropertyValueStub;
-import org.apache.tuscany.sca.implementation.spring.processor.ReferenceAnnotationProcessor;
+import org.apache.tuscany.sca.implementation.spring.processor.tie.ComponentNameAnnotationProcessor;
+import org.apache.tuscany.sca.implementation.spring.processor.tie.ComponentStub;
+import org.apache.tuscany.sca.implementation.spring.processor.tie.ConstructorAnnotationProcessor;
+import org.apache.tuscany.sca.implementation.spring.processor.tie.InitDestroyAnnotationProcessor;
+import org.apache.tuscany.sca.implementation.spring.processor.tie.PropertyAnnotationProcessor;
+import org.apache.tuscany.sca.implementation.spring.processor.tie.PropertyValueStub;
+import org.apache.tuscany.sca.implementation.spring.processor.tie.ReferenceAnnotationProcessor;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.core.io.UrlResource;
@@ -53,6 +54,10 @@ public class SpringContextTie {
SCAParentApplicationContext scaParentContext = new SCAParentApplicationContext(implementation);
springContext = createApplicationContext(scaParentContext, resource);
}
+
+ public ApplicationContext getApplicationContext() {
+ return springContext;
+ }
public void start() {
// Do refresh here to ensure that Spring Beans are not touched before the SCA config process is complete...
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SpringContextTie.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SpringContextTie.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SpringImplementationStub.java (from r987669, tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringImplementationStub.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SpringImplementationStub.java?p2=tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SpringImplementationStub.java&p1=tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringImplementationStub.java&r1=987669&r2=987670&rev=987670&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringImplementationStub.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SpringImplementationStub.java Fri Aug 20 23:42:07 2010
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.tuscany.sca.implementation.spring.runtime.context;
+package org.apache.tuscany.sca.implementation.spring.context.tie;
import java.lang.reflect.Method;
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SpringImplementationStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SpringImplementationStub.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringBeanElement.java (from r987669, tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringBeanElement.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringBeanElement.java?p2=tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringBeanElement.java&p1=tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringBeanElement.java&r1=987669&r2=987670&rev=987670&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringBeanElement.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringBeanElement.java Fri Aug 20 23:42:07 2010
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tuscany.sca.implementation.spring.metadata;
+package org.apache.tuscany.sca.implementation.spring.elements.tie;
import java.util.ArrayList;
import java.util.List;
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringBeanElement.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringBeanElement.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringConstructorArgElement.java (from r987669, tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringConstructorArgElement.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringConstructorArgElement.java?p2=tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringConstructorArgElement.java&p1=tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringConstructorArgElement.java&r1=987669&r2=987670&rev=987670&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringConstructorArgElement.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringConstructorArgElement.java Fri Aug 20 23:42:07 2010
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tuscany.sca.implementation.spring.metadata;
+package org.apache.tuscany.sca.implementation.spring.elements.tie;
import java.util.ArrayList;
import java.util.List;
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringConstructorArgElement.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringConstructorArgElement.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringElementTie.java (from r987669, tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringElementTie.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringElementTie.java?p2=tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringElementTie.java&p1=tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringElementTie.java&r1=987669&r2=987670&rev=987670&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringElementTie.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringElementTie.java Fri Aug 20 23:42:07 2010
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.tuscany.sca.implementation.spring.metadata;
+package org.apache.tuscany.sca.implementation.spring.elements.tie;
import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringElementTie.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringElementTie.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringPropertyElement.java (from r987669, tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringPropertyElement.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringPropertyElement.java?p2=tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringPropertyElement.java&p1=tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringPropertyElement.java&r1=987669&r2=987670&rev=987670&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringPropertyElement.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringPropertyElement.java Fri Aug 20 23:42:07 2010
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tuscany.sca.implementation.spring.metadata;
+package org.apache.tuscany.sca.implementation.spring.elements.tie;
import java.util.ArrayList;
import java.util.List;
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringPropertyElement.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringPropertyElement.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAPropertyElement.java (from r987669, tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringSCAPropertyElement.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAPropertyElement.java?p2=tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAPropertyElement.java&p1=tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringSCAPropertyElement.java&r1=987669&r2=987670&rev=987670&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringSCAPropertyElement.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAPropertyElement.java Fri Aug 20 23:42:07 2010
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tuscany.sca.implementation.spring.metadata;
+package org.apache.tuscany.sca.implementation.spring.elements.tie;
/**
* Represents an <sca:property> element in a Spring application-context
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAPropertyElement.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAPropertyElement.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAReferenceElement.java (from r987669, tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringSCAReferenceElement.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAReferenceElement.java?p2=tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAReferenceElement.java&p1=tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringSCAReferenceElement.java&r1=987669&r2=987670&rev=987670&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringSCAReferenceElement.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAReferenceElement.java Fri Aug 20 23:42:07 2010
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tuscany.sca.implementation.spring.metadata;
+package org.apache.tuscany.sca.implementation.spring.elements.tie;
/**
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAReferenceElement.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAReferenceElement.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAServiceElement.java (from r987669, tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringSCAServiceElement.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAServiceElement.java?p2=tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAServiceElement.java&p1=tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringSCAServiceElement.java&r1=987669&r2=987670&rev=987670&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/metadata/SpringSCAServiceElement.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAServiceElement.java Fri Aug 20 23:42:07 2010
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tuscany.sca.implementation.spring.metadata;
+package org.apache.tuscany.sca.implementation.spring.elements.tie;
/**
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAServiceElement.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAServiceElement.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/SCANamespaceHandlerResolver.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/SCANamespaceHandlerResolver.java?rev=987670&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/SCANamespaceHandlerResolver.java (added)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/SCANamespaceHandlerResolver.java Fri Aug 20 23:42:07 2010
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+package org.apache.tuscany.sca.implementation.spring.namespace.tie;
+
+import org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver;
+import org.springframework.beans.factory.xml.NamespaceHandler;
+
+/**
+ * Overrides the default Spring namespace resolver to automatically register
+ * {@link ScaNamespaceHandler} instead of requiring a value to be supplied in a
+ * Spring configuration
+ *
+ * @version $Rev$ $Date$
+ */
+public class SCANamespaceHandlerResolver extends DefaultNamespaceHandlerResolver {
+ private static final String SCA_NAMESPACE = "http://www.springframework.org/schema/sca";
+
+ private ScaNamespaceHandler handler;
+
+ public SCANamespaceHandlerResolver(ClassLoader classLoader) {
+ super(classLoader);
+ handler = new ScaNamespaceHandler(/*componentType*/);
+ }
+
+ public SCANamespaceHandlerResolver(String handlerMappingsLocation, ClassLoader classLoader) {
+ super(classLoader, handlerMappingsLocation);
+ handler = new ScaNamespaceHandler(/*componentType*/);
+ }
+
+ @Override
+ public NamespaceHandler resolve(String namespaceUri) {
+ if (SCA_NAMESPACE.equals(namespaceUri)) {
+ return handler;
+ }
+ return super.resolve(namespaceUri);
+ }
+}
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/SCANamespaceHandlerResolver.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/SCANamespaceHandlerResolver.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaNamespaceHandler.java (from r987669, tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaNamespaceHandler.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaNamespaceHandler.java?p2=tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaNamespaceHandler.java&p1=tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaNamespaceHandler.java&r1=987669&r2=987670&rev=987670&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaNamespaceHandler.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaNamespaceHandler.java Fri Aug 20 23:42:07 2010
@@ -14,7 +14,7 @@
* limitations under the License.
*
*/
-package org.apache.tuscany.sca.implementation.spring.namespace;
+package org.apache.tuscany.sca.implementation.spring.namespace.tie;
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
@@ -26,10 +26,10 @@ import org.springframework.beans.factory
public class ScaNamespaceHandler extends NamespaceHandlerSupport {
public ScaNamespaceHandler() {
- init();
}
- public final void init() {
+ @Override
+ public void init() {
registerBeanDefinitionParser("reference", new ScaReferenceBeanDefinitionParser());
registerBeanDefinitionParser("service", new ScaServiceBeanDefinitionParser());
registerBeanDefinitionParser("property", new ScaPropertyBeanDefinitionParser());
Added: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaPropertyBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaPropertyBeanDefinitionParser.java?rev=987670&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaPropertyBeanDefinitionParser.java (added)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaPropertyBeanDefinitionParser.java Fri Aug 20 23:42:07 2010
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2002-2006 the original author or authors.
+ *
+ * Licensed 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.
+ *
+ */
+package org.apache.tuscany.sca.implementation.spring.namespace.tie;
+
+import org.apache.tuscany.sca.implementation.spring.context.tie.SCAGenericApplicationContext;
+import org.apache.tuscany.sca.implementation.spring.elements.tie.SpringSCAPropertyElement;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+import org.springframework.beans.factory.xml.BeanDefinitionParser;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.w3c.dom.Element;
+
+/**
+ * Parser for the <sca:reference> element
+ * @version $Rev$ $Date$
+ */
+public class ScaPropertyBeanDefinitionParser implements BeanDefinitionParser {
+
+ public BeanDefinition parse(Element element, ParserContext parserContext) {
+ BeanDefinitionRegistry registry = parserContext.getRegistry();
+ if (registry instanceof SCAGenericApplicationContext) {
+ SCAGenericApplicationContext context = (SCAGenericApplicationContext)registry;
+ SpringSCAPropertyElement propertyElement =
+ new SpringSCAPropertyElement(element.getAttributeNS(null, "name"), element.getAttributeNS(null, "type"));
+ context.addSCAPropertyElement(propertyElement);
+ }
+ // do nothing, this is handled by Tuscany
+ return null;
+ }
+}
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaPropertyBeanDefinitionParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaPropertyBeanDefinitionParser.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaReferenceBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaReferenceBeanDefinitionParser.java?rev=987670&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaReferenceBeanDefinitionParser.java (added)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaReferenceBeanDefinitionParser.java Fri Aug 20 23:42:07 2010
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2002-2006 the original author or authors.
+ *
+ * Licensed 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.
+ *
+ */
+package org.apache.tuscany.sca.implementation.spring.namespace.tie;
+
+import org.apache.tuscany.sca.implementation.spring.context.tie.SCAGenericApplicationContext;
+import org.apache.tuscany.sca.implementation.spring.elements.tie.SpringSCAReferenceElement;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+import org.springframework.beans.factory.xml.BeanDefinitionParser;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.w3c.dom.Element;
+
+/**
+ * Parser for the <sca:reference> element
+ *
+ * @version $Rev$ $Date$
+ */
+public class ScaReferenceBeanDefinitionParser implements BeanDefinitionParser {
+
+ public BeanDefinition parse(Element element, ParserContext parserContext) {
+ BeanDefinitionRegistry registry = parserContext.getRegistry();
+ if (registry instanceof SCAGenericApplicationContext) {
+ SCAGenericApplicationContext context = (SCAGenericApplicationContext)registry;
+ SpringSCAReferenceElement referenceElement =
+ new SpringSCAReferenceElement(element.getAttributeNS(null, "name"),
+ element.getAttributeNS(null, "type"));
+ referenceElement.setDefaultBean(element.getAttributeNS(null, "default"));
+ context.addSCAReferenceElement(referenceElement);
+ }
+
+ // do nothing, this is handled by Tuscany
+ return null;
+ }
+
+}
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaReferenceBeanDefinitionParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaReferenceBeanDefinitionParser.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaServiceBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaServiceBeanDefinitionParser.java?rev=987670&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaServiceBeanDefinitionParser.java (added)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaServiceBeanDefinitionParser.java Fri Aug 20 23:42:07 2010
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2002-2006 the original author or authors.
+ *
+ * Licensed 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.
+ *
+ */
+package org.apache.tuscany.sca.implementation.spring.namespace.tie;
+
+import org.apache.tuscany.sca.implementation.spring.context.tie.SCAGenericApplicationContext;
+import org.apache.tuscany.sca.implementation.spring.elements.tie.SpringSCAServiceElement;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+import org.springframework.beans.factory.xml.BeanDefinitionParser;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.w3c.dom.Element;
+
+/**
+ * Parser for the <sca:service/> element
+ *
+ * @version $Rev$ $Date$
+ */
+public class ScaServiceBeanDefinitionParser implements BeanDefinitionParser {
+
+ public BeanDefinition parse(Element element, ParserContext parserContext) {
+ BeanDefinitionRegistry registry = parserContext.getRegistry();
+ if (registry instanceof SCAGenericApplicationContext) {
+ SCAGenericApplicationContext context = (SCAGenericApplicationContext)registry;
+ SpringSCAServiceElement serviceElement =
+ new SpringSCAServiceElement(element.getAttributeNS(null, "name"),
+ element.getAttributeNS(null, "target"));
+ serviceElement.setType(element.getAttributeNS(null, "type"));
+ context.addSCAServiceElement(serviceElement);
+ }
+ // do nothing, handled by Tuscany
+ return null;
+ }
+
+}
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaServiceBeanDefinitionParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaServiceBeanDefinitionParser.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ComponentNameAnnotationProcessor.java (from r987669, tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ReferenceAnnotationProcessor.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ComponentNameAnnotationProcessor.java?p2=tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ComponentNameAnnotationProcessor.java&p1=tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ReferenceAnnotationProcessor.java&r1=987669&r2=987670&rev=987670&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ReferenceAnnotationProcessor.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ComponentNameAnnotationProcessor.java Fri Aug 20 23:42:07 2010
@@ -16,15 +16,16 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tuscany.sca.implementation.spring.processor;
+package org.apache.tuscany.sca.implementation.spring.processor.tie;
import java.beans.PropertyDescriptor;
import java.lang.annotation.Annotation;
+import java.lang.ref.Reference;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
-import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.ComponentName;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeansException;
import org.springframework.beans.FatalBeanException;
@@ -32,28 +33,29 @@ import org.springframework.beans.factory
import org.springframework.util.Assert;
import org.springframework.util.ReflectionUtils;
-public class ReferenceAnnotationProcessor implements BeanPostProcessor {
+public class ComponentNameAnnotationProcessor implements BeanPostProcessor {
- private Class<? extends Annotation> referenceAnnotationType = Reference.class;
- private ComponentStub component;
+ private Class<? extends Annotation> componentNameAnnotationType = ComponentName.class;
- public ReferenceAnnotationProcessor(ComponentStub component) {
- this.component = component;
+ private String componentName;
+
+ public ComponentNameAnnotationProcessor(String componentName) {
+ this.componentName = componentName;
}
/**
- * Gets referece annotation type.
+ * Gets componentName annotation type.
*/
- protected Class<? extends Annotation> getReferenceAnnotationType() {
- return this.referenceAnnotationType;
+ protected Class<? extends Annotation> getComponentNameAnnotationType() {
+ return this.componentNameAnnotationType;
}
/**
- * Sets referece annotation type.
+ * Sets componentName annotation type.
*/
- public void setReferenceAnnotationType(Class<? extends Annotation> referenceAnnotationType) {
- Assert.notNull(referenceAnnotationType, "'referenceAnnotationType' type must not be null.");
- this.referenceAnnotationType = referenceAnnotationType;
+ public void setComponentNameAnnotationType(Class<? extends Annotation> componentNameAnnotationType) {
+ Assert.notNull(componentNameAnnotationType, "'componentNameAnnotationType' type must not be null.");
+ this.componentNameAnnotationType = componentNameAnnotationType;
}
/**
@@ -82,86 +84,68 @@ public class ReferenceAnnotationProcesso
final Class<?> clazz = bean.getClass();
- ReflectionUtils.doWithMethods(clazz, new ReflectionUtils.MethodCallback() {
- public void doWith(Method method) {
-
- Reference annotation = (Reference)method.getAnnotation(getReferenceAnnotationType());
+ ReflectionUtils.doWithFields(clazz, new ReflectionUtils.FieldCallback() {
+ public void doWith(Field field) {
+ Annotation annotation = field.getAnnotation(getComponentNameAnnotationType());
if (annotation != null) {
- if (Modifier.isStatic(method.getModifiers())) {
- throw new IllegalStateException("Reference annotation is not supported on static methods");
+ if (Modifier.isStatic(field.getModifiers())) {
+ throw new IllegalStateException("ComponentName annotation is not supported on static fields");
}
- /*
- if (Modifier.isPrivate(method.getModifiers())) {
- throw new IllegalStateException("Reference annotation is not supported on private methods");
+ if (Modifier.isPrivate(field.getModifiers())) {
+ throw new IllegalStateException("ComponentName annotation is not supported on private fields");
}
- */
- if (method.getParameterTypes().length == 0) {
- throw new IllegalStateException(
- "Reference annotation requires at least one argument: " + method);
- }
+ ReflectionUtils.makeAccessible(field);
- PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method);
- if (pd != null) {
- String refName = annotation.name();
- if ("".equals(refName)) {
- injectReference(bean, pd, pd.getName());
- } else {
- injectReference(bean, pd, refName);
- }
+ if (field.getType().getName().equals("java.lang.String")) {
+ Object nameObj = componentName;
+ if (nameObj != null)
+ ReflectionUtils.setField(field, bean, nameObj);
+ } else {
+ throw new IllegalStateException(
+ "ComponentName annotation is supported only on java.lang.String field type.");
}
}
}
});
- ReflectionUtils.doWithFields(clazz, new ReflectionUtils.FieldCallback() {
- public void doWith(Field field) {
-
- Reference annotation = (Reference)field.getAnnotation(getReferenceAnnotationType());
+ ReflectionUtils.doWithMethods(clazz, new ReflectionUtils.MethodCallback() {
+ public void doWith(Method method) {
+ Annotation annotation = method.getAnnotation(getComponentNameAnnotationType());
if (annotation != null) {
- if (Modifier.isStatic(field.getModifiers())) {
- throw new IllegalStateException("Reference annotation is not supported on static fields");
+ if (Modifier.isStatic(method.getModifiers())) {
+ throw new IllegalStateException("ComponentName annotation is not supported on static methods");
}
- /*
- if (Modifier.isPrivate(field.getModifiers())) {
- throw new IllegalStateException("Reference annotation is not supported on private fields");
+ if (Modifier.isPrivate(method.getModifiers())) {
+ throw new IllegalStateException("ComponentName annotation is not supported on private methods");
}
- */
- ReflectionUtils.makeAccessible(field);
+ if (method.getParameterTypes().length == 0) {
+ throw new IllegalStateException(
+ "ComponentName annotation requires at least one argument: " + method);
+ }
+
+ PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method);
- Object referenceObj = null;
- String refName = annotation.name();
- if ("".equals(refName)) {
- referenceObj = component.getService(field.getType(), field.getName());
+ if (pd.getPropertyType().getName().equals("java.lang.String")) {
+ Object nameObj = componentName;
+ if (nameObj != null) {
+ try {
+ pd.getWriteMethod().invoke(bean, new Object[] {nameObj});
+ } catch (Throwable e) {
+ throw new FatalBeanException("Problem injecting reference: " + e.getMessage(), e);
+ }
+ }
} else {
- referenceObj = component.getService(field.getType(), refName);
+ throw new IllegalStateException(
+ "ComponentName annotation is supported only on java.lang.String field type.");
}
-
- if (referenceObj != null)
- ReflectionUtils.setField(field, bean, referenceObj);
}
}
});
}
-
- /**
- * Processes a property descriptor to inject a service.
- */
- public void injectReference(Object bean, PropertyDescriptor pd, String name) {
-
- Object referenceObj = component.getService(pd.getPropertyType(), name);
-
- if (referenceObj != null) {
- try {
- pd.getWriteMethod().invoke(bean, new Object[] {referenceObj});
- } catch (Throwable e) {
- throw new FatalBeanException("Problem injecting reference: " + e.getMessage(), e);
- }
- }
- }
}
Copied: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ComponentStub.java (from r987669, tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ComponentStub.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ComponentStub.java?p2=tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ComponentStub.java&p1=tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ComponentStub.java&r1=987669&r2=987670&rev=987670&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ComponentStub.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ComponentStub.java Fri Aug 20 23:42:07 2010
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.tuscany.sca.implementation.spring.processor;
+package org.apache.tuscany.sca.implementation.spring.processor.tie;
import java.lang.reflect.Method;
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ComponentStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ComponentStub.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ConstructorAnnotationProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ConstructorAnnotationProcessor.java?rev=987670&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ConstructorAnnotationProcessor.java (added)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ConstructorAnnotationProcessor.java Fri Aug 20 23:42:07 2010
@@ -0,0 +1,112 @@
+/*
+ * 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.
+ */
+package org.apache.tuscany.sca.implementation.spring.processor.tie;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter;
+import org.springframework.util.Assert;
+
+public class ConstructorAnnotationProcessor extends InstantiationAwareBeanPostProcessorAdapter {
+
+ private Class<? extends Annotation> constructorAnnotationType = org.oasisopen.sca.annotation.Constructor.class;
+
+ private Class<? extends Annotation> autowiredAnnotationType = Autowired.class;
+
+ public ConstructorAnnotationProcessor() {
+ // Default constructor.
+ }
+
+ /**
+ * Set the 'autowired' annotation type, to be used on constructors, fields,
+ * setter methods and arbitrary config methods.
+ */
+ public void setAutowiredAnnotationType(Class<? extends Annotation> autowiredAnnotationType) {
+ Assert.notNull(autowiredAnnotationType, "'autowiredAnnotationType' must not be null");
+ this.autowiredAnnotationType = autowiredAnnotationType;
+ }
+
+ /**
+ * Return the 'autowired' annotation type.
+ */
+ protected Class<? extends Annotation> getAutowiredAnnotationType() {
+ return this.autowiredAnnotationType;
+ }
+
+ /**
+ * Return the 'constructor' annotation type.
+ */
+ protected Class<? extends Annotation> getConstructorAnnotationType() {
+ return this.constructorAnnotationType;
+ }
+
+ /**
+ * Sets the 'constructor' annotation type.
+ */
+ public void setConstructorAnnotationType(Class<? extends Annotation> constructorAnnotationType) {
+ Assert.notNull(constructorAnnotationType, "'constructorAnnotationType' type must not be null.");
+ this.constructorAnnotationType = constructorAnnotationType;
+ }
+
+ /**
+ * This method is used to execute before a bean's initialization callback.
+ *
+ * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
+ */
+ public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
+ return bean;
+ }
+
+ /**
+ * This method is used to execute after a bean's initialization callback.
+ *
+ * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
+ */
+ public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
+ return bean;
+ }
+
+ public Constructor[] determineCandidateConstructors(Class beanClass, String beanName) throws BeansException {
+ /*Constructor[] declaredConstructors = beanClass.getDeclaredConstructors();
+ Method[] declaredMethods = beanClass.getDeclaredMethods();
+ List candidates = new ArrayList(declaredConstructors.length);
+
+ for (int i = 0; i < declaredMethods.length; i++) {
+ Method method = declaredMethods[i];
+ Annotation annotation = method.getAnnotation(getConstructorAnnotationType());
+ if (annotation != null) {
+ if (Modifier.isStatic(method.getModifiers())) {
+ throw new IllegalStateException("Constructor annotation is not supported on static methods");
+ }
+
+ if (candidates.size() == 1) {
+ throw new IllegalStateException("Only one method is allowed to have constructor annotation in a bean: " + method);
+ }
+
+ candidates.add(method);
+ }
+ }
+
+ return (Constructor[]) candidates.toArray(new Constructor[candidates.size()]);*/
+ return null;
+ }
+}
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ConstructorAnnotationProcessor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ConstructorAnnotationProcessor.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/InitDestroyAnnotationProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/InitDestroyAnnotationProcessor.java?rev=987670&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/InitDestroyAnnotationProcessor.java (added)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/InitDestroyAnnotationProcessor.java Fri Aug 20 23:42:07 2010
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ */
+package org.apache.tuscany.sca.implementation.spring.processor.tie;
+
+import java.lang.annotation.Annotation;
+
+import org.oasisopen.sca.annotation.Destroy;
+import org.oasisopen.sca.annotation.Init;
+import org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor;
+
+public class InitDestroyAnnotationProcessor extends InitDestroyAnnotationBeanPostProcessor {
+
+ private static final long serialVersionUID = 0;
+
+ private Class<? extends Annotation> initAnnotationType = Init.class;
+ private Class<? extends Annotation> destroyAnnotationType = Destroy.class;
+
+ /**
+ * Gets init annotation type.
+ */
+ protected Class<? extends Annotation> getInitAnnotationType() {
+ return this.initAnnotationType;
+ }
+
+ /**
+ * Sets init annotation type.
+ */
+ /*
+ * public void setInitAnnotationType(Class<? extends Annotation>
+ * initAnnotationType) { Assert.notNull(initAnnotationType,
+ * "Init annotation type must not be null."); this.initAnnotationType =
+ * initAnnotationType; }
+ */
+
+ /**
+ * Gets destroy annotation type.
+ */
+ protected Class<? extends Annotation> getDestroyAnnotationType() {
+ return this.destroyAnnotationType;
+ }
+
+ /**
+ * Sets destroy annotation type.
+ */
+ /*
+ * public void setDestroyAnnotationType(Class<? extends Annotation>
+ * destroyAnnotationType) { Assert.notNull(destroyAnnotationType,
+ * "Destroy annotation type must not be null."); this.destroyAnnotationType
+ * = destroyAnnotationType; }
+ */
+
+ public InitDestroyAnnotationProcessor() {
+ // Set the @Init annotation type
+ setInitAnnotationType(initAnnotationType);
+
+ // Set the @Destroy annotation type
+ setDestroyAnnotationType(destroyAnnotationType);
+ }
+}
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/InitDestroyAnnotationProcessor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/InitDestroyAnnotationProcessor.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/PropertyAnnotationProcessor.java (from r987669, tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyAnnotationProcessor.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/PropertyAnnotationProcessor.java?p2=tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/PropertyAnnotationProcessor.java&p1=tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyAnnotationProcessor.java&r1=987669&r2=987670&rev=987670&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyAnnotationProcessor.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/PropertyAnnotationProcessor.java Fri Aug 20 23:42:07 2010
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tuscany.sca.implementation.spring.processor;
+package org.apache.tuscany.sca.implementation.spring.processor.tie;
import java.beans.PropertyDescriptor;
import java.lang.annotation.Annotation;
Copied: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/PropertyValueStub.java (from r987669, tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyValueStub.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/PropertyValueStub.java?p2=tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/PropertyValueStub.java&p1=tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyValueStub.java&r1=987669&r2=987670&rev=987670&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyValueStub.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/PropertyValueStub.java Fri Aug 20 23:42:07 2010
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.tuscany.sca.implementation.spring.processor;
+package org.apache.tuscany.sca.implementation.spring.processor.tie;
import java.lang.reflect.Method;
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/PropertyValueStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/PropertyValueStub.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ReferenceAnnotationProcessor.java (from r987669, tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ReferenceAnnotationProcessor.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ReferenceAnnotationProcessor.java?p2=tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ReferenceAnnotationProcessor.java&p1=tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ReferenceAnnotationProcessor.java&r1=987669&r2=987670&rev=987670&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ReferenceAnnotationProcessor.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ReferenceAnnotationProcessor.java Fri Aug 20 23:42:07 2010
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tuscany.sca.implementation.spring.processor;
+package org.apache.tuscany.sca.implementation.spring.processor.tie;
import java.beans.PropertyDescriptor;
import java.lang.annotation.Annotation;
Copied: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/SpringXMLLoaderTie.java (from r987669, tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/SpringXMLLoaderTie.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/SpringXMLLoaderTie.java?p2=tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/SpringXMLLoaderTie.java&p1=tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/SpringXMLLoaderTie.java&r1=987669&r2=987670&rev=987670&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/SpringXMLLoaderTie.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/SpringXMLLoaderTie.java Fri Aug 20 23:42:07 2010
@@ -17,12 +17,12 @@
* under the License.
*/
-package org.apache.tuscany.sca.implementation.spring.processor;
+package org.apache.tuscany.sca.implementation.spring.processor.tie;
import java.net.URL;
import java.util.List;
-import org.apache.tuscany.sca.implementation.spring.runtime.context.SCAGenericApplicationContext;
+import org.apache.tuscany.sca.implementation.spring.context.tie.SCAGenericApplicationContext;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.ApplicationContext;
import org.springframework.core.io.UrlResource;
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/SpringXMLLoaderTie.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/SpringXMLLoaderTie.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/resources/META-INF/spring.handlers
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/resources/META-INF/spring.handlers?rev=987670&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/resources/META-INF/spring.handlers (added)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/resources/META-INF/spring.handlers Fri Aug 20 23:42:07 2010
@@ -0,0 +1 @@
+http\://www.springframework.org/schema/sca=org.apache.tuscany.sca.implementation.spring.namespace.tie.ScaNamespaceHandler
Added: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/resources/META-INF/spring.schemas
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/resources/META-INF/spring.schemas?rev=987670&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/resources/META-INF/spring.schemas (added)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/resources/META-INF/spring.schemas Fri Aug 20 23:42:07 2010
@@ -0,0 +1 @@
+http\://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd=org/springframework/sca/xml/spring-sca.xsd
Added: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/resources/org/springframework/sca/xml/spring-sca.xsd
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/resources/org/springframework/sca/xml/spring-sca.xsd?rev=987670&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/resources/org/springframework/sca/xml/spring-sca.xsd (added)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/resources/org/springframework/sca/xml/spring-sca.xsd Fri Aug 20 23:42:07 2010
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<xsd:schema xmlns="http://www.springframework.org/schema/sca" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ attributeFormDefault="unqualified" elementFormDefault="qualified"
+ targetNamespace="http://www.springframework.org/schema/sca">
+
+ <xsd:element name="reference">
+ <xsd:complexType>
+ <xsd:attribute name="name" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="type" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="default" use="optional">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="property">
+ <xsd:complexType>
+ <xsd:attribute name="id" use="optional">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="name" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="type" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="service">
+ <xsd:complexType>
+ <xsd:attribute name="name" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="type" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="target" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+
+</xsd:schema>
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/resources/org/springframework/sca/xml/spring-sca.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-spring-tie/src/main/resources/org/springframework/sca/xml/spring-sca.xsd
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: tuscany/sca-java-2.x/trunk/modules/implementation-spring/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring/META-INF/MANIFEST.MF?rev=987670&r1=987669&r2=987670&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring/META-INF/MANIFEST.MF (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring/META-INF/MANIFEST.MF Fri Aug 20 23:42:07 2010
@@ -41,22 +41,10 @@ Bundle-SymbolicName: org.apache.tuscany.
Bundle-DocURL: http://www.apache.org/
Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
Export-Package: org.apache.tuscany.sca.implementation.spring;version="2.0.0",
- org.apache.tuscany.sca.implementation.spring.introspect;version="2.0.0";
- uses:="org.apache.tuscany.sca.assembly,
+ org.apache.tuscany.sca.implementation.spring.xml;version="2.0.0";
+ uses:="javax.xml.stream,
org.apache.tuscany.sca.contribution.resolver,
- org.apache.tuscany.sca.implementation.java.introspect,
org.apache.tuscany.sca.implementation.spring,
org.apache.tuscany.sca.contribution.processor,
- org.apache.tuscany.sca.implementation.java,
org.apache.tuscany.sca.core,
- org.apache.tuscany.sca.monitor,
- org.apache.tuscany.sca.interfacedef.java",
- org.apache.tuscany.sca.implementation.spring.invocation;version="2.0.0";
- uses:="org.apache.tuscany.sca.invocation,
- org.apache.tuscany.sca.runtime,
- org.apache.tuscany.sca.context,
- org.apache.tuscany.sca.provider,
- org.apache.tuscany.sca.implementation.spring,
- org.apache.tuscany.sca.core,
- org.apache.tuscany.sca.core.invocation,
- org.apache.tuscany.sca.interfacedef"
+ javax.xml.namespace"