From 4e13586bc791d71c41760cf4d0a5cc908973de3e Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:09:18 +0000 Subject: Moving 2.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835134 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/provider/BindingProviderFactory.java | 60 --- .../DefaultDefinitionsProviderExtensionPoint.java | 93 ---- .../DefaultProviderFactoryExtensionPoint.java | 505 --------------------- .../tuscany/sca/provider/DefinitionsProvider.java | 33 -- .../sca/provider/DefinitionsProviderException.java | 30 -- .../DefinitionsProviderExtensionPoint.java | 35 -- .../sca/provider/ImplementationProvider.java | 68 --- .../provider/ImplementationProviderFactory.java | 42 -- .../sca/provider/OperationSelectorProvider.java | 39 -- .../provider/OperationSelectorProviderFactory.java | 53 --- .../tuscany/sca/provider/PolicyImplementor.java | 38 -- .../tuscany/sca/provider/PolicyProvider.java | 41 -- .../sca/provider/PolicyProviderFactory.java | 62 --- .../tuscany/sca/provider/PolicyProviderRRB.java | 37 -- .../tuscany/sca/provider/ProviderFactory.java | 36 -- .../provider/ProviderFactoryExtensionPoint.java | 63 --- .../sca/provider/ReferenceBindingProvider.java | 76 ---- .../sca/provider/ReferenceBindingProviderRRB.java | 35 -- .../sca/provider/ServiceBindingProvider.java | 63 --- .../sca/provider/ServiceBindingProviderRRB.java | 35 -- .../tuscany/sca/provider/WireFormatProvider.java | 51 --- .../sca/provider/WireFormatProviderFactory.java | 53 --- 22 files changed, 1548 deletions(-) delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingProviderFactory.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultDefinitionsProviderExtensionPoint.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProvider.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProviderException.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProviderExtensionPoint.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProvider.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProviderFactory.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProvider.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProviderFactory.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyImplementor.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProvider.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderFactory.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderRRB.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactory.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactoryExtensionPoint.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProvider.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProviderRRB.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProvider.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProviderRRB.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProvider.java delete mode 100644 branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProviderFactory.java (limited to 'branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider') diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingProviderFactory.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingProviderFactory.java deleted file mode 100644 index 0f6a932c51..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingProviderFactory.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.provider; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; - -/** - * A factory for creating the runtime artifacts that represent bindings. - * - * @version $Rev$ $Date$ - */ -public interface BindingProviderFactory extends ProviderFactory { - - /** - * Creates a new reference binding provider for the given component and - * reference. - * - * @param component The runtime component - * @param reference The reference on the runtime component - * @param binding The binding assembly model object - * @return The binding provider - */ - ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component, - RuntimeComponentReference reference, - M binding); - - /** - * Creates a new service binding provider for the given component and - * service. - * - * @param component The runtime component - * @param service The service on the runtime component - * @param binding The binding assembly model object - * @return The binding provider - */ - ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component, - RuntimeComponentService service, - M binding); - -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultDefinitionsProviderExtensionPoint.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultDefinitionsProviderExtensionPoint.java deleted file mode 100644 index fc1c2ed5af..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultDefinitionsProviderExtensionPoint.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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.provider; - -import java.lang.reflect.Constructor; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.extensibility.ServiceDeclaration; -import org.apache.tuscany.sca.extensibility.ServiceDiscovery; - -/** - * Concrete Implementation for the SCADefinitionsProviderExtensionPoint - * - * @version $Rev$ $Date$ - */ -public class DefaultDefinitionsProviderExtensionPoint implements - DefinitionsProviderExtensionPoint { - - private ExtensionPointRegistry extensionPointRegistry = null; - - private boolean loaded; - private List scaDefnsProviders = new ArrayList(); - - public DefaultDefinitionsProviderExtensionPoint(ExtensionPointRegistry extnPtReg) { - this.extensionPointRegistry = extnPtReg; - } - - public void addDefinitionsProvider(DefinitionsProvider provider) { - scaDefnsProviders.add(provider); - } - - public void removeDefinitionsProvider(DefinitionsProvider provider) { - scaDefnsProviders.remove(provider); - } - - public List getDefinitionsProviders() { - loadProviders(); - return scaDefnsProviders; - } - - private synchronized void loadProviders() { - if(loaded) { - return; - } - // Get the provider service declarations - Set defnProviderDecls; - DefinitionsProvider aProvider = null; - Class providerClass = null; - Constructor constructor = null; - - try { - defnProviderDecls = - ServiceDiscovery.getInstance().getServiceDeclarations(DefinitionsProvider.class.getName()); - - for (ServiceDeclaration aDefnProviderDecl : defnProviderDecls) { - providerClass = aDefnProviderDecl.loadClass(); - - try { - constructor = providerClass.getConstructor(); - aProvider = (DefinitionsProvider)constructor.newInstance(); - } catch (NoSuchMethodException e1) { - constructor = providerClass.getConstructor(ExtensionPointRegistry.class); - aProvider = (DefinitionsProvider)constructor.newInstance(extensionPointRegistry); - } - - scaDefnsProviders.add(aProvider); - } - } catch (Exception e) { - throw new RuntimeException(e); - } - loaded = true; - } -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java deleted file mode 100644 index 518927939f..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java +++ /dev/null @@ -1,505 +0,0 @@ -/* - * 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.provider; - -import java.lang.reflect.Constructor; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Implementation; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.extensibility.ServiceDeclaration; -import org.apache.tuscany.sca.extensibility.ServiceDiscovery; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; - -/** - * Default implementation of a provider factory extension point. - * - * @version $Rev$ $Date$ - */ -public class DefaultProviderFactoryExtensionPoint implements ProviderFactoryExtensionPoint { - - private ExtensionPointRegistry registry; - private final Map, ProviderFactory> providerFactories = new HashMap, ProviderFactory>(); - private final List policyProviderFactories = new ArrayList(); - private boolean loaded; - - /** - * The default constructor. Does nothing. - * - */ - public DefaultProviderFactoryExtensionPoint(ExtensionPointRegistry registry) { - this.registry = registry; - } - - /** - * Add a provider factory. - * - * @param providerFactory The provider factory - */ - public void addProviderFactory(ProviderFactory providerFactory) { - if(providerFactory instanceof PolicyProviderFactory) { - policyProviderFactories.add((PolicyProviderFactory)providerFactory); - } - providerFactories.put(providerFactory.getModelType(), providerFactory); - } - - /** - * Remove a provider factory. - * - * @param providerFactory The provider factory - */ - public void removeProviderFactory(ProviderFactory providerFactory) { - if(providerFactory instanceof PolicyProviderFactory) { - policyProviderFactories.remove((PolicyProviderFactory)providerFactory); - } - providerFactories.remove(providerFactory.getModelType()); - } - - /** - * Returns the provider factory associated with the given model type. - * @param modelType A model type - * @return The provider factory associated with the given model type - */ - public ProviderFactory getProviderFactory(Class modelType) { - loadProviderFactories(); - - Class[] classes = modelType.getInterfaces(); - for (Class c : classes) { - ProviderFactory factory = providerFactories.get(c); - if (factory != null) { - return factory; - } - } - return providerFactories.get(modelType); - } - - public List getPolicyProviderFactories() { - loadProviderFactories(); - return policyProviderFactories; - } - - /** - * Load provider factories declared under META-INF/services. - * @param registry - */ - private synchronized void loadProviderFactories() { - if (loaded) - return; - - loadProviderFactories(BindingProviderFactory.class); - loadProviderFactories(ImplementationProviderFactory.class); - loadProviderFactories(PolicyProviderFactory.class); - loadProviderFactories(WireFormatProviderFactory.class); - loadProviderFactories(OperationSelectorProviderFactory.class); - - loaded = true; - } - - /** - * Load provider factories declared under META-INF/services. - * @param registry - * @param factoryClass - * @return - */ - private List loadProviderFactories(Class factoryClass) { - - // Get the provider factory service declarations - Set factoryDeclarations; - ServiceDiscovery serviceDiscovery = ServiceDiscovery.getInstance(); - try { - factoryDeclarations = serviceDiscovery.getServiceDeclarations(factoryClass.getName()); - } catch (Exception e) { - throw new IllegalStateException(e); - } - - // Get the target extension point - ProviderFactoryExtensionPoint factoryExtensionPoint = - registry.getExtensionPoint(ProviderFactoryExtensionPoint.class); - List factories = new ArrayList(); - - for (ServiceDeclaration factoryDeclaration : factoryDeclarations) { - Map attributes = factoryDeclaration.getAttributes(); - - // Load an implementation provider factory - if (factoryClass == ImplementationProviderFactory.class) { - String modelTypeName = attributes.get("model"); - - // Create a provider factory wrapper and register it - ImplementationProviderFactory factory = - new LazyImplementationProviderFactory(registry, modelTypeName, factoryDeclaration); - factoryExtensionPoint.addProviderFactory(factory); - factories.add(factory); - - } else if (factoryClass == BindingProviderFactory.class) { - - // Load a binding provider factory - String modelTypeName = attributes.get("model"); - - // Create a provider factory wrapper and register it - BindingProviderFactory factory = - new LazyBindingProviderFactory(registry, modelTypeName, factoryDeclaration); - factoryExtensionPoint.addProviderFactory(factory); - factories.add(factory); - } else if (factoryClass == PolicyProviderFactory.class) { - // Load a policy provider factory - String modelTypeName = attributes.get("model"); - - // Create a provider factory wrapper and register it - PolicyProviderFactory factory = - new LazyPolicyProviderFactory(registry, modelTypeName, factoryDeclaration); - factoryExtensionPoint.addProviderFactory(factory); - factories.add(factory); - } else if (factoryClass == WireFormatProviderFactory.class) { - - // Load a wire format provider factory - String modelTypeName = attributes.get("model"); - - // Create a provider factory wrapper and register it - WireFormatProviderFactory factory = - new LazyWireFormatProviderFactory(registry, modelTypeName, factoryDeclaration); - factoryExtensionPoint.addProviderFactory(factory); - factories.add(factory); - } else if (factoryClass == OperationSelectorProviderFactory.class) { - - // Load a wire format provider factory - String modelTypeName = attributes.get("model"); - - // Create a provider factory wrapper and register it - OperationSelectorProviderFactory factory = - new LazyOperationSelectorProviderFactory(registry, modelTypeName, factoryDeclaration); - factoryExtensionPoint.addProviderFactory(factory); - factories.add(factory); - } - } - return factories; - } - - /** - * A wrapper around an implementation provider factory allowing lazy - * loading and initialization of implementation providers. - */ - private static class LazyBindingProviderFactory implements BindingProviderFactory { - - private ExtensionPointRegistry registry; - private String modelTypeName; - private ServiceDeclaration factoryDeclaration; - private BindingProviderFactory factory; - private Class modelType; - - private LazyBindingProviderFactory(ExtensionPointRegistry registry, - String modelTypeName, - ServiceDeclaration factoryDeclaration) { - this.registry = registry; - this.modelTypeName = modelTypeName; - this.factoryDeclaration = factoryDeclaration; - } - - @SuppressWarnings("unchecked") - private BindingProviderFactory getFactory() { - if (factory == null) { - try { - Class factoryClass = - (Class)factoryDeclaration.loadClass(); - Constructor constructor = - factoryClass.getConstructor(ExtensionPointRegistry.class); - factory = constructor.newInstance(registry); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return factory; - } - - @SuppressWarnings("unchecked") - public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component, - RuntimeComponentReference reference, - Binding binding) { - return getFactory().createReferenceBindingProvider(component, reference, binding); - } - - @SuppressWarnings("unchecked") - public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component, - RuntimeComponentService service, - Binding binding) { - return getFactory().createServiceBindingProvider(component, service, binding); - } - - public Class getModelType() { - if (modelType == null) { - try { - modelType = factoryDeclaration.loadClass(modelTypeName); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return modelType; - } - - } - - /** - * A wrapper around an implementation provider factory allowing lazy - * loading and initialization of implementation providers. - */ - private class LazyImplementationProviderFactory implements ImplementationProviderFactory { - - private ExtensionPointRegistry registry; - private String modelTypeName; - private ServiceDeclaration providerClass; - private ImplementationProviderFactory factory; - private Class modelType; - - private LazyImplementationProviderFactory(ExtensionPointRegistry registry, - String modelTypeName, - ServiceDeclaration providerClass) { - this.registry = registry; - this.modelTypeName = modelTypeName; - this.providerClass = providerClass; - } - - @SuppressWarnings("unchecked") - private ImplementationProviderFactory getFactory() { - if (factory == null) { - try { - Class factoryClass = - (Class)providerClass.loadClass(); - Constructor constructor = - factoryClass.getConstructor(ExtensionPointRegistry.class); - factory = constructor.newInstance(registry); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return factory; - } - - @SuppressWarnings("unchecked") - public ImplementationProvider createImplementationProvider(RuntimeComponent component, - Implementation Implementation) { - return getFactory().createImplementationProvider(component, Implementation); - } - - public Class getModelType() { - if (modelType == null) { - try { - - modelType = providerClass.loadClass(modelTypeName); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return modelType; - } - - } - - /** - * A wrapper around an policy provider factory allowing lazy - * loading and initialization of policy providers. - */ - private class LazyPolicyProviderFactory implements PolicyProviderFactory { - private ExtensionPointRegistry registry; - private String modelTypeName; - private ServiceDeclaration providerClass; - private PolicyProviderFactory factory; - private Class modelType; - - private LazyPolicyProviderFactory(ExtensionPointRegistry registry, - String modelTypeName, - ServiceDeclaration providerClass) { - this.registry = registry; - this.modelTypeName = modelTypeName; - this.providerClass = providerClass; - } - - @SuppressWarnings("unchecked") - private PolicyProviderFactory getFactory() { - if (factory == null) { - try { - Class factoryClass = (Class)providerClass.loadClass(); - Constructor constructor = - factoryClass.getConstructor(ExtensionPointRegistry.class); - factory = constructor.newInstance(registry); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return factory; - } - - public PolicyProvider createImplementationPolicyProvider(RuntimeComponent component, - Implementation implementation) { - return getFactory().createImplementationPolicyProvider(component, implementation); - } - - public PolicyProvider createReferencePolicyProvider(RuntimeComponent component, - RuntimeComponentReference reference, - Binding binding) { - return getFactory().createReferencePolicyProvider(component, reference, binding); - } - - public PolicyProvider createServicePolicyProvider(RuntimeComponent component, - RuntimeComponentService service, - Binding binding) { - return getFactory().createServicePolicyProvider(component, service, binding); - } - - public Class getModelType() { - if (modelType == null) { - try { - modelType = providerClass.loadClass(modelTypeName); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return modelType; - } - } - - /** - * A wrapper around a wire format provider factory allowing lazy - * loading and initialization of wire format providers. - */ - private class LazyWireFormatProviderFactory implements WireFormatProviderFactory { - - private ExtensionPointRegistry registry; - private String modelTypeName; - private ServiceDeclaration providerClass; - private WireFormatProviderFactory factory; - private Class modelType; - - private LazyWireFormatProviderFactory(ExtensionPointRegistry registry, - String modelTypeName, - ServiceDeclaration providerClass) { - this.registry = registry; - this.modelTypeName = modelTypeName; - this.providerClass = providerClass; - } - - @SuppressWarnings("unchecked") - private WireFormatProviderFactory getFactory() { - if (factory == null) { - try { - Class factoryClass = - (Class)providerClass.loadClass(); - Constructor constructor = - factoryClass.getConstructor(ExtensionPointRegistry.class); - factory = constructor.newInstance(registry); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return factory; - } - - public WireFormatProvider createReferenceWireFormatProvider(RuntimeComponent component, - RuntimeComponentReference reference, - Binding binding){ - return getFactory().createReferenceWireFormatProvider(component, reference, binding); - } - - public WireFormatProvider createServiceWireFormatProvider(RuntimeComponent component, - RuntimeComponentService service, - Binding binding){ - return getFactory().createServiceWireFormatProvider(component, service, binding); - } - - public Class getModelType() { - if (modelType == null) { - try { - - modelType = providerClass.loadClass(modelTypeName); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return modelType; - } - } - - /** - * A wrapper around a operation selector provider factory allowing lazy - * loading and initialization of operation selector providers. - */ - private class LazyOperationSelectorProviderFactory implements OperationSelectorProviderFactory { - - private ExtensionPointRegistry registry; - private String modelTypeName; - private ServiceDeclaration providerClass; - private OperationSelectorProviderFactory factory; - private Class modelType; - - private LazyOperationSelectorProviderFactory(ExtensionPointRegistry registry, - String modelTypeName, - ServiceDeclaration providerClass) { - this.registry = registry; - this.modelTypeName = modelTypeName; - this.providerClass = providerClass; - } - - @SuppressWarnings("unchecked") - private OperationSelectorProviderFactory getFactory() { - if (factory == null) { - try { - Class factoryClass = - (Class)providerClass.loadClass(); - Constructor constructor = - factoryClass.getConstructor(ExtensionPointRegistry.class); - factory = constructor.newInstance(registry); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return factory; - } - - public OperationSelectorProvider createReferenceOperationSelectorProvider(RuntimeComponent component, - RuntimeComponentReference reference, - Binding binding){ - return getFactory().createReferenceOperationSelectorProvider(component, reference, binding); - } - - public OperationSelectorProvider createServiceOperationSelectorProvider(RuntimeComponent component, - RuntimeComponentService service, - Binding binding){ - return getFactory().createServiceOperationSelectorProvider(component, service, binding); - } - - public Class getModelType() { - if (modelType == null) { - try { - - modelType = providerClass.loadClass(modelTypeName); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - return modelType; - } - } - -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProvider.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProvider.java deleted file mode 100644 index 7871aea07c..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProvider.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.provider; - -import org.apache.tuscany.sca.definitions.Definitions; - -/** - * Models a provider of SCA Definitions. Typically SCA Definitions providers - * may either load a definitions.xml file or create the SCA Definitions model - * programmatically. - * - * @version $Rev$ $Date$ - */ -public interface DefinitionsProvider { - Definitions getDefinitions() throws DefinitionsProviderException ; -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProviderException.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProviderException.java deleted file mode 100644 index 11464125ad..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProviderException.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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.provider; - -/** - * @version $Rev$ $Date$ - */ -public class DefinitionsProviderException extends Exception { - - public DefinitionsProviderException(Throwable e) { - super(e); - } -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProviderExtensionPoint.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProviderExtensionPoint.java deleted file mode 100644 index 61cfbe8536..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefinitionsProviderExtensionPoint.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.provider; - -import java.util.List; - -/** - * An extension point for SCA Definitions Providers. SCA Definition providers, load SCA Definitions - * items that are being specifically contributed by the module that hosts the provider in question. - * - * @version $Rev$ $Date$ - */ -public interface DefinitionsProviderExtensionPoint { - - void addDefinitionsProvider(DefinitionsProvider provider); - void removeDefinitionsProvider(DefinitionsProvider provider); - List getDefinitionsProviders(); -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProvider.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProvider.java deleted file mode 100644 index 015c673d66..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProvider.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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.provider; - -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; - -/** - * A component implementation can implement this interface in order to tie - * into the Tuscany runtime - * - * @version $Rev$ $Date$ - */ -public interface ImplementationProvider { - - /** - * This method will be invoked when the component implementation - * is activated. - */ - void start(); - - /** - * This method will be invoked when the component implementation - * is deactivated. - */ - void stop(); - - /** - * Create an invoker for the component implementation in the invocation - * chain. The invoker will be responsible for calling the implementation - * logic for the given component. - * - * @param service The component service - * @param operation The operation that the interceptor will handle - * @return An invoker that handles the invocation logic, null should be - * returned if no invoker is required - */ - Invoker createInvoker(RuntimeComponentService service, Operation operation); - - /** - * For bindings that invoke one-way callback operations asynchronously, - * there is no need to perform a thread switch before calling the invoker. - * This method indicates whether the binding has this capability. - * - * @return true if the callback invoker is able to invoke one-way operations - * asynchronously, false if all invocations are synchronous - */ - boolean supportsOneWayInvocation(); - -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProviderFactory.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProviderFactory.java deleted file mode 100644 index 6a37d1e951..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProviderFactory.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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.provider; - -import org.apache.tuscany.sca.assembly.Implementation; -import org.apache.tuscany.sca.runtime.RuntimeComponent; - -/** - * An interface for factories that create implementation providers. - * - * @version $Rev$ $Date$ - */ -public interface ImplementationProviderFactory extends ProviderFactory { - - /** - * Creates a new implementation provider for the given - * component. - * - * @param component The runtime component - * @param Implementation The implementation type - * @return The implementation provider - */ - ImplementationProvider createImplementationProvider(RuntimeComponent component, M Implementation); - -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProvider.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProvider.java deleted file mode 100644 index f385c7dfba..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProvider.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.provider; - -import org.apache.tuscany.sca.invocation.Interceptor; - -/** - * @version $Rev$ $Date$ - */ -public interface OperationSelectorProvider { - /** - * Create an interceptor for the operation selector - * @return An interceptor that realize the policySet - */ - Interceptor createInterceptor(); - - /** - * Get the phase that the interceptor should be added - * @return The phase that this interceptor belongs to - */ - String getPhase(); -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProviderFactory.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProviderFactory.java deleted file mode 100644 index 183b38cb33..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/OperationSelectorProviderFactory.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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.provider; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.OperationSelector; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; - -/** - * @version $Rev$ $Date$ - */ -public interface OperationSelectorProviderFactory extends ProviderFactory { - /** - * Create wire format provider for a given reference binding - * @param component - * @param reference - * @param binding - * @return - */ - OperationSelectorProvider createReferenceOperationSelectorProvider(RuntimeComponent component, - RuntimeComponentReference reference, - Binding binding); - - /** - * Create policy provider for a given service binding - * @param component - * @param service - * @param binding - * @return - */ - OperationSelectorProvider createServiceOperationSelectorProvider(RuntimeComponent component, - RuntimeComponentService service, - Binding binding); -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyImplementor.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyImplementor.java deleted file mode 100644 index f2b59a7c54..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyImplementor.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.provider; - -import java.util.List; - -import javax.xml.namespace.QName; - -/** - * This interface can be optionally implemented by the Binding or Implementation providers to - * indicate if they implement the policies in the binding/implementation provider. - * - * @version $Rev$ $Date$ - */ -public interface PolicyImplementor { - /** - * Get a list of policy names that are implemented by this policy implementor - * @return A list of policy names - */ - List getImplementedPolicies(); -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProvider.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProvider.java deleted file mode 100644 index 644283dea1..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProvider.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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.provider; - -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Interceptor; - -/** - * @version $Rev$ $Date$ - */ -public interface PolicyProvider { - /** - * Create an interceptor for a given operation - * @param operation - * @return An interceptor that realize the policySet - */ - Interceptor createInterceptor(Operation operation); - - /** - * Get the phase that the interceptor should be added - * @return The phase that this interceptor belongs to - */ - String getPhase(); -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderFactory.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderFactory.java deleted file mode 100644 index d9ac4d16b0..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderFactory.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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.provider; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Implementation; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; - -/** - * @version $Rev$ $Date$ - */ -public interface PolicyProviderFactory extends ProviderFactory { - /** - * Create policy provider for a given reference binding - * @param component - * @param reference - * @param binding - * @return - */ - PolicyProvider createReferencePolicyProvider(RuntimeComponent component, - RuntimeComponentReference reference, - Binding binding); - - /** - * Create policy provider for a given service binding - * @param component - * @param service - * @param binding - * @return - */ - PolicyProvider createServicePolicyProvider(RuntimeComponent component, - RuntimeComponentService service, - Binding binding); - - /** - * Create policy provider for a given component implementation - * @param component - * @param implementation - * @return - */ - PolicyProvider createImplementationPolicyProvider(RuntimeComponent component, Implementation implementation); - -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderRRB.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderRRB.java deleted file mode 100644 index 23a48c8e36..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/PolicyProviderRRB.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.provider; - -import org.apache.tuscany.sca.invocation.Interceptor; - -/** - * TODO RRB experiment - * This is an experiment extension to try out the request response - * binding function - * @version $Rev$ $Date$ - */ -public interface PolicyProviderRRB extends PolicyProvider { - /** - * Create a binding interceptor - * @return An interceptor that realize the policySet - */ - Interceptor createBindingInterceptor(); - -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactory.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactory.java deleted file mode 100644 index 2102806881..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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.provider; - -/** - * A factory for runtime providers. - * - * @version $Rev$ $Date$ - */ -public interface ProviderFactory { - - /** - * The model type that this factory creates providers for. - * - * @return the model type - */ - Class getModelType(); - -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactoryExtensionPoint.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactoryExtensionPoint.java deleted file mode 100644 index d8f9973338..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactoryExtensionPoint.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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.provider; - -import java.util.List; - - -/** - * An extension point for provider factories. Holds all of the provider - * factories from loaded extension points. Allows a provider factory - * to be located based on a given model type. Hence the runtime can - * generate runtime artifacts from the in memory assembly model. - * - * @version $Rev$ $Date$ - */ -public interface ProviderFactoryExtensionPoint { - - - /** - * Add a provider factory. - * - * @param providerFactory The provider factory - */ - void addProviderFactory(ProviderFactory providerFactory); - - /** - * Remove a provider factory. - * - * @param providerFactory The provider factory - */ - void removeProviderFactory(ProviderFactory providerFactory); - - /** - * Returns the provider factory associated with the given model type. - * @param modelType A model type - * @return The provider factory associated with the given model type - */ - ProviderFactory getProviderFactory(Class modelType); - - /** - * Get a list of registered PolicyProviderFactory - * @return a list of registered PolicyProviderFactory - */ - List getPolicyProviderFactories(); - -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProvider.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProvider.java deleted file mode 100644 index b3ab1d8b87..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProvider.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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.provider; - -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; - -/** - * A reference binding implementation can options implement this - * interface to tie into the Tuscany SCA runtime - * - * @version $Rev$ $Date$ - */ -public interface ReferenceBindingProvider { - - /** - * This method will be invoked when the component reference binding is - * activated. - */ - void start(); - - /** - * This method will be invoked when the component reference binding is - * deactivated. - */ - void stop(); - - /** - * Create an invoker for the reference binding in the invocation chain. The - * invoker is responsible for making the outbound invocation over the - * binding protocol. - * - * @param operation The operation that the interceptor will handle - * @return An invoker that handles the invocation logic, null should be - * returned if no invoker is required - */ - Invoker createInvoker(Operation operation); - - /** - * Get the effective interface contract imposed by the binding. For example, - * it will be interface contract introspected from the WSDL portType used by - * the endpoint for a WebService binding. - * - * @return The effective interface contract, if null is returned, the - * interface contract for the component reference will be used - */ - InterfaceContract getBindingInterfaceContract(); - - /** - * For bindings that invoke one-way operations asynchronously, there is no - * need to perform a thread switch before calling the invoker. This method - * indicates whether the binding has this capability. - * - * @return true if the binding invoker is able to invoke one-way operations - * asynchronously, false if all invocations are synchronous - */ - boolean supportsOneWayInvocation(); -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProviderRRB.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProviderRRB.java deleted file mode 100644 index 3ea9d0ac3c..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProviderRRB.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.provider; - -import org.apache.tuscany.sca.runtime.RuntimeWire; - -/** - * TODO RRB experiment - * This is an experiment extension to try out the request response - * binding function - * - * @version $Rev$ $Date$ - */ -public interface ReferenceBindingProviderRRB extends ReferenceBindingProvider { - - void configureBindingChain(RuntimeWire runtimeWire); - -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProvider.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProvider.java deleted file mode 100644 index e15234a549..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProvider.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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.provider; - -import org.apache.tuscany.sca.interfacedef.InterfaceContract; - -/** - * A service binding can optionally implement this interface to tie - * into the Tuscany SCA runtime - * - * @version $Rev$ $Date$ - */ -public interface ServiceBindingProvider { - /** - * This method will be invoked when the component service binding is - * activated. - */ - void start(); - - /** - * This method will be invoked when the component service binding is - * deactivated. - */ - void stop(); - - /** - * Get the effective interface contract imposed by the binding. For example, - * it will be interface contract introspected from the WSDL portType used by - * the endpoint for a WebService binding. - * - * @return The effective interface contract, if null is returned, the - * interface contract for the component service will be used - */ - InterfaceContract getBindingInterfaceContract(); - - /** - * For bindings that invoke one-way callback operations asynchronously, - * there is no need to perform a thread switch before calling the invoker. - * This method indicates whether the binding has this capability. - * - * @return true if the callback invoker is able to invoke one-way operations - * asynchronously, false if all invocations are synchronous - */ - boolean supportsOneWayInvocation(); - -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProviderRRB.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProviderRRB.java deleted file mode 100644 index 278bb23e0a..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProviderRRB.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.provider; - -import org.apache.tuscany.sca.runtime.RuntimeWire; - -/** - * TODO RRB experiment - * This is an experiment extension to try out the request response - * binding function - * - * @version $Rev$ $Date$ - */ -public interface ServiceBindingProviderRRB extends ServiceBindingProvider { - - void configureBindingChain(RuntimeWire runtimeWire); - -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProvider.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProvider.java deleted file mode 100644 index a7bca9afba..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProvider.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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.provider; - -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.invocation.Interceptor; - -/** - * @version $Rev$ $Date$ - */ -public interface WireFormatProvider { - - /* - * Return the contract that describes the interface that - * is providing data to or accepting data from the - * wire format interceptor. The wire formats job - * is to translate between this interface contract and the - * format on the wire - * @return the wire format interface contract - */ - InterfaceContract getWireFormatInterfaceContract(); - - /** - * Create an interceptor for the wire format - * @return An interceptor that realize the policySet - */ - Interceptor createInterceptor(); - - /** - * Get the phase that the interceptor should be added - * @return The phase that this interceptor belongs to - */ - String getPhase(); -} diff --git a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProviderFactory.java b/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProviderFactory.java deleted file mode 100644 index fd748df6ca..0000000000 --- a/branches/sca-java-2.0-M2/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/WireFormatProviderFactory.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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.provider; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.WireFormat; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; - -/** - * @version $Rev$ $Date$ - */ -public interface WireFormatProviderFactory extends ProviderFactory { - /** - * Create wire format provider for a given reference binding - * @param component - * @param reference - * @param binding - * @return - */ - WireFormatProvider createReferenceWireFormatProvider(RuntimeComponent component, - RuntimeComponentReference reference, - Binding binding); - - /** - * Create policy provider for a given service binding - * @param component - * @param service - * @param binding - * @return - */ - WireFormatProvider createServiceWireFormatProvider(RuntimeComponent component, - RuntimeComponentService service, - Binding binding); -} -- cgit v1.2.3