You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by ant elder <an...@gmail.com> on 2011/03/30 01:05:10 UTC

Re: svn commit: r1086667 - in /tuscany/sca-java-2.x/trunk/modules: node-api/ node-api/META-INF/ node-api/src/main/java/org/apache/tuscany/sca/node/ node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/ node-impl/META-INF/ node-impl/src/ma

There is something quite weird going on with this group of commits you
just did, the svn history and diffs is all mixed up so you can't see
whats going on, eg see this file which is a pom.xml turning into a
java class.

Did you do anything out of the ordinary with the commits?

   ...ant

On Tue, Mar 29, 2011 at 7:25 PM,  <lr...@apache.org> wrote:
> Author: lresende
> Date: Tue Mar 29 18:25:37 2011
> New Revision: 1086667
>
> URL: http://svn.apache.org/viewvc?rev=1086667&view=rev
> Log:
> TUSCANY-3496 - Adding extensibility to node api to allow other applications to tap to it and provide services that require introspecting node metadata
>
> Added:
>    tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/
>    tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeActivator.java
>      - copied, changed from r1086614, tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml
>    tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeActivatorExtensionPoint.java
>      - copied, changed from r1086614, tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml
>    tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeExtension.java
>      - copied, changed from r1086614, tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml
>    tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/extensibility/
>    tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/extensibility/impl/
>    tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/extensibility/impl/DefaultNodeActivatorExtensionPoint.java   (with props)
>    tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.extensibility.NodeActivatorExtensionPoint
> Modified:
>    tuscany/sca-java-2.x/trunk/modules/node-api/META-INF/MANIFEST.MF
>    tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml
>    tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Node.java
>    tuscany/sca-java-2.x/trunk/modules/node-impl/META-INF/MANIFEST.MF
>    tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
>
> Modified: tuscany/sca-java-2.x/trunk/modules/node-api/META-INF/MANIFEST.MF
> URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/node-api/META-INF/MANIFEST.MF?rev=1086667&r1=1086666&r2=1086667&view=diff
> ==============================================================================
> --- tuscany/sca-java-2.x/trunk/modules/node-api/META-INF/MANIFEST.MF (original)
> +++ tuscany/sca-java-2.x/trunk/modules/node-api/META-INF/MANIFEST.MF Tue Mar 29 18:25:37 2011
> @@ -1,6 +1,7 @@
>  Manifest-Version: 1.0
>  Export-Package: org.apache.tuscany.sca.node;version="2.0.0";uses:="org.oasisopen.sca",
> - org.apache.tuscany.sca.node.configuration;version="2.0.0"
> + org.apache.tuscany.sca.node.configuration;version="2.0.0",
> + org.apache.tuscany.sca.node.extensibility
>  SCA-Version: 1.1
>  Bundle-Name: Apache Tuscany SCA Node API
>  DynamicImport-Package: org.apache.tuscany.sca.node.impl,org.apache.tus
> @@ -10,7 +11,8 @@ Bundle-Version: 2.0.0
>  Bundle-ManifestVersion: 2
>  Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
>  Bundle-Description: Apache Tuscany SCA Node API
> -Import-Package: org.apache.tuscany.sca.node;version="2.0.0",
> +Import-Package: org.apache.tuscany.sca.assembly,
> + org.apache.tuscany.sca.node;version="2.0.0",
>  org.apache.tuscany.sca.node.configuration;version="2.0.0",
>  org.oasisopen.sca;version="2.0.0"
>  Bundle-SymbolicName: org.apache.tuscany.sca.node.api
>
> Modified: tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml
> URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml?rev=1086667&r1=1086666&r2=1086667&view=diff
> ==============================================================================
> --- tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml (original)
> +++ tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml Tue Mar 29 18:25:37 2011
> @@ -30,12 +30,17 @@
>     <artifactId>tuscany-node-api</artifactId>
>     <name>Apache Tuscany SCA Node API</name>
>
> -    <dependencies>
> +    <dependencies>
>         <dependency>
>             <groupId>org.apache.tuscany.sca</groupId>
>             <artifactId>tuscany-sca-api</artifactId>
>             <version>2.0-SNAPSHOT</version>
>         </dependency>
> +        <dependency>
> +            <groupId>org.apache.tuscany.sca</groupId>
> +            <artifactId>tuscany-assembly</artifactId>
> +            <version>2.0-SNAPSHOT</version>
> +        </dependency>
>     </dependencies>
>
>  </project>
>
> Modified: tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Node.java
> URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Node.java?rev=1086667&r1=1086666&r2=1086667&view=diff
> ==============================================================================
> --- tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Node.java (original)
> +++ tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/Node.java Tue Mar 29 18:25:37 2011
> @@ -22,9 +22,6 @@ package org.apache.tuscany.sca.node;
>  import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
>  import org.oasisopen.sca.ServiceReference;
>
> -
> -
> -
>  /**
>  * Represents an SCA processing node.
>  * A node is loaded with an SCA composites. It can start and stop that composite.
> @@ -82,5 +79,5 @@ public interface Node {
>      * @param <B> the Java type of the business interface for the service
>      * @return a ServiceReference for the designated service
>      */
> -    <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String serviceName);
> +    <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String serviceName);
>  }
>
> Copied: tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeActivator.java (from r1086614, tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml)
> URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeActivator.java?p2=tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeActivator.java&p1=tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml&r1=1086614&r2=1086667&rev=1086667&view=diff
> ==============================================================================
> --- tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml (original)
> +++ tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeActivator.java Tue Mar 29 18:25:37 2011
> @@ -1,5 +1,4 @@
> -<?xml version="1.0" encoding="UTF-8"?>
> -<!--
> +/*
>  * Licensed to the Apache Software Foundation (ASF) under one
>  * or more contributor license agreements.  See the NOTICE file
>  * distributed with this work for additional information
> @@ -16,26 +15,15 @@
>  * KIND, either express or implied.  See the License for the
>  * specific language governing permissions and limitations
>  * under the License.
> --->
> -<project>
> + */
>
> -    <modelVersion>4.0.0</modelVersion>
> -    <parent>
> -        <groupId>org.apache.tuscany.sca</groupId>
> -        <artifactId>tuscany-modules</artifactId>
> -        <version>2.0-SNAPSHOT</version>
> -        <relativePath>../pom.xml</relativePath>
> -    </parent>
> +package org.apache.tuscany.sca.node.extensibility;
>
> -    <artifactId>tuscany-node-api</artifactId>
> -    <name>Apache Tuscany SCA Node API</name>
> +import org.apache.tuscany.sca.node.Node;
>
> -    <dependencies>
> -        <dependency>
> -            <groupId>org.apache.tuscany.sca</groupId>
> -            <artifactId>tuscany-sca-api</artifactId>
> -            <version>2.0-SNAPSHOT</version>
> -        </dependency>
> -    </dependencies>
> +public interface NodeActivator {
>
> -</project>
> +    void nodeStarted(Node node);
> +
> +    void nodeStopped(Node node);
> +}
>
> Copied: tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeActivatorExtensionPoint.java (from r1086614, tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml)
> URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeActivatorExtensionPoint.java?p2=tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeActivatorExtensionPoint.java&p1=tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml&r1=1086614&r2=1086667&rev=1086667&view=diff
> ==============================================================================
> --- tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml (original)
> +++ tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeActivatorExtensionPoint.java Tue Mar 29 18:25:37 2011
> @@ -1,5 +1,4 @@
> -<?xml version="1.0" encoding="UTF-8"?>
> -<!--
> +/*
>  * Licensed to the Apache Software Foundation (ASF) under one
>  * or more contributor license agreements.  See the NOTICE file
>  * distributed with this work for additional information
> @@ -16,26 +15,18 @@
>  * KIND, either express or implied.  See the License for the
>  * specific language governing permissions and limitations
>  * under the License.
> --->
> -<project>
> + */
>
> -    <modelVersion>4.0.0</modelVersion>
> -    <parent>
> -        <groupId>org.apache.tuscany.sca</groupId>
> -        <artifactId>tuscany-modules</artifactId>
> -        <version>2.0-SNAPSHOT</version>
> -        <relativePath>../pom.xml</relativePath>
> -    </parent>
> -
> -    <artifactId>tuscany-node-api</artifactId>
> -    <name>Apache Tuscany SCA Node API</name>
> -
> -    <dependencies>
> -        <dependency>
> -            <groupId>org.apache.tuscany.sca</groupId>
> -            <artifactId>tuscany-sca-api</artifactId>
> -            <version>2.0-SNAPSHOT</version>
> -        </dependency>
> -    </dependencies>
> +package org.apache.tuscany.sca.node.extensibility;
>
> -</project>
> +import java.util.List;
> +
> +
> +public interface NodeActivatorExtensionPoint extends NodeActivator {
> +
> +    void addNodeActivator(NodeActivator listener);
> +
> +    void removeNodeActivator(NodeActivator listener);
> +
> +    List<NodeActivator> getNodeActivators();
> +}
>
> Copied: tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeExtension.java (from r1086614, tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml)
> URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeExtension.java?p2=tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeExtension.java&p1=tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml&r1=1086614&r2=1086667&rev=1086667&view=diff
> ==============================================================================
> --- tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml (original)
> +++ tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeExtension.java Tue Mar 29 18:25:37 2011
> @@ -1,5 +1,4 @@
> -<?xml version="1.0" encoding="UTF-8"?>
> -<!--
> +/*
>  * Licensed to the Apache Software Foundation (ASF) under one
>  * or more contributor license agreements.  See the NOTICE file
>  * distributed with this work for additional information
> @@ -16,26 +15,24 @@
>  * KIND, either express or implied.  See the License for the
>  * specific language governing permissions and limitations
>  * under the License.
> --->
> -<project>
> + */
>
> -    <modelVersion>4.0.0</modelVersion>
> -    <parent>
> -        <groupId>org.apache.tuscany.sca</groupId>
> -        <artifactId>tuscany-modules</artifactId>
> -        <version>2.0-SNAPSHOT</version>
> -        <relativePath>../pom.xml</relativePath>
> -    </parent>
> -
> -    <artifactId>tuscany-node-api</artifactId>
> -    <name>Apache Tuscany SCA Node API</name>
> -
> -    <dependencies>
> -        <dependency>
> -            <groupId>org.apache.tuscany.sca</groupId>
> -            <artifactId>tuscany-sca-api</artifactId>
> -            <version>2.0-SNAPSHOT</version>
> -        </dependency>
> -    </dependencies>
> +package org.apache.tuscany.sca.node.extensibility;
>
> -</project>
> +import org.apache.tuscany.sca.assembly.Composite;
> +import org.apache.tuscany.sca.core.ExtensionPointRegistry;
> +import org.apache.tuscany.sca.node.Node;
> +import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
> +
> +public interface NodeExtension extends Node {
> +
> +    String getURI();
> +
> +    String getDomainURI();
> +
> +    NodeConfiguration getConfiguration();
> +
> +    Composite getDomainComposite();
> +
> +    ExtensionPointRegistry getExtensionPointRegistry();
> +}
>
> Modified: tuscany/sca-java-2.x/trunk/modules/node-impl/META-INF/MANIFEST.MF
> URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/node-impl/META-INF/MANIFEST.MF?rev=1086667&r1=1086666&r2=1086667&view=diff
> ==============================================================================
> --- tuscany/sca-java-2.x/trunk/modules/node-impl/META-INF/MANIFEST.MF (original)
> +++ tuscany/sca-java-2.x/trunk/modules/node-impl/META-INF/MANIFEST.MF Tue Mar 29 18:25:37 2011
> @@ -30,6 +30,7 @@ Import-Package: javax.management;resolut
>  org.apache.tuscany.sca.monitor;version="2.0.0",
>  org.apache.tuscany.sca.node;version="2.0.0",
>  org.apache.tuscany.sca.node.configuration;version="2.0.0",
> + org.apache.tuscany.sca.node.extensibility,
>  org.apache.tuscany.sca.node.impl;version="2.0.0",
>  org.apache.tuscany.sca.runtime;version="2.0.0",
>  org.apache.tuscany.sca.work;version="2.0.0",
>
> Added: tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/extensibility/impl/DefaultNodeActivatorExtensionPoint.java
> URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/extensibility/impl/DefaultNodeActivatorExtensionPoint.java?rev=1086667&view=auto
> ==============================================================================
> --- tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/extensibility/impl/DefaultNodeActivatorExtensionPoint.java (added)
> +++ tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/extensibility/impl/DefaultNodeActivatorExtensionPoint.java Tue Mar 29 18:25:37 2011
> @@ -0,0 +1,132 @@
> +/*
> + * 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.node.extensibility.impl;
> +
> +import java.io.IOException;
> +import java.util.ArrayList;
> +import java.util.Collection;
> +import java.util.List;
> +import java.util.Map;
> +import java.util.logging.Level;
> +import java.util.logging.Logger;
> +
> +import org.apache.tuscany.sca.core.ExtensionPointRegistry;
> +import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
> +import org.apache.tuscany.sca.extensibility.ServiceHelper;
> +import org.apache.tuscany.sca.node.Node;
> +import org.apache.tuscany.sca.node.extensibility.NodeActivator;
> +import org.apache.tuscany.sca.node.extensibility.NodeActivatorExtensionPoint;
> +
> +public class DefaultNodeActivatorExtensionPoint implements NodeActivatorExtensionPoint {
> +    private final static Logger logger = Logger.getLogger(DefaultNodeActivatorExtensionPoint.class.getName());
> +    private List<NodeActivator> activators = new ArrayList<NodeActivator>();
> +    private ExtensionPointRegistry registry;
> +    private boolean loadedActivators;
> +
> +    public DefaultNodeActivatorExtensionPoint(ExtensionPointRegistry registry) {
> +        this.registry = registry;
> +    }
> +
> +    public void addNodeActivator(NodeActivator activator) {
> +        this.activators.add(activator);
> +    }
> +
> +    @Override
> +    public void removeNodeActivator(NodeActivator activator) {
> +        this.activators.remove(activator);
> +    }
> +
> +    @Override
> +    public List<NodeActivator> getNodeActivators() {
> +        loadModuleActivators();
> +        return activators;
> +    }
> +
> +    @Override
> +    public void nodeStarted(Node node) {
> +        for(NodeActivator activator : activators) {
> +            activator.nodeStarted(node);
> +        }
> +    }
> +
> +    @Override
> +    public void nodeStopped(Node node) {
> +        for(NodeActivator activator : activators) {
> +            activator.nodeStopped(node);
> +        }
> +    }
> +
> +
> +
> +    /**
> +     * Dynamically load node activators declared under META-INF/services
> +     */
> +    private synchronized void loadModuleActivators() {
> +        if (loadedActivators)
> +            return;
> +
> +        // Get the activator service declarations
> +        Collection<ServiceDeclaration> activatorDeclarations;
> +        try {
> +            // Load the module activators by ranking
> +            activatorDeclarations = registry.getServiceDiscovery().getServiceDeclarations(NodeActivator.class.getName(), true);
> +        } catch (IOException e) {
> +            throw new IllegalStateException(e);
> +        }
> +
> +        // Load and instantiate module activators
> +        for (ServiceDeclaration activatorDeclaration : activatorDeclarations) {
> +            if (logger.isLoggable(Level.FINE)) {
> +                logger.fine("Loading " + activatorDeclaration.getClassName());
> +            }
> +            NodeActivator activator = null;
> +            try {
> +                Class<NodeActivator> activatorClass = (Class<NodeActivator>)activatorDeclaration.loadClass();
> +                try {
> +                    activator = ServiceHelper.newInstance(activatorClass, ExtensionPointRegistry.class, registry);
> +                } catch (NoSuchMethodException e) {
> +                    try {
> +                        activator =
> +                            ServiceHelper.newInstance(activatorClass,
> +                                          new Class<?>[] {ExtensionPointRegistry.class, Map.class},
> +                                          registry,
> +                                          activatorDeclaration.getAttributes());
> +
> +                    } catch (NoSuchMethodException e1) {
> +                        activator = ServiceHelper.newInstance(activatorClass);
> +
> +                    }
> +                }
> +            } catch (Throwable e) {
> +                String optional = activatorDeclaration.getAttributes().get("optional");
> +                if ("true".equalsIgnoreCase(optional)) {
> +                    // If the optional flag is true, just log the error
> +                    logger.log(Level.SEVERE, e.getMessage(), e);
> +                    continue;
> +                } else {
> +                    throw new IllegalArgumentException(e);
> +                }
> +            }
> +            addNodeActivator(activator);
> +        }
> +
> +        loadedActivators = true;
> +    }
> +}
>
> Propchange: tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/extensibility/impl/DefaultNodeActivatorExtensionPoint.java
> ------------------------------------------------------------------------------
>    svn:eol-style = native
>
> Propchange: tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/extensibility/impl/DefaultNodeActivatorExtensionPoint.java
> ------------------------------------------------------------------------------
>    svn:keywords = Rev Date
>
> Modified: tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
> URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java?rev=1086667&r1=1086666&r2=1086667&view=diff
> ==============================================================================
> --- tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java (original)
> +++ tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java Tue Mar 29 18:25:37 2011
> @@ -44,6 +44,9 @@ import org.apache.tuscany.sca.core.invoc
>  import org.apache.tuscany.sca.monitor.Monitor;
>  import org.apache.tuscany.sca.node.Node;
>  import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
> +import org.apache.tuscany.sca.node.extensibility.NodeActivator;
> +import org.apache.tuscany.sca.node.extensibility.NodeActivatorExtensionPoint;
> +import org.apache.tuscany.sca.node.extensibility.NodeExtension;
>  import org.apache.tuscany.sca.runtime.ActivationException;
>  import org.apache.tuscany.sca.runtime.CompositeActivator;
>  import org.apache.tuscany.sca.runtime.DomainRegistryFactory;
> @@ -58,7 +61,7 @@ import org.oasisopen.sca.ServiceUnavaila
>  /**
>  * An SCA Node that is managed by the NodeManager
>  */
> -public class NodeImpl implements Node {
> +public class NodeImpl implements Node, NodeExtension {
>     private static final Logger logger = Logger.getLogger(NodeImpl.class.getName());
>     private ProxyFactory proxyFactory;
>     private CompositeActivator compositeActivator;
> @@ -67,6 +70,7 @@ public class NodeImpl implements Node {
>     private NodeConfiguration configuration;
>     private NodeFactoryImpl nodeFactory;
>     private List<Contribution> contributions;
> +    private NodeActivatorExtensionPoint nodeActivators;
>     // private NodeManager mbean;
>
>     /**
> @@ -78,8 +82,9 @@ public class NodeImpl implements Node {
>         super();
>         this.configuration = configuration;
>         this.nodeFactory = nodeFactory;
> +        this.nodeActivators = nodeFactory.getExtensionPointRegistry().getExtensionPoint(NodeActivatorExtensionPoint.class);
>     }
> -
> +
>     /**
>      * Create a node from the configuration and loaded contributions
>      * @param manager
> @@ -90,6 +95,7 @@ public class NodeImpl implements Node {
>         super();
>         this.configuration = configuration;
>         this.nodeFactory = manager;
> +        this.nodeActivators = nodeFactory.getExtensionPointRegistry().getExtensionPoint(NodeActivatorExtensionPoint.class);
>         this.contributions = new ArrayList<Contribution>(contributions);
>     }
>
> @@ -97,54 +103,58 @@ public class NodeImpl implements Node {
>         return getConfiguration().getURI();
>     }
>
> +    public String getDomainURI() {
> +        return getConfiguration().getDomainURI();
> +    }
> +
>     public Node start() {
>         logger.log(nodeFactory.quietLogging? Level.FINE : Level.INFO, "Starting node: " + configuration.getURI() + " domain: " + configuration.getDomainURI());
>
>         nodeFactory.init();
>         nodeFactory.addNode(configuration, this);
>         this.proxyFactory = nodeFactory.proxyFactory;
> -
> +
>         try {
>             Monitor monitor = nodeFactory.monitorFactory.createMonitor();
>             ProcessorContext context = new ProcessorContext(monitor);
> -
> +
>             // Set up the thead context monitor
>             Monitor tcm = nodeFactory.monitorFactory.setContextMonitor(monitor);
>             try {
>                 // Use the lack of the contributions collection as an indicator for when the node
> -                // is being started for the first time. If it is the first time do all the work
> +                // is being started for the first time. If it is the first time do all the work
>                 // to read the contributions and create the domain composite
>                 if (contributions == null) {
>                     contributions = nodeFactory.loadContributions(configuration, context);
>                 }
> -
> -                if (domainComposite == null) {
> -
> +
> +                if (domainComposite == null) {
> +
>                     UtilityExtensionPoint utilities = nodeFactory.registry.getExtensionPoint(UtilityExtensionPoint.class);
>                     this.compositeActivator = utilities.getUtility(CompositeActivator.class);
>
>                     domainComposite = nodeFactory.configureNode(configuration, contributions, context);
> -
> +
>                     DomainRegistryFactory domainRegistryFactory = ExtensibleDomainRegistryFactory.getInstance(nodeFactory.registry);
>                     EndpointRegistry endpointRegistry =
>                         domainRegistryFactory.getEndpointRegistry(configuration.getDomainRegistryURI(), configuration.getDomainURI());
>
>                     this.compositeContext =
> -                        new CompositeContext(nodeFactory.registry,
> -                                             endpointRegistry,
> -                                             domainComposite,
> -                                             configuration.getDomainURI(),
> +                        new CompositeContext(nodeFactory.registry,
> +                                             endpointRegistry,
> +                                             domainComposite,
> +                                             configuration.getDomainURI(),
>                                              configuration.getURI(),
>                                              nodeFactory.getDeployer().getSystemDefinitions());
>                     // Pass down the context attributes
>                     compositeContext.getAttributes().putAll(configuration.getAttributes());
>                 }
> -
> +
>             } finally {
>                 // Reset the thread context monitor
>                 nodeFactory.monitorFactory.setContextMonitor(tcm);
>             }
> -
> +
>             // Activate the composite
>             compositeActivator.activate(compositeContext, domainComposite);
>
> @@ -172,6 +182,9 @@ public class NodeImpl implements Node {
>                 logger.log(Level.SEVERE, e.getMessage(), e);
>             }
>
> +            for(NodeActivator activator : nodeActivators.getNodeActivators()) {
> +                activator.nodeStarted(this);
> +            }
>             return this;
>
>         } catch (Throwable e) {
> @@ -212,13 +225,17 @@ public class NodeImpl implements Node {
>             } // end if
>
>             nodeFactory.removeNode(configuration);
> -/*
> +/*
>             this.compositeActivator = null;
>             this.proxyFactory = null;
>             this.domainComposite = null;
>             this.compositeContext = null;
> -*/
> -
> +*/
> +
> +            for(NodeActivator activator : nodeActivators.getNodeActivators()) {
> +                activator.nodeStopped(this);
> +            }
> +
>             ThreadMessageContext.removeMessageContext();
>
>         } catch (ActivationException e) {
> @@ -269,7 +286,7 @@ public class NodeImpl implements Node {
>         if (component == null) {
>             throw new ServiceUnavailableException("The service " + name + " has not been contributed to the domain");
>         }
> -
> +
>         return ((RuntimeComponent)component).getServiceReference(businessInterface, serviceName);
>     }
>
> @@ -303,47 +320,47 @@ public class NodeImpl implements Node {
>         }
>         return endpoints;
>     }
> -
> +
>     public Composite getDomainComposite() {
>         return domainComposite;
> -    }
> -
> +    }
> +
>     public String dumpDomainComposite() {
> -
> -        StAXArtifactProcessorExtensionPoint xmlProcessors =
> +
> +        StAXArtifactProcessorExtensionPoint xmlProcessors =
>             getExtensionPointRegistry().getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
> -        StAXArtifactProcessor<Composite>  compositeProcessor =
> -            xmlProcessors.getProcessor(Composite.class);
> -
> +        StAXArtifactProcessor<Composite>  compositeProcessor =
> +            xmlProcessors.getProcessor(Composite.class);
> +
>         return writeComposite(getDomainComposite(), compositeProcessor);
>     }
> -
> +
>     private String writeComposite(Composite composite, StAXArtifactProcessor<Composite> compositeProcessor){
>         ByteArrayOutputStream bos = new ByteArrayOutputStream();
>         XMLOutputFactory outputFactory =
>             nodeFactory.getExtensionPointRegistry().getExtensionPoint(FactoryExtensionPoint.class)
>                 .getFactory(XMLOutputFactory.class);
> -
> +
>         try {
>             compositeProcessor.write(composite, outputFactory.createXMLStreamWriter(bos), new ProcessorContext(nodeFactory.registry));
>         } catch(Exception ex) {
>             return ex.toString();
>         }
> -
> +
>         String result = bos.toString();
> -
> +
>         // write out and nested composites
>         for (Component component : composite.getComponents()) {
>             if (component.getImplementation() instanceof Composite) {
> -                result += "\n<!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -->\n" +
> +                result += "\n<!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -->\n" +
>                            writeComposite((Composite)component.getImplementation(),
>                                           compositeProcessor);
>             }
>         }
> -
> +
>         return result;
>     }
> -
> +
>     public List<Contribution> getContributions() {
>         return contributions;
>     }
>
> Added: tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.extensibility.NodeActivatorExtensionPoint
> URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.extensibility.NodeActivatorExtensionPoint?rev=1086667&view=auto
> ==============================================================================
> --- tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.extensibility.NodeActivatorExtensionPoint (added)
> +++ tuscany/sca-java-2.x/trunk/modules/node-impl/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.extensibility.NodeActivatorExtensionPoint Tue Mar 29 18:25:37 2011
> @@ -0,0 +1,19 @@
> +# Licensed to the Apache Software Foundation (ASF) under one
> +# or more contributor license agreements.  See the NOTICE file
> +# distributed with this work for additional information
> +# regarding copyright ownership.  The ASF licenses this file
> +# to you under the Apache License, Version 2.0 (the
> +# "License"); you may not use this file except in compliance
> +# with the License.  You may obtain a copy of the License at
> +#
> +#   http://www.apache.org/licenses/LICENSE-2.0
> +#
> +# Unless required by applicable law or agreed to in writing,
> +# software distributed under the License is distributed on an
> +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> +# KIND, either express or implied.  See the License for the
> +# specific language governing permissions and limitations
> +# under the License.
> +
> +org.apache.tuscany.sca.node.extensibility.impl.DefaultNodeActivatorExtensionPoint
> +
>
>
>

Re: svn commit: r1086667 - in /tuscany/sca-java-2.x/trunk/modules: node-api/ node-api/META-INF/ node-api/src/main/java/org/apache/tuscany/sca/node/ node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/ node-impl/META-INF/ node-impl/src/ma

Posted by ant elder <an...@apache.org>.
On Wed, Mar 30, 2011 at 1:42 PM, Luciano Resende <lu...@gmail.com> wrote:
> On Tuesday, March 29, 2011, ant elder <an...@apache.org> wrote:
>> On Wed, Mar 30, 2011 at 4:53 AM, Luciano Resende <lu...@gmail.com> wrote:
>>> On Tue, Mar 29, 2011 at 4:05 PM, ant elder <an...@gmail.com> wrote:
>>>> There is something quite weird going on with this group of commits you
>>>> just did, the svn history and diffs is all mixed up so you can't see
>>>> whats going on, eg see this file which is a pom.xml turning into a
>>>> java class.
>>>>
>>>> Did you do anything out of the ordinary with the commits?
>>>>
>>>>   ...ant
>>>
>>> Basically git branch, commit, commit, git merge trunk...
>>> The following seems very strange...
>>>
>>>>    tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeActivator.java
>>>>      - copied, changed from r1086614, tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml
>>>>    tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeActivatorExtensionPoint.java
>>>>      - copied, changed from r1086614, tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml
>>>>    tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeExtension.java
>>>>      - copied, changed from r1086614, tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml
>>>
>>> But it seems that the files are ok in trunk.
>>>
>>
>> But without diffs we can't see what was changed and the file history
>> is lost so we can't see the provenance of the code. You need to fix
>> this please Luciano.
>>
>>    ...ant
>
>
> What ??? These are new files and the only issue is that for some
> reason Git or svn created a mail wrong... Come on Ant !!!
>

It might be obvious to you what the changes are doing but thats
because you made the changes, to others looking at these commit
messages its hard to work out.

Its committer 101 that commits are done in small discrete changes with
descriptive log messages and without mixing multiple changes or
formatting so that others can easily see whats going on and so its
possible to work out historical changes from the svn history. If you
know this was just a one off oversight or gremlin getting into your
git tools then fine but if you don't know what went wrong then i think
we need to sort it out so it doesn't continue happening. I'm happy to
help you do that, perhaps we can talk to infra@ as i know there are
others there who use git without these type of problems.

   ...ant

Re: svn commit: r1086667 - in /tuscany/sca-java-2.x/trunk/modules: node-api/ node-api/META-INF/ node-api/src/main/java/org/apache/tuscany/sca/node/ node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/ node-impl/META-INF/ node-impl/src/ma

Posted by Luciano Resende <lu...@gmail.com>.
On Tuesday, March 29, 2011, ant elder <an...@apache.org> wrote:
> On Wed, Mar 30, 2011 at 4:53 AM, Luciano Resende <lu...@gmail.com> wrote:
>> On Tue, Mar 29, 2011 at 4:05 PM, ant elder <an...@gmail.com> wrote:
>>> There is something quite weird going on with this group of commits you
>>> just did, the svn history and diffs is all mixed up so you can't see
>>> whats going on, eg see this file which is a pom.xml turning into a
>>> java class.
>>>
>>> Did you do anything out of the ordinary with the commits?
>>>
>>>   ...ant
>>
>> Basically git branch, commit, commit, git merge trunk...
>> The following seems very strange...
>>
>>>    tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeActivator.java
>>>      - copied, changed from r1086614, tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml
>>>    tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeActivatorExtensionPoint.java
>>>      - copied, changed from r1086614, tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml
>>>    tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeExtension.java
>>>      - copied, changed from r1086614, tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml
>>
>> But it seems that the files are ok in trunk.
>>
>
> But without diffs we can't see what was changed and the file history
> is lost so we can't see the provenance of the code. You need to fix
> this please Luciano.
>
>    ...ant


What ??? These are new files and the only issue is that for some
reason Git or svn created a mail wrong... Come on Ant !!!

-- 
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/

Re: svn commit: r1086667 - in /tuscany/sca-java-2.x/trunk/modules: node-api/ node-api/META-INF/ node-api/src/main/java/org/apache/tuscany/sca/node/ node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/ node-impl/META-INF/ node-impl/src/ma

Posted by ant elder <an...@apache.org>.
On Wed, Mar 30, 2011 at 4:53 AM, Luciano Resende <lu...@gmail.com> wrote:
> On Tue, Mar 29, 2011 at 4:05 PM, ant elder <an...@gmail.com> wrote:
>> There is something quite weird going on with this group of commits you
>> just did, the svn history and diffs is all mixed up so you can't see
>> whats going on, eg see this file which is a pom.xml turning into a
>> java class.
>>
>> Did you do anything out of the ordinary with the commits?
>>
>>   ...ant
>
> Basically git branch, commit, commit, git merge trunk...
> The following seems very strange...
>
>>    tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeActivator.java
>>      - copied, changed from r1086614, tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml
>>    tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeActivatorExtensionPoint.java
>>      - copied, changed from r1086614, tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml
>>    tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeExtension.java
>>      - copied, changed from r1086614, tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml
>
> But it seems that the files are ok in trunk.
>

But without diffs we can't see what was changed and the file history
is lost so we can't see the provenance of the code. You need to fix
this please Luciano.

   ...ant

Re: svn commit: r1086667 - in /tuscany/sca-java-2.x/trunk/modules: node-api/ node-api/META-INF/ node-api/src/main/java/org/apache/tuscany/sca/node/ node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/ node-impl/META-INF/ node-impl/src/ma

Posted by Luciano Resende <lu...@gmail.com>.
On Tue, Mar 29, 2011 at 4:05 PM, ant elder <an...@gmail.com> wrote:
> There is something quite weird going on with this group of commits you
> just did, the svn history and diffs is all mixed up so you can't see
> whats going on, eg see this file which is a pom.xml turning into a
> java class.
>
> Did you do anything out of the ordinary with the commits?
>
>   ...ant

Basically git branch, commit, commit, git merge trunk...
The following seems very strange...

>    tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeActivator.java
>      - copied, changed from r1086614, tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml
>    tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeActivatorExtensionPoint.java
>      - copied, changed from r1086614, tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml
>    tuscany/sca-java-2.x/trunk/modules/node-api/src/main/java/org/apache/tuscany/sca/node/extensibility/NodeExtension.java
>      - copied, changed from r1086614, tuscany/sca-java-2.x/trunk/modules/node-api/pom.xml

But it seems that the files are ok in trunk.

-- 
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/