diff options
Diffstat (limited to '')
11 files changed, 167 insertions, 8 deletions
diff --git a/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SCAApplicationContext.java b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/impl/SCAApplicationContext.java index b550fc3229..6ed1840b6b 100644 --- a/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SCAApplicationContext.java +++ b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/impl/SCAApplicationContext.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.tuscany.sca.implementation.spring; +package org.apache.tuscany.sca.implementation.spring.impl; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.context.ApplicationContext; diff --git a/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SCANamespaceHandlerResolver.java b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/impl/SCANamespaceHandlerResolver.java index 32f575fe46..4e1c861910 100644 --- a/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SCANamespaceHandlerResolver.java +++ b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/impl/SCANamespaceHandlerResolver.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.tuscany.sca.implementation.spring; +package org.apache.tuscany.sca.implementation.spring.impl; import org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver; import org.springframework.beans.factory.xml.NamespaceHandler; diff --git a/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SCAParentApplicationContext.java b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/impl/SCAParentApplicationContext.java index d419d6db68..d654d1172a 100644 --- a/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SCAParentApplicationContext.java +++ b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/impl/SCAParentApplicationContext.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.tuscany.sca.implementation.spring; +package org.apache.tuscany.sca.implementation.spring.impl; import java.io.IOException; import java.util.List; @@ -29,6 +29,7 @@ import org.apache.tuscany.sca.assembly.Reference; import org.apache.tuscany.sca.core.factory.ObjectFactory; import org.apache.tuscany.sca.core.invocation.ProxyFactory; import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory; +import org.apache.tuscany.sca.implementation.spring.SpringImplementation; import org.apache.tuscany.sca.interfacedef.java.JavaInterface; import org.apache.tuscany.sca.runtime.RuntimeComponent; import org.springframework.beans.BeansException; @@ -54,7 +55,7 @@ import org.springframework.core.io.Resource; * * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $ */ -class SCAParentApplicationContext implements ApplicationContext { +public class SCAParentApplicationContext implements ApplicationContext { // The Spring implementation for which this is the parent application context private SpringImplementation implementation; diff --git a/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/impl/ScaNamespaceHandler.java b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/impl/ScaNamespaceHandler.java new file mode 100644 index 0000000000..5f7614a68e --- /dev/null +++ b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/impl/ScaNamespaceHandler.java @@ -0,0 +1,40 @@ +/* + * 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.impl; + +import org.springframework.beans.factory.xml.NamespaceHandlerSupport; + +/** + * Handler for the <sca:> namespace in an application context + * + * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $ + */ +public class ScaNamespaceHandler extends NamespaceHandlerSupport { + + public ScaNamespaceHandler() { + init(); + } + + public final void init() { + registerBeanDefinitionParser("reference", new ScaReferenceBeanDefinitionParser()); + registerBeanDefinitionParser("service", new ScaServiceBeanDefinitionParser()); + registerBeanDefinitionParser("property", new ScaPropertyBeanDefinitionParser()); + } + +} diff --git a/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/impl/ScaPropertyBeanDefinitionParser.java b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/impl/ScaPropertyBeanDefinitionParser.java new file mode 100644 index 0000000000..a025d23b9f --- /dev/null +++ b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/impl/ScaPropertyBeanDefinitionParser.java @@ -0,0 +1,37 @@ +/* + * 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.impl; + +import org.springframework.beans.factory.config.BeanDefinition; +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: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $ + */ +public class ScaPropertyBeanDefinitionParser implements BeanDefinitionParser { + + public BeanDefinition parse(Element element, ParserContext parserContext) { + // do nothing, this is handled by Tuscany + return null; + } + +} diff --git a/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/impl/ScaReferenceBeanDefinitionParser.java b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/impl/ScaReferenceBeanDefinitionParser.java new file mode 100644 index 0000000000..178f538339 --- /dev/null +++ b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/impl/ScaReferenceBeanDefinitionParser.java @@ -0,0 +1,38 @@ +/* + * 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.impl; + +import org.springframework.beans.factory.config.BeanDefinition; +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: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $ + */ +public class ScaReferenceBeanDefinitionParser implements BeanDefinitionParser { + + public BeanDefinition parse(Element element, ParserContext parserContext) { + // do nothing, this is handled by Tuscany + return null; + } + +} diff --git a/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/impl/ScaServiceBeanDefinitionParser.java b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/impl/ScaServiceBeanDefinitionParser.java new file mode 100644 index 0000000000..ae5093dbea --- /dev/null +++ b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/impl/ScaServiceBeanDefinitionParser.java @@ -0,0 +1,38 @@ +/* + * 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.impl; + +import org.springframework.beans.factory.config.BeanDefinition; +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: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $ + */ +public class ScaServiceBeanDefinitionParser implements BeanDefinitionParser { + + public BeanDefinition parse(Element element, ParserContext parserContext) { + // do nothing, handled by Tuscany + return null; + } + +} diff --git a/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProvider.java b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringImplementationProvider.java index d7724f1723..f780c71549 100644 --- a/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProvider.java +++ b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringImplementationProvider.java @@ -17,10 +17,13 @@ * under the License. */ -package org.apache.tuscany.sca.implementation.spring; +package org.apache.tuscany.sca.implementation.spring.provider; import org.apache.tuscany.sca.core.invocation.ProxyFactory; import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory; +import org.apache.tuscany.sca.implementation.spring.SpringImplementation; +import org.apache.tuscany.sca.implementation.spring.impl.SCAApplicationContext; +import org.apache.tuscany.sca.implementation.spring.impl.SCAParentApplicationContext; import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.invocation.Invoker; import org.apache.tuscany.sca.provider.ImplementationProvider; diff --git a/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProviderFactory.java b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringImplementationProviderFactory.java index f2bb1fd6e8..eb83a92f6a 100644 --- a/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProviderFactory.java +++ b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringImplementationProviderFactory.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.tuscany.sca.implementation.spring; +package org.apache.tuscany.sca.implementation.spring.provider; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory; @@ -26,6 +26,7 @@ import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; import org.apache.tuscany.sca.databinding.TransformerExtensionPoint; import org.apache.tuscany.sca.databinding.impl.MediatorImpl; import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory; +import org.apache.tuscany.sca.implementation.spring.SpringImplementation; import org.apache.tuscany.sca.provider.ImplementationProvider; import org.apache.tuscany.sca.provider.ImplementationProviderFactory; import org.apache.tuscany.sca.runtime.RuntimeComponent; diff --git a/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringInvocationException.java b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringInvocationException.java index 410525a054..a195549851 100644 --- a/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringInvocationException.java +++ b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringInvocationException.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.tuscany.sca.implementation.spring; +package org.apache.tuscany.sca.implementation.spring.provider; /** * @version $Rev$ $Date$ diff --git a/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringInvoker.java b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringInvoker.java index 5eeb802727..b63518d1c7 100644 --- a/branches/sca-equinox/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringInvoker.java +++ b/branches/sca-equinox/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringInvoker.java @@ -16,11 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.tuscany.sca.implementation.spring; +package org.apache.tuscany.sca.implementation.spring.provider; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import org.apache.tuscany.sca.implementation.spring.SpringImplementation; import org.apache.tuscany.sca.implementation.spring.xml.SpringBeanElement; import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil; |