You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by re...@apache.org on 2015/03/23 17:38:27 UTC

[43/51] [partial] incubator-taverna-engine git commit:

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/SwingAwareObserver.java
----------------------------------------------------------------------
diff --git a/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/SwingAwareObserver.java b/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/SwingAwareObserver.java
deleted file mode 100644
index 39435d7..0000000
--- a/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/SwingAwareObserver.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2012 The University of Manchester
- *
- *  Modifications to the initial code base are copyright of their
- *  respective authors, or their employers as appropriate.
- *
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1 of
- *  the License, or (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.observer;
-
-import javax.swing.SwingUtilities;
-
-/**
- * Implementation of an {@link Observer} that adds calls to notify to the AWT event dispatching
- * thread.
- *
- * @author David Withers
- */
-public abstract class SwingAwareObserver<Message> implements Observer<Message> {
-
-	@Override
-	public void notify(final Observable<Message> sender, final Message message) throws Exception {
-	    Runnable runnable = new Runnable() {
-			@Override
-			public void run() {
-				notifySwing(sender, message);
-			}
-	    };
-		if (SwingUtilities.isEventDispatchThread()) {
-			runnable.run();
-		} else {
-			// T2-971
-			SwingUtilities.invokeLater(runnable);
-		}
-	}
-
-	public abstract void notifySwing(Observable<Message> sender, Message message);
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/package-info.java
----------------------------------------------------------------------
diff --git a/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/package-info.java b/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/package-info.java
deleted file mode 100644
index e9d3ff2..0000000
--- a/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/package-info.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester   
- * 
- *  Modifications to the initial code base are copyright of their
- *  respective authors, or their employers as appropriate.
- * 
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1 of
- *  the License, or (at your option) any later version.
- *    
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *    
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-/**
- * Implementation of the observer pattern.  {@link Observer}s registers with an 
- * {@link Observable} using {@link Observable#addObserver(Observer)}, and will receive 
- * notifications as a call to {@link Observer#notify(Observable, Object)}. 
- * <p>
- * Typical implementations of {@link Observable} will be delegating to a 
- * {@link MultiCaster} to do the boring observer registration and message 
- * dispatching.
- * </p>
- * <p>
- * Example of Observable:
- * <pre>
- * public class MyObservable implements Observable<MyEvent> {
- * 	 public static class MyEvent {
- * 		// ..
- * 	 }
- * 	 private MultiCaster&lt:MyEvent&gt; multiCaster = new MultiCaster&lt:MyEvent&gt;(this);
- * 
- *	 public void doStuff() {
- *		multiCaster.notify(new MyEvent());
- *	 }
- * 
- * 	 public void addObserver(Observer<MyEvent> observer) {
- * 		multiCaster.addObserver(observer);
- * 	 }
- * 
- * 	 public List<Observer<MyEvent>> getObservers() {
- * 		return multiCaster.getObservers();
- * 	 }
- * 
- * 	 public void removeObserver(Observer<MyEvent> observer) {
- * 		multiCaster.removeObserver(observer);
- * 	 }
- * }
- * </pre>
- * And an observer that is notified when MyObservable.doStuff() is called:
- * <pre>
- * public class MyObserver implements Observer<MyEvent> {
- *	 public void notify(Observable<MyEvent> sender, MyEvent message) {
- *		System.out.println("Receieved " + message + " from " + sender);
- * 	 }
- * }
- * </pre>
- * Example of usage:
- * <pre>
- * 		MyObservable observable = new MyObservable();
- *		MyObserver observer = new MyObserver();
- *		observable.addObserver(observer);
- *		observable.doStuff();
- *	</pre>
- */
-package net.sf.taverna.t2.lang.observer;
-

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-observer/src/main/java/org/apache/taverna/lang/observer/MultiCaster.java
----------------------------------------------------------------------
diff --git a/taverna-observer/src/main/java/org/apache/taverna/lang/observer/MultiCaster.java b/taverna-observer/src/main/java/org/apache/taverna/lang/observer/MultiCaster.java
new file mode 100644
index 0000000..553ed0f
--- /dev/null
+++ b/taverna-observer/src/main/java/org/apache/taverna/lang/observer/MultiCaster.java
@@ -0,0 +1,92 @@
+/*
+* 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.taverna.lang.observer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Send notifications to registered observers about changes to models
+ * 
+ * @author Ian Dunlop
+ * @author Stian Soiland
+ * 
+ * @param <Message>
+ */
+public class MultiCaster<Message> implements Observable<Message> {
+
+	private static Logger logger = Logger.getLogger(MultiCaster.class);
+
+	private Observable<Message> observable;
+
+	protected List<Observer<Message>> observers = new ArrayList<Observer<Message>>();
+
+	/**
+	 * Set the {@link #observable} ie. the class that changes are happening to
+	 * and it's Message for this {@link MultiCaster}
+	 * 
+	 * @param observable
+	 */
+	public MultiCaster(Observable<Message> observable) {
+		this.observable = observable;
+	}
+
+	/**
+	 * Tell all the registered observers about the change to the model
+	 * 
+	 * @param message
+	 */
+	@SuppressWarnings("unchecked")
+	public void notify(Message message) {
+		// Use a copy that can be iterated even if register/remove is called
+		for (Observer<Message> observer : getObservers()) {
+			try {
+				observer.notify(observable, message);
+			} catch (Exception ex) {
+				logger.warn("Could not notify " + observer, ex);
+			}
+		}
+	}
+
+	/**
+	 * Register an observer ie. someone who wants informed about changes
+	 */
+	public synchronized void addObserver(Observer<Message> observer) {
+		observers.add(observer);
+	}
+
+	/**
+	 * Remove the observer and no longer send out any notifications about it
+	 */
+	public synchronized void removeObserver(Observer<Message> observer) {
+		observers.remove(observer);
+	}
+
+	/**
+	 * A list of all the classes currently registered with this
+	 * {@link MultiCaster}
+	 */
+	public synchronized List<Observer<Message>> getObservers() {
+		return new ArrayList<Observer<Message>>(observers);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-observer/src/main/java/org/apache/taverna/lang/observer/Observable.java
----------------------------------------------------------------------
diff --git a/taverna-observer/src/main/java/org/apache/taverna/lang/observer/Observable.java b/taverna-observer/src/main/java/org/apache/taverna/lang/observer/Observable.java
new file mode 100644
index 0000000..d80a91b
--- /dev/null
+++ b/taverna-observer/src/main/java/org/apache/taverna/lang/observer/Observable.java
@@ -0,0 +1,55 @@
+/*
+* 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.taverna.lang.observer;
+
+import java.util.List;
+
+/**
+ * Implements this if you want to notify other classes about changes
+ * 
+ * @author Ian Dunlop
+ * @author Stian Soiland
+ * 
+ * @param <Message>
+ */
+public interface Observable<Message> {
+	/**
+	 * Register an {@link Observer}
+	 * 
+	 * @param observer
+	 *            the class who wants notified of changes
+	 */
+	public void addObserver(Observer<Message> observer);
+
+	/**
+	 * Remove a class who is currently observing
+	 * 
+	 * @param observer
+	 *            the class who no longer wants notified
+	 */
+	public void removeObserver(Observer<Message> observer);
+
+	/**
+	 * A list of all the currently registered {@link Observer}s
+	 * 
+	 * @return
+	 */
+	public List<Observer<Message>> getObservers();
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-observer/src/main/java/org/apache/taverna/lang/observer/Observer.java
----------------------------------------------------------------------
diff --git a/taverna-observer/src/main/java/org/apache/taverna/lang/observer/Observer.java b/taverna-observer/src/main/java/org/apache/taverna/lang/observer/Observer.java
new file mode 100644
index 0000000..df51cf8
--- /dev/null
+++ b/taverna-observer/src/main/java/org/apache/taverna/lang/observer/Observer.java
@@ -0,0 +1,43 @@
+/*
+* 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.taverna.lang.observer;
+
+/**
+ * Implement if you want to register with an {@link Observable}
+ * 
+ * @author Ian Dunlop
+ * @author Stian Soiland
+ * 
+ * @param <Message>
+ */
+public interface Observer<Message> {
+	/**
+	 * Called by the {@link Observable} to notify the implementing class of
+	 * changes
+	 * 
+	 * @param sender
+	 *            the class where the changes have happened
+	 * @param message
+	 *            what has changed
+	 * @throws Exception
+	 */
+	public void notify(Observable<Message> sender, Message message)
+			throws Exception;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-observer/src/main/java/org/apache/taverna/lang/observer/SwingAwareObserver.java
----------------------------------------------------------------------
diff --git a/taverna-observer/src/main/java/org/apache/taverna/lang/observer/SwingAwareObserver.java b/taverna-observer/src/main/java/org/apache/taverna/lang/observer/SwingAwareObserver.java
new file mode 100644
index 0000000..45dd21f
--- /dev/null
+++ b/taverna-observer/src/main/java/org/apache/taverna/lang/observer/SwingAwareObserver.java
@@ -0,0 +1,50 @@
+/*
+* 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.taverna.lang.observer;
+
+import javax.swing.SwingUtilities;
+
+/**
+ * Implementation of an {@link Observer} that adds calls to notify to the AWT event dispatching
+ * thread.
+ *
+ * @author David Withers
+ */
+public abstract class SwingAwareObserver<Message> implements Observer<Message> {
+
+	@Override
+	public void notify(final Observable<Message> sender, final Message message) throws Exception {
+	    Runnable runnable = new Runnable() {
+			@Override
+			public void run() {
+				notifySwing(sender, message);
+			}
+	    };
+		if (SwingUtilities.isEventDispatchThread()) {
+			runnable.run();
+		} else {
+			// T2-971
+			SwingUtilities.invokeLater(runnable);
+		}
+	}
+
+	public abstract void notifySwing(Observable<Message> sender, Message message);
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-observer/src/main/java/org/apache/taverna/lang/observer/package-info.java
----------------------------------------------------------------------
diff --git a/taverna-observer/src/main/java/org/apache/taverna/lang/observer/package-info.java b/taverna-observer/src/main/java/org/apache/taverna/lang/observer/package-info.java
new file mode 100644
index 0000000..3cf0002
--- /dev/null
+++ b/taverna-observer/src/main/java/org/apache/taverna/lang/observer/package-info.java
@@ -0,0 +1,72 @@
+/*
+* 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.
+*/
+
+/**
+ * Implementation of the observer pattern.  {@link Observer}s registers with an 
+ * {@link Observable} using {@link Observable#addObserver(Observer)}, and will receive 
+ * notifications as a call to {@link Observer#notify(Observable, Object)}. 
+ * <p>
+ * Typical implementations of {@link Observable} will be delegating to a 
+ * {@link MultiCaster} to do the boring observer registration and message 
+ * dispatching.
+ * </p>
+ * <p>
+ * Example of Observable:
+ * <pre>
+ * public class MyObservable implements Observable<MyEvent> {
+ * 	 public static class MyEvent {
+ * 		// ..
+ * 	 }
+ * 	 private MultiCaster&lt:MyEvent&gt; multiCaster = new MultiCaster&lt:MyEvent&gt;(this);
+ * 
+ *	 public void doStuff() {
+ *		multiCaster.notify(new MyEvent());
+ *	 }
+ * 
+ * 	 public void addObserver(Observer<MyEvent> observer) {
+ * 		multiCaster.addObserver(observer);
+ * 	 }
+ * 
+ * 	 public List<Observer<MyEvent>> getObservers() {
+ * 		return multiCaster.getObservers();
+ * 	 }
+ * 
+ * 	 public void removeObserver(Observer<MyEvent> observer) {
+ * 		multiCaster.removeObserver(observer);
+ * 	 }
+ * }
+ * </pre>
+ * And an observer that is notified when MyObservable.doStuff() is called:
+ * <pre>
+ * public class MyObserver implements Observer<MyEvent> {
+ *	 public void notify(Observable<MyEvent> sender, MyEvent message) {
+ *		System.out.println("Receieved " + message + " from " + sender);
+ * 	 }
+ * }
+ * </pre>
+ * Example of usage:
+ * <pre>
+ * 		MyObservable observable = new MyObservable();
+ *		MyObserver observer = new MyObserver();
+ *		observable.addObserver(observer);
+ *		observable.doStuff();
+ *	</pre>
+ */
+package org.apache.taverna.lang.observer;
+

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-observer/src/test/java/net/sf/taverna/t2/lang/observer/ObserverTest.java
----------------------------------------------------------------------
diff --git a/taverna-observer/src/test/java/net/sf/taverna/t2/lang/observer/ObserverTest.java b/taverna-observer/src/test/java/net/sf/taverna/t2/lang/observer/ObserverTest.java
deleted file mode 100644
index 661cbbc..0000000
--- a/taverna-observer/src/test/java/net/sf/taverna/t2/lang/observer/ObserverTest.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester   
- * 
- *  Modifications to the initial code base are copyright of their
- *  respective authors, or their employers as appropriate.
- * 
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1 of
- *  the License, or (at your option) any later version.
- *    
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *    
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.observer;
-
-import static org.junit.Assert.*;
-
-import java.util.List;
-
-import net.sf.taverna.t2.lang.observer.MultiCaster;
-import net.sf.taverna.t2.lang.observer.Observable;
-import net.sf.taverna.t2.lang.observer.Observer;
-
-import org.junit.Test;
-
-public class ObserverTest {
-
-	@Test
-	public void registerObserver() throws Exception {
-		MyObservable observable = new MyObservable();
-		MyObserver observer1 = new MyObserver();
-		MyObserver observer2 = new MyObserver();
-
-		observable.triggerEvent(); // don't notify, but increase count
-		assertNull(observer1.lastMessage);
-		observable.addObserver(observer1);
-		assertNull(observer1.lastMessage);
-		assertNull(observer2.lastMessage);
-		assertNull(observer1.lastSender);
-		assertNull(observer2.lastSender);
-		observable.triggerEvent();
-		assertEquals("This is message 1", observer1.lastMessage);
-		assertSame(observable, observer1.lastSender);
-		assertNull(observer2.lastSender);
-
-		observable.addObserver(observer2);
-		assertNull(observer2.lastMessage);
-		observable.triggerEvent();
-		assertEquals("This is message 2", observer1.lastMessage);
-		assertEquals("This is message 2", observer2.lastMessage);
-		assertSame(observable, observer1.lastSender);
-		assertSame(observable, observer2.lastSender);
-
-		MyObservable otherObservable = new MyObservable();
-		otherObservable.addObserver(observer2);
-		otherObservable.triggerEvent();
-		// New instance, should start from 0
-		assertEquals("This is message 0", observer2.lastMessage);
-		assertSame(otherObservable, observer2.lastSender);
-
-		// observer1 unchanged
-		assertEquals("This is message 2", observer1.lastMessage);
-		assertSame(observable, observer1.lastSender);
-
-	}
-
-	@Test
-	public void concurrencyTest() {
-		MyObservable observable = new MyObservable();
-		MyObserver dummyObserver = new MyObserver();
-		SelvRemovingObserver selfRemoving = new SelvRemovingObserver();
-		observable.addObserver(dummyObserver);
-		observable.addObserver(selfRemoving);
-		assertEquals(2, observable.getObservers().size());
-		observable.triggerEvent();
-		
-		
-	}
-	
-	public class MyObservable implements Observable<String> {
-
-		private int counter = 0;
-		MultiCaster<String> multiCaster = new MultiCaster<String>(this);
-
-		public void addObserver(Observer<String> observer) {
-			multiCaster.addObserver(observer);
-		}
-
-		public void removeObserver(Observer<String> observer) {
-			multiCaster.removeObserver(observer);
-		}
-
-		public void triggerEvent() {
-			multiCaster.notify("This is message " + counter++);
-		}
-
-		public List<Observer<String>> getObservers() {
-			return multiCaster.getObservers();
-		}
-	}
-
-	public class MyObserver implements Observer<String> {
-		String lastMessage = null;
-		Observable<String> lastSender = null;
-
-		public void notify(Observable<String> sender, String message) {
-			lastSender = sender;
-			lastMessage = message;
-		}
-	}
-	
-	public class SelvRemovingObserver implements Observer<String> {
-
-		public int called=0;
-		
-		public void notify(Observable<String> sender, String message) {
-			called++;
-			if (called > 1) {
-				fail("Did not remove itself");
-			}
-			sender.removeObserver(this);
-		}
-		
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-observer/src/test/java/org/apache/taverna/lang/observer/ObserverTest.java
----------------------------------------------------------------------
diff --git a/taverna-observer/src/test/java/org/apache/taverna/lang/observer/ObserverTest.java b/taverna-observer/src/test/java/org/apache/taverna/lang/observer/ObserverTest.java
new file mode 100644
index 0000000..7b4874c
--- /dev/null
+++ b/taverna-observer/src/test/java/org/apache/taverna/lang/observer/ObserverTest.java
@@ -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.taverna.lang.observer;
+
+import static org.junit.Assert.*;
+
+import java.util.List;
+
+import org.junit.Test;
+
+public class ObserverTest {
+
+	@Test
+	public void registerObserver() throws Exception {
+		MyObservable observable = new MyObservable();
+		MyObserver observer1 = new MyObserver();
+		MyObserver observer2 = new MyObserver();
+
+		observable.triggerEvent(); // don't notify, but increase count
+		assertNull(observer1.lastMessage);
+		observable.addObserver(observer1);
+		assertNull(observer1.lastMessage);
+		assertNull(observer2.lastMessage);
+		assertNull(observer1.lastSender);
+		assertNull(observer2.lastSender);
+		observable.triggerEvent();
+		assertEquals("This is message 1", observer1.lastMessage);
+		assertSame(observable, observer1.lastSender);
+		assertNull(observer2.lastSender);
+
+		observable.addObserver(observer2);
+		assertNull(observer2.lastMessage);
+		observable.triggerEvent();
+		assertEquals("This is message 2", observer1.lastMessage);
+		assertEquals("This is message 2", observer2.lastMessage);
+		assertSame(observable, observer1.lastSender);
+		assertSame(observable, observer2.lastSender);
+
+		MyObservable otherObservable = new MyObservable();
+		otherObservable.addObserver(observer2);
+		otherObservable.triggerEvent();
+		// New instance, should start from 0
+		assertEquals("This is message 0", observer2.lastMessage);
+		assertSame(otherObservable, observer2.lastSender);
+
+		// observer1 unchanged
+		assertEquals("This is message 2", observer1.lastMessage);
+		assertSame(observable, observer1.lastSender);
+
+	}
+
+	@Test
+	public void concurrencyTest() {
+		MyObservable observable = new MyObservable();
+		MyObserver dummyObserver = new MyObserver();
+		SelvRemovingObserver selfRemoving = new SelvRemovingObserver();
+		observable.addObserver(dummyObserver);
+		observable.addObserver(selfRemoving);
+		assertEquals(2, observable.getObservers().size());
+		observable.triggerEvent();
+		
+		
+	}
+	
+	public class MyObservable implements Observable<String> {
+
+		private int counter = 0;
+		MultiCaster<String> multiCaster = new MultiCaster<String>(this);
+
+		public void addObserver(Observer<String> observer) {
+			multiCaster.addObserver(observer);
+		}
+
+		public void removeObserver(Observer<String> observer) {
+			multiCaster.removeObserver(observer);
+		}
+
+		public void triggerEvent() {
+			multiCaster.notify("This is message " + counter++);
+		}
+
+		public List<Observer<String>> getObservers() {
+			return multiCaster.getObservers();
+		}
+	}
+
+	public class MyObserver implements Observer<String> {
+		String lastMessage = null;
+		Observable<String> lastSender = null;
+
+		public void notify(Observable<String> sender, String message) {
+			lastSender = sender;
+			lastMessage = message;
+		}
+	}
+	
+	public class SelvRemovingObserver implements Observer<String> {
+
+		public int called=0;
+		
+		public void notify(Observable<String> sender, String message) {
+			called++;
+			if (called > 1) {
+				fail("Did not remove itself");
+			}
+			sender.removeObserver(this);
+		}
+		
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/AbstractExternalReference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/AbstractExternalReference.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/AbstractExternalReference.java
deleted file mode 100644
index 599d0bb..0000000
--- a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/AbstractExternalReference.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester   
- * 
- *  Modifications to the initial code base are copyright of their
- *  respective authors, or their employers as appropriate.
- * 
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1 of
- *  the License, or (at your option) any later version.
- *    
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *    
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.reference;
-
-import static net.sf.taverna.t2.reference.ReferencedDataNature.*;
-
-/**
- * A trivial implementation of ExternalReference. This abstract class should be
- * used as the superclass of any ExternalReference implementations as it
- * provides base metadata for the hibernate-based persistence system used by the
- * main reference manager implementation. While the interface contract cannot
- * require this your extensions will likely not work properly unless you use
- * this class.
- * 
- * @author Tom Oinn
- */
-public abstract class AbstractExternalReference implements ExternalReferenceSPI {
-	// Used internally by Hibernate for this class and subclasses
-	private int primaryKey;
-
-	/**
-	 * Used by Hibernate internally to establish a foreign key relationship
-	 * between this abstract superclass and tables corresponding to
-	 * implementations of the ExternalReference interface. Has no impact on any
-	 * application level code, this method is only ever used by the internals of
-	 * the hibernate framework.
-	 */
-	public final void setPrimaryKey(int newKey) {
-		this.primaryKey = newKey;
-	}
-
-	/**
-	 * Used by Hibernate internally to establish a foreign key relationship
-	 * between this abstract superclass and tables corresponding to
-	 * implementations of the ExternalReference interface. Has no impact on any
-	 * application level code, this method is only ever used by the internals of
-	 * the hibernate framework.
-	 */
-	public final int getPrimaryKey() {
-		return this.primaryKey;
-	}
-
-	/**
-	 * Default to returning DataReferenceNature.UNKNOWN
-	 */
-	@Override
-	public ReferencedDataNature getDataNature() {
-		return UNKNOWN;
-	}
-
-	/**
-	 * Default to returning null for charset
-	 */
-	@Override
-	public String getCharset() {
-		return null;
-	}
-
-	/**
-	 * Default to a value of 0.0f for the resolution cost, but implementations
-	 * should at least attempt to set this to a more sensible level!
-	 */
-	@Override
-	public float getResolutionCost() {
-		return 0.0f;
-	}
-
-	@Override
-	public abstract ExternalReferenceSPI clone()
-			throws CloneNotSupportedException;
-}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ContextualizedT2Reference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ContextualizedT2Reference.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ContextualizedT2Reference.java
deleted file mode 100644
index a5699b0..0000000
--- a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ContextualizedT2Reference.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester   
- * 
- *  Modifications to the initial code base are copyright of their
- *  respective authors, or their employers as appropriate.
- * 
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1 of
- *  the License, or (at your option) any later version.
- *    
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *    
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.reference;
-
-/**
- * Used by the {@link ReferenceService#traverseFrom(T2Reference, int)} when
- * traversing a collection structure. Each contextualized t2reference contains
- * the {@link T2Reference} along with an integer array index representing the
- * position of that reference within the traversal structure. The index
- * [i<sub>0</sub>,i<sub>1</sub>,i<sub>2</sub> ... i<sub>n</sub>] is interpreted
- * such that the reference is located at
- * parent.get(i<sub>0</sub>).get(i<sub>1</sub
- * >).get(i<sub>2</sub>)....get(i<sub>n</sub>). If the index is empty then the
- * T2Reference <em>is</em> the original reference supplied to the
- * {@link ReferenceService#traverseFrom(T2Reference, int) traverseFrom} method.
- * 
- * @author Tom Oinn
- */
-public interface ContextualizedT2Reference {
-	/**
-	 * @return the T2Reference to which the associated index applies.
-	 */
-	T2Reference getReference();
-
-	/**
-	 * @return the index of this T2Reference
-	 */
-	int[] getIndex();
-}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/DaoException.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/DaoException.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/DaoException.java
deleted file mode 100644
index 7de38df..0000000
--- a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/DaoException.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester   
- * 
- *  Modifications to the initial code base are copyright of their
- *  respective authors, or their employers as appropriate.
- * 
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1 of
- *  the License, or (at your option) any later version.
- *    
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *    
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.reference;
-
-/**
- * Thrown by the Data Access Object interface methods, wrapping any underlying
- * exception.
- * 
- * @author Tom Oinn
- */
-public class DaoException extends RuntimeException {
-	static final long serialVersionUID = 8496141798637577803L;
-
-	public DaoException() {
-		super();
-	}
-
-	public DaoException(String message) {
-		super(message);
-	}
-
-	public DaoException(Throwable cause) {
-		super(cause);
-	}
-
-	public DaoException(String message, Throwable cause) {
-		super(message, cause);
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/DereferenceException.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/DereferenceException.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/DereferenceException.java
deleted file mode 100644
index d2f814f..0000000
--- a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/DereferenceException.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester   
- * 
- *  Modifications to the initial code base are copyright of their
- *  respective authors, or their employers as appropriate.
- * 
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1 of
- *  the License, or (at your option) any later version.
- *    
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *    
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.reference;
-
-/**
- * Thrown when a problem occurs during de-reference of an ExternalReferenceSPI
- * implementation. This include operations which implicitly de-reference the
- * reference such as those infering character set or data natures.
- * 
- * @author Tom Oinn
- */
-public class DereferenceException extends RuntimeException {
-	private static final long serialVersionUID = 8054381613840005541L;
-
-	public DereferenceException() {
-		//
-	}
-
-	public DereferenceException(String message) {
-		super(message);
-	}
-
-	public DereferenceException(Throwable cause) {
-		super(cause);
-	}
-
-	public DereferenceException(String message, Throwable cause) {
-		super(message, cause);
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocument.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocument.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocument.java
deleted file mode 100644
index 06a20e3..0000000
--- a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocument.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester   
- * 
- *  Modifications to the initial code base are copyright of their
- *  respective authors, or their employers as appropriate.
- * 
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1 of
- *  the License, or (at your option) any later version.
- *    
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *    
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.reference;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * Contains the definition of an error token within the workflow system.
- * 
- * @author Tom Oinn
- * @author David Withers
- */
-public interface ErrorDocument extends Identified {
-	/**
-	 * If the error document is created from a {@link Throwable} it will have a
-	 * stack trace, in this case the stack trace is represented as a list of
-	 * {@link StackTraceElement} beans
-	 */
-	List<StackTraceElementBean> getStackTraceStrings();
-
-	/**
-	 * If the error document is created from a {@link Throwable}, this contains
-	 * the message part of the {@link Throwable}.
-	 */
-	String getExceptionMessage();
-
-	/**
-	 * Error documents can carry an arbitrary string message, this returns it.
-	 */
-	String getMessage();
-
-	/**
-	 * If the error document is created from set of references that contain
-	 * error documents, this method returns them.
-	 */
-	Set<T2Reference> getErrorReferences();
-}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentDao.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentDao.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentDao.java
deleted file mode 100644
index 72fabf1..0000000
--- a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentDao.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester   
- * 
- *  Modifications to the initial code base are copyright of their
- *  respective authors, or their employers as appropriate.
- * 
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1 of
- *  the License, or (at your option) any later version.
- *    
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *    
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.reference;
-
-import static org.springframework.transaction.annotation.Propagation.REQUIRED;
-import static org.springframework.transaction.annotation.Propagation.SUPPORTS;
-
-import org.springframework.transaction.annotation.Transactional;
-
-/**
- * Data access object handling ErrorDocument instances.
- * 
- * @author Tom Oinn
- */
-public interface ErrorDocumentDao {
-	/**
-	 * Store a named ErrorDocument to the database.
-	 * 
-	 * @param errorDoc
-	 *            error document to store
-	 * @throws DaoException
-	 *             if any exception is thrown when connecting to the underlying
-	 *             store or when storing the error document
-	 */
-	@Transactional(propagation = REQUIRED, readOnly = false)
-	void store(ErrorDocument errorDoc) throws DaoException;
-
-	/**
-	 * Retrieves a named and populated ErrorDocument
-	 * 
-	 * @param reference
-	 *            id of the error document to retrieve
-	 * @return a previously stored ErrorDocument instance
-	 * @throws DaoException
-	 *             if any exception is thrown when connecting to the underlying
-	 *             data store or when attempting retrieval of the error document
-	 */
-	@Transactional(propagation = SUPPORTS, readOnly = true)
-	ErrorDocument get(T2Reference reference) throws DaoException;
-
-	@Transactional(propagation = SUPPORTS, readOnly = false)
-	boolean delete(ErrorDocument errorDoc) throws DaoException;
-
-	@Transactional(propagation = SUPPORTS, readOnly = false)
-	void deleteErrorDocumentsForWFRun(String workflowRunId) throws DaoException;
-}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentService.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentService.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentService.java
deleted file mode 100644
index 6eee715..0000000
--- a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentService.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester   
- * 
- *  Modifications to the initial code base are copyright of their
- *  respective authors, or their employers as appropriate.
- * 
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1 of
- *  the License, or (at your option) any later version.
- *    
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *    
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.reference;
-
-import java.util.Set;
-
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
-
-/**
- * Provides facilities to register list of T2References, register empty lists at
- * any given depth and to resolve appropriate T2Reference instances back to
- * these lists. Registration operations assign names and lock the list contents
- * as a result. This service operates strictly on T2References, it neither tries
- * to nor is capable of any form of reference resolution, so aspects such as
- * collection traversal are not handled here (these are performed by the top
- * level reference service)
- * 
- * @author Tom Oinn
- */
-@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
-public interface ErrorDocumentService {
-	/**
-	 * Register a new error document.
-	 * <p>
-	 * The created reference will be related with a workflow run id passed
-	 * through ReferenceContext so we can track all data referenced by a
-	 * specific run.
-	 * 
-	 * @param message
-	 *            a free text message describing the error, if available. If
-	 *            there is no message use the empty string here.
-	 * @param t
-	 *            a Throwable describing the underlying fault causing this error
-	 *            document to be registered, if any. If there is no Throwable
-	 *            associated use null.
-	 * @param depth
-	 *            depth of the error, used when returning an error document
-	 *            instead of an identified list.
-	 * @return a new ErrorDocument instance, constructed fully and stored in the
-	 *         underlying storage system
-	 */
-	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
-	ErrorDocument registerError(String message, Throwable t, int depth,
-			ReferenceContext context) throws ErrorDocumentServiceException;
-
-	/**
-	 * Equivalent to <code>registerError(message, null, depth, context)</code>.
-	 */
-	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
-	ErrorDocument registerError(String message, int depth,
-			ReferenceContext context) throws ErrorDocumentServiceException;
-
-	/**
-	 * Equivalent to <code>registerError("", t, depth, context)</code>.
-	 */
-	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
-	ErrorDocument registerError(Throwable t, int depth, ReferenceContext context)
-			throws ErrorDocumentServiceException;
-
-	/**
-	 * Register a new error document.
-	 * <p>
-	 * The created reference will be related with a workflow run id passed
-	 * through ReferenceContext so we can track all data referenced by a
-	 * specific run.
-	 * 
-	 * @param message
-	 *            a free text message describing the error, if available. If
-	 *            there is no message use the empty string here.
-	 * @param errors
-	 *            a set of references that contain error documents.
-	 * @param depth
-	 *            depth of the error, used when returning an error document
-	 *            instead of an identified list.
-	 * @return a new ErrorDocument instance, constructed fully and stored in the
-	 *         underlying storage system
-	 */
-	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
-	ErrorDocument registerError(String message, Set<T2Reference> errors,
-			int depth, ReferenceContext context)
-			throws ErrorDocumentServiceException;
-
-	/**
-	 * Retrieve a previously named and registered ErrorDocument from the backing
-	 * store
-	 * 
-	 * @param id
-	 *            identifier of the error document to retrieve
-	 * @return an ErrorDocument
-	 * @throws ErrorDocumentServiceException
-	 *             if anything goes wrong with the retrieval process or if there
-	 *             is something wrong with the reference (such as it being of
-	 *             the wrong reference type).
-	 */
-	ErrorDocument getError(T2Reference id) throws ErrorDocumentServiceException;
-
-	/**
-	 * Functionality the same as {@link #getError(T2Reference) getError} but in
-	 * asynchronous mode, returning immediately and using the supplied callback
-	 * to communicate its results.
-	 * 
-	 * @param id
-	 *            a {@link T2Reference} identifying an {@link ErrorDocument} to
-	 *            retrieve
-	 * @param callback
-	 *            a {@link ErrorDocumentServiceCallback} used to convey the
-	 *            results of the asynchronous call
-	 * @throws ErrorDocumentServiceException
-	 *             if the reference set service is not correctly configured.
-	 *             Exceptions encountered when performing the asynchronous call
-	 *             are not returned here, for obvious reasons, and are instead
-	 *             messaged through the callback interface.
-	 */
-	void getErrorAsynch(T2Reference id, ErrorDocumentServiceCallback callback)
-			throws ErrorDocumentServiceException;
-
-	/**
-	 * Return the T2Reference for the sole child of an error document
-	 * identifier.
-	 */
-	T2Reference getChild(T2Reference errorId)
-			throws ErrorDocumentServiceException;
-
-	@Transactional(propagation = Propagation.SUPPORTS, readOnly = false)
-	boolean delete(T2Reference reference) throws ReferenceServiceException;
-
-	/**
-	 * Delete all {@link ErrorDocument}S used by the specific workflow run.
-	 */
-	@Transactional(propagation = Propagation.SUPPORTS, readOnly = false)
-	void deleteErrorDocumentsForWorkflowRun(String workflowRunId)
-			throws ReferenceServiceException;
-}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentServiceCallback.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentServiceCallback.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentServiceCallback.java
deleted file mode 100644
index 5e55672..0000000
--- a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentServiceCallback.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester   
- * 
- *  Modifications to the initial code base are copyright of their
- *  respective authors, or their employers as appropriate.
- * 
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1 of
- *  the License, or (at your option) any later version.
- *    
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *    
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.reference;
-
-/**
- * Callback interface used by asynchronous methods in the
- * {@link ErrorDocumentService} interface
- * 
- * @author Tom Oinn
- */
-public interface ErrorDocumentServiceCallback {
-	/**
-	 * Called when the requested {@link ReferenceSet} has been successfully
-	 * retrieved.
-	 * 
-	 * @param errorDoc
-	 *            the ErrorDocument requested
-	 */
-	void errorRetrieved(ErrorDocument errorDoc);
-
-	/**
-	 * Called if the retrieval failed for some reason
-	 * 
-	 * @param cause
-	 *            an ErrorDocumentServiceException explaining the retrieval
-	 *            failure
-	 */
-	void errorRetrievalFailed(ErrorDocumentServiceException cause);
-}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentServiceException.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentServiceException.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentServiceException.java
deleted file mode 100644
index 3959c6a..0000000
--- a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentServiceException.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester   
- * 
- *  Modifications to the initial code base are copyright of their
- *  respective authors, or their employers as appropriate.
- * 
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1 of
- *  the License, or (at your option) any later version.
- *    
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *    
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.reference;
-
-/**
- * RuntimeException subclass thrown by the error document service layer
- * interfaces. All underlying exceptions are either handled by the service layer
- * or wrapped in this exception (or a subclass) and rethrown.
- * 
- * @author Tom Oinn
- */
-public class ErrorDocumentServiceException extends RuntimeException {
-	private static final long serialVersionUID = 5556399589785258956L;
-
-	public ErrorDocumentServiceException() {
-		super();
-	}
-
-	public ErrorDocumentServiceException(String message, Throwable cause) {
-		super(message, cause);
-	}
-
-	public ErrorDocumentServiceException(String message) {
-		super(message);
-	}
-
-	public ErrorDocumentServiceException(Throwable cause) {
-		super(cause);
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceBuilderSPI.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceBuilderSPI.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceBuilderSPI.java
deleted file mode 100644
index 2dfb340..0000000
--- a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceBuilderSPI.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester   
- * 
- *  Modifications to the initial code base are copyright of their
- *  respective authors, or their employers as appropriate.
- * 
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1 of
- *  the License, or (at your option) any later version.
- *    
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *    
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.reference;
-
-import java.io.InputStream;
-
-/**
- * Constructs an ExternalReferenceSPI instance from a byte stream. Used by the
- * {@link ReferenceSetAugmentor} when there isn't a direct reference to
- * reference translation path available for a desired target type, but available
- * for external use wherever this functionality is needed.
- * <p>
- * Where an underlying resource is required this is extracted from the supplied
- * ReferenceContext, this implies that all methods in implementations of this
- * interface should be thread safe, allowing multiple concurrent threads
- * cleanly. For SPI purposes implementations should be java beans with default
- * constructors.
- * 
- * @author Tom Oinn
- */
-public interface ExternalReferenceBuilderSPI<TargetType extends ExternalReferenceSPI> {
-	/**
-	 * Given a stream of bytes, build the appropriate target
-	 * ExternalReferenceSPI implementation which would de-reference to the value
-	 * of that stream and return it.
-	 * 
-	 * @param byteStream
-	 *            the bytestream to read target from.
-	 * @param context
-	 *            a reference resolution context, needed potentially to
-	 *            construct the new ExternalReferenceSchemeSPI, especially in
-	 *            cases where the context contains security agents giving access
-	 *            to a remote data staging system *
-	 * @throws ExternalReferenceConstructionException
-	 *             if an error occurs instantiating the new reference.
-	 * @return the newly constructed ExternalReferenceSPI instance.
-	 */
-	TargetType createReference(InputStream byteStream, ReferenceContext context);
-
-	/**
-	 * Expose the type of the ExternalReferenceSPI that this builder can
-	 * construct
-	 * 
-	 * @return the class of ExternalReferenceSPI returned by the create
-	 *         reference methods.
-	 */
-	Class<TargetType> getReferenceType();
-
-	/**
-	 * Because the reference builder may rely on facilities provided to it
-	 * through the context this method is available to check whether these
-	 * facilities are sufficient.
-	 * 
-	 * @param context
-	 *            the reference context that will be used to construct new
-	 *            references
-	 * @return whether the context contains necessary resources for the
-	 *         reference construction process
-	 */
-	boolean isEnabled(ReferenceContext context);
-
-	/**
-	 * Return an approximate complexity cost of the reference construction. In
-	 * general we can't make any guarantees about this because the complexity of
-	 * the construction depends on more than just the type involved - it can
-	 * depend on local configuration, network location relative to the data
-	 * stores referenced and in some cases on the data themselves. For now
-	 * though we assign an approximation, the default value is 1.0f and lower
-	 * values represent less costly operations.
-	 */
-	float getConstructionCost();
-}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceConstructionException.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceConstructionException.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceConstructionException.java
deleted file mode 100644
index 0892ecc..0000000
--- a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceConstructionException.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester   
- * 
- *  Modifications to the initial code base are copyright of their
- *  respective authors, or their employers as appropriate.
- * 
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1 of
- *  the License, or (at your option) any later version.
- *    
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *    
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.reference;
-
-/**
- * Thrown when an exception occurs during construction of an
- * ExternalReferenceSPI instance. This includes construction through direct
- * method invocation, through the ExternalReferenceBuilderSPI interface and
- * through the ExternalReferenceTranslatorSPI interface.
- * 
- * @author Tom Oinn
- */
-public class ExternalReferenceConstructionException extends RuntimeException {
-	private static final long serialVersionUID = 8334725795238353354L;
-
-	public ExternalReferenceConstructionException() {
-		super();
-	}
-
-	public ExternalReferenceConstructionException(String message) {
-		super(message);
-	}
-
-	public ExternalReferenceConstructionException(Throwable cause) {
-		super(cause);
-	}
-
-	public ExternalReferenceConstructionException(String message,
-			Throwable cause) {
-		super(message, cause);
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceSPI.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceSPI.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceSPI.java
deleted file mode 100644
index 4d6a047..0000000
--- a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceSPI.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester   
- * 
- *  Modifications to the initial code base are copyright of their
- *  respective authors, or their employers as appropriate.
- * 
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1 of
- *  the License, or (at your option) any later version.
- *    
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *    
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.reference;
-
-import java.io.InputStream;
-
-/**
- * A reference to a single piece of data. This may or may not be within the
- * enactment infrastructure, it could refer to data held in a file, a URL, a
- * grid storage system or anything of that nature. Ideally the data this
- * reference points to should not change - we'd like to say 'must not change' at
- * this point but this isn't always possible, implementations should aim to
- * provide the appearance that data are immutable.
- * <p>
- * When used within the workflow engine implementations of this interface are
- * always contained in a ReferenceSet instance.
- * <p>
- * Implementors of this interface are strongly advised to use the
- * AbstractExternalReference superclass - this provides the necessary primary
- * key information used by hibernate-based implementations of the reference
- * manager. Technically we don't require it as it's possible that other backend
- * stores may exist, but the core store used by T2 is based on hibernate so it's
- * a very good idea to follow this! Basically if you don't your code won't work
- * in the current system.
- * <p>
- * This interface is an SPI - while implementations are never constructed based
- * on the SPI registry it is used to discover all implementing classes and
- * automatically register their hibernate mapping files. Implementors should add
- * their implementation class name to a
- * META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceSPI file in
- * the implementation artifact. For examples please refer to the
- * t2reference-core-extensions module, this contains implementations of this
- * interface for common basic reference types.
- * <p>
- * Note - if your implementation class has a complex hibernate mapping that uses
- * components which are themselves mapped into the database (perfectly legal to
- * do) then you must mark those components as instances of HibernateMappedEntity
- * so their corresponding mapping and class definitions are loaded by the
- * Hibernate backed reference set dao. If your implementation class uses inline
- * compound keys or other component types where you reference another class but
- * the other class is not mapped itself in hibernate you must instead make the
- * component class an instance of HibernateComponentClass - a marker interface -
- * for the same reason. Both of these are SPIs themselves, and require the
- * appropriate entries to be added to their service metadata files in your
- * extension jar.
- * 
- * @author Tom Oinn
- */
-public interface ExternalReferenceSPI extends Cloneable {
-	/**
-	 * Determine, if possible, whether the data this reference refers to is
-	 * textual or binary in nature. If this determination is impossible, either
-	 * because the ExternalReference implementation does not know or because the
-	 * data is not accessible for some reason then this should return
-	 * ReferenceDataNature.UNKNOWN
-	 * 
-	 * @return the nature of the referenced data
-	 */
-	ReferencedDataNature getDataNature();
-
-	/**
-	 * For textual data return the character set that should be used to pull
-	 * data into a java String object. Callers must deal with a null return
-	 * value in the event of either unknown charset or unknown or binary data
-	 * types.
-	 * 
-	 * @return string character set, for example 'utf-8', or <code>null</code>
-	 *         if binary or unknown type.
-	 */
-	String getCharset();
-
-	/**
-	 * Open and return an InputStream to the data referenced using, if required,
-	 * any facilities within the supplied context.
-	 * 
-	 * @param context
-	 *            the ReferenceContext object used to obtain e.g. security
-	 *            agents or other facilities required when de-referencing this
-	 *            reference.
-	 * @return an InputStream providing access to the referenced data
-	 * @throws DereferenceException
-	 *             if the reference cannot be de-referenced. This may be because
-	 *             of problems with the context such as security failures, or it
-	 *             may be because the reference is inherently not possible to
-	 *             de-reference (as in the case of a non-serializable API
-	 *             consumer reference).
-	 */
-	InputStream openStream(ReferenceContext context)
-			throws DereferenceException;
-
-	/**
-	 * Approximate size of the stored data or -1 if we do not know.
-	 */
-	Long getApproximateSizeInBytes();
-
-	/**
-	 * Resolution cost is an informal guide to how costly the process of
-	 * de-referencing this reference would be. It's used when assessing which
-	 * out of a set of ExternalReferenceSPI implementations to use to get the
-	 * value of the reference(s), in particular when rendering to POJOs or when
-	 * translating throught the de-reference / construct from stream route. As
-	 * this property is highly complex and potentially expensive in itself to
-	 * evaluate there's no requirement for it to be absolutely correct, it's
-	 * just used as a guide that, for example, it is easier to get bytes from a
-	 * file on the local disk than to get them from a resource held on a grid on
-	 * the other side of the planet.
-	 * 
-	 * @return a float representing some notion of resolution cost, lower values
-	 *         represent cheaper de-reference paths.
-	 */
-	float getResolutionCost();
-
-	ExternalReferenceSPI clone() throws CloneNotSupportedException;
-}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceTranslatorSPI.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceTranslatorSPI.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceTranslatorSPI.java
deleted file mode 100644
index bc46dce..0000000
--- a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceTranslatorSPI.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester   
- * 
- *  Modifications to the initial code base are copyright of their
- *  respective authors, or their employers as appropriate.
- * 
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1 of
- *  the License, or (at your option) any later version.
- *    
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *    
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.reference;
-
-/**
- * Constructs an ExternalReference instance from an existing ExternalReference,
- * most usually of a different type. Used by the {@link ReferenceSetAugmentor}.
- * This SPI should not be used for cases where an ExternalReferenceSPI is
- * constructed from a stream of bytes, this is intended for direct reference to
- * reference translation with the assumption that this is more efficient for
- * whatever reason. For cases where the reference is constructed from a byte
- * stream you should implement {@link ExternalReferenceBuilder} instead.
- * <p>
- * For SPI purposes implementations should be java beans with default
- * constructors, any required state such as the location of remote repositories
- * to which data can be staged will be passed in in the ReferenceContext.
- * 
- * @author Tom Oinn
- */
-public interface ExternalReferenceTranslatorSPI<SourceType extends ExternalReferenceSPI, TargetType extends ExternalReferenceSPI> {
-	/**
-	 * Given an existing ExternalReferenceSPI, build the appropriate target
-	 * ExternalReferenceSPI implementation and return it.
-	 * 
-	 * @param sourceReference
-	 *            the reference to be used as source for the translation.
-	 * @param context
-	 *            a reference resolution context, needed potentially to access
-	 *            the existing external references or to construct the new one,
-	 *            especially in cases where the context contains security agents
-	 *            giving access to a remote data staging system
-	 * @throws ExternalReferenceConstructionException
-	 *             if an error occurs instantiating the new reference.
-	 * @return the newly constructed ExternalReferenceSPI instance.
-	 */
-	TargetType createReference(SourceType sourceReference,
-			ReferenceContext context);
-
-	/**
-	 * Return the type of external reference that this translator consumes.
-	 * 
-	 * @return ExternalReferenceSPI class corresponding to the reference type
-	 *         used as a source by this translator.
-	 */
-	Class<SourceType> getSourceReferenceType();
-
-	/**
-	 * Return the type of external reference this translator constructs.
-	 * 
-	 * @return ExternalReferenceSPI class corresponding to the reference type
-	 *         emitted by this translator.
-	 */
-	Class<TargetType> getTargetReferenceType();
-
-	/**
-	 * Because the reference translator may rely on facilities provided to it
-	 * through the context this method is available to check whether these
-	 * facilities are sufficient.
-	 * 
-	 * @param context
-	 *            the reference context that will be used to construct new
-	 *            references during the translation process
-	 * @return whether the context contains necessary resources for the
-	 *         reference construction process
-	 */
-	boolean isEnabled(ReferenceContext context);
-
-	/**
-	 * Return an approximate complexity cost of the translation. In general we
-	 * can't make any guarantees about this because the complexity of the
-	 * translation depends on more than just the types involved - it can depend
-	 * on local configuration, network location relative to the data stores
-	 * referenced and in some cases on the data themselves. For now though we
-	 * assign an approximation, the default value is 1.0f and lower values
-	 * represent less costly operations.
-	 */
-	float getTranslationCost();
-}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceValidationException.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceValidationException.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceValidationException.java
deleted file mode 100644
index c8b540d..0000000
--- a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceValidationException.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester   
- * 
- *  Modifications to the initial code base are copyright of their
- *  respective authors, or their employers as appropriate.
- * 
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1 of
- *  the License, or (at your option) any later version.
- *    
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *    
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.reference;
-
-/**
- * Thrown by setter methods and constructors of ExternalReferenceSPI
- * implementations when fed parameters which cause some kind of format or
- * validation error. These might include badly formed URL or file paths or any
- * other property that fails to validate against some reference type specific
- * scheme.
- * 
- * @author Tom Oinn
- */
-public class ExternalReferenceValidationException extends RuntimeException {
-	private static final long serialVersionUID = 3031393671457773057L;
-
-	public ExternalReferenceValidationException() {
-		//
-	}
-
-	public ExternalReferenceValidationException(String message) {
-		super(message);
-	}
-
-	public ExternalReferenceValidationException(Throwable cause) {
-		super(cause);
-	}
-
-	public ExternalReferenceValidationException(String message, Throwable cause) {
-		super(message, cause);
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/Identified.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/Identified.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/Identified.java
deleted file mode 100644
index 8e9c5fd..0000000
--- a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/Identified.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester   
- * 
- *  Modifications to the initial code base are copyright of their
- *  respective authors, or their employers as appropriate.
- * 
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1 of
- *  the License, or (at your option) any later version.
- *    
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *    
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.reference;
-
-/**
- * Interface for any object that has an associated {@link T2Reference}
- * 
- * @author Tom Oinn
- */
-public interface Identified {
-	/**
-	 * Return an appropriately configured instance of T2Reference for this
-	 * identified object.
-	 * 
-	 * @return the id of this object in the form of a T2Reference
-	 */
-	T2Reference getId();
-}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/IdentifiedList.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/IdentifiedList.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/IdentifiedList.java
deleted file mode 100644
index 032906f..0000000
--- a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/IdentifiedList.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester   
- * 
- *  Modifications to the initial code base are copyright of their
- *  respective authors, or their employers as appropriate.
- * 
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1 of
- *  the License, or (at your option) any later version.
- *    
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *    
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.reference;
-
-import java.util.List;
-
-/**
- * An identified list is a list which is identified by a T2Reference. Lists are
- * immutable once named - if getId() returns a non null value all list methods
- * modifying the underlying list data will throw {@link IllegalStateException}.
- * In the reference management API this list sub-interface is used to represent
- * both collections of identifiers (i.e. 'raw' stored lists) and more fully
- * resolved structures where the types in the list can be reference sets, error
- * documents and other lists of such. The {@link ListDao} interface uses only
- * the 'raw' form consisting of flat lists of identifiers.
- * <p>
- * The IdentifiedList has a unique T2Reference associated with it. If this is
- * null the contents of the list may be modified, otherwise all modification
- * operations throw {@link IllegalStateException}. Lists in T2, once named, are
- * immutable.
- * 
- * @author Tom Oinn
- * 
- * @param <T>
- */
-public interface IdentifiedList<T> extends List<T>, Identified {
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/5f1ddb71/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ListDao.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ListDao.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ListDao.java
deleted file mode 100644
index 7e064be..0000000
--- a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ListDao.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester   
- * 
- *  Modifications to the initial code base are copyright of their
- *  respective authors, or their employers as appropriate.
- * 
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public License
- *  as published by the Free Software Foundation; either version 2.1 of
- *  the License, or (at your option) any later version.
- *    
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *    
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.reference;
-
-import static org.springframework.transaction.annotation.Propagation.REQUIRED;
-import static org.springframework.transaction.annotation.Propagation.SUPPORTS;
-
-import org.springframework.transaction.annotation.Transactional;
-
-/**
- * Data access object handling NamedLists of T2Reference instances.
- * 
- * @author Tom Oinn
- */
-public interface ListDao {
-	/**
-	 * Store a named and populated IdentifiedList of T2Reference to the
-	 * database.
-	 * 
-	 * @param theList
-	 *            list to store
-	 * @throws DaoException
-	 *             if any exception is thrown when connecting to the underlying
-	 *             store or when storing the list
-	 */
-	@Transactional(propagation = REQUIRED, readOnly = false)
-	void store(IdentifiedList<T2Reference> theList) throws DaoException;
-
-	/**
-	 * Retrieves a named and populated IdentifiedList of T2Reference from the
-	 * database by T2Reference
-	 * 
-	 * @param reference
-	 *            id of the list to retrieve
-	 * @return a previously stored list of T2References
-	 * @throws DaoException
-	 *             if any exception is thrown when connecting to the underlying
-	 *             data store or when attempting retrieval of the list
-	 */
-	@Transactional(propagation = SUPPORTS, readOnly = true)
-	IdentifiedList<T2Reference> get(T2Reference reference) throws DaoException;
-
-	@Transactional(propagation = SUPPORTS, readOnly = false)
-	boolean delete(IdentifiedList<T2Reference> theList) throws DaoException;
-
-	@Transactional(propagation = SUPPORTS, readOnly = false)
-	void deleteIdentifiedListsForWFRun(String workflowRunId)
-			throws DaoException;
-}