You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by zo...@apache.org on 2010/06/05 17:59:07 UTC

svn commit: r951733 - in /incubator/aries/trunk/samples/goat: ./ goat-api/src/main/java/org/apache/aries/samples/goat/api/ goat-assembly/ goat-assembly/src/main/filtered-resources/configuration/ goat-info-enhancer/ goat-info-enhancer/src/ goat-info-enh...

Author: zoe
Date: Sat Jun  5 15:59:06 2010
New Revision: 951733

URL: http://svn.apache.org/viewvc?rev=951733&view=rev
Log:
ARIES-319 Committing for Holly

Added:
    incubator/aries/trunk/samples/goat/goat-info-enhancer/
    incubator/aries/trunk/samples/goat/goat-info-enhancer/pom.xml
    incubator/aries/trunk/samples/goat/goat-info-enhancer/src/
    incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/
    incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/
    incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/
    incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/
    incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/
    incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/
    incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/
    incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/
    incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/Activator.java
    incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/ModelInfoEnhancerService.java
    incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/ServiceInterceptor.java
Removed:
    incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/ComponentColorProperty.js
    incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/RelationshipAggregation.js
Modified:
    incubator/aries/trunk/samples/goat/goat-api/src/main/java/org/apache/aries/samples/goat/api/ComponentInfoProvider.java
    incubator/aries/trunk/samples/goat/goat-api/src/main/java/org/apache/aries/samples/goat/api/RelationshipInfoProvider.java
    incubator/aries/trunk/samples/goat/goat-assembly/pom.xml
    incubator/aries/trunk/samples/goat/goat-assembly/src/main/filtered-resources/configuration/config.ini
    incubator/aries/trunk/samples/goat/goat-web/src/main/java/org/apache/aries/samples/goat/web/ServerSideClass.java
    incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/ComponentStatusGrid.js
    incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/TriangleDecorator.js
    incubator/aries/trunk/samples/goat/pom.xml

Modified: incubator/aries/trunk/samples/goat/goat-api/src/main/java/org/apache/aries/samples/goat/api/ComponentInfoProvider.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-api/src/main/java/org/apache/aries/samples/goat/api/ComponentInfoProvider.java?rev=951733&r1=951732&r2=951733&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-api/src/main/java/org/apache/aries/samples/goat/api/ComponentInfoProvider.java (original)
+++ incubator/aries/trunk/samples/goat/goat-api/src/main/java/org/apache/aries/samples/goat/api/ComponentInfoProvider.java Sat Jun  5 15:59:06 2010
@@ -18,51 +18,59 @@
  */
 package org.apache.aries.samples.goat.api;
 
-import java.util.List;
+import java.util.Collection;
 
 /**
  * Provides information about components within a model.
- *
- * Good usage practice would be to subscribe a listener .. and THEN call getComponents.. 
- * (doing it the other way round risks leaving a window during which a change could occur, and you not be informed).
- * (doing it this way round, at worst, you'll see an update before you handle getComponents, 
- *  and since an update can be an add, you'll just process it twice) 
- *
+ * 
+ * Good usage practice would be to subscribe a listener .. and THEN call
+ * getComponents.. (doing it the other way round risks leaving a window during
+ * which a change could occur, and you not be informed). (doing it this way
+ * round, at worst, you'll see an update before you handle getComponents, and
+ * since an update can be an add, you'll just process it twice)
+ * 
  */
 public interface ComponentInfoProvider {
-	
+
 	/**
-	 * Callback interface implemented by users of the ComponentInfoProvider interface, allowing 
-	 * notification of changes, or deletions to components they have been informed about.
+	 * Callback interface implemented by users of the ComponentInfoProvider
+	 * interface, allowing notification of changes, or deletions to components
+	 * they have been informed about.
 	 */
 	static interface ComponentInfoListener {
-		//called to add, or update a component.
+		// called to add, or update a component.
 		public void updateComponent(ComponentInfo b);
+
 		public void removeComponent(ComponentInfo b);
 	};
-	
+
 	/**
 	 * Gets the current set of 'top level' components in this model.
 	 * 
-	 * Any nested components are only obtainable via the 'getChildren' method on ComponentInfo.
+	 * Any nested components are only obtainable via the 'getChildren' method on
+	 * ComponentInfo.
 	 * 
 	 * @return
 	 */
-	List<ComponentInfo> getComponents();
-	
+	Collection<ComponentInfo> getComponents();
+
 	/**
-	 * Gets a component for an id previously returned via getComponents, or updateComponent
+	 * Gets a component for an id previously returned via getComponents, or
+	 * updateComponent
+	 * 
 	 * @param id
 	 * @return component, or null if component id is either unknown, or deleted.
 	 */
 	ComponentInfo getComponentForId(String id);
-	
+
 	/**
-	 * Add a listener to this Info Provider, to be informed of changes/deletions.
+	 * Add a listener to this Info Provider, to be informed of
+	 * changes/deletions.
+	 * 
 	 * @param listener
 	 */
 	public void registerComponentInfoListener(ComponentInfoListener listener);
-	
-	//TODO: unregisterComponentInfoListener ;-) 
+
+	// TODO: unregisterComponentInfoListener ;-)
 
 }

Modified: incubator/aries/trunk/samples/goat/goat-api/src/main/java/org/apache/aries/samples/goat/api/RelationshipInfoProvider.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-api/src/main/java/org/apache/aries/samples/goat/api/RelationshipInfoProvider.java?rev=951733&r1=951732&r2=951733&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-api/src/main/java/org/apache/aries/samples/goat/api/RelationshipInfoProvider.java (original)
+++ incubator/aries/trunk/samples/goat/goat-api/src/main/java/org/apache/aries/samples/goat/api/RelationshipInfoProvider.java Sat Jun  5 15:59:06 2010
@@ -18,15 +18,17 @@
  */
 package org.apache.aries.samples.goat.api;
 
-import java.util.List;
+import java.util.Collection;
 
 public interface RelationshipInfoProvider {
 	static interface RelationshipInfoListener {
 		public void updateRelationship(RelationshipInfo b);
+
 		public void removeRelationship(RelationshipInfo b);
 	};
-	
-	List<RelationshipInfo> getRelationships();
-	
-	public void registerRelationshipInfoListener(RelationshipInfoListener listener);
+
+	Collection<RelationshipInfo> getRelationships();
+
+	public void registerRelationshipInfoListener(
+			RelationshipInfoListener listener);
 }

Modified: incubator/aries/trunk/samples/goat/goat-assembly/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-assembly/pom.xml?rev=951733&r1=951732&r2=951733&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-assembly/pom.xml (original)
+++ incubator/aries/trunk/samples/goat/goat-assembly/pom.xml Sat Jun  5 15:59:06 2010
@@ -124,6 +124,10 @@
 			<groupId>org.apache.aries.samples.goat</groupId>
 			<artifactId>org.apache.aries.samples.goat.bundlecontextmodel</artifactId>
 		</dependency>
+        <dependency>
+			<groupId>org.apache.aries.samples.goat</groupId>
+			<artifactId>org.apache.aries.samples.goat.info.enhancer</artifactId>
+		</dependency>
 	</dependencies>
 	<build>
 

Modified: incubator/aries/trunk/samples/goat/goat-assembly/src/main/filtered-resources/configuration/config.ini
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-assembly/src/main/filtered-resources/configuration/config.ini?rev=951733&r1=951732&r2=951733&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-assembly/src/main/filtered-resources/configuration/config.ini (original)
+++ incubator/aries/trunk/samples/goat/goat-assembly/src/main/filtered-resources/configuration/config.ini Sat Jun  5 15:59:06 2010
@@ -30,6 +30,7 @@ services-3.1.200-v20070605.jar@start,\
 org.apache.aries.samples.goat.api-${version}@start,\
 org.apache.aries.samples.goat.web-${version}.jar@start,\
 org.apache.aries.samples.goat.dummy-${version}.jar@start,\
+org.apache.aries.samples.goat.info.enhancer-${version}.jar@start,\
 org.apache.aries.samples.goat.bundlecontextmodel-${version}.jar@start
 eclipse.ignoreApp=true
 org.ops4j.pax.logging.DefaultServiceLog.level=INFO

Added: incubator/aries/trunk/samples/goat/goat-info-enhancer/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-info-enhancer/pom.xml?rev=951733&view=auto
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-info-enhancer/pom.xml (added)
+++ incubator/aries/trunk/samples/goat/goat-info-enhancer/pom.xml Sat Jun  5 15:59:06 2010
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+	license agreements. See the NOTICE file distributed with this work for additional 
+	information regarding copyright ownership. The ASF licenses this file to 
+	You under the Apache License, Version 2.0 (the "License"); you may not use 
+	this file except in compliance with the License. You may obtain a copy of 
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+	by applicable law or agreed to in writing, software distributed under the 
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+	OF ANY KIND, either express or implied. See the License for the specific 
+	language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.aries.samples.goat</groupId>
+		<artifactId>goat</artifactId>
+		<version>0.2-incubating-SNAPSHOT</version>
+	</parent>
+
+	<artifactId>org.apache.aries.samples.goat.info.enhancer</artifactId>
+	<name>Apache Aries GOAT model info enhancer</name>
+	<packaging>bundle</packaging>
+
+	<dependencies>
+		<dependency>
+			<groupId>${pom.groupId}</groupId>
+			<artifactId>org.apache.aries.samples.goat.api</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>${pom.groupId}</groupId>
+			<artifactId>org.apache.aries.samples.goat.web</artifactId>
+		</dependency>
+	</dependencies>
+
+
+	<properties>
+		<aries.osgi.activator>
+			org.apache.aries.samples.goat.enhancer.Activator
+        </aries.osgi.activator>
+	</properties>
+
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<configuration>
+					<instructions>
+						<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+						<Private-Package>org.apache.aries.samples.goat.enhancer.*</Private-Package> 
+						<Export-Package>!org.apache.aries.samples.goat.enhancer.*</Export-Package> 
+					</instructions>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+
+</project>
+

Added: incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/Activator.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/Activator.java?rev=951733&view=auto
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/Activator.java (added)
+++ incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/Activator.java Sat Jun  5 15:59:06 2010
@@ -0,0 +1,45 @@
+/**
+ * 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.aries.samples.goat.enhancer;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+	private ServiceInterceptor interceptor;
+
+	@Override
+	public void start(BundleContext ctx) throws Exception {
+		interceptor = new ServiceInterceptor(ctx);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+	 */
+	@Override
+	public void stop(BundleContext arg0) throws Exception {
+		interceptor.stop();
+	}
+
+}

Added: incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/ModelInfoEnhancerService.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/ModelInfoEnhancerService.java?rev=951733&view=auto
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/ModelInfoEnhancerService.java (added)
+++ incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/ModelInfoEnhancerService.java Sat Jun  5 15:59:06 2010
@@ -0,0 +1,338 @@
+/**
+ * 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.aries.samples.goat.enhancer;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.aries.samples.goat.api.ComponentInfo;
+import org.apache.aries.samples.goat.api.ComponentInfoProvider;
+import org.apache.aries.samples.goat.api.ModelInfoService;
+import org.apache.aries.samples.goat.api.RelationshipInfo;
+import org.apache.aries.samples.goat.api.RelationshipInfoProvider;
+import org.apache.aries.samples.goat.info.ComponentInfoImpl;
+import org.apache.aries.samples.goat.info.RelationshipInfoImpl;
+
+public class ModelInfoEnhancerService implements ModelInfoService,
+		ComponentInfoProvider, RelationshipInfoProvider,
+		ComponentInfoProvider.ComponentInfoListener,
+		RelationshipInfoProvider.RelationshipInfoListener {
+
+	private static final String SERVICE_REGISTRATION = "Service registration";
+
+	private static final String SERVICE_USAGE = "Service usage";
+
+	// TODO where should we expose these shared strings?
+	private static final String SERVICE = "Service";
+
+	private ModelInfoService originalService;
+
+	private final Map<String, ComponentInfo> components = new HashMap<String, ComponentInfo>();
+	private final Map<String, RelationshipInfo> relationships = new HashMap<String, RelationshipInfo>();
+
+	private final List<ComponentInfoListener> clisteners;
+	private final List<RelationshipInfoListener> rlisteners;
+
+	public ModelInfoEnhancerService(ModelInfoService infoService) {
+
+		clisteners = Collections
+				.synchronizedList(new ArrayList<ComponentInfoListener>());
+		rlisteners = Collections
+				.synchronizedList(new ArrayList<RelationshipInfoListener>());
+
+		this.originalService = infoService;
+		Collection<ComponentInfo> originalComponents = originalService
+				.getComponentInfoProvider().getComponents();
+		// We keep all the original components
+		for (ComponentInfo info : originalComponents) {
+			components.put(info.getId(), info);
+		}
+		// We add a new component for each service
+		Collection<RelationshipInfo> originalRelationships = originalService
+				.getRelationshipInfoProvider().getRelationships();
+		// We keep all the original components
+		for (RelationshipInfo rel : originalRelationships) {
+
+			if (SERVICE.equals(rel.getType())) {
+				ComponentInfoImpl serviceComponent = new ComponentInfoImpl();
+				String id = constructServiceComponentId(rel);
+				serviceComponent.setId(id);
+				Map<String, String> componentProperties = new HashMap<String, String>();
+				componentProperties.put("Name", rel.getName());
+				serviceComponent.setComponentProperties(componentProperties);
+
+				components.put(id, serviceComponent);
+
+				// Make new relationships;
+
+				RelationshipInfoImpl registration = new RelationshipInfoImpl();
+				registration.setType(SERVICE_REGISTRATION);
+				registration.setName(rel.getName());
+				registration.setProvidedBy(rel.getProvidedBy());
+				registration.setRelationshipAspects(rel
+						.getRelationshipAspects());
+
+				ArrayList<ComponentInfo> arrayList = new ArrayList<ComponentInfo>();
+				arrayList.add(serviceComponent);
+				registration.setConsumedBy(arrayList);
+
+				relationships.put(constructId(registration), registration);
+
+				RelationshipInfoImpl consumption = new RelationshipInfoImpl();
+				consumption.setType(SERVICE_USAGE);
+				consumption.setName(rel.getName());
+				consumption.setProvidedBy(serviceComponent);
+				consumption.setConsumedBy(rel.getConsumedBy());
+				consumption
+						.setRelationshipAspects(rel.getRelationshipAspects());
+
+				relationships.put(constructId(consumption), consumption);
+
+			} else {
+				// Pass non-service relationships through
+				relationships.put(constructId(rel), rel);
+
+			}
+
+			originalService.getComponentInfoProvider()
+					.registerComponentInfoListener(this);
+			originalService.getRelationshipInfoProvider()
+					.registerRelationshipInfoListener(this);
+		}
+
+	}
+
+	@Override
+	public String getName() {
+		return "Model Enhancer Service";
+	}
+
+	@Override
+	public ComponentInfoProvider getComponentInfoProvider() {
+		return this;
+	}
+
+	@Override
+	public RelationshipInfoProvider getRelationshipInfoProvider() {
+		return this;
+	}
+
+	@Override
+	public Collection<RelationshipInfo> getRelationships() {
+		return relationships.values();
+	}
+
+	@Override
+	public Collection<ComponentInfo> getComponents() {
+		return components.values();
+	}
+
+	@Override
+	public ComponentInfo getComponentForId(String id) {
+		return components.get(id);
+	}
+
+	@Override
+	public void registerRelationshipInfoListener(
+			RelationshipInfoListener listener) {
+		rlisteners.add(listener);
+	}
+
+	@Override
+	public void registerComponentInfoListener(ComponentInfoListener listener) {
+		clisteners.add(listener);
+	}
+
+	@Override
+	public void updateRelationship(RelationshipInfo r) {
+		if (SERVICE.equals(r.getType())) {
+			updateSyntheticServiceArtefactsAndNotifyListeners(r);
+		} else {
+			// Update our copy
+			relationships.put(constructId(r), r);
+			// This shouldn't affect us, but pass it on to our listeners
+			for (RelationshipInfoListener listener : rlisteners) {
+				listener.updateRelationship(r);
+			}
+		}
+
+	}
+
+	@Override
+	public void removeRelationship(RelationshipInfo r) {
+
+		if (SERVICE.equals(r.getType())) {
+			removeSyntheticServiceArtefactsAndNotifyListeners(r);
+		} else {
+			// We don't want to track this relationship anymore
+			String id = constructId(r);
+			RelationshipInfo relationship = relationships.get(id);
+			relationships.remove(id);
+			if (relationship != null) {
+				// This shouldn't affect us, but pass it on to our listeners
+				for (RelationshipInfoListener listener : rlisteners) {
+					listener.removeRelationship(relationship);
+				}
+			}
+		}
+
+	}
+
+	@Override
+	public void updateComponent(ComponentInfo b) {
+		// Update our copy
+		components.put(b.getId(), b);
+		// This shouldn't affect us, but pass it on to our listeners
+		for (ComponentInfoListener listener : clisteners) {
+			listener.updateComponent(b);
+		}
+
+	}
+
+	@Override
+	public void removeComponent(ComponentInfo b) {
+		// This shouldn't affect us unless it has relationships pointing to it
+		// Cheerfully assume that gets handled upstream
+
+		// We don't want to know about this component anymore
+		ComponentInfo component = components.remove(b);
+		if (component != null) {// This shouldn't affect us, but pass it on to
+								// our listeners
+			for (ComponentInfoListener listener : clisteners) {
+				listener.removeComponent(component);
+			}
+		}
+
+	}
+
+	private String constructServiceComponentId(RelationshipInfo rel) {
+		return "/syntheticenhancedservices/" + rel.getName() + "/"
+				+ rel.getProvidedBy().getId();
+	}
+
+	private String constructId(RelationshipInfo b) {
+		return b.getType() + "/" + b.getName() + "/"
+				+ b.getProvidedBy().getId();
+	}
+
+	private void removeSyntheticServiceArtefactsAndNotifyListeners(
+			RelationshipInfo r) {
+		// We need to remove our two relationships and the synthetic
+		// component
+
+		String componentId = constructServiceComponentId(r);
+
+		// Do the relationships first
+		// The registration has type "service registration", and the
+		// original provider and name
+		String registrationRelationshipId = SERVICE_REGISTRATION + "/"
+				+ r.getName() + "/" + r.getProvidedBy().getId();
+		RelationshipInfo registrationRelationship = relationships
+				.get(registrationRelationshipId);
+
+		// The consumers have type "service usage", and the
+		// original name, and the new provided by
+
+		String usageRelationshipId = SERVICE_USAGE + "/" + r.getName() + "/"
+				+ componentId;
+		RelationshipInfo usageRelationship = relationships
+				.get(usageRelationshipId);
+
+		relationships.remove(usageRelationshipId);
+		relationships.remove(registrationRelationshipId);
+
+		// Tell our listeners about the relationships first
+
+		for (RelationshipInfoListener listener : rlisteners) {
+			if (usageRelationship != null) {
+				listener.removeRelationship(usageRelationship);
+			}
+			if (registrationRelationship != null) {
+				listener.removeRelationship(registrationRelationship);
+			}
+
+		}
+
+		ComponentInfo component = components.remove(componentId);
+		if (component != null) {
+			// Tell our listeners their service component went away
+			for (ComponentInfoListener listener : clisteners) {
+				listener.removeComponent(component);
+			}
+		}
+	}
+
+	private void updateSyntheticServiceArtefactsAndNotifyListeners(
+			RelationshipInfo r) {
+		// We need to update our two relationships and the synthetic
+		// component
+		// Hopefully the thing which changed won't prevent us
+		// from finding our relationship
+
+		String componentId = constructServiceComponentId(r);
+
+		// Do the relationships first
+		// The registration has type "service registration", and the
+		// original provider and name
+		String registrationRelationshipId = SERVICE_REGISTRATION + "/"
+				+ r.getName() + "/" + r.getProvidedBy().getId();
+		RelationshipInfoImpl registrationRelationship = (RelationshipInfoImpl) relationships
+				.get(registrationRelationshipId);
+		registrationRelationship.setName(r.getName());
+		registrationRelationship.setRelationshipAspects(r
+				.getRelationshipAspects());
+
+		// The consumers have type "service usage", and the
+		// original name, and the new provided by
+
+		String usageRelationshipId = SERVICE_USAGE + "/" + r.getName() + "/"
+				+ componentId;
+		RelationshipInfoImpl usageRelationship = (RelationshipInfoImpl) relationships
+				.get(usageRelationshipId);
+
+		// The consumers may have changed, so we update the usage relationship
+		usageRelationship.setConsumedBy(r.getConsumedBy());
+		usageRelationship.setName(r.getName());
+		usageRelationship.setRelationshipAspects(r.getRelationshipAspects());
+
+		// Tell our listeners about the relationships first
+
+		for (RelationshipInfoListener listener : rlisteners) {
+			if (usageRelationship != null) {
+				listener.updateRelationship(usageRelationship);
+			}
+			if (registrationRelationship != null) {
+				listener.updateRelationship(registrationRelationship);
+			}
+
+		}
+
+		ComponentInfo component = components.get(componentId);
+		if (component != null) {
+			// Tell our listeners their service component was updated
+			for (ComponentInfoListener listener : clisteners) {
+				listener.updateComponent(component);
+			}
+		}
+	}
+}

Added: incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/ServiceInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/ServiceInterceptor.java?rev=951733&view=auto
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/ServiceInterceptor.java (added)
+++ incubator/aries/trunk/samples/goat/goat-info-enhancer/src/main/java/org/apache/aries/samples/goat/enhancer/ServiceInterceptor.java Sat Jun  5 15:59:06 2010
@@ -0,0 +1,126 @@
+/**
+ * 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.aries.samples.goat.enhancer;
+
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Map;
+
+import org.apache.aries.samples.goat.api.ModelInfoService;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+
+public class ServiceInterceptor implements ServiceListener {
+
+	private static final String DISPLAY_NAME = "displayName";
+	/**
+   * 
+   */
+	public static final String SERVICE_ID = "service.id";
+	private final BundleContext ctx;
+	private final Map<String, ServiceRegistration> registrations = new HashMap<String, ServiceRegistration>();
+
+	public ServiceInterceptor(BundleContext ctx) {
+		this.ctx = ctx;
+		// Check all the existing services
+		try {
+			// Handle any existing services
+			ServiceReference[] references = ctx.getAllServiceReferences(
+					ModelInfoService.class.getName(), null);
+
+			for (ServiceReference reference : references) {
+				registerServiceEnhancer(reference);
+			}
+
+			ctx.addServiceListener(this, "(objectclass='"
+					+ ModelInfoService.class.getName() + "')");
+
+		} catch (InvalidSyntaxException e) {
+			e.printStackTrace();
+		}
+		// We could listen for find events and mask the original services if we
+		// wanted to
+		// ServiceRegistration findRegistration =
+		// ctx.registerService(FindHook.class.getName(),
+		// new InterceptorFindHook(), null);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.osgi.framework.ServiceListener#serviceChanged(org.osgi.framework.
+	 * ServiceEvent)
+	 */
+	@Override
+	public void serviceChanged(ServiceEvent event) {
+		ServiceReference reference = event.getServiceReference();
+		if (event != null && event.getType() == ServiceEvent.REGISTERED) {
+			registerServiceEnhancer(reference);
+
+		} else if (event != null
+				&& event.getType() == ServiceEvent.UNREGISTERING) {
+			// Better unregister our enhancer
+			Object id = reference.getProperty(SERVICE_ID);
+			ServiceRegistration registration = registrations.get(id);
+			if (registration != null) {
+				registration.unregister();
+				registrations.remove(id);
+			}
+		}
+
+	}
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	private void registerServiceEnhancer(ServiceReference reference) {
+		Object actualService = ctx.getService(reference);
+
+		if (actualService instanceof ModelInfoService) {
+			ModelInfoService infoService = (ModelInfoService) actualService;
+			Object serviceId = reference.getProperty(SERVICE_ID);
+			Object enhancer = new ModelInfoEnhancerService(infoService);
+			Dictionary properties = new Hashtable();
+			Object originalDisplayName = reference.getProperty(DISPLAY_NAME);
+			properties.put(DISPLAY_NAME, originalDisplayName + " [enhanced]");
+			ServiceRegistration registration = ctx.registerService(
+					ModelInfoService.class.getName(), enhancer, properties);
+			registrations.put(serviceId + "", registration);
+		} else {
+			System.out.println("Oh dear - unexpected service "
+					+ actualService.getClass());
+		}
+	}
+
+	/**
+   * 
+   */
+	public void stop() {
+		for (ServiceRegistration registration : registrations.values()) {
+			registration.unregister();
+		}
+
+	}
+
+}

Modified: incubator/aries/trunk/samples/goat/goat-web/src/main/java/org/apache/aries/samples/goat/web/ServerSideClass.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-web/src/main/java/org/apache/aries/samples/goat/web/ServerSideClass.java?rev=951733&r1=951732&r2=951733&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-web/src/main/java/org/apache/aries/samples/goat/web/ServerSideClass.java (original)
+++ incubator/aries/trunk/samples/goat/goat-web/src/main/java/org/apache/aries/samples/goat/web/ServerSideClass.java Sat Jun  5 15:59:06 2010
@@ -19,197 +19,231 @@
 package org.apache.aries.samples.goat.web;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 import javax.servlet.ServletContext;
 
-import org.directwebremoting.ScriptSession;
-import org.directwebremoting.ScriptBuffer;
+import org.apache.aries.samples.goat.api.ComponentInfo;
+import org.apache.aries.samples.goat.api.ComponentInfoProvider;
+import org.apache.aries.samples.goat.api.ModelInfoService;
+import org.apache.aries.samples.goat.api.RelationshipInfo;
 import org.directwebremoting.Browser;
+import org.directwebremoting.ScriptBuffer;
+import org.directwebremoting.ScriptSession;
 import org.directwebremoting.ServerContextFactory;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.ServiceReference;
 
-import org.apache.aries.samples.goat.api.ComponentInfo;
-import org.apache.aries.samples.goat.api.ComponentInfoProvider;
-import org.apache.aries.samples.goat.api.ModelInfoService;
-import org.apache.aries.samples.goat.api.RelationshipInfo;
-
 public class ServerSideClass {
 
-	private String modelInfoServiceHint="";
-	
-	private ModelInfoService ModelInfoService=null;
-	
-	private Map<ModelInfoService, ComponentInfoProvider.ComponentInfoListener>listeners=new HashMap<ModelInfoService,ComponentInfoProvider.ComponentInfoListener>();
-
-
-    private class ListenerImpl implements ComponentInfoProvider.ComponentInfoListener{
-    	String server;
-    	public ListenerImpl(String server){
-    		this.server=server;
-    	}
-    	public void updateComponent(ComponentInfo b) {
-    		if(this.server.equals(modelInfoServiceHint)){
- 			   //todo: only issue the add for the new bundle, and affected other bundles.
- 			   getInitialComponents(modelInfoServiceHint);
- 		   }
-    	}
-    	public void removeComponent(ComponentInfo b) {
-    		//todo
-    	}
-    }
-    
+	private String modelInfoServiceHint = "";
+
+	private ModelInfoService ModelInfoService = null;
+
+	private Map<ModelInfoService, ComponentInfoProvider.ComponentInfoListener> listeners = new HashMap<ModelInfoService, ComponentInfoProvider.ComponentInfoListener>();
+
+	private class ListenerImpl implements
+			ComponentInfoProvider.ComponentInfoListener {
+		String server;
+
+		public ListenerImpl(String server) {
+			this.server = server;
+		}
+
+		public void updateComponent(ComponentInfo b) {
+			if (this.server.equals(modelInfoServiceHint)) {
+				// todo: only issue the add for the new bundle, and affected
+				// other bundles.
+				getInitialComponents(modelInfoServiceHint);
+			}
+		}
+
+		public void removeComponent(ComponentInfo b) {
+			// todo
+		}
+	}
+
 	public ServerSideClass() {
 		System.err.println("SSC Built!");
-       	
-    }
-    
+
+	}
+
 	@SuppressWarnings("unused")
-	private String bundleStateToString(int bundleState){
-		switch(bundleState){
-		case Bundle.UNINSTALLED : return "UNINSTALLED";
-		case Bundle.INSTALLED : return "INSTALLED";
-		case Bundle.RESOLVED : return "RESOLVED";
-		case Bundle.STARTING : return "STARTING";
-		case Bundle.STOPPING : return "STOPPING";
-		case Bundle.ACTIVE : return "ACTIVE";
-		default : return "UNKNOWN["+bundleState+"]";
-		}
-	}    
-    
-    /**
-     * this is invoked by a page onload.. so until it's invoked.. we dont care about components
-     */
-    public void getInitialComponents(String dataProvider){
-    	
-    	System.err.println("GET INITIAL BUNDLES ASKED TO USE DATAPROVIDER "+dataProvider);
-    	
-    	if(dataProvider==null)
-    		throw new IllegalArgumentException("Unable to accept 'null' as a dataProvider");
-    	
-    	//do we need to update?
-    	if( !this.modelInfoServiceHint.equals(dataProvider)){
-    		    		
-    		this.modelInfoServiceHint = dataProvider;
-		    		
-    		
-    		if(!(this.ModelInfoService==null)){
-    			//we already had a provider.. we need to shut down the existing components & relationships in the browsers..
-    			addFunctionCall("forgetAboutAllEverything");
-    		}
-    		
-        	ServletContext context = org.directwebremoting.ServerContextFactory.get().getServletContext();
-    		Object o = context.getAttribute("osgi-bundlecontext");
-    		if(o!=null){
-    			if(o instanceof BundleContext){
-    				BundleContext b_ctx = (BundleContext)o;
-    				
-    				System.err.println("Looking up bcip");
-    				try{
-    				ServiceReference sr[] = b_ctx.getServiceReferences(ModelInfoService.class.getName(), "(displayName="+this.modelInfoServiceHint+")");
-    				if(sr!=null){
-    					System.err.println("Getting bcip");
-    					this.ModelInfoService = (ModelInfoService)b_ctx.getService(sr[0]);
-    					System.err.println("Got bcip "+this.ModelInfoService);
-    				}else{
-    					System.err.println("UNABLE TO FIND BCIP!!");
-    					System.err.println("UNABLE TO FIND BCIP!!");
-    					System.err.println("UNABLE TO FIND BCIP!!");
-    				}
-    				}catch(InvalidSyntaxException ise){
-    					
-    				}
-  				
-    				if(this.ModelInfoService!=null){
-    					if(!listeners.containsKey(this.ModelInfoService)){    
-    						ComponentInfoProvider.ComponentInfoListener l = new ListenerImpl(this.modelInfoServiceHint);
-    						listeners.put(this.ModelInfoService, l);
-    						this.ModelInfoService.getComponentInfoProvider().registerComponentInfoListener(l);
-    					}
-    				}
-    			}
-    		}
-    		
-    	}
-    	    	
-    	List<ComponentInfo> bis = this.ModelInfoService.getComponentInfoProvider().getComponents();
-    	System.err.println("Got "+(bis==null?"null":bis.size())+" components back from the provider ");
-    	if(bis!=null){
-    		for(ComponentInfo b: bis){
-    	
-    			System.err.println("Adding Component .. "+b.getId());
-	
-    			addFunctionCall("addComponent",  b);    			   			
-    		}
-    	} 
-    	
-    	List<RelationshipInfo> ris = this.ModelInfoService.getRelationshipInfoProvider().getRelationships();
-    	System.err.println("Got "+(ris==null?"null":ris.size())+" relationships back from the provider ");
-    	if(ris!=null){
-    		for(RelationshipInfo r: ris){
-    			System.err.println("Adding relationship type "+r.getType()+" called "+r.getName()+" from "+r.getProvidedBy().getId());
-    			
-    			addFunctionCall("addRelationship",  r);
-    		}
-    	}
-    	 	
-    }
-	private void addFunctionCall(String name, Object... params){
-        final ScriptBuffer script = new ScriptBuffer();
-        script.appendScript(name).appendScript("(");
-        for(int i = 0; i < params.length; i++)
-        {
-            if(i != 0)script.appendScript(",");
-            script.appendData(params[i]);
-        }
-        script.appendScript(");");
-        Browser.withAllSessions(new Runnable(){ public void run(){
-            for(ScriptSession s: Browser.getTargetSessions()){
-                s.addScript(script);
-            }
-        }});
-    }
+	private String bundleStateToString(int bundleState) {
+		switch (bundleState) {
+		case Bundle.UNINSTALLED:
+			return "UNINSTALLED";
+		case Bundle.INSTALLED:
+			return "INSTALLED";
+		case Bundle.RESOLVED:
+			return "RESOLVED";
+		case Bundle.STARTING:
+			return "STARTING";
+		case Bundle.STOPPING:
+			return "STOPPING";
+		case Bundle.ACTIVE:
+			return "ACTIVE";
+		default:
+			return "UNKNOWN[" + bundleState + "]";
+		}
+	}
 
-	public String[] getProviders(){
+	/**
+	 * this is invoked by a page onload.. so until it's invoked.. we dont care
+	 * about components
+	 */
+	public void getInitialComponents(String dataProvider) {
+
+		System.err.println("GET INITIAL BUNDLES ASKED TO USE DATAPROVIDER "
+				+ dataProvider);
+
+		if (dataProvider == null)
+			throw new IllegalArgumentException(
+					"Unable to accept 'null' as a dataProvider");
+
+		// do we need to update?
+		if (!this.modelInfoServiceHint.equals(dataProvider)) {
+
+			this.modelInfoServiceHint = dataProvider;
+
+			if (!(this.ModelInfoService == null)) {
+				// we already had a provider.. we need to shut down the existing
+				// components & relationships in the browsers..
+				addFunctionCall("forgetAboutAllEverything");
+			}
+
+			ServletContext context = org.directwebremoting.ServerContextFactory
+					.get().getServletContext();
+			Object o = context.getAttribute("osgi-bundlecontext");
+			if (o != null) {
+				if (o instanceof BundleContext) {
+					BundleContext b_ctx = (BundleContext) o;
+
+					System.err.println("Looking up bcip");
+					try {
+						ServiceReference sr[] = b_ctx.getServiceReferences(
+								ModelInfoService.class.getName(),
+								"(displayName=" + this.modelInfoServiceHint
+										+ ")");
+						if (sr != null) {
+							System.err.println("Getting bcip");
+							this.ModelInfoService = (ModelInfoService) b_ctx
+									.getService(sr[0]);
+							System.err.println("Got bcip "
+									+ this.ModelInfoService);
+						} else {
+							System.err.println("UNABLE TO FIND BCIP!!");
+							System.err.println("UNABLE TO FIND BCIP!!");
+							System.err.println("UNABLE TO FIND BCIP!!");
+						}
+					} catch (InvalidSyntaxException ise) {
+
+					}
+
+					if (this.ModelInfoService != null) {
+						if (!listeners.containsKey(this.ModelInfoService)) {
+							ComponentInfoProvider.ComponentInfoListener l = new ListenerImpl(
+									this.modelInfoServiceHint);
+							listeners.put(this.ModelInfoService, l);
+							this.ModelInfoService.getComponentInfoProvider()
+									.registerComponentInfoListener(l);
+						}
+					}
+				}
+			}
+
+		}
+
+		Collection<ComponentInfo> bis = this.ModelInfoService
+				.getComponentInfoProvider().getComponents();
+		System.err.println("Got " + (bis == null ? "null" : bis.size())
+				+ " components back from the provider ");
+		if (bis != null) {
+			for (ComponentInfo b : bis) {
+
+				System.err.println("Adding Component .. " + b.getId());
+
+				addFunctionCall("addComponent", b);
+			}
+		}
+
+		Collection<RelationshipInfo> ris = this.ModelInfoService
+				.getRelationshipInfoProvider().getRelationships();
+		System.err.println("Got " + (ris == null ? "null" : ris.size())
+				+ " relationships back from the provider ");
+		if (ris != null) {
+			for (RelationshipInfo r : ris) {
+				System.err.println("Adding relationship type " + r.getType()
+						+ " called " + r.getName() + " from "
+						+ r.getProvidedBy().getId());
+
+				addFunctionCall("addRelationship", r);
+			}
+		}
+
+	}
+
+	private void addFunctionCall(String name, Object... params) {
+		final ScriptBuffer script = new ScriptBuffer();
+		script.appendScript(name).appendScript("(");
+		for (int i = 0; i < params.length; i++) {
+			if (i != 0)
+				script.appendScript(",");
+			script.appendData(params[i]);
+		}
+		script.appendScript(");");
+		Browser.withAllSessions(new Runnable() {
+			public void run() {
+				for (ScriptSession s : Browser.getTargetSessions()) {
+					s.addScript(script);
+				}
+			}
+		});
+	}
+
+	public String[] getProviders() {
 		System.err.println("Getting providers...");
-		ArrayList<String> result=new ArrayList<String>();
-    	ServletContext context = ServerContextFactory.get().getServletContext();
+		ArrayList<String> result = new ArrayList<String>();
+		ServletContext context = ServerContextFactory.get().getServletContext();
 		Object o = context.getAttribute("osgi-bundlecontext");
-		if(o!=null){
-			if(o instanceof BundleContext){
-				BundleContext b_ctx = (BundleContext)o;
-				try{
+		if (o != null) {
+			if (o instanceof BundleContext) {
+				BundleContext b_ctx = (BundleContext) o;
+				try {
 					System.err.println("Getting providers [2]...");
-					ServiceReference[] srs = b_ctx.getServiceReferences(ModelInfoService.class.getName(), null);
-					System.err.println("Got.. "+srs);
-					if(srs==null || srs.length==0){
+					ServiceReference[] srs = b_ctx.getServiceReferences(
+							ModelInfoService.class.getName(), null);
+					System.err.println("Got.. " + srs);
+					if (srs == null || srs.length == 0) {
 						System.err.println("NO DATA PROVIDERS");
-						throw new RuntimeException("Unable to find any data providers");
+						throw new RuntimeException(
+								"Unable to find any data providers");
 					}
 					System.err.println("Processing srs as loop.");
-					for(ServiceReference sr : srs){
+					for (ServiceReference sr : srs) {
 						System.err.println("Processing srs entry...");
-						
-						String name = (String.valueOf(sr.getProperty("displayName")));
-						
+
+						String name = (String.valueOf(sr
+								.getProperty("displayName")));
+
 						result.add(name);
-					}	
+					}
 					System.err.println("Processed srs as loop.");
-				}catch(InvalidSyntaxException e){
-					//wont happen, the exception relates to the filter, (2nd arg above), which is constant null.
+				} catch (InvalidSyntaxException e) {
+					// wont happen, the exception relates to the filter, (2nd
+					// arg above), which is constant null.
 				}
 			}
-		}	
-		System.err.println("Returning "+result.size());
+		}
+		System.err.println("Returning " + result.size());
 		String[] arr = new String[result.size()];
 		arr = result.toArray(arr);
-		for(String x: arr){
-			System.err.println(" - "+x);
+		for (String x : arr) {
+			System.err.println(" - " + x);
 		}
 		return arr;
 	}

Modified: incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/ComponentStatusGrid.js
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/ComponentStatusGrid.js?rev=951733&r1=951732&r2=951733&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/ComponentStatusGrid.js (original)
+++ incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/ComponentStatusGrid.js Sat Jun  5 15:59:06 2010
@@ -122,10 +122,11 @@ onComponentCreate: function(/*goat.Compo
 	if (this.jsonStore != null) {
 			
 		//read through the property elements to their values.. 
-		var id = component.elements["component.property.BundleID"].value;
-		var name = component.elements["component.property.SymbolicName"].value;
-		var state = component.elements["component.property.State"].value;
-		var version = component.elements["component.property.Version"].value;
+		undefinedString = "undefined";
+		var id = component.elements["component.property.BundleID"] != null? component.elements["component.property.BundleID"].value: undefinedString;
+		var name = component.elements["component.property.SymbolicName"] != null? component.elements["component.property.SymbolicName"].value: undefinedString;
+		var state = component.elements["component.property.State"] != null? component.elements["component.property.State"].value: undefinedString;
+		var version = component.elements["component.property.Version"] != null? component.elements["component.property.Version"].value: undefinedString;
 		
 		this.jsonStore.newItem({id: component.id, bundleid: id, name: name, state: state, version: version, x: component.x, y: component.y});
 	}

Modified: incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/TriangleDecorator.js
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/TriangleDecorator.js?rev=951733&r1=951732&r2=951733&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/TriangleDecorator.js (original)
+++ incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/TriangleDecorator.js Sat Jun  5 15:59:06 2010
@@ -97,10 +97,10 @@ dojo.declare("goat.elements.TriangleDeco
     			// The triangle starts in the middle of the line
     			var tx1 = (fromx + tox) / 2;
     			var ty1 = (fromy + toy) / 2;
-    			var tx2 = tx1 - deltax / divider + deltay / divider;
-    			var ty2 = ty1 - deltay / divider - deltax / divider;
-    			var tx3 = tx1 - deltax / divider - deltay / divider;
-    			var ty3 = ty1 - deltay / divider + deltax / divider;
+    			var tx2 = tx1 + deltax / divider + deltay / divider;
+    			var ty2 = ty1 + deltay / divider - deltax / divider;
+    			var tx3 = tx1 + deltax / divider - deltay / divider;
+    			var ty3 = ty1 + deltay / divider + deltax / divider;
         
     			if (this.triangle == null) {
     				this.triangle = this.trianglegroup.createPolyline( [ {

Modified: incubator/aries/trunk/samples/goat/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/pom.xml?rev=951733&r1=951732&r2=951733&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/pom.xml (original)
+++ incubator/aries/trunk/samples/goat/pom.xml Sat Jun  5 15:59:06 2010
@@ -56,6 +56,11 @@
                 <artifactId>org.apache.aries.samples.goat.bundlecontextmodel</artifactId>
                 <version>${version}</version>
             </dependency>
+            <dependency>
+                <groupId>${pom.groupId}</groupId>
+                <artifactId>org.apache.aries.samples.goat.info.enhancer</artifactId>
+                <version>${version}</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 
@@ -67,6 +72,7 @@
         <module>goat-assembly</module>
     <!--    <module>goat-eba</module> -->
         <module>goat-bundlecontext-modelprovider</module>
+        <module>goat-info-enhancer</module>
     </modules>
 
 </project>