tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r544133 - in /incubator/tuscany/java/sca/modules/extension-helper/src/main: java/org/apache/tuscany/sca/spi/ java/org/apache/tuscany/sca/spi/impl/ resources/META-INF/services/
Date Mon, 04 Jun 2007 11:52:38 GMT
Author: antelder
Date: Mon Jun  4 04:52:37 2007
New Revision: 544133

URL: http://svn.apache.org/viewvc?view=rev&rev=544133
Log:
Continue on with extension-helper dev

Added:
    incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/ReferenceInvokerFactory.java
  (with props)
    incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/ServiceListener.java
  (with props)
    incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/BindingSCDLProcessor.java
  (with props)
    incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/BindingsActivator.java
      - copied, changed from r543947, incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/UtilsModuleActivator.java
Removed:
    incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/UtilsModuleActivator.java
Modified:
    incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/BindingActivator.java
    incubator/tuscany/java/sca/modules/extension-helper/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator

Modified: incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/BindingActivator.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/BindingActivator.java?view=diff&rev=544133&r1=544132&r2=544133
==============================================================================
--- incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/BindingActivator.java
(original)
+++ incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/BindingActivator.java
Mon Jun  4 04:52:37 2007
@@ -19,22 +19,21 @@
 
 package org.apache.tuscany.sca.spi;
 
+import javax.xml.namespace.QName;
+
 import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
 import org.apache.tuscany.sca.runtime.RuntimeComponent;
 import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
 import org.apache.tuscany.sca.runtime.RuntimeComponentService;
 
 public interface BindingActivator<B extends Binding> {
 
-    Class<B> getModelType();
-
-    StAXArtifactProcessor<B> getSCDLProcessor();
+    QName getSCDLQName();
     
-    ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent rc, RuntimeComponentReference
rcr, B b);
+    Class<B> getBindingClass();
+
+    ReferenceInvokerFactory createInvokerFactory(RuntimeComponent rc, RuntimeComponentReference
rcr, B binding);
     
-    ServiceBindingProvider createServiceBindingProvider(RuntimeComponent rc, RuntimeComponentService
rcs, B b);
+    ServiceListener createServiceListener(RuntimeComponent rc, RuntimeComponentService rcs,
B binding);
     
 }

Added: incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/ReferenceInvokerFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/ReferenceInvokerFactory.java?view=auto&rev=544133
==============================================================================
--- incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/ReferenceInvokerFactory.java
(added)
+++ incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/ReferenceInvokerFactory.java
Mon Jun  4 04:52:37 2007
@@ -0,0 +1,32 @@
+/*
+ * 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.spi;
+
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Invoker;
+
+public interface ReferenceInvokerFactory {
+
+    public Invoker createInvoker(Operation operation);
+    
+    public void start();
+    public void stop();
+    
+}

Propchange: incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/ReferenceInvokerFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/ReferenceInvokerFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/ServiceListener.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/ServiceListener.java?view=auto&rev=544133
==============================================================================
--- incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/ServiceListener.java
(added)
+++ incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/ServiceListener.java
Mon Jun  4 04:52:37 2007
@@ -0,0 +1,28 @@
+/*
+ * 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.spi;
+
+
+public interface ServiceListener {
+    
+    void start();
+    void stop();
+
+}

Propchange: incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/ServiceListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/ServiceListener.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/BindingSCDLProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/BindingSCDLProcessor.java?view=auto&rev=544133
==============================================================================
--- incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/BindingSCDLProcessor.java
(added)
+++ incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/BindingSCDLProcessor.java
Mon Jun  4 04:52:37 2007
@@ -0,0 +1,128 @@
+/*
+ * 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.spi.impl;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.service.ContributionReadException;
+import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
+import org.apache.tuscany.sca.spi.utils.AbstractBinding;
+
+/**
+ * An SCDL ArtifactProcessor which uses the Binding class getters/setters
+ * to define the SCDL attributes.
+ * 
+ * TODO: merge this with SCDLProcessor
+ */
+public class BindingSCDLProcessor implements StAXArtifactProcessor {
+
+    protected QName scdlQName;
+    protected Class<Binding> bindingClass;
+
+    protected Map<String, Method> attributeSetters;
+    protected Method elementTextSetter;
+
+    public BindingSCDLProcessor(QName scdlQName, Class<Binding> implementationClass)
{
+        this.scdlQName = scdlQName;
+        this.bindingClass = implementationClass;
+        initAttributes();
+    }
+
+    protected void initAttributes() {
+        attributeSetters = new HashMap<String, Method>();
+        Set<Method> methods = new HashSet<Method>(Arrays.asList(bindingClass.getMethods()));
+        methods.removeAll(Arrays.asList(AbstractBinding.class.getMethods()));
+        for (Method m : methods) {
+            if ("setElementText".equals(m.getName())) {
+                elementTextSetter = m;
+            } else if ((m.getName().startsWith("set"))) {
+                attributeSetters.put(m.getName().substring(3).toLowerCase(), m);
+            }
+        }
+    }
+
+    public QName getArtifactType() {
+        return scdlQName;
+    }
+
+    public Class<Binding> getModelType() {
+        return bindingClass;
+    }
+
+    public Binding read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException
{
+        Binding impl;
+        try {
+            impl = bindingClass.newInstance();
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+
+        for (String attribute : attributeSetters.keySet()) {
+            String value = reader.getAttributeValue(null, attribute);
+            if (value != null && value.length() > 0) {
+                try {
+                    attributeSetters.get(attribute).invoke(impl, new Object[] {value});
+                } catch (Exception e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        }
+
+        if (elementTextSetter != null) {
+            try {
+                String value = reader.getElementText();
+                if (value != null && value.length() > 0) {
+                    elementTextSetter.invoke(impl, value);
+                }
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
+        }
+
+        while (!(reader.getEventType() == END_ELEMENT && scdlQName.equals(reader.getName()))
&& reader.hasNext()) {
+            reader.next();
+        }
+
+        return impl;
+    }
+
+    public void resolve(Object model, ModelResolver resolver) throws ContributionResolveException
{
+    }
+
+    public void write(Object model, XMLStreamWriter outputSource) throws ContributionWriteException,
XMLStreamException {
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/BindingSCDLProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/BindingSCDLProcessor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/BindingsActivator.java
(from r543947, incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/UtilsModuleActivator.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/BindingsActivator.java?view=diff&rev=544133&p1=incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/UtilsModuleActivator.java&r1=543947&p2=incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/BindingsActivator.java&r2=544133
==============================================================================
--- incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/UtilsModuleActivator.java
(original)
+++ incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/BindingsActivator.java
Mon Jun  4 04:52:37 2007
@@ -24,21 +24,16 @@
 
 import org.apache.tuscany.sca.assembly.AssemblyFactory;
 import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Implementation;
 import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
 import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
 import org.apache.tuscany.sca.core.ExtensionPointRegistry;
 import org.apache.tuscany.sca.core.ModelFactoryExtensionPoint;
 import org.apache.tuscany.sca.core.ModuleActivator;
-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.interfacedef.InterfaceContract;
 import org.apache.tuscany.sca.interfacedef.Operation;
 import org.apache.tuscany.sca.invocation.Invoker;
 import org.apache.tuscany.sca.invocation.Message;
 import org.apache.tuscany.sca.provider.BindingProviderFactory;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
 import org.apache.tuscany.sca.provider.ProviderFactory;
 import org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint;
 import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
@@ -47,91 +42,101 @@
 import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
 import org.apache.tuscany.sca.runtime.RuntimeComponentService;
 import org.apache.tuscany.sca.spi.BindingActivator;
-import org.apache.tuscany.sca.spi.ImplementationActivator;
-import org.apache.tuscany.sca.spi.InvokerFactory;
-import org.apache.tuscany.sca.spi.utils.PropertyValueObjectFactory;
-import org.apache.tuscany.sca.spi.utils.DefaultPropertyValueObjectFactory;
-
-public class UtilsModuleActivator implements ModuleActivator {
-
-    List<BindingActivator> bindingActivators;
-    List<ImplementationActivator> implementationActivators;
-    private AssemblyFactory assemblyFactory;
+import org.apache.tuscany.sca.spi.ReferenceInvokerFactory;
+import org.apache.tuscany.sca.spi.ServiceListener;
+
+public class BindingsActivator implements ModuleActivator {
+
+    protected List<BindingActivator> bindingActivators;
+    protected AssemblyFactory assemblyFactory;
     
     public void start(ExtensionPointRegistry registry) {
 
         ModelFactoryExtensionPoint factories = registry.getExtensionPoint(ModelFactoryExtensionPoint.class);
         this.assemblyFactory = factories.getFactory(AssemblyFactory.class);
 
-        DataBindingExtensionPoint dataBindings = registry.getExtensionPoint(DataBindingExtensionPoint.class);
-        TransformerExtensionPoint transformers = registry.getExtensionPoint(TransformerExtensionPoint.class);

-        MediatorImpl mediator = new MediatorImpl(dataBindings, transformers);
-        PropertyValueObjectFactory propertyFactory = new DefaultPropertyValueObjectFactory(mediator);
-        registry.addExtensionPoint(propertyFactory);
-
-        startBindings(registry);
-        startImplementations(registry);
-    }
-
-    public void stop(ExtensionPointRegistry registry) {
-        stopBindings(registry);
-        stopImplementations(registry);
-    }
-
-    @SuppressWarnings("unchecked")
-    public void startBindings(ExtensionPointRegistry registry) {
-
         this.bindingActivators = DiscoveryUtils.discoverActivators(BindingActivator.class,
getClass().getClassLoader(), registry);
 
         StAXArtifactProcessorExtensionPoint staxProcessors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
 
         for (final BindingActivator bindingActivator : bindingActivators) {
 
-            staxProcessors.addArtifactProcessor(bindingActivator.getSCDLProcessor());
+            staxProcessors.addArtifactProcessor(new BindingSCDLProcessor(bindingActivator.getSCDLQName(),
bindingActivator.getBindingClass()));
 
-            if (bindingActivator.getModelType() != null) {
+            if (bindingActivator.getBindingClass() != null) {
                 // Add a ProviderFactory
                 ProviderFactoryExtensionPoint providerFactories =
                     registry.getExtensionPoint(ProviderFactoryExtensionPoint.class);
 
                 providerFactories.addProviderFactory(new BindingProviderFactory() {
-                    public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent
rc,
-                                                                                   RuntimeComponentReference
rcr,
-                                                                                   Binding
b) {
-                        return bindingActivator.createReferenceBindingProvider(rc, rcr, b);
+                    public ReferenceBindingProvider createReferenceBindingProvider(final
RuntimeComponent rc,
+                                                                                   final
RuntimeComponentReference rcr,
+                                                                                   final
Binding b) {
+                        return new ReferenceBindingProvider() {
+                            List<InvokerProxy> invokers = new ArrayList<InvokerProxy>();
+                            private ReferenceInvokerFactory factory;
+                            public Invoker createInvoker(Operation operation, boolean isCallback)
{
+                                InvokerProxy invoker = new InvokerProxy(operation);
+                                invokers.add(invoker);    
+                                return invoker;
+                            }
+                            public InterfaceContract getBindingInterfaceContract() {
+                                return null;
+                            }
+                            public void start() {
+                                factory = bindingActivator.createInvokerFactory(rc, rcr,
b);
+                                factory.start();
+                                
+                                for (InvokerProxy invoker : invokers) {
+                                    invoker.start(factory);
+                                }
+                            }
+                            public void stop() {
+                                factory.stop();
+                            }};
                     }
 
-                    public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent
rc,
-                                                                               RuntimeComponentService
rcs,
-                                                                               Binding b)
{
-                        return bindingActivator.createServiceBindingProvider(rc, rcs, b);
+                    public ServiceBindingProvider createServiceBindingProvider(final RuntimeComponent
rc,
+                                                                               final RuntimeComponentService
rcs,
+                                                                               final Binding
b) {
+                        return new ServiceBindingProvider(){
+                            ServiceListener listener = bindingActivator.createServiceListener(rc,
rcs, b);
+                            public InterfaceContract getBindingInterfaceContract() {
+                                return null;
+                            }
+                            public void start() {
+                                listener.start();
+                            }
+                            public void stop() {
+                                listener.stop();
+                            }};
                     }
 
                     public Class getModelType() {
-                        return bindingActivator.getModelType();
+                        return bindingActivator.getBindingClass();
                     }
                 });
             }
         }
     }
 
-    public void stopBindings(ExtensionPointRegistry registry) {
+    public void stop(ExtensionPointRegistry registry) {
         StAXArtifactProcessorExtensionPoint staxProcessors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
         ProviderFactoryExtensionPoint providerFactories = registry.getExtensionPoint(ProviderFactoryExtensionPoint.class);
 
         for (final BindingActivator bindingActivator : bindingActivators) {
 
             // Remove the binding SCDL processor from the runtime
-            if (staxProcessors != null && bindingActivator.getSCDLProcessor() !=
null) {
-                StAXArtifactProcessor processor = staxProcessors.getProcessor(bindingActivator.getSCDLProcessor().getClass());
+            if (staxProcessors != null && bindingActivator.getSCDLQName() != null)
{
+                StAXArtifactProcessor processor = staxProcessors.getProcessor(bindingActivator.getSCDLQName());
                 if (processor != null) {
                     staxProcessors.removeArtifactProcessor(processor);
                 }
             }
 
             // Remove the ProviderFactory from the runtime
-            if (providerFactories != null && bindingActivator.getModelType() != null)
{
-                ProviderFactory factory = providerFactories.getProviderFactory(bindingActivator.getModelType());
+            if (providerFactories != null && bindingActivator.getBindingClass() !=
null) {
+                ProviderFactory factory = providerFactories.getProviderFactory(bindingActivator.getBindingClass());
                 if (factory != null) {
                     providerFactories.removeProviderFactory(factory);
                 }
@@ -139,76 +144,22 @@
         }
     }
 
-    protected void startImplementations(ExtensionPointRegistry registry) {
-        this.implementationActivators = DiscoveryUtils.discoverActivators(ImplementationActivator.class,
getClass().getClassLoader(), registry);
-
-        StAXArtifactProcessorExtensionPoint staxProcessors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
-
-        for (final ImplementationActivator implementationActivator : implementationActivators)
{
-
-            SCDLProcessor scdlProcessor = new SCDLProcessor(assemblyFactory, implementationActivator.getSCDLQName(),
implementationActivator.getImplementationClass());
-            staxProcessors.addArtifactProcessor(scdlProcessor);
-
-            ProviderFactoryExtensionPoint providerFactories = registry.getExtensionPoint(ProviderFactoryExtensionPoint.class);
-
-            if (implementationActivator.getImplementationClass() != null && providerFactories
!= null) {
-
-                providerFactories.addProviderFactory(new ImplementationProviderFactory()
{
-                    public ImplementationProvider createImplementationProvider(final RuntimeComponent
rc, final Implementation impl) {
-                        return new ImplementationProvider() {
-                            List<DelegaterInvoker> invokers = new ArrayList<DelegaterInvoker>();
-                            public Invoker createInvoker(RuntimeComponentService arg0, final
Operation op) {
-                                DelegaterInvoker invoker = new DelegaterInvoker();
-                                invoker.op = op;
-                                invokers.add(invoker);    
-                                return invoker;
-                            }
-                            public Invoker createCallbackInvoker(Operation arg0) {
-                                throw new RuntimeException("TODO: callbacks not yet implemented");

-                            }
-                            public void start() {
-                                InvokerFactory factory = implementationActivator.createInvokerFactory(rc,
impl);
-                                for (DelegaterInvoker invoker : invokers) {
-                                    invoker.start(factory);
-                                }
-                            }
-                            public void stop() {
-                            }
-                            class DelegaterInvoker implements Invoker {
-                                Invoker invoker;
-                                Operation op;
-                                public Message invoke(Message arg0) {
-                                    return invoker.invoke(arg0);
-                                }
-                                public void start(InvokerFactory factory) {
-                                    invoker = factory.createInvoker(op);
-                                }
-                             }
-                            };
-                    }
-                    public Class getModelType() {
-                        return implementationActivator.getImplementationClass();
-                    }
-                });
-            }
-        }
-    }
-
-    protected void stopImplementations(ExtensionPointRegistry registry) {
-        StAXArtifactProcessorExtensionPoint staxProcessors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
-
-        for (final ImplementationActivator implementationActivator : implementationActivators)
{
-            if (staxProcessors != null && implementationActivator.getSCDLQName()
!= null) {
-                StAXArtifactProcessor processor = staxProcessors.getProcessor(implementationActivator.getSCDLQName());
-                if (processor != null) {
-                    staxProcessors.removeArtifactProcessor(processor);
-                }
-            }
-        }
-    }
-
     public Object[] getExtensionPoints() {
         return null; // not used by binding or implementation extensions
     }
 
 }
+class InvokerProxy implements Invoker {
+    Invoker invoker;
+    Operation op;
+    InvokerProxy(Operation op) {
+        this.op = op;
+    }
+    public Message invoke(Message arg0) {
+        return invoker.invoke(arg0);
+    }
+    public void start(ReferenceInvokerFactory factory) {
+        invoker = factory.createInvoker(op);
+    }
+ }
+

Modified: incubator/tuscany/java/sca/modules/extension-helper/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/extension-helper/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator?view=diff&rev=544133&r1=544132&r2=544133
==============================================================================
--- incubator/tuscany/java/sca/modules/extension-helper/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
(original)
+++ incubator/tuscany/java/sca/modules/extension-helper/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
Mon Jun  4 04:52:37 2007
@@ -17,3 +17,4 @@
 
 # Implementation class for the ExtensionActivator
 org.apache.tuscany.sca.spi.impl.ImplementationsActivator
+org.apache.tuscany.sca.spi.impl.BindingsActivator



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message