You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2015/10/18 17:37:36 UTC
[01/17] incubator-taverna-osgi git commit: uk.org.taverna.osgi ->
org.apache.taverna.osgilauncher
Repository: incubator-taverna-osgi
Updated Branches:
refs/heads/master 49b3b4250 -> 84b5025db
uk.org.taverna.osgi -> org.apache.taverna.osgilauncher
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/a1422f8a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/a1422f8a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/a1422f8a
Branch: refs/heads/master
Commit: a1422f8a44be56da46c20037de88b0f059a26771
Parents: 49b3b42
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Oct 18 13:26:42 2015 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Oct 18 13:26:42 2015 +0100
----------------------------------------------------------------------
.../taverna/osgilauncher/OsgiLauncher.java | 434 +++++++++++++++++++
.../java/uk/org/taverna/osgi/OsgiLauncher.java | 434 -------------------
2 files changed, 434 insertions(+), 434 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/a1422f8a/osgi-launcher/src/main/java/org/apache/taverna/osgilauncher/OsgiLauncher.java
----------------------------------------------------------------------
diff --git a/osgi-launcher/src/main/java/org/apache/taverna/osgilauncher/OsgiLauncher.java b/osgi-launcher/src/main/java/org/apache/taverna/osgilauncher/OsgiLauncher.java
new file mode 100644
index 0000000..cc47bb0
--- /dev/null
+++ b/osgi-launcher/src/main/java/org/apache/taverna/osgilauncher/OsgiLauncher.java
@@ -0,0 +1,434 @@
+/*******************************************************************************
+ * 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 org.apache.taverna.osgilauncher;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.ServiceLoader;
+import java.util.Set;
+import java.util.logging.Logger;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
+
+/**
+ * OSGi Framework launcher.
+ *
+ * Handles loading and starting of OSGi bundles and Spring DM managed services.
+ *
+ * An implementation of an OSGi Service Platform Release 4.1 (or higher) must be available on the
+ * classpath.
+ *
+ * @author David Withers
+ */
+public class OsgiLauncher {
+
+ /**
+ * Default boot delegation packages.
+ */
+ public static final String DEFAULT_BOOT_DELEGATION_PACKAGES = "sun.*,com.sun.*,java.*";
+
+ /**
+ * Default system packages.
+ */
+ public static final String DEFAULT_SYSTEM_PACKAGES = "com.sun.org.apache.xml.internal.utils";
+
+ /**
+ * Default time to wait for services to start up.
+ */
+ private static final long serviceLoadTimeoutSeconds = 30;
+
+ private static final Logger logger = Logger.getLogger(OsgiLauncher.class.getName());
+
+ private Framework framework;
+ private BundleContext context;
+
+ private Map<String, String> frameworkConfiguration = new HashMap<String, String>();
+ private List<URI> bundlesToInstall = new ArrayList<URI>();
+ private List<Bundle> installedBundles = new ArrayList<Bundle>();
+ private Set<String> startedSpringContexts = new HashSet<String>();
+ private Bundle springOsgiExtender;
+
+ private OsgiLauncher(File storageDirectory) {
+ setStorageDirectory(storageDirectory);
+ setCleanStorageDirectory(true);
+ setBootDelegationPackages(DEFAULT_BOOT_DELEGATION_PACKAGES);
+ setSystemPackages(DEFAULT_SYSTEM_PACKAGES);
+ }
+
+ /**
+ * Constructs an <code>OsgiLauncher</code> that loads bundles from a directory.
+ *
+ * Any file in the specified directory with a .jar extension will be loaded when the framework
+ * is started.
+ *
+ * @param storageDirectory
+ * persistent storage area used by the framework
+ * @param storageDirectory
+ * the directory containing bundles to load
+ */
+ public OsgiLauncher(File storageDirectory, File bundleDirectory) {
+ this(storageDirectory);
+ List<File> jars = Arrays.asList(bundleDirectory.listFiles(new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ return name.endsWith(".jar");
+ }
+ }));
+ for (File jar : jars) {
+ bundlesToInstall.add(jar.toURI());
+ }
+ }
+
+ /**
+ * Constructs an <code>OsgiLauncher</code> that loads the specified bundles.
+ *
+ * @param storageDirectory
+ * persistent storage area used by the framework
+ * @param bundleURIs
+ * bundles to load
+ */
+ public OsgiLauncher(File storageDirectory, List<URI> bundleURIs) {
+ this(storageDirectory);
+ for (URI bundleURI : bundleURIs) {
+ bundlesToInstall.add(bundleURI);
+ }
+ }
+
+ /**
+ * Starts the OSGi framework, installs and starts the bundles.
+ *
+ * @throws BundleException
+ * if the framework could not be started
+ */
+ public void start() throws BundleException {
+ logger.info("Loading the OSGi Framework Factory");
+ FrameworkFactory frameworkFactory = ServiceLoader.load(FrameworkFactory.class).iterator()
+ .next();
+
+ logger.info("Creating the OSGi Framework");
+ framework = frameworkFactory.newFramework(frameworkConfiguration);
+ logger.info("Starting the OSGi Framework");
+ framework.start();
+
+ context = framework.getBundleContext();
+ context.addServiceListener(new ServiceListener() {
+ public void serviceChanged(ServiceEvent event) {
+ ServiceReference serviceReference = event.getServiceReference();
+ if (event.getType() == ServiceEvent.REGISTERED) {
+ Object property = serviceReference
+ .getProperty("org.springframework.context.service.name");
+ if (property != null) {
+ addStartedSpringContext(property.toString());
+ }
+ }
+ logger.fine((event.getType() == ServiceEvent.REGISTERED ? "Registering : "
+ : "Unregistering : ") + serviceReference);
+ }
+ });
+
+ installedBundles = installBundles(bundlesToInstall);
+
+ List<Bundle> bundlesToStart = new ArrayList<Bundle>();
+ for (Bundle bundle : installedBundles) {
+ if ("org.springframework.osgi.extender".equals(bundle.getSymbolicName())) {
+ springOsgiExtender = bundle;
+ } else {
+ bundlesToStart.add(bundle);
+ }
+ }
+ startBundles(bundlesToStart);
+ }
+
+ /**
+ * Starts SpringDM managed services.
+ *
+ * @param waitForServices
+ * if true waits for services to start before returning
+ * @throws BundleException
+ * if the framework has not been started or a service could not be started
+ */
+ public void startServices(boolean waitForServices) throws BundleException {
+ if (framework == null || framework.getState() != Bundle.ACTIVE) {
+ throw new BundleException("Framework not started");
+ }
+ if (springOsgiExtender != null) {
+ logger.info("Starting Spring OSGi Extender");
+ springOsgiExtender.start();
+ if (waitForServices) {
+ logger.info("Waiting for spring contexts to be started");
+ for (Bundle bundle : installedBundles) {
+ if (bundle.getState() == Bundle.ACTIVE) {
+ if (hasSpringContext(bundle)) {
+ logger.fine("Waiting for " + bundle.getSymbolicName());
+ waitForSpringContext(context, bundle.getSymbolicName(), serviceLoadTimeoutSeconds);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Stops the OSGI framework.
+ *
+ * @throws BundleException
+ * if the framework has not been started
+ * @throws InterruptedException
+ * if the thread is interrupted while the framework is stopping
+ */
+ public void stop() throws BundleException, InterruptedException {
+ if (framework == null || framework.getState() != Bundle.ACTIVE) {
+ throw new BundleException("Framework not started");
+ }
+ framework.stop();
+ framework.waitForStop(0);
+ context = null;
+ }
+
+ /**
+ * Installs the bundles specified by the URIs into the framework.
+ *
+ * @param bundlesURIs
+ * the URIs of the bundles to install
+ * @return the installed bundles
+ * @throws BundleException
+ * if a bundle could not be installed
+ */
+ public List<Bundle> installBundles(List<URI> bundlesURIs) throws BundleException {
+ List<Bundle> installedBundles = new ArrayList<Bundle>();
+ logger.info("Installing bundles into the OSGi Framework");
+ for (URI bundleURI : bundlesURIs) {
+ installedBundles.add(installBundle(bundleURI));
+ }
+ return installedBundles;
+ }
+
+ /**
+ * Installs the bundle specified by the URI into the framework.
+ *
+ * @param bundleURI
+ * the URI of the bundle to install
+ * @return the installed bundle
+ * @throws BundleException
+ * if the bundle could not be installed
+ */
+ public Bundle installBundle(URI bundleURI) throws BundleException {
+ logger.fine("Installing bundle " + bundleURI);
+ return context.installBundle(bundleURI.toASCIIString());
+ }
+
+ /**
+ * Starts the bundles.
+ *
+ * If a bundle is a fragment bundle that bundle is not started.
+ *
+ * @param bundles
+ * the bundles to start
+ * @throws BundleException
+ * if a bundle could not be started
+ */
+ public void startBundles(List<Bundle> bundles) throws BundleException {
+ logger.info("Starting bundles in the OSGi Framework");
+ for (Bundle bundle : bundles) {
+ startBundle(bundle);
+ }
+ }
+
+ /**
+ * Starts the bundle.
+ *
+ * If the bundle is a fragment bundle the bundle is not started.
+ *
+ * @param bundle
+ * the bundle to start
+ * @throws BundleException
+ * if the bundle could not be started
+ */
+ public void startBundle(Bundle bundle) throws BundleException {
+ if (bundle.getHeaders().get(Constants.FRAGMENT_HOST) == null) {
+ logger.fine("Starting bundle " + bundle);
+ bundle.start();
+ }
+ }
+
+ /**
+ * Returns the context. Returns <code>null</code> if the framework is not started.
+ *
+ * @return the context
+ */
+ public BundleContext getContext() {
+ return context;
+ }
+
+ /**
+ * Sets the configuration to use when creating the OSGi framework.
+ *
+ * @param frameworkConfiguration the configuration to use when creating the OSGi framework
+ */
+ public void setFrameworkConfiguration(Map<String, String> frameworkConfiguration) {
+ this.frameworkConfiguration = frameworkConfiguration;
+ }
+
+ /**
+ * Adds boot delegation packages.
+ *
+ * Multiple packages must be separated by a ','.
+ *
+ * @param additionalBootDelegationPackages
+ * boot delegation packages to add
+ */
+ public void addBootDelegationPackages(String additionalBootDelegationPackages) {
+ String bootDelegationPackages = frameworkConfiguration
+ .get(Constants.FRAMEWORK_BOOTDELEGATION);
+ if (bootDelegationPackages == null || bootDelegationPackages.isEmpty()) {
+ bootDelegationPackages = additionalBootDelegationPackages;
+ } else {
+ bootDelegationPackages = bootDelegationPackages + ","
+ + additionalBootDelegationPackages;
+ }
+ frameworkConfiguration.put(Constants.FRAMEWORK_BOOTDELEGATION, bootDelegationPackages);
+ }
+
+ /**
+ * Sets the boot delegation packages.
+ *
+ * Multiple packages must be separated by a ','.
+ *
+ * @param bootDelegationPackages
+ * the boot delegation packages
+ */
+ public void setBootDelegationPackages(String bootDelegationPackages) {
+ frameworkConfiguration.put(Constants.FRAMEWORK_BOOTDELEGATION, bootDelegationPackages);
+ }
+
+ /**
+ * Adds system packages.
+ *
+ * Multiple packages must be separated by a ','.
+ *
+ * @param additionalSystemPackages
+ * system packages to add
+ */
+ public void addSystemPackages(String additionalSystemPackages) {
+ String systemPackages = frameworkConfiguration
+ .get(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA);
+ if (systemPackages == null || systemPackages.isEmpty()) {
+ systemPackages = additionalSystemPackages;
+ } else {
+ systemPackages = systemPackages + "," + additionalSystemPackages;
+ }
+ frameworkConfiguration.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, systemPackages);
+ }
+
+ /**
+ * Sets the system packages.
+ *
+ * Multiple packages must be separated by a ','.
+ *
+ * @param systemPackages
+ * the system packages
+ */
+ public void setSystemPackages(String systemPackages) {
+ frameworkConfiguration.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, systemPackages);
+ }
+
+ /**
+ * Sets the persistent storage area used by the framework.
+ *
+ * @param storageDirectory the persistent storage area used by the framework
+ */
+ public void setStorageDirectory(File storageDirectory) {
+ frameworkConfiguration.put(Constants.FRAMEWORK_STORAGE, storageDirectory.getAbsolutePath());
+ }
+
+ /**
+ * Set whether the storage directory should be cleaned on startup.
+ *
+ * @param cleanStorageDirectory
+ * whether the storage directory should be cleaned on startup
+ */
+ public void setCleanStorageDirectory(boolean cleanStorageDirectory) {
+ if (cleanStorageDirectory) {
+ frameworkConfiguration.put(Constants.FRAMEWORK_STORAGE_CLEAN,
+ Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT);
+ } else {
+ frameworkConfiguration.remove(Constants.FRAMEWORK_STORAGE_CLEAN);
+ }
+ }
+
+ /**
+ * Returns true if a bundle contains spring context files.
+ *
+ * @param bundle
+ * the bundle to check
+ * @return true if a bundle contains spring context files
+ */
+ private boolean hasSpringContext(Bundle bundle) {
+ String springFilesLocation = "META-INF/spring";
+ // check for custom spring files location
+ @SuppressWarnings("rawtypes")
+ Dictionary headers = bundle.getHeaders();
+ if (headers != null) {
+ Object header = headers.get("Spring-Context");
+ if (header != null) {
+ springFilesLocation = header.toString().trim();
+ }
+ }
+ @SuppressWarnings("rawtypes")
+ Enumeration springFiles = bundle.findEntries(springFilesLocation, "*.xml", false);
+ return springFiles != null && springFiles.hasMoreElements();
+ }
+
+ private synchronized void waitForSpringContext(BundleContext context, String springContext,
+ long timeoutSeconds) {
+ long timeLeftToWait = timeoutSeconds * 1000;
+ long startTime = System.currentTimeMillis();
+
+ while (!startedSpringContexts.contains(springContext) && timeLeftToWait > 0) {
+ try {
+ wait(timeLeftToWait);
+ } catch (InterruptedException e) {}
+ timeLeftToWait = timeLeftToWait - (System.currentTimeMillis() - startTime);
+ }
+ }
+
+ private synchronized void addStartedSpringContext(String springContext) {
+ startedSpringContexts.add(springContext);
+ notifyAll();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/a1422f8a/osgi-launcher/src/main/java/uk/org/taverna/osgi/OsgiLauncher.java
----------------------------------------------------------------------
diff --git a/osgi-launcher/src/main/java/uk/org/taverna/osgi/OsgiLauncher.java b/osgi-launcher/src/main/java/uk/org/taverna/osgi/OsgiLauncher.java
deleted file mode 100644
index cfd006b..0000000
--- a/osgi-launcher/src/main/java/uk/org/taverna/osgi/OsgiLauncher.java
+++ /dev/null
@@ -1,434 +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 uk.org.taverna.osgi;
-
-import java.io.File;
-import java.io.FilenameFilter;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.ServiceLoader;
-import java.util.Set;
-import java.util.logging.Logger;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceEvent;
-import org.osgi.framework.ServiceListener;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.launch.Framework;
-import org.osgi.framework.launch.FrameworkFactory;
-
-/**
- * OSGi Framework launcher.
- *
- * Handles loading and starting of OSGi bundles and Spring DM managed services.
- *
- * An implementation of an OSGi Service Platform Release 4.1 (or higher) must be available on the
- * classpath.
- *
- * @author David Withers
- */
-public class OsgiLauncher {
-
- /**
- * Default boot delegation packages.
- */
- public static final String DEFAULT_BOOT_DELEGATION_PACKAGES = "sun.*,com.sun.*,java.*";
-
- /**
- * Default system packages.
- */
- public static final String DEFAULT_SYSTEM_PACKAGES = "com.sun.org.apache.xml.internal.utils";
-
- /**
- * Default time to wait for services to start up.
- */
- private static final long serviceLoadTimeoutSeconds = 30;
-
- private static final Logger logger = Logger.getLogger(OsgiLauncher.class.getName());
-
- private Framework framework;
- private BundleContext context;
-
- private Map<String, String> frameworkConfiguration = new HashMap<String, String>();
- private List<URI> bundlesToInstall = new ArrayList<URI>();
- private List<Bundle> installedBundles = new ArrayList<Bundle>();
- private Set<String> startedSpringContexts = new HashSet<String>();
- private Bundle springOsgiExtender;
-
- private OsgiLauncher(File storageDirectory) {
- setStorageDirectory(storageDirectory);
- setCleanStorageDirectory(true);
- setBootDelegationPackages(DEFAULT_BOOT_DELEGATION_PACKAGES);
- setSystemPackages(DEFAULT_SYSTEM_PACKAGES);
- }
-
- /**
- * Constructs an <code>OsgiLauncher</code> that loads bundles from a directory.
- *
- * Any file in the specified directory with a .jar extension will be loaded when the framework
- * is started.
- *
- * @param storageDirectory
- * persistent storage area used by the framework
- * @param storageDirectory
- * the directory containing bundles to load
- */
- public OsgiLauncher(File storageDirectory, File bundleDirectory) {
- this(storageDirectory);
- List<File> jars = Arrays.asList(bundleDirectory.listFiles(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return name.endsWith(".jar");
- }
- }));
- for (File jar : jars) {
- bundlesToInstall.add(jar.toURI());
- }
- }
-
- /**
- * Constructs an <code>OsgiLauncher</code> that loads the specified bundles.
- *
- * @param storageDirectory
- * persistent storage area used by the framework
- * @param bundleURIs
- * bundles to load
- */
- public OsgiLauncher(File storageDirectory, List<URI> bundleURIs) {
- this(storageDirectory);
- for (URI bundleURI : bundleURIs) {
- bundlesToInstall.add(bundleURI);
- }
- }
-
- /**
- * Starts the OSGi framework, installs and starts the bundles.
- *
- * @throws BundleException
- * if the framework could not be started
- */
- public void start() throws BundleException {
- logger.info("Loading the OSGi Framework Factory");
- FrameworkFactory frameworkFactory = ServiceLoader.load(FrameworkFactory.class).iterator()
- .next();
-
- logger.info("Creating the OSGi Framework");
- framework = frameworkFactory.newFramework(frameworkConfiguration);
- logger.info("Starting the OSGi Framework");
- framework.start();
-
- context = framework.getBundleContext();
- context.addServiceListener(new ServiceListener() {
- public void serviceChanged(ServiceEvent event) {
- ServiceReference serviceReference = event.getServiceReference();
- if (event.getType() == ServiceEvent.REGISTERED) {
- Object property = serviceReference
- .getProperty("org.springframework.context.service.name");
- if (property != null) {
- addStartedSpringContext(property.toString());
- }
- }
- logger.fine((event.getType() == ServiceEvent.REGISTERED ? "Registering : "
- : "Unregistering : ") + serviceReference);
- }
- });
-
- installedBundles = installBundles(bundlesToInstall);
-
- List<Bundle> bundlesToStart = new ArrayList<Bundle>();
- for (Bundle bundle : installedBundles) {
- if ("org.springframework.osgi.extender".equals(bundle.getSymbolicName())) {
- springOsgiExtender = bundle;
- } else {
- bundlesToStart.add(bundle);
- }
- }
- startBundles(bundlesToStart);
- }
-
- /**
- * Starts SpringDM managed services.
- *
- * @param waitForServices
- * if true waits for services to start before returning
- * @throws BundleException
- * if the framework has not been started or a service could not be started
- */
- public void startServices(boolean waitForServices) throws BundleException {
- if (framework == null || framework.getState() != Bundle.ACTIVE) {
- throw new BundleException("Framework not started");
- }
- if (springOsgiExtender != null) {
- logger.info("Starting Spring OSGi Extender");
- springOsgiExtender.start();
- if (waitForServices) {
- logger.info("Waiting for spring contexts to be started");
- for (Bundle bundle : installedBundles) {
- if (bundle.getState() == Bundle.ACTIVE) {
- if (hasSpringContext(bundle)) {
- logger.fine("Waiting for " + bundle.getSymbolicName());
- waitForSpringContext(context, bundle.getSymbolicName(), serviceLoadTimeoutSeconds);
- }
- }
- }
- }
- }
- }
-
- /**
- * Stops the OSGI framework.
- *
- * @throws BundleException
- * if the framework has not been started
- * @throws InterruptedException
- * if the thread is interrupted while the framework is stopping
- */
- public void stop() throws BundleException, InterruptedException {
- if (framework == null || framework.getState() != Bundle.ACTIVE) {
- throw new BundleException("Framework not started");
- }
- framework.stop();
- framework.waitForStop(0);
- context = null;
- }
-
- /**
- * Installs the bundles specified by the URIs into the framework.
- *
- * @param bundlesURIs
- * the URIs of the bundles to install
- * @return the installed bundles
- * @throws BundleException
- * if a bundle could not be installed
- */
- public List<Bundle> installBundles(List<URI> bundlesURIs) throws BundleException {
- List<Bundle> installedBundles = new ArrayList<Bundle>();
- logger.info("Installing bundles into the OSGi Framework");
- for (URI bundleURI : bundlesURIs) {
- installedBundles.add(installBundle(bundleURI));
- }
- return installedBundles;
- }
-
- /**
- * Installs the bundle specified by the URI into the framework.
- *
- * @param bundleURI
- * the URI of the bundle to install
- * @return the installed bundle
- * @throws BundleException
- * if the bundle could not be installed
- */
- public Bundle installBundle(URI bundleURI) throws BundleException {
- logger.fine("Installing bundle " + bundleURI);
- return context.installBundle(bundleURI.toASCIIString());
- }
-
- /**
- * Starts the bundles.
- *
- * If a bundle is a fragment bundle that bundle is not started.
- *
- * @param bundles
- * the bundles to start
- * @throws BundleException
- * if a bundle could not be started
- */
- public void startBundles(List<Bundle> bundles) throws BundleException {
- logger.info("Starting bundles in the OSGi Framework");
- for (Bundle bundle : bundles) {
- startBundle(bundle);
- }
- }
-
- /**
- * Starts the bundle.
- *
- * If the bundle is a fragment bundle the bundle is not started.
- *
- * @param bundle
- * the bundle to start
- * @throws BundleException
- * if the bundle could not be started
- */
- public void startBundle(Bundle bundle) throws BundleException {
- if (bundle.getHeaders().get(Constants.FRAGMENT_HOST) == null) {
- logger.fine("Starting bundle " + bundle);
- bundle.start();
- }
- }
-
- /**
- * Returns the context. Returns <code>null</code> if the framework is not started.
- *
- * @return the context
- */
- public BundleContext getContext() {
- return context;
- }
-
- /**
- * Sets the configuration to use when creating the OSGi framework.
- *
- * @param frameworkConfiguration the configuration to use when creating the OSGi framework
- */
- public void setFrameworkConfiguration(Map<String, String> frameworkConfiguration) {
- this.frameworkConfiguration = frameworkConfiguration;
- }
-
- /**
- * Adds boot delegation packages.
- *
- * Multiple packages must be separated by a ','.
- *
- * @param additionalBootDelegationPackages
- * boot delegation packages to add
- */
- public void addBootDelegationPackages(String additionalBootDelegationPackages) {
- String bootDelegationPackages = frameworkConfiguration
- .get(Constants.FRAMEWORK_BOOTDELEGATION);
- if (bootDelegationPackages == null || bootDelegationPackages.isEmpty()) {
- bootDelegationPackages = additionalBootDelegationPackages;
- } else {
- bootDelegationPackages = bootDelegationPackages + ","
- + additionalBootDelegationPackages;
- }
- frameworkConfiguration.put(Constants.FRAMEWORK_BOOTDELEGATION, bootDelegationPackages);
- }
-
- /**
- * Sets the boot delegation packages.
- *
- * Multiple packages must be separated by a ','.
- *
- * @param bootDelegationPackages
- * the boot delegation packages
- */
- public void setBootDelegationPackages(String bootDelegationPackages) {
- frameworkConfiguration.put(Constants.FRAMEWORK_BOOTDELEGATION, bootDelegationPackages);
- }
-
- /**
- * Adds system packages.
- *
- * Multiple packages must be separated by a ','.
- *
- * @param additionalSystemPackages
- * system packages to add
- */
- public void addSystemPackages(String additionalSystemPackages) {
- String systemPackages = frameworkConfiguration
- .get(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA);
- if (systemPackages == null || systemPackages.isEmpty()) {
- systemPackages = additionalSystemPackages;
- } else {
- systemPackages = systemPackages + "," + additionalSystemPackages;
- }
- frameworkConfiguration.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, systemPackages);
- }
-
- /**
- * Sets the system packages.
- *
- * Multiple packages must be separated by a ','.
- *
- * @param systemPackages
- * the system packages
- */
- public void setSystemPackages(String systemPackages) {
- frameworkConfiguration.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, systemPackages);
- }
-
- /**
- * Sets the persistent storage area used by the framework.
- *
- * @param storageDirectory the persistent storage area used by the framework
- */
- public void setStorageDirectory(File storageDirectory) {
- frameworkConfiguration.put(Constants.FRAMEWORK_STORAGE, storageDirectory.getAbsolutePath());
- }
-
- /**
- * Set whether the storage directory should be cleaned on startup.
- *
- * @param cleanStorageDirectory
- * whether the storage directory should be cleaned on startup
- */
- public void setCleanStorageDirectory(boolean cleanStorageDirectory) {
- if (cleanStorageDirectory) {
- frameworkConfiguration.put(Constants.FRAMEWORK_STORAGE_CLEAN,
- Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT);
- } else {
- frameworkConfiguration.remove(Constants.FRAMEWORK_STORAGE_CLEAN);
- }
- }
-
- /**
- * Returns true if a bundle contains spring context files.
- *
- * @param bundle
- * the bundle to check
- * @return true if a bundle contains spring context files
- */
- private boolean hasSpringContext(Bundle bundle) {
- String springFilesLocation = "META-INF/spring";
- // check for custom spring files location
- @SuppressWarnings("rawtypes")
- Dictionary headers = bundle.getHeaders();
- if (headers != null) {
- Object header = headers.get("Spring-Context");
- if (header != null) {
- springFilesLocation = header.toString().trim();
- }
- }
- @SuppressWarnings("rawtypes")
- Enumeration springFiles = bundle.findEntries(springFilesLocation, "*.xml", false);
- return springFiles != null && springFiles.hasMoreElements();
- }
-
- private synchronized void waitForSpringContext(BundleContext context, String springContext,
- long timeoutSeconds) {
- long timeLeftToWait = timeoutSeconds * 1000;
- long startTime = System.currentTimeMillis();
-
- while (!startedSpringContexts.contains(springContext) && timeLeftToWait > 0) {
- try {
- wait(timeLeftToWait);
- } catch (InterruptedException e) {}
- timeLeftToWait = timeLeftToWait - (System.currentTimeMillis() - startTime);
- }
- }
-
- private synchronized void addStartedSpringContext(String springContext) {
- startedSpringContexts.add(springContext);
- notifyAll();
- }
-
-}
[03/17] incubator-taverna-osgi git commit: uk.org.taverna.* ->
org.apache.taverna.*
Posted by st...@apache.org.
uk.org.taverna.* -> org.apache.taverna.*
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/fec32dfa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/fec32dfa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/fec32dfa
Branch: refs/heads/master
Commit: fec32dfa02c5f5a493ccf7e712ade177ffc4d5b9
Parents: 98e26a2
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Oct 18 13:29:08 2015 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Oct 18 13:29:08 2015 +0100
----------------------------------------------------------------------
.../app/impl/ApplicationConfigurationImpl.java | 293 +++++++++++++++++++
.../app/impl/ApplicationUserHome.java | 224 ++++++++++++++
.../app/impl/Log4JConfiguration.java | 160 ++++++++++
.../app/impl/ApplicationConfigurationImpl.java | 293 -------------------
.../app/impl/ApplicationUserHome.java | 224 --------------
.../app/impl/Log4JConfiguration.java | 160 ----------
6 files changed, 677 insertions(+), 677 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fec32dfa/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationConfigurationImpl.java b/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationConfigurationImpl.java
new file mode 100644
index 0000000..9dd1a1b
--- /dev/null
+++ b/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationConfigurationImpl.java
@@ -0,0 +1,293 @@
+/*******************************************************************************
+ * 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 org.apache.taverna.configuration.app.impl;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Properties;
+import java.util.UUID;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+
+import org.apache.log4j.Logger;
+import org.apache.taverna.configuration.app.ApplicationConfiguration;
+
+import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
+
+/**
+ * Represent the application config as it has been specified in {@value #PROPERTIES}. This
+ * configuration specifies the application's name and title, etc.
+ * <p>
+ * An application would typically provide the {@value #PROPERTIES} file on the classpath under a
+ * <code>conf</code> directory, or in a <code>conf</code> directory in the application's
+ * distribution directory.
+ *
+ * @author Stian Soiland-Reyes
+ * @author David Withers
+ */
+public class ApplicationConfigurationImpl implements ApplicationConfiguration {
+
+ private static final Logger logger = Logger.getLogger(ApplicationConfigurationImpl.class);
+
+ private static final String UNKNOWN_APPLICATION = "unknownApplication-"
+ + UUID.randomUUID().toString();
+
+ public static final String APP_HOME = "taverna.app.home";
+ public static final String APP_STARTUP = "taverna.app.startup";
+ public static final String APPLICATION_PROFILE = "ApplicationProfile.xml";
+
+ private File startupDir;
+ private File homeDir;
+
+ private ApplicationProfile applicationProfile;
+ private ApplicationProfile defaultApplicationProfile;
+
+ public ApplicationConfigurationImpl() {
+ }
+
+ @Override
+ public String getName() {
+ String name = null;
+ ApplicationProfile profile = getDefaultApplicationProfile();
+ if (profile != null) {
+ name = profile.getName();
+ }
+ if (name == null) {
+ logger.error("ApplicationConfig could not determine application name, using "
+ + UNKNOWN_APPLICATION);
+ return UNKNOWN_APPLICATION;
+ }
+ return name;
+ }
+
+ @Override
+ public String getTitle() {
+ return getName();
+ }
+
+ @Override
+ public File getStartupDir() {
+ if (startupDir == null) {
+ String startupDirName = System.getProperty(APP_STARTUP);
+ if (startupDirName != null) {
+ startupDir = new File(startupDirName).getAbsoluteFile();
+ }
+ }
+ return startupDir;
+ }
+
+ @Override
+ public synchronized File getApplicationHomeDir() {
+ if (homeDir == null) {
+ if (getName().equals(ApplicationConfigurationImpl.UNKNOWN_APPLICATION)) {
+ try {
+ // Make a temporary home directory as a backup
+ homeDir = File.createTempFile(getName(), "home");
+ homeDir.delete();
+ homeDir.mkdirs();
+ } catch (IOException e) {
+ throw new IllegalStateException("Can't create temporary application home", e);
+ }
+ logger.warn("Could not determine application's user home,"
+ + " using temporary dir " + homeDir);
+ } else {
+ homeDir = new ApplicationUserHome(getName(), System.getProperty(APP_HOME)).getAppUserHome();
+ }
+ if (homeDir == null || !homeDir.isDirectory()) {
+ throw new IllegalStateException("Could not create application home directory "
+ + homeDir);
+ }
+ }
+ return homeDir;
+ }
+
+ @Override
+ public File getUserPluginDir() {
+ File userPluginsDir = new File(getApplicationHomeDir(), PLUGINS_DIR);
+ try {
+ userPluginsDir.mkdirs();
+ } catch (SecurityException e) {
+ logger.warn("Error creating user plugin directory at " + userPluginsDir, e);
+ }
+ return userPluginsDir;
+ }
+
+ @Override
+ public File getSystemPluginDir() {
+ File systemPluginsDir = new File(getStartupDir(), PLUGINS_DIR);
+ try {
+ systemPluginsDir.mkdirs();
+ } catch (SecurityException e) {
+ logger.debug("Error creating system plugin directory at " + systemPluginsDir, e);
+ }
+ return systemPluginsDir;
+ }
+
+ @Override
+ public File getLogFile() {
+ return new File(getLogDir(), getName() + ".log");
+ }
+
+ @Override
+ public File getLogDir() {
+ File logDir = new File(getApplicationHomeDir(), "logs");
+ logDir.mkdirs();
+ if (!logDir.isDirectory()) {
+ throw new IllegalStateException("Could not create log directory " + logDir);
+ }
+ return logDir;
+ }
+
+ private void findInClassLoader(List<URI> configs, ClassLoader classLoader, String resourcePath) {
+ Enumeration<URL> resources;
+ try {
+ resources = classLoader.getResources(resourcePath);
+ } catch (IOException ex) {
+ System.err.println("Error looking for " + resourcePath + " in " + classLoader);
+ ex.printStackTrace();
+ return;
+ }
+ while (resources.hasMoreElements()) {
+ URL configURL = resources.nextElement();
+ try {
+ configs.add(configURL.toURI());
+ } catch (URISyntaxException ex) {
+ throw new RuntimeException("Invalid URL from getResource(): " + configURL, ex);
+ }
+ }
+ }
+
+ /**
+ * Attempt to load application properties from propertyFileName.
+ * <p>
+ * Will attempt to load a property file from the locations below. The first non-empty properties
+ * successfully loaded will be returned.
+ * <ol>
+ * <li>$startup/conf/$resourceName</li>
+ * <li>$startup/$resourceName</li>
+ * <li>$contextClassPath/conf/$resourceName</li>
+ * <li>$contextClassPath/$resourceName</li>
+ * <li>$classpath/conf/$resourceName</li>
+ * <li>$classpath/$resourceName</li>
+ * </ol>
+ * <p>
+ * Where <code>$startup</code> is this application's startup directory as determined by
+ * {@link #getStartupDir()}, and <code>$contextClassPath</code> means a search using
+ * {@link ClassLoader#getResources(String)} from the classloader returned by
+ * {@link Thread#getContextClassLoader()} and then again <code>$classpath</code> for the
+ * classloader of {@link #getClass()} of this instance.
+ * </p>
+ * <p>
+ * If none of these sources could find a non-empty property file, a warning is logged, and an
+ * empty {@link Properties} instance is returned.
+ *
+ * @param resourceName
+ * Relative filename of property file
+ *
+ * @return Loaded or empty {@link Properties} instance.
+ */
+ protected Properties loadProperties(String resourceName) {
+ // Ordered list of config locations to attempt to load
+ // properties from
+ List<URI> configs = new ArrayList<URI>();
+
+ File startupDir = getStartupDir();
+ if (startupDir != null) {
+ configs.add(startupDir.toURI().resolve(CONF_DIR).resolve(resourceName));
+ configs.add(startupDir.toURI().resolve(resourceName));
+ }
+
+ ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
+ findInClassLoader(configs, contextClassLoader, CONF_DIR + resourceName);
+ findInClassLoader(configs, contextClassLoader, resourceName);
+
+ findInClassLoader(configs, getClass().getClassLoader(), CONF_DIR + resourceName);
+ findInClassLoader(configs, getClass().getClassLoader(), resourceName);
+
+ Properties loadedProps = new Properties();
+ for (URI config : configs) {
+ try {
+ InputStream inputStream = config.toURL().openStream();
+ loadedProps.load(inputStream);
+ } catch (MalformedURLException ex) {
+ throw new RuntimeException("Invalid URL from URI: " + config, ex);
+ } catch (IOException ex) {
+ continue; // Probably not found/access denied
+ }
+ if (!loadedProps.isEmpty()) {
+ logger.debug("Loaded " + resourceName + " from " + config);
+ return loadedProps;
+ }
+ }
+ logger.debug("Could not find application properties file " + resourceName);
+ return loadedProps;
+ }
+
+ @Override
+ public ApplicationProfile getApplicationProfile() {
+ if (applicationProfile == null) {
+ File applicationProfileFile = new File(getApplicationHomeDir(), APPLICATION_PROFILE);
+ if (!applicationProfileFile.exists()) {
+ logger.debug("Application profile not found at " + applicationProfileFile);
+ return getDefaultApplicationProfile();
+ }
+ try {
+ JAXBContext jaxbContext = JAXBContext.newInstance(ApplicationProfile.class);
+ Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+ applicationProfile = (ApplicationProfile) unmarshaller.unmarshal(applicationProfileFile);
+ } catch (JAXBException e) {
+ logger.error("Could not read application profile from " + applicationProfileFile, e);
+ }
+ if (applicationProfile == null) {
+ logger.debug("Application profile not found at " + applicationProfileFile);
+ return getDefaultApplicationProfile();
+ }
+ }
+ return applicationProfile;
+ }
+
+ public ApplicationProfile getDefaultApplicationProfile() {
+ if (defaultApplicationProfile == null) {
+ File applicationProfileFile = new File(getStartupDir(), APPLICATION_PROFILE);
+ if (applicationProfileFile.exists()) {
+ try {
+ JAXBContext jaxbContext = JAXBContext.newInstance(ApplicationProfile.class);
+ Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+ defaultApplicationProfile = (ApplicationProfile) unmarshaller.unmarshal(applicationProfileFile);
+ } catch (JAXBException e) {
+ throw new IllegalStateException("Could not read application profile from " + applicationProfileFile);
+ }
+ }
+ }
+ return defaultApplicationProfile;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fec32dfa/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationUserHome.java
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationUserHome.java b/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationUserHome.java
new file mode 100644
index 0000000..fa95a97
--- /dev/null
+++ b/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationUserHome.java
@@ -0,0 +1,224 @@
+/*******************************************************************************
+ * 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 org.apache.taverna.configuration.app.impl;
+
+import java.io.File;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Find and create an application's user directory according to operating system
+ * standards.
+ * <p>
+ * For example for the application "MyApp" this class will be able to find
+ * <code>$HOME/.myapp</code> on Linux or
+ * <code>C:\Document and settings\MyUsername\Application Data\MyApplication</code>
+ * on Windows XP.
+ *
+ * @author Stian Soiland-Reyes
+ * @author Stuart Owen
+ *
+ */
+public class ApplicationUserHome {
+
+ private final String defaultApplicationHome;
+
+ private final String applicationName;
+
+ private File homeDir;
+
+ private static Logger logger = Logger.getLogger(ApplicationUserHome.class);
+
+ /**
+ * Initialise with the name of the application.
+ *
+ * @param applicationName
+ * This name will be used as a template for creating the
+ * application home directory (but might be transcribed, for
+ * instance to lowercase). It is generally recommended, but not
+ * required - that this name does not contain spaces or any
+ * special international/Unicode characters.
+ */
+ public ApplicationUserHome(String applicationName) {
+ this(applicationName, null);
+ }
+
+ /**
+ * Initialise with the name of the application and a default application
+ * home.
+ *
+ * @param applicationName
+ * This name will be used as a template for creating the
+ * application home directory (but might be transcribed, for
+ * instance to lowercase). It is generally recommended, but not
+ * required - that this name does not contain spaces or any
+ * special international/Unicode characters.
+ * @param defaultApplicationHome
+ * The full path to the default home directory. If this string is
+ * not <code>null</code>, then a {@link File} based on this
+ * directory will always be returned by
+ * {@link #getDefaultApplicationHome()} - otherwise the normal
+ * operating system logic is used to determine the application's
+ * home directory.
+ */
+ public ApplicationUserHome(String applicationName,
+ String defaultApplicationHome) {
+ this.applicationName = applicationName;
+ this.defaultApplicationHome = defaultApplicationHome;
+ }
+
+ /**
+ * Find (and if necessary create) the user's application directory,
+ * according to operating system standards. The resolved directory is then
+ * returned as a {@link File} object.
+ * <p>
+ * The application's name as defined by {@link #getApplicationName()} is
+ * used as a basis for naming the directory of the application's user
+ * directory, but the directory name might for instance be transformed to
+ * lowercase.
+ * <p>
+ * If {@link #getDefaultApplicationHome()} returns a non-null value, the
+ * directory specified by that path will be used instead of the operation
+ * system specific directory. The directory will be created if needed.
+ * <p>
+ * If any exception occurs (such as out of diskspace), <code>null</code>
+ * will be returned.
+ *
+ * <p>
+ * On Windows XP, this will typically be something like:
+ *
+ * <pre>
+ * C:\Document and settings\MyUsername\Application Data\MyApplication
+ * </pre>
+ *
+ * and on Windows Vista it would be something like:
+ *
+ * <pre>
+ * C:\Users\MyUsername\Application Data\MyApplication
+ * </pre>
+ *
+ * while on Mac OS X it will be something like:
+ *
+ * <pre>
+ * /Users/MyUsername/Library/Application Support/MyApplication
+ * </pre>
+ *
+ * All other OS'es are assumed to be UNIX-alike, returning something like:
+ *
+ * <pre>
+ * /user/myusername/.myapplication
+ * </pre>
+ *
+ * <p>
+ * If the directory does not already exist, it will be created.
+ * </p>
+ *
+ * @return An {@link File} referring to an existing directory for
+ * user-specific configuration etc. for the given application.
+ */
+ public synchronized File getAppUserHome() {
+ if (homeDir != null) {
+ return homeDir;
+ }
+ File appHome;
+ String applicationHome = getDefaultApplicationHome();
+ if (applicationHome != null) {
+ appHome = new File(applicationHome);
+ } else {
+ if (getApplicationName() == null) {
+ logger.warn("Unknown application name");
+ return null;
+ }
+ File home = new File(System.getProperty("user.home"));
+ if (!home.isDirectory()) {
+ logger.error("User home not a valid directory: " + home);
+ return null;
+ }
+ String os = System.getProperty("os.name");
+ // logger.debug("OS is " + os);
+ if (os.equals("Mac OS X")) {
+ File libDir = new File(home, "Library/Application Support");
+ libDir.mkdirs();
+ appHome = new File(libDir, getApplicationName());
+ } else if (os.startsWith("Windows")) {
+ String APPDATA = System.getenv("APPDATA");
+ File appData = null;
+ if (APPDATA != null) {
+ appData = new File(APPDATA);
+ }
+ if (appData != null && appData.isDirectory()) {
+ appHome = new File(appData, getApplicationName());
+ } else {
+ logger.warn("Could not find %APPDATA%: " + APPDATA);
+ appHome = new File(home, getApplicationName());
+ }
+ } else {
+ // We'll assume UNIX style is OK
+ appHome = new File(home, "."
+ + getApplicationName().toLowerCase().replace(' ', '-'));
+ }
+ }
+ if (!appHome.exists()) {
+ if (appHome.mkdir()) {
+ logger.info("Created " + appHome);
+ } else {
+ logger.error("Could not create " + appHome);
+ return null;
+ }
+ }
+ if (!appHome.isDirectory()) {
+ logger.error("User home not a valid directory: " + appHome);
+ return null;
+ }
+ this.homeDir = appHome.getAbsoluteFile();
+ return this.homeDir;
+ }
+
+ /**
+ * The application's name. This name will be used as a template for creating
+ * the application home directory (but might be transcribed, for instance to
+ * lowercase). It is generally recommended, but not required - that this
+ * name does not contain spaces or any special international/Unicode
+ * characters.
+ *
+ * @return The application's name.
+ *
+ */
+ public String getApplicationName() {
+ return applicationName;
+ }
+
+ /**
+ * The full path to the default home directory. If this string is not
+ * <code>null</code>, then a {@link File} based on this directory will
+ * always be returned by {@link #getDefaultApplicationHome()} - otherwise
+ * the normal operating system logic is used to determine the application's
+ * home directory.
+ *
+ * @return The full path to the application's home directory, or
+ * <code>null</code> if the operation system specific logic is to
+ * be used.
+ */
+ public String getDefaultApplicationHome() {
+ return defaultApplicationHome;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fec32dfa/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/Log4JConfiguration.java
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/Log4JConfiguration.java b/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/Log4JConfiguration.java
new file mode 100644
index 0000000..7f0c43f
--- /dev/null
+++ b/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/Log4JConfiguration.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * 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 org.apache.taverna.configuration.app.impl;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.PatternLayout;
+import org.apache.log4j.PropertyConfigurator;
+import org.apache.log4j.RollingFileAppender;
+import org.apache.taverna.configuration.app.ApplicationConfiguration;
+
+public class Log4JConfiguration {
+ public final static String LOG4J_PROPERTIES = "log4j.properties";
+
+ private static boolean log4jConfigured = false;
+
+ private ApplicationConfiguration applicationConfiguration;
+
+ private Properties properties ;
+
+ public Log4JConfiguration() {
+// prepareLog4J();
+ }
+
+ public void prepareLog4J() {
+ if (!log4jConfigured) {
+ Properties log4jProperties = getLogProperties();
+ if (log4jProperties != null && ! log4jProperties.isEmpty()) {
+ LogManager.resetConfiguration();
+ PropertyConfigurator.configure(log4jProperties);
+ }
+
+ String logFilePath = applicationConfiguration.getLogFile().getAbsolutePath();
+ PatternLayout layout = new PatternLayout("%-5p %d{ISO8601} (%c:%L) - %m%n");
+
+ // Add file appender
+ RollingFileAppender appender;
+ try {
+ appender = new RollingFileAppender(layout, logFilePath);
+ appender.setMaxFileSize("1MB");
+ appender.setEncoding("UTF-8");
+ appender.setMaxBackupIndex(4);
+ // Let root logger decide level
+ appender.setThreshold(Level.ALL);
+ LogManager.getRootLogger().addAppender(appender);
+ } catch (IOException e) {
+ System.err.println("Could not log to " + logFilePath);
+ }
+
+ log4jConfigured = true;
+ }
+ }
+
+ /**
+ * Initialises and provides access to the list of Properties.
+ * @return
+ */
+ public Properties getLogProperties() {
+ if (properties == null) {
+ InputStream is = getLogPropertiesInputStream();
+ if (is != null) {
+ try {
+ properties = new Properties();
+ properties.load(is);
+// properties.putAll(System.getProperties());
+ } catch (IOException e) {
+ errorLog("An error occurred trying to load the " + LOG4J_PROPERTIES + " file",e);
+ }
+ }
+ }
+ return properties;
+ }
+
+ /**
+ * Return an input stream to the configuration file, or null if it can't be found
+ * @return
+ */
+ private InputStream getLogPropertiesInputStream() {
+ InputStream result = null;
+ File propertiesFile = getLogPropertiesFile();
+ if (propertiesFile!=null) {
+ try {
+ result=new FileInputStream(propertiesFile);
+ } catch (FileNotFoundException e) {
+ errorLog("Unable to find "+LOG4J_PROPERTIES,e);
+ }
+ }
+ else {
+ errorLog("Unable to determine file for "+LOG4J_PROPERTIES,null);
+ }
+ return result;
+ }
+
+ /**
+ * Returns a File object to the configuration file or null if it cannot be found.
+ *
+ * @return
+ */
+ private File getLogPropertiesFile() {
+ File home = applicationConfiguration.getApplicationHomeDir();
+ File startup = applicationConfiguration.getStartupDir();
+ File result=null;
+ if (home!=null) {
+ File file = new File(new File(home, ApplicationConfiguration.CONF_DIR), LOG4J_PROPERTIES);
+ if (file.exists()) {
+ result=file;
+ }
+ }
+ if (result==null && startup!=null) {
+ File file = new File(new File(startup, ApplicationConfiguration.CONF_DIR), LOG4J_PROPERTIES);
+ if (file.exists()) {
+ result=file;
+ }
+ }
+ return result;
+ }
+
+ private void errorLog(String message, Throwable exception) {
+ System.out.println(message);
+ if (exception!=null) {
+ exception.printStackTrace();
+ }
+
+ }
+
+ /**
+ * Sets the applicationConfiguration.
+ *
+ * @param applicationConfiguration the new value of applicationConfiguration
+ */
+ public void setApplicationConfiguration(ApplicationConfiguration applicationConfiguration) {
+ this.applicationConfiguration = applicationConfiguration;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fec32dfa/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/ApplicationConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/ApplicationConfigurationImpl.java b/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/ApplicationConfigurationImpl.java
deleted file mode 100644
index 8230e85..0000000
--- a/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/ApplicationConfigurationImpl.java
+++ /dev/null
@@ -1,293 +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 uk.org.taverna.configuration.app.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Properties;
-import java.util.UUID;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
-
-import org.apache.log4j.Logger;
-import org.apache.taverna.configuration.app.ApplicationConfiguration;
-
-import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
-
-/**
- * Represent the application config as it has been specified in {@value #PROPERTIES}. This
- * configuration specifies the application's name and title, etc.
- * <p>
- * An application would typically provide the {@value #PROPERTIES} file on the classpath under a
- * <code>conf</code> directory, or in a <code>conf</code> directory in the application's
- * distribution directory.
- *
- * @author Stian Soiland-Reyes
- * @author David Withers
- */
-public class ApplicationConfigurationImpl implements ApplicationConfiguration {
-
- private static final Logger logger = Logger.getLogger(ApplicationConfigurationImpl.class);
-
- private static final String UNKNOWN_APPLICATION = "unknownApplication-"
- + UUID.randomUUID().toString();
-
- public static final String APP_HOME = "taverna.app.home";
- public static final String APP_STARTUP = "taverna.app.startup";
- public static final String APPLICATION_PROFILE = "ApplicationProfile.xml";
-
- private File startupDir;
- private File homeDir;
-
- private ApplicationProfile applicationProfile;
- private ApplicationProfile defaultApplicationProfile;
-
- public ApplicationConfigurationImpl() {
- }
-
- @Override
- public String getName() {
- String name = null;
- ApplicationProfile profile = getDefaultApplicationProfile();
- if (profile != null) {
- name = profile.getName();
- }
- if (name == null) {
- logger.error("ApplicationConfig could not determine application name, using "
- + UNKNOWN_APPLICATION);
- return UNKNOWN_APPLICATION;
- }
- return name;
- }
-
- @Override
- public String getTitle() {
- return getName();
- }
-
- @Override
- public File getStartupDir() {
- if (startupDir == null) {
- String startupDirName = System.getProperty(APP_STARTUP);
- if (startupDirName != null) {
- startupDir = new File(startupDirName).getAbsoluteFile();
- }
- }
- return startupDir;
- }
-
- @Override
- public synchronized File getApplicationHomeDir() {
- if (homeDir == null) {
- if (getName().equals(ApplicationConfigurationImpl.UNKNOWN_APPLICATION)) {
- try {
- // Make a temporary home directory as a backup
- homeDir = File.createTempFile(getName(), "home");
- homeDir.delete();
- homeDir.mkdirs();
- } catch (IOException e) {
- throw new IllegalStateException("Can't create temporary application home", e);
- }
- logger.warn("Could not determine application's user home,"
- + " using temporary dir " + homeDir);
- } else {
- homeDir = new ApplicationUserHome(getName(), System.getProperty(APP_HOME)).getAppUserHome();
- }
- if (homeDir == null || !homeDir.isDirectory()) {
- throw new IllegalStateException("Could not create application home directory "
- + homeDir);
- }
- }
- return homeDir;
- }
-
- @Override
- public File getUserPluginDir() {
- File userPluginsDir = new File(getApplicationHomeDir(), PLUGINS_DIR);
- try {
- userPluginsDir.mkdirs();
- } catch (SecurityException e) {
- logger.warn("Error creating user plugin directory at " + userPluginsDir, e);
- }
- return userPluginsDir;
- }
-
- @Override
- public File getSystemPluginDir() {
- File systemPluginsDir = new File(getStartupDir(), PLUGINS_DIR);
- try {
- systemPluginsDir.mkdirs();
- } catch (SecurityException e) {
- logger.debug("Error creating system plugin directory at " + systemPluginsDir, e);
- }
- return systemPluginsDir;
- }
-
- @Override
- public File getLogFile() {
- return new File(getLogDir(), getName() + ".log");
- }
-
- @Override
- public File getLogDir() {
- File logDir = new File(getApplicationHomeDir(), "logs");
- logDir.mkdirs();
- if (!logDir.isDirectory()) {
- throw new IllegalStateException("Could not create log directory " + logDir);
- }
- return logDir;
- }
-
- private void findInClassLoader(List<URI> configs, ClassLoader classLoader, String resourcePath) {
- Enumeration<URL> resources;
- try {
- resources = classLoader.getResources(resourcePath);
- } catch (IOException ex) {
- System.err.println("Error looking for " + resourcePath + " in " + classLoader);
- ex.printStackTrace();
- return;
- }
- while (resources.hasMoreElements()) {
- URL configURL = resources.nextElement();
- try {
- configs.add(configURL.toURI());
- } catch (URISyntaxException ex) {
- throw new RuntimeException("Invalid URL from getResource(): " + configURL, ex);
- }
- }
- }
-
- /**
- * Attempt to load application properties from propertyFileName.
- * <p>
- * Will attempt to load a property file from the locations below. The first non-empty properties
- * successfully loaded will be returned.
- * <ol>
- * <li>$startup/conf/$resourceName</li>
- * <li>$startup/$resourceName</li>
- * <li>$contextClassPath/conf/$resourceName</li>
- * <li>$contextClassPath/$resourceName</li>
- * <li>$classpath/conf/$resourceName</li>
- * <li>$classpath/$resourceName</li>
- * </ol>
- * <p>
- * Where <code>$startup</code> is this application's startup directory as determined by
- * {@link #getStartupDir()}, and <code>$contextClassPath</code> means a search using
- * {@link ClassLoader#getResources(String)} from the classloader returned by
- * {@link Thread#getContextClassLoader()} and then again <code>$classpath</code> for the
- * classloader of {@link #getClass()} of this instance.
- * </p>
- * <p>
- * If none of these sources could find a non-empty property file, a warning is logged, and an
- * empty {@link Properties} instance is returned.
- *
- * @param resourceName
- * Relative filename of property file
- *
- * @return Loaded or empty {@link Properties} instance.
- */
- protected Properties loadProperties(String resourceName) {
- // Ordered list of config locations to attempt to load
- // properties from
- List<URI> configs = new ArrayList<URI>();
-
- File startupDir = getStartupDir();
- if (startupDir != null) {
- configs.add(startupDir.toURI().resolve(CONF_DIR).resolve(resourceName));
- configs.add(startupDir.toURI().resolve(resourceName));
- }
-
- ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
- findInClassLoader(configs, contextClassLoader, CONF_DIR + resourceName);
- findInClassLoader(configs, contextClassLoader, resourceName);
-
- findInClassLoader(configs, getClass().getClassLoader(), CONF_DIR + resourceName);
- findInClassLoader(configs, getClass().getClassLoader(), resourceName);
-
- Properties loadedProps = new Properties();
- for (URI config : configs) {
- try {
- InputStream inputStream = config.toURL().openStream();
- loadedProps.load(inputStream);
- } catch (MalformedURLException ex) {
- throw new RuntimeException("Invalid URL from URI: " + config, ex);
- } catch (IOException ex) {
- continue; // Probably not found/access denied
- }
- if (!loadedProps.isEmpty()) {
- logger.debug("Loaded " + resourceName + " from " + config);
- return loadedProps;
- }
- }
- logger.debug("Could not find application properties file " + resourceName);
- return loadedProps;
- }
-
- @Override
- public ApplicationProfile getApplicationProfile() {
- if (applicationProfile == null) {
- File applicationProfileFile = new File(getApplicationHomeDir(), APPLICATION_PROFILE);
- if (!applicationProfileFile.exists()) {
- logger.debug("Application profile not found at " + applicationProfileFile);
- return getDefaultApplicationProfile();
- }
- try {
- JAXBContext jaxbContext = JAXBContext.newInstance(ApplicationProfile.class);
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- applicationProfile = (ApplicationProfile) unmarshaller.unmarshal(applicationProfileFile);
- } catch (JAXBException e) {
- logger.error("Could not read application profile from " + applicationProfileFile, e);
- }
- if (applicationProfile == null) {
- logger.debug("Application profile not found at " + applicationProfileFile);
- return getDefaultApplicationProfile();
- }
- }
- return applicationProfile;
- }
-
- public ApplicationProfile getDefaultApplicationProfile() {
- if (defaultApplicationProfile == null) {
- File applicationProfileFile = new File(getStartupDir(), APPLICATION_PROFILE);
- if (applicationProfileFile.exists()) {
- try {
- JAXBContext jaxbContext = JAXBContext.newInstance(ApplicationProfile.class);
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- defaultApplicationProfile = (ApplicationProfile) unmarshaller.unmarshal(applicationProfileFile);
- } catch (JAXBException e) {
- throw new IllegalStateException("Could not read application profile from " + applicationProfileFile);
- }
- }
- }
- return defaultApplicationProfile;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fec32dfa/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/ApplicationUserHome.java
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/ApplicationUserHome.java b/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/ApplicationUserHome.java
deleted file mode 100644
index a5bf207..0000000
--- a/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/ApplicationUserHome.java
+++ /dev/null
@@ -1,224 +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 uk.org.taverna.configuration.app.impl;
-
-import java.io.File;
-
-import org.apache.log4j.Logger;
-
-/**
- * Find and create an application's user directory according to operating system
- * standards.
- * <p>
- * For example for the application "MyApp" this class will be able to find
- * <code>$HOME/.myapp</code> on Linux or
- * <code>C:\Document and settings\MyUsername\Application Data\MyApplication</code>
- * on Windows XP.
- *
- * @author Stian Soiland-Reyes
- * @author Stuart Owen
- *
- */
-public class ApplicationUserHome {
-
- private final String defaultApplicationHome;
-
- private final String applicationName;
-
- private File homeDir;
-
- private static Logger logger = Logger.getLogger(ApplicationUserHome.class);
-
- /**
- * Initialise with the name of the application.
- *
- * @param applicationName
- * This name will be used as a template for creating the
- * application home directory (but might be transcribed, for
- * instance to lowercase). It is generally recommended, but not
- * required - that this name does not contain spaces or any
- * special international/Unicode characters.
- */
- public ApplicationUserHome(String applicationName) {
- this(applicationName, null);
- }
-
- /**
- * Initialise with the name of the application and a default application
- * home.
- *
- * @param applicationName
- * This name will be used as a template for creating the
- * application home directory (but might be transcribed, for
- * instance to lowercase). It is generally recommended, but not
- * required - that this name does not contain spaces or any
- * special international/Unicode characters.
- * @param defaultApplicationHome
- * The full path to the default home directory. If this string is
- * not <code>null</code>, then a {@link File} based on this
- * directory will always be returned by
- * {@link #getDefaultApplicationHome()} - otherwise the normal
- * operating system logic is used to determine the application's
- * home directory.
- */
- public ApplicationUserHome(String applicationName,
- String defaultApplicationHome) {
- this.applicationName = applicationName;
- this.defaultApplicationHome = defaultApplicationHome;
- }
-
- /**
- * Find (and if necessary create) the user's application directory,
- * according to operating system standards. The resolved directory is then
- * returned as a {@link File} object.
- * <p>
- * The application's name as defined by {@link #getApplicationName()} is
- * used as a basis for naming the directory of the application's user
- * directory, but the directory name might for instance be transformed to
- * lowercase.
- * <p>
- * If {@link #getDefaultApplicationHome()} returns a non-null value, the
- * directory specified by that path will be used instead of the operation
- * system specific directory. The directory will be created if needed.
- * <p>
- * If any exception occurs (such as out of diskspace), <code>null</code>
- * will be returned.
- *
- * <p>
- * On Windows XP, this will typically be something like:
- *
- * <pre>
- * C:\Document and settings\MyUsername\Application Data\MyApplication
- * </pre>
- *
- * and on Windows Vista it would be something like:
- *
- * <pre>
- * C:\Users\MyUsername\Application Data\MyApplication
- * </pre>
- *
- * while on Mac OS X it will be something like:
- *
- * <pre>
- * /Users/MyUsername/Library/Application Support/MyApplication
- * </pre>
- *
- * All other OS'es are assumed to be UNIX-alike, returning something like:
- *
- * <pre>
- * /user/myusername/.myapplication
- * </pre>
- *
- * <p>
- * If the directory does not already exist, it will be created.
- * </p>
- *
- * @return An {@link File} referring to an existing directory for
- * user-specific configuration etc. for the given application.
- */
- public synchronized File getAppUserHome() {
- if (homeDir != null) {
- return homeDir;
- }
- File appHome;
- String applicationHome = getDefaultApplicationHome();
- if (applicationHome != null) {
- appHome = new File(applicationHome);
- } else {
- if (getApplicationName() == null) {
- logger.warn("Unknown application name");
- return null;
- }
- File home = new File(System.getProperty("user.home"));
- if (!home.isDirectory()) {
- logger.error("User home not a valid directory: " + home);
- return null;
- }
- String os = System.getProperty("os.name");
- // logger.debug("OS is " + os);
- if (os.equals("Mac OS X")) {
- File libDir = new File(home, "Library/Application Support");
- libDir.mkdirs();
- appHome = new File(libDir, getApplicationName());
- } else if (os.startsWith("Windows")) {
- String APPDATA = System.getenv("APPDATA");
- File appData = null;
- if (APPDATA != null) {
- appData = new File(APPDATA);
- }
- if (appData != null && appData.isDirectory()) {
- appHome = new File(appData, getApplicationName());
- } else {
- logger.warn("Could not find %APPDATA%: " + APPDATA);
- appHome = new File(home, getApplicationName());
- }
- } else {
- // We'll assume UNIX style is OK
- appHome = new File(home, "."
- + getApplicationName().toLowerCase().replace(' ', '-'));
- }
- }
- if (!appHome.exists()) {
- if (appHome.mkdir()) {
- logger.info("Created " + appHome);
- } else {
- logger.error("Could not create " + appHome);
- return null;
- }
- }
- if (!appHome.isDirectory()) {
- logger.error("User home not a valid directory: " + appHome);
- return null;
- }
- this.homeDir = appHome.getAbsoluteFile();
- return this.homeDir;
- }
-
- /**
- * The application's name. This name will be used as a template for creating
- * the application home directory (but might be transcribed, for instance to
- * lowercase). It is generally recommended, but not required - that this
- * name does not contain spaces or any special international/Unicode
- * characters.
- *
- * @return The application's name.
- *
- */
- public String getApplicationName() {
- return applicationName;
- }
-
- /**
- * The full path to the default home directory. If this string is not
- * <code>null</code>, then a {@link File} based on this directory will
- * always be returned by {@link #getDefaultApplicationHome()} - otherwise
- * the normal operating system logic is used to determine the application's
- * home directory.
- *
- * @return The full path to the application's home directory, or
- * <code>null</code> if the operation system specific logic is to
- * be used.
- */
- public String getDefaultApplicationHome() {
- return defaultApplicationHome;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fec32dfa/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/Log4JConfiguration.java
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/Log4JConfiguration.java b/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/Log4JConfiguration.java
deleted file mode 100644
index 3585815..0000000
--- a/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/Log4JConfiguration.java
+++ /dev/null
@@ -1,160 +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 uk.org.taverna.configuration.app.impl;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.LogManager;
-import org.apache.log4j.PatternLayout;
-import org.apache.log4j.PropertyConfigurator;
-import org.apache.log4j.RollingFileAppender;
-import org.apache.taverna.configuration.app.ApplicationConfiguration;
-
-public class Log4JConfiguration {
- public final static String LOG4J_PROPERTIES = "log4j.properties";
-
- private static boolean log4jConfigured = false;
-
- private ApplicationConfiguration applicationConfiguration;
-
- private Properties properties ;
-
- public Log4JConfiguration() {
-// prepareLog4J();
- }
-
- public void prepareLog4J() {
- if (!log4jConfigured) {
- Properties log4jProperties = getLogProperties();
- if (log4jProperties != null && ! log4jProperties.isEmpty()) {
- LogManager.resetConfiguration();
- PropertyConfigurator.configure(log4jProperties);
- }
-
- String logFilePath = applicationConfiguration.getLogFile().getAbsolutePath();
- PatternLayout layout = new PatternLayout("%-5p %d{ISO8601} (%c:%L) - %m%n");
-
- // Add file appender
- RollingFileAppender appender;
- try {
- appender = new RollingFileAppender(layout, logFilePath);
- appender.setMaxFileSize("1MB");
- appender.setEncoding("UTF-8");
- appender.setMaxBackupIndex(4);
- // Let root logger decide level
- appender.setThreshold(Level.ALL);
- LogManager.getRootLogger().addAppender(appender);
- } catch (IOException e) {
- System.err.println("Could not log to " + logFilePath);
- }
-
- log4jConfigured = true;
- }
- }
-
- /**
- * Initialises and provides access to the list of Properties.
- * @return
- */
- public Properties getLogProperties() {
- if (properties == null) {
- InputStream is = getLogPropertiesInputStream();
- if (is != null) {
- try {
- properties = new Properties();
- properties.load(is);
-// properties.putAll(System.getProperties());
- } catch (IOException e) {
- errorLog("An error occurred trying to load the " + LOG4J_PROPERTIES + " file",e);
- }
- }
- }
- return properties;
- }
-
- /**
- * Return an input stream to the configuration file, or null if it can't be found
- * @return
- */
- private InputStream getLogPropertiesInputStream() {
- InputStream result = null;
- File propertiesFile = getLogPropertiesFile();
- if (propertiesFile!=null) {
- try {
- result=new FileInputStream(propertiesFile);
- } catch (FileNotFoundException e) {
- errorLog("Unable to find "+LOG4J_PROPERTIES,e);
- }
- }
- else {
- errorLog("Unable to determine file for "+LOG4J_PROPERTIES,null);
- }
- return result;
- }
-
- /**
- * Returns a File object to the configuration file or null if it cannot be found.
- *
- * @return
- */
- private File getLogPropertiesFile() {
- File home = applicationConfiguration.getApplicationHomeDir();
- File startup = applicationConfiguration.getStartupDir();
- File result=null;
- if (home!=null) {
- File file = new File(new File(home, ApplicationConfiguration.CONF_DIR), LOG4J_PROPERTIES);
- if (file.exists()) {
- result=file;
- }
- }
- if (result==null && startup!=null) {
- File file = new File(new File(startup, ApplicationConfiguration.CONF_DIR), LOG4J_PROPERTIES);
- if (file.exists()) {
- result=file;
- }
- }
- return result;
- }
-
- private void errorLog(String message, Throwable exception) {
- System.out.println(message);
- if (exception!=null) {
- exception.printStackTrace();
- }
-
- }
-
- /**
- * Sets the applicationConfiguration.
- *
- * @param applicationConfiguration the new value of applicationConfiguration
- */
- public void setApplicationConfiguration(ApplicationConfiguration applicationConfiguration) {
- this.applicationConfiguration = applicationConfiguration;
- }
-
-}
[11/17] incubator-taverna-osgi git commit:
org.apache.taverna.configuration.impl
Posted by st...@apache.org.
org.apache.taverna.configuration.impl
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/b5890181
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/b5890181
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/b5890181
Branch: refs/heads/master
Commit: b589018133f52bbe52ab440fcbcfcc57a115574c
Parents: e7b6fc0
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Oct 18 13:39:37 2015 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Oct 18 13:39:37 2015 +0100
----------------------------------------------------------------------
.../impl/ConfigurationManagerImpl.java | 152 +++++++++++++++
.../proxy/impl/HttpProxyConfigurationImpl.java | 165 +++++++++++++++++
.../impl/ConfigurationManagerImpl.java | 152 ---------------
.../proxy/impl/HttpProxyConfigurationImpl.java | 165 -----------------
.../impl/ConfigurationManagerImplTest.java | 183 +++++++++++++++++++
.../configuration/impl/DummyUIFactory1.java | 126 +++++++++++++
.../configuration/impl/DummyUIFactory2.java | 126 +++++++++++++
.../impl/ConfigurationManagerImplTest.java | 182 ------------------
.../configuration/impl/DummyUIFactory1.java | 126 -------------
.../configuration/impl/DummyUIFactory2.java | 126 -------------
10 files changed, 752 insertions(+), 751 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/b5890181/taverna-configuration-impl/src/main/java/org/apache/taverna/configuration/impl/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/main/java/org/apache/taverna/configuration/impl/ConfigurationManagerImpl.java b/taverna-configuration-impl/src/main/java/org/apache/taverna/configuration/impl/ConfigurationManagerImpl.java
new file mode 100644
index 0000000..67ae6f8
--- /dev/null
+++ b/taverna-configuration-impl/src/main/java/org/apache/taverna/configuration/impl/ConfigurationManagerImpl.java
@@ -0,0 +1,152 @@
+/*******************************************************************************
+ * 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 org.apache.taverna.configuration.impl;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.log4j.Logger;
+import org.apache.taverna.configuration.Configurable;
+import org.apache.taverna.configuration.ConfigurationManager;
+import org.apache.taverna.configuration.app.ApplicationConfiguration;
+
+/**
+ * Handles the configuration for a {@link Configurable} object
+ *
+ * @author Ian Dunlop
+ * @author Stuart Owen
+ */
+public class ConfigurationManagerImpl implements ConfigurationManager {
+
+ private static final Logger logger = Logger.getLogger(ConfigurationManagerImpl.class);
+
+ private File baseConfigLocation;
+
+ public ConfigurationManagerImpl(ApplicationConfiguration applicationConfiguration) {
+ File home = applicationConfiguration.getApplicationHomeDir();
+ File config = new File(home,"conf");
+ if (!config.exists()) {
+ config.mkdir();
+ }
+ setBaseConfigLocation(config);
+ }
+
+ /**
+ * Write out the properties configuration to disk based on the UUID of the
+ * {@link Configurable}
+ * <br>
+ * Default values are not stored within the file, but only those that have been changed or deleted.
+ *
+ * @param configurable
+ * @throws Exception
+ */
+ @Override
+ public void store(Configurable configurable) throws Exception {
+ try {
+
+ Map<String, String> propertyMap = configurable.getInternalPropertyMap();
+ Properties props = new Properties();
+ for (String key : propertyMap.keySet()) {
+ if (!propertyMap.get(key).equals(configurable.getDefaultProperty(key))) {
+ props.put(key, propertyMap.get(key));
+ }
+ }
+ File configFile = new File(baseConfigLocation,generateFilename(configurable));
+ logger.info("Storing configuration for "+configurable.getFilePrefix()+" to "+configFile.getAbsolutePath());
+ props.store(new FileOutputStream(configFile), "");
+ } catch (Exception e) {
+ throw new Exception("Configuration storage failed: " + e);
+ }
+ }
+
+
+
+ /**
+ * Loads the configuration details from disk or from memory and populates the provided Configurable
+ *
+ * @param configurable
+ * @return
+ * @throws Exception
+ * if there are no configuration details available
+ */
+ @Override
+ public void populate(Configurable configurable)
+ throws Exception {
+ try {
+ File configFile = new File(baseConfigLocation,generateFilename(configurable));
+ if (configFile.exists()) {
+ Properties props = new Properties();
+ props.load(new FileInputStream(configFile));
+ configurable.clear();
+ for (Object key : props.keySet()) {
+ configurable.setProperty(key.toString(), props.getProperty(key.toString()));
+ }
+ }
+ else {
+ logger.info("Config file for "+configurable.getFilePrefix()+" not yet created. Creating with default values.");
+ configurable.restoreDefaults();
+ store(configurable);
+ }
+
+ } catch (Exception e) {
+ logger.error("There was a error reading the configuration file for "+configurable.getFilePrefix()+", using defaults",e);
+ configurable.restoreDefaults();
+ }
+ }
+
+ protected String generateFilename(Configurable configurable) {
+ return configurable.getFilePrefix()+"-"+configurable.getUUID() + ".config";
+ }
+
+ public boolean isBaseLocationSet() {
+ return baseConfigLocation!=null;
+ }
+
+ /**
+ * Where the config files are being stored
+ *
+ * @return
+ * @throws Exception
+ */
+ public File getBaseConfigLocation() throws Exception {
+ if (isBaseLocationSet()) {
+ return baseConfigLocation;
+ } else {
+ throw new Exception("Set location first");
+ }
+ }
+
+ /**
+ * Where should the config files be stored
+ *
+ * @return
+ * @throws Exception
+ */
+ public void setBaseConfigLocation(File baseConfigLocation) {
+ // TODO if this is a different place than before then copy all the
+ // config files to this new place
+ this.baseConfigLocation = baseConfigLocation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/b5890181/taverna-configuration-impl/src/main/java/org/apache/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/main/java/org/apache/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java b/taverna-configuration-impl/src/main/java/org/apache/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java
new file mode 100644
index 0000000..983e712
--- /dev/null
+++ b/taverna-configuration-impl/src/main/java/org/apache/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java
@@ -0,0 +1,165 @@
+/*******************************************************************************
+ * 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 org.apache.taverna.configuration.proxy.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+//import org.apache.axis.AxisProperties;
+import org.apache.log4j.Logger;
+import org.apache.taverna.configuration.AbstractConfigurable;
+import org.apache.taverna.configuration.ConfigurationManager;
+import org.apache.taverna.configuration.proxy.HttpProxyConfiguration;
+
+/**
+ * The HttpProxyConfiguration handles the configuration of HTTP
+ * proxy when Taverna is launched.
+ *
+ * @author alanrw
+ * @author David Withers
+ */
+public class HttpProxyConfigurationImpl extends AbstractConfigurable implements
+ HttpProxyConfiguration {
+
+ private Map<String, String> defaultPropertyMap;
+
+ /**
+ * A Properties that holds the original System settings for HTTP proxy. They
+ * need to be copied as they are overwritten if something other than those
+ * System settings are used.
+ */
+ private Properties originalSystemSettings;
+
+ private static Logger logger = Logger.getLogger(HttpProxyConfigurationImpl.class);
+
+ /**
+ * Read the original System settings. Read the configuration file and set
+ * the proxy settings accordingly.
+ */
+ private HttpProxyConfigurationImpl(ConfigurationManager configurationManager) {
+ super(configurationManager);
+ changeProxySettings();
+ }
+
+ /**
+ * Return the original System property value for the specified key. Null of
+ * no such property existed.
+ *
+ * @param key
+ * @return
+ */
+ public String getOriginalSystemSetting(String key) {
+ if (originalSystemSettings == null) {
+ originalSystemSettings = new Properties();
+ originalSystemSettings.putAll(System.getProperties());
+ }
+ return originalSystemSettings.getProperty(key);
+ }
+
+ @Override
+ public void changeProxySettings() {
+ String option = getProperty(PROXY_USE_OPTION);
+ if (option.equals(USE_SYSTEM_PROPERTIES_OPTION)) {
+ changeSystemProperty(PROXY_HOST, getOriginalSystemSetting(PROXY_HOST));
+ changeSystemProperty(PROXY_PORT, getOriginalSystemSetting(PROXY_PORT));
+ changeSystemProperty(PROXY_USER, getOriginalSystemSetting(PROXY_USER));
+ changeSystemProperty(PROXY_PASSWORD, getOriginalSystemSetting(PROXY_PASSWORD));
+ changeSystemProperty(NON_PROXY_HOSTS, getOriginalSystemSetting(NON_PROXY_HOSTS));
+ } else if (option.equals(USE_NO_PROXY_OPTION)) {
+ changeSystemProperty(PROXY_HOST, null);
+ changeSystemProperty(PROXY_PORT, null);
+ changeSystemProperty(PROXY_USER, null);
+ changeSystemProperty(PROXY_PASSWORD, null);
+ changeSystemProperty(NON_PROXY_HOSTS, null);
+ } else if (option.equals(USE_SPECIFIED_VALUES_OPTION)) {
+ changeSystemProperty(PROXY_HOST, getProperty(TAVERNA_PROXY_HOST));
+ changeSystemProperty(PROXY_PORT, getProperty(TAVERNA_PROXY_PORT));
+ changeSystemProperty(PROXY_USER, getProperty(TAVERNA_PROXY_USER));
+ changeSystemProperty(PROXY_PASSWORD, getProperty(TAVERNA_PROXY_PASSWORD));
+ changeSystemProperty(NON_PROXY_HOSTS, getProperty(TAVERNA_NON_PROXY_HOSTS));
+ }
+ logger.info(PROXY_HOST + " is " + System.getProperty(PROXY_HOST));
+ logger.info(PROXY_PORT + " is " + System.getProperty(PROXY_PORT));
+ logger.info(PROXY_USER + " is " + System.getProperty(PROXY_USER));
+ logger.info(NON_PROXY_HOSTS + " is " + System.getProperty(NON_PROXY_HOSTS));
+ }
+
+ /**
+ * Change the specified System property to the given value. If the value is
+ * null then the property is cleared.
+ *
+ * @param key
+ * @param value
+ */
+ private void changeSystemProperty(String key, String value) {
+ if ((value == null) || value.equals("")) {
+ System.clearProperty(key);
+ } else {
+ System.setProperty(key, value);
+ }
+ //AxisProperties.setProperty(key, (value == null ? "" : value));
+ }
+
+ @Override
+ public Map<String, String> getDefaultPropertyMap() {
+ if (defaultPropertyMap == null) {
+ defaultPropertyMap = new HashMap<String, String>();
+ defaultPropertyMap.put(PROXY_USE_OPTION, USE_SYSTEM_PROPERTIES_OPTION);
+ String proxyHost = getOriginalSystemSetting(PROXY_HOST);
+ defaultPropertyMap.put(SYSTEM_PROXY_HOST, proxyHost == null ? "" : proxyHost);
+ String proxyPort = getOriginalSystemSetting(PROXY_PORT);
+ defaultPropertyMap.put(SYSTEM_PROXY_PORT, proxyPort == null ? "" : proxyPort);
+ String proxyUser = getOriginalSystemSetting(PROXY_USER);
+ defaultPropertyMap.put(SYSTEM_PROXY_USER, proxyUser == null ? "" : proxyUser);
+ String proxyPassword = getOriginalSystemSetting(PROXY_PASSWORD);
+ defaultPropertyMap.put(SYSTEM_PROXY_PASSWORD, proxyPassword == null ? "" : proxyPassword);
+ String nonProxyHosts = getOriginalSystemSetting(NON_PROXY_HOSTS);
+ defaultPropertyMap.put(SYSTEM_NON_PROXY_HOSTS, nonProxyHosts == null ? "" : nonProxyHosts);
+ defaultPropertyMap.put(TAVERNA_PROXY_HOST, "");
+ defaultPropertyMap.put(TAVERNA_PROXY_PORT, "");
+ defaultPropertyMap.put(TAVERNA_PROXY_USER, "");
+ defaultPropertyMap.put(TAVERNA_PROXY_PASSWORD, "");
+ defaultPropertyMap.put(TAVERNA_NON_PROXY_HOSTS, "");
+ }
+ return defaultPropertyMap;
+ }
+
+ @Override
+ public String getUUID() {
+ return "B307A902-F292-4D2F-B8E7-00CC983982B6";
+ }
+
+ @Override
+ public String getDisplayName() {
+ return "HTTP proxy";
+ }
+
+ @Override
+ public String getFilePrefix() {
+ return "HttpProxy";
+ }
+
+ @Override
+ public String getCategory() {
+ return "general";
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/b5890181/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/impl/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/impl/ConfigurationManagerImpl.java b/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/impl/ConfigurationManagerImpl.java
deleted file mode 100644
index 9e33c87..0000000
--- a/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/impl/ConfigurationManagerImpl.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 uk.org.taverna.configuration.impl;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.log4j.Logger;
-import org.apache.taverna.configuration.Configurable;
-import org.apache.taverna.configuration.ConfigurationManager;
-import org.apache.taverna.configuration.app.ApplicationConfiguration;
-
-/**
- * Handles the configuration for a {@link Configurable} object
- *
- * @author Ian Dunlop
- * @author Stuart Owen
- */
-public class ConfigurationManagerImpl implements ConfigurationManager {
-
- private static final Logger logger = Logger.getLogger(ConfigurationManagerImpl.class);
-
- private File baseConfigLocation;
-
- public ConfigurationManagerImpl(ApplicationConfiguration applicationConfiguration) {
- File home = applicationConfiguration.getApplicationHomeDir();
- File config = new File(home,"conf");
- if (!config.exists()) {
- config.mkdir();
- }
- setBaseConfigLocation(config);
- }
-
- /**
- * Write out the properties configuration to disk based on the UUID of the
- * {@link Configurable}
- * <br>
- * Default values are not stored within the file, but only those that have been changed or deleted.
- *
- * @param configurable
- * @throws Exception
- */
- @Override
- public void store(Configurable configurable) throws Exception {
- try {
-
- Map<String, String> propertyMap = configurable.getInternalPropertyMap();
- Properties props = new Properties();
- for (String key : propertyMap.keySet()) {
- if (!propertyMap.get(key).equals(configurable.getDefaultProperty(key))) {
- props.put(key, propertyMap.get(key));
- }
- }
- File configFile = new File(baseConfigLocation,generateFilename(configurable));
- logger.info("Storing configuration for "+configurable.getFilePrefix()+" to "+configFile.getAbsolutePath());
- props.store(new FileOutputStream(configFile), "");
- } catch (Exception e) {
- throw new Exception("Configuration storage failed: " + e);
- }
- }
-
-
-
- /**
- * Loads the configuration details from disk or from memory and populates the provided Configurable
- *
- * @param configurable
- * @return
- * @throws Exception
- * if there are no configuration details available
- */
- @Override
- public void populate(Configurable configurable)
- throws Exception {
- try {
- File configFile = new File(baseConfigLocation,generateFilename(configurable));
- if (configFile.exists()) {
- Properties props = new Properties();
- props.load(new FileInputStream(configFile));
- configurable.clear();
- for (Object key : props.keySet()) {
- configurable.setProperty(key.toString(), props.getProperty(key.toString()));
- }
- }
- else {
- logger.info("Config file for "+configurable.getFilePrefix()+" not yet created. Creating with default values.");
- configurable.restoreDefaults();
- store(configurable);
- }
-
- } catch (Exception e) {
- logger.error("There was a error reading the configuration file for "+configurable.getFilePrefix()+", using defaults",e);
- configurable.restoreDefaults();
- }
- }
-
- protected String generateFilename(Configurable configurable) {
- return configurable.getFilePrefix()+"-"+configurable.getUUID() + ".config";
- }
-
- public boolean isBaseLocationSet() {
- return baseConfigLocation!=null;
- }
-
- /**
- * Where the config files are being stored
- *
- * @return
- * @throws Exception
- */
- public File getBaseConfigLocation() throws Exception {
- if (isBaseLocationSet()) {
- return baseConfigLocation;
- } else {
- throw new Exception("Set location first");
- }
- }
-
- /**
- * Where should the config files be stored
- *
- * @return
- * @throws Exception
- */
- public void setBaseConfigLocation(File baseConfigLocation) {
- // TODO if this is a different place than before then copy all the
- // config files to this new place
- this.baseConfigLocation = baseConfigLocation;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/b5890181/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java b/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java
deleted file mode 100644
index 7e7462f..0000000
--- a/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java
+++ /dev/null
@@ -1,165 +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 uk.org.taverna.configuration.proxy.impl;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-//import org.apache.axis.AxisProperties;
-import org.apache.log4j.Logger;
-import org.apache.taverna.configuration.AbstractConfigurable;
-import org.apache.taverna.configuration.ConfigurationManager;
-import org.apache.taverna.configuration.proxy.HttpProxyConfiguration;
-
-/**
- * The HttpProxyConfiguration handles the configuration of HTTP
- * proxy when Taverna is launched.
- *
- * @author alanrw
- * @author David Withers
- */
-public class HttpProxyConfigurationImpl extends AbstractConfigurable implements
- HttpProxyConfiguration {
-
- private Map<String, String> defaultPropertyMap;
-
- /**
- * A Properties that holds the original System settings for HTTP proxy. They
- * need to be copied as they are overwritten if something other than those
- * System settings are used.
- */
- private Properties originalSystemSettings;
-
- private static Logger logger = Logger.getLogger(HttpProxyConfigurationImpl.class);
-
- /**
- * Read the original System settings. Read the configuration file and set
- * the proxy settings accordingly.
- */
- private HttpProxyConfigurationImpl(ConfigurationManager configurationManager) {
- super(configurationManager);
- changeProxySettings();
- }
-
- /**
- * Return the original System property value for the specified key. Null of
- * no such property existed.
- *
- * @param key
- * @return
- */
- public String getOriginalSystemSetting(String key) {
- if (originalSystemSettings == null) {
- originalSystemSettings = new Properties();
- originalSystemSettings.putAll(System.getProperties());
- }
- return originalSystemSettings.getProperty(key);
- }
-
- @Override
- public void changeProxySettings() {
- String option = getProperty(PROXY_USE_OPTION);
- if (option.equals(USE_SYSTEM_PROPERTIES_OPTION)) {
- changeSystemProperty(PROXY_HOST, getOriginalSystemSetting(PROXY_HOST));
- changeSystemProperty(PROXY_PORT, getOriginalSystemSetting(PROXY_PORT));
- changeSystemProperty(PROXY_USER, getOriginalSystemSetting(PROXY_USER));
- changeSystemProperty(PROXY_PASSWORD, getOriginalSystemSetting(PROXY_PASSWORD));
- changeSystemProperty(NON_PROXY_HOSTS, getOriginalSystemSetting(NON_PROXY_HOSTS));
- } else if (option.equals(USE_NO_PROXY_OPTION)) {
- changeSystemProperty(PROXY_HOST, null);
- changeSystemProperty(PROXY_PORT, null);
- changeSystemProperty(PROXY_USER, null);
- changeSystemProperty(PROXY_PASSWORD, null);
- changeSystemProperty(NON_PROXY_HOSTS, null);
- } else if (option.equals(USE_SPECIFIED_VALUES_OPTION)) {
- changeSystemProperty(PROXY_HOST, getProperty(TAVERNA_PROXY_HOST));
- changeSystemProperty(PROXY_PORT, getProperty(TAVERNA_PROXY_PORT));
- changeSystemProperty(PROXY_USER, getProperty(TAVERNA_PROXY_USER));
- changeSystemProperty(PROXY_PASSWORD, getProperty(TAVERNA_PROXY_PASSWORD));
- changeSystemProperty(NON_PROXY_HOSTS, getProperty(TAVERNA_NON_PROXY_HOSTS));
- }
- logger.info(PROXY_HOST + " is " + System.getProperty(PROXY_HOST));
- logger.info(PROXY_PORT + " is " + System.getProperty(PROXY_PORT));
- logger.info(PROXY_USER + " is " + System.getProperty(PROXY_USER));
- logger.info(NON_PROXY_HOSTS + " is " + System.getProperty(NON_PROXY_HOSTS));
- }
-
- /**
- * Change the specified System property to the given value. If the value is
- * null then the property is cleared.
- *
- * @param key
- * @param value
- */
- private void changeSystemProperty(String key, String value) {
- if ((value == null) || value.equals("")) {
- System.clearProperty(key);
- } else {
- System.setProperty(key, value);
- }
- //AxisProperties.setProperty(key, (value == null ? "" : value));
- }
-
- @Override
- public Map<String, String> getDefaultPropertyMap() {
- if (defaultPropertyMap == null) {
- defaultPropertyMap = new HashMap<String, String>();
- defaultPropertyMap.put(PROXY_USE_OPTION, USE_SYSTEM_PROPERTIES_OPTION);
- String proxyHost = getOriginalSystemSetting(PROXY_HOST);
- defaultPropertyMap.put(SYSTEM_PROXY_HOST, proxyHost == null ? "" : proxyHost);
- String proxyPort = getOriginalSystemSetting(PROXY_PORT);
- defaultPropertyMap.put(SYSTEM_PROXY_PORT, proxyPort == null ? "" : proxyPort);
- String proxyUser = getOriginalSystemSetting(PROXY_USER);
- defaultPropertyMap.put(SYSTEM_PROXY_USER, proxyUser == null ? "" : proxyUser);
- String proxyPassword = getOriginalSystemSetting(PROXY_PASSWORD);
- defaultPropertyMap.put(SYSTEM_PROXY_PASSWORD, proxyPassword == null ? "" : proxyPassword);
- String nonProxyHosts = getOriginalSystemSetting(NON_PROXY_HOSTS);
- defaultPropertyMap.put(SYSTEM_NON_PROXY_HOSTS, nonProxyHosts == null ? "" : nonProxyHosts);
- defaultPropertyMap.put(TAVERNA_PROXY_HOST, "");
- defaultPropertyMap.put(TAVERNA_PROXY_PORT, "");
- defaultPropertyMap.put(TAVERNA_PROXY_USER, "");
- defaultPropertyMap.put(TAVERNA_PROXY_PASSWORD, "");
- defaultPropertyMap.put(TAVERNA_NON_PROXY_HOSTS, "");
- }
- return defaultPropertyMap;
- }
-
- @Override
- public String getUUID() {
- return "B307A902-F292-4D2F-B8E7-00CC983982B6";
- }
-
- @Override
- public String getDisplayName() {
- return "HTTP proxy";
- }
-
- @Override
- public String getFilePrefix() {
- return "HttpProxy";
- }
-
- @Override
- public String getCategory() {
- return "general";
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/b5890181/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/ConfigurationManagerImplTest.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/ConfigurationManagerImplTest.java b/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/ConfigurationManagerImplTest.java
new file mode 100644
index 0000000..d5034b9
--- /dev/null
+++ b/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/ConfigurationManagerImplTest.java
@@ -0,0 +1,183 @@
+/*******************************************************************************
+ * 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 org.apache.taverna.configuration.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.Properties;
+import java.util.UUID;
+
+import org.apache.taverna.configuration.AbstractConfigurable;
+import org.apache.taverna.configuration.Configurable;
+import org.apache.taverna.configuration.DummyConfigurable;
+import org.apache.taverna.configuration.app.ApplicationConfiguration;
+import org.apache.taverna.configuration.impl.ConfigurationManagerImpl;
+import org.junit.Before;
+import org.junit.Test;
+
+import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
+
+public class ConfigurationManagerImplTest {
+
+ private File configFile;
+
+ private ConfigurationManagerImpl manager;
+
+ private DummyConfigurable dummyConfigurable;
+
+ @Before
+ public void setup() throws Exception {
+ dummyConfigurable = new DummyConfigurable(manager);
+ File f = new File(System.getProperty("java.io.tmpdir"));
+ File configTestsDir = new File(f, "configTests");
+ if (!configTestsDir.exists())
+ configTestsDir.mkdir();
+ final File d = new File(configTestsDir, UUID.randomUUID().toString());
+ d.mkdir();
+ manager = new ConfigurationManagerImpl(new ApplicationConfiguration() {
+ public File getApplicationHomeDir() {
+ return d;
+ }
+
+ public String getName() {
+ return null;
+ }
+
+ public String getTitle() {
+ return null;
+ }
+
+ public File getStartupDir() {
+ return null;
+ }
+
+ public File getUserPluginDir() {
+ return null;
+ }
+
+ public File getSystemPluginDir() {
+ return null;
+ }
+
+ public File getLogFile() {
+ return null;
+ }
+
+ public File getLogDir() {
+ return null;
+ }
+
+ public Properties getProperties() {
+ return null;
+ }
+
+ @Override
+ public ApplicationProfile getApplicationProfile() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ });
+ configFile = new File(d, "conf/"+manager.generateFilename(dummyConfigurable));
+ dummyConfigurable.restoreDefaults();
+ }
+
+ @Test
+ public void testStore() throws Exception {
+ Configurable conf = dummyConfigurable;
+ manager.store(conf);
+ assertTrue(configFile.exists());
+ }
+
+ @Test
+ public void testDefaultValues() throws Exception {
+ Configurable conf = dummyConfigurable;
+ assertEquals("name should equal john", "john", conf.getProperty("name"));
+ manager.store(conf);
+ Properties props = new Properties();
+ props.load(new FileInputStream(configFile));
+ assertFalse("stored properties should not contain the default value",
+ props.containsKey("name"));
+ manager.populate(conf);
+ assertEquals("default property name should still exist after re-populating", "john",
+ conf.getProperty("name"));
+ }
+
+ @Test
+ public void testRemoveNotDefaultValue() throws Exception {
+ Configurable conf = dummyConfigurable;
+ conf.setProperty("hhh", "iii");
+ manager.store(conf);
+ Properties props = new Properties();
+ props.load(new FileInputStream(configFile));
+ assertEquals("The stored file should contain the new entry", "iii", props.get("hhh"));
+ conf.deleteProperty("hhh");
+ manager.store(conf);
+ manager.populate(conf);
+ assertNull("The removed value should no longer exist", conf.getProperty("hhh"));
+ props.clear();
+ props.load(new FileInputStream(configFile));
+ assertNull("The stored file should no longer contain the deleted entry", props.get("hhh"));
+ }
+
+ @Test
+ public void testNewValues() throws Exception {
+ Configurable conf = dummyConfigurable;
+ conf.setProperty("country", "france");
+ assertEquals("country should equal france", "france", conf.getProperty("country"));
+ manager.store(conf);
+ Properties props = new Properties();
+ props.load(new FileInputStream(configFile));
+ assertTrue("stored properties should contain the default value",
+ props.containsKey("country"));
+ assertEquals("stored property country should equal france", "france",
+ props.getProperty("country"));
+ manager.populate(conf);
+ assertEquals("default property name should still exist after re-populating", "france",
+ conf.getProperty("country"));
+ }
+
+ @Test
+ public void testDeleteDefaultProperty() throws Exception {
+ AbstractConfigurable conf = dummyConfigurable;
+ assertEquals("name should equal john", "john", conf.getProperty("name"));
+ conf.deleteProperty("name");
+ manager.store(conf);
+ manager.populate(conf);
+ assertNull("value for name should be null", conf.getProperty("name"));
+
+ Properties props = new Properties();
+ props.load(new FileInputStream(configFile));
+ assertTrue("Key name should be in stored props because its a deleted default value",
+ props.containsKey("name"));
+ assertEquals("name should have the special value to indicate its been deleted",
+ AbstractConfigurable.DELETED_VALUE_CODE, props.getProperty("name"));
+ }
+
+ @Test
+ public void testFilename() {
+ assertTrue(configFile.getAbsolutePath().endsWith("dummyPrefix-cheese.config"));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/b5890181/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/DummyUIFactory1.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/DummyUIFactory1.java b/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/DummyUIFactory1.java
new file mode 100644
index 0000000..8dc55e5
--- /dev/null
+++ b/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/DummyUIFactory1.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * 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 org.apache.taverna.configuration.impl;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.swing.JPanel;
+
+import org.apache.taverna.configuration.Configurable;
+import org.apache.taverna.configuration.ConfigurationUIFactory;
+
+public class DummyUIFactory1 implements ConfigurationUIFactory {
+
+ public boolean canHandle(String uuid) {
+ return getConfigurable().getUUID().equals(uuid);
+ }
+
+ public Configurable getConfigurable() {
+ return new DummyConfigurable1();
+ }
+
+ public JPanel getConfigurationPanel() {
+ return new JPanel();
+ }
+
+ static class DummyConfigurable1 implements Configurable {
+
+ public void deleteProperty(String key) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public String getCategory() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Map<String, String> getDefaultPropertyMap() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getProperty(String key) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Map<String, String> getInternalPropertyMap() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<String> getPropertyStringList(String key) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getUUID() {
+ return "123";
+ }
+
+ public void restoreDefaults() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setProperty(String key, String value) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setPropertyStringList(String key, List<String> value) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public String getDefaultProperty(String key) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void clear() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Set<String> getKeys() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getDisplayName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getFilePrefix() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/b5890181/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/DummyUIFactory2.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/DummyUIFactory2.java b/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/DummyUIFactory2.java
new file mode 100644
index 0000000..9d7d284
--- /dev/null
+++ b/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/DummyUIFactory2.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * 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 org.apache.taverna.configuration.impl;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.swing.JPanel;
+
+import org.apache.taverna.configuration.Configurable;
+import org.apache.taverna.configuration.ConfigurationUIFactory;
+
+public class DummyUIFactory2 implements ConfigurationUIFactory {
+
+ public boolean canHandle(String uuid) {
+ return getConfigurable().getUUID().equals(uuid);
+ }
+
+ public Configurable getConfigurable() {
+ return new DummyConfigurable2();
+ }
+
+ public JPanel getConfigurationPanel() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ static class DummyConfigurable2 implements Configurable {
+
+ public void deleteProperty(String key) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public String getCategory() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Map<String, String> getDefaultPropertyMap() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getProperty(String key) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Map<String, String> getInternalPropertyMap() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<String> getPropertyStringList(String key) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getUUID() {
+ return "456";
+ }
+
+ public void restoreDefaults() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setProperty(String key, String value) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setPropertyStringList(String key, List<String> value) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public String getDefaultProperty(String key) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void clear() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Set<String> getKeys() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getDisplayName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getFilePrefix() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/b5890181/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/ConfigurationManagerImplTest.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/ConfigurationManagerImplTest.java b/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/ConfigurationManagerImplTest.java
deleted file mode 100644
index 3b66b94..0000000
--- a/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/ConfigurationManagerImplTest.java
+++ /dev/null
@@ -1,182 +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 uk.org.taverna.configuration.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.util.Properties;
-import java.util.UUID;
-
-import org.apache.taverna.configuration.AbstractConfigurable;
-import org.apache.taverna.configuration.Configurable;
-import org.apache.taverna.configuration.DummyConfigurable;
-import org.apache.taverna.configuration.app.ApplicationConfiguration;
-import org.junit.Before;
-import org.junit.Test;
-
-import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
-
-public class ConfigurationManagerImplTest {
-
- private File configFile;
-
- private ConfigurationManagerImpl manager;
-
- private DummyConfigurable dummyConfigurable;
-
- @Before
- public void setup() throws Exception {
- dummyConfigurable = new DummyConfigurable(manager);
- File f = new File(System.getProperty("java.io.tmpdir"));
- File configTestsDir = new File(f, "configTests");
- if (!configTestsDir.exists())
- configTestsDir.mkdir();
- final File d = new File(configTestsDir, UUID.randomUUID().toString());
- d.mkdir();
- manager = new ConfigurationManagerImpl(new ApplicationConfiguration() {
- public File getApplicationHomeDir() {
- return d;
- }
-
- public String getName() {
- return null;
- }
-
- public String getTitle() {
- return null;
- }
-
- public File getStartupDir() {
- return null;
- }
-
- public File getUserPluginDir() {
- return null;
- }
-
- public File getSystemPluginDir() {
- return null;
- }
-
- public File getLogFile() {
- return null;
- }
-
- public File getLogDir() {
- return null;
- }
-
- public Properties getProperties() {
- return null;
- }
-
- @Override
- public ApplicationProfile getApplicationProfile() {
- // TODO Auto-generated method stub
- return null;
- }
- });
- configFile = new File(d, "conf/"+manager.generateFilename(dummyConfigurable));
- dummyConfigurable.restoreDefaults();
- }
-
- @Test
- public void testStore() throws Exception {
- Configurable conf = dummyConfigurable;
- manager.store(conf);
- assertTrue(configFile.exists());
- }
-
- @Test
- public void testDefaultValues() throws Exception {
- Configurable conf = dummyConfigurable;
- assertEquals("name should equal john", "john", conf.getProperty("name"));
- manager.store(conf);
- Properties props = new Properties();
- props.load(new FileInputStream(configFile));
- assertFalse("stored properties should not contain the default value",
- props.containsKey("name"));
- manager.populate(conf);
- assertEquals("default property name should still exist after re-populating", "john",
- conf.getProperty("name"));
- }
-
- @Test
- public void testRemoveNotDefaultValue() throws Exception {
- Configurable conf = dummyConfigurable;
- conf.setProperty("hhh", "iii");
- manager.store(conf);
- Properties props = new Properties();
- props.load(new FileInputStream(configFile));
- assertEquals("The stored file should contain the new entry", "iii", props.get("hhh"));
- conf.deleteProperty("hhh");
- manager.store(conf);
- manager.populate(conf);
- assertNull("The removed value should no longer exist", conf.getProperty("hhh"));
- props.clear();
- props.load(new FileInputStream(configFile));
- assertNull("The stored file should no longer contain the deleted entry", props.get("hhh"));
- }
-
- @Test
- public void testNewValues() throws Exception {
- Configurable conf = dummyConfigurable;
- conf.setProperty("country", "france");
- assertEquals("country should equal france", "france", conf.getProperty("country"));
- manager.store(conf);
- Properties props = new Properties();
- props.load(new FileInputStream(configFile));
- assertTrue("stored properties should contain the default value",
- props.containsKey("country"));
- assertEquals("stored property country should equal france", "france",
- props.getProperty("country"));
- manager.populate(conf);
- assertEquals("default property name should still exist after re-populating", "france",
- conf.getProperty("country"));
- }
-
- @Test
- public void testDeleteDefaultProperty() throws Exception {
- AbstractConfigurable conf = dummyConfigurable;
- assertEquals("name should equal john", "john", conf.getProperty("name"));
- conf.deleteProperty("name");
- manager.store(conf);
- manager.populate(conf);
- assertNull("value for name should be null", conf.getProperty("name"));
-
- Properties props = new Properties();
- props.load(new FileInputStream(configFile));
- assertTrue("Key name should be in stored props because its a deleted default value",
- props.containsKey("name"));
- assertEquals("name should have the special value to indicate its been deleted",
- AbstractConfigurable.DELETED_VALUE_CODE, props.getProperty("name"));
- }
-
- @Test
- public void testFilename() {
- assertTrue(configFile.getAbsolutePath().endsWith("dummyPrefix-cheese.config"));
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/b5890181/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/DummyUIFactory1.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/DummyUIFactory1.java b/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/DummyUIFactory1.java
deleted file mode 100644
index 08ca082..0000000
--- a/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/DummyUIFactory1.java
+++ /dev/null
@@ -1,126 +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 uk.org.taverna.configuration.impl;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.swing.JPanel;
-
-import org.apache.taverna.configuration.Configurable;
-import org.apache.taverna.configuration.ConfigurationUIFactory;
-
-public class DummyUIFactory1 implements ConfigurationUIFactory {
-
- public boolean canHandle(String uuid) {
- return getConfigurable().getUUID().equals(uuid);
- }
-
- public Configurable getConfigurable() {
- return new DummyConfigurable1();
- }
-
- public JPanel getConfigurationPanel() {
- return new JPanel();
- }
-
- static class DummyConfigurable1 implements Configurable {
-
- public void deleteProperty(String key) {
- // TODO Auto-generated method stub
-
- }
-
- public String getCategory() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Map<String, String> getDefaultPropertyMap() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getProperty(String key) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Map<String, String> getInternalPropertyMap() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public List<String> getPropertyStringList(String key) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getUUID() {
- return "123";
- }
-
- public void restoreDefaults() {
- // TODO Auto-generated method stub
-
- }
-
- public void setProperty(String key, String value) {
- // TODO Auto-generated method stub
-
- }
-
- public void setPropertyStringList(String key, List<String> value) {
- // TODO Auto-generated method stub
-
- }
-
- public String getDefaultProperty(String key) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void clear() {
- // TODO Auto-generated method stub
-
- }
-
- public Set<String> getKeys() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getDisplayName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getFilePrefix() {
- // TODO Auto-generated method stub
- return null;
- }
-
-
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/b5890181/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/DummyUIFactory2.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/DummyUIFactory2.java b/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/DummyUIFactory2.java
deleted file mode 100644
index a09ff98..0000000
--- a/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/DummyUIFactory2.java
+++ /dev/null
@@ -1,126 +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 uk.org.taverna.configuration.impl;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.swing.JPanel;
-
-import org.apache.taverna.configuration.Configurable;
-import org.apache.taverna.configuration.ConfigurationUIFactory;
-
-public class DummyUIFactory2 implements ConfigurationUIFactory {
-
- public boolean canHandle(String uuid) {
- return getConfigurable().getUUID().equals(uuid);
- }
-
- public Configurable getConfigurable() {
- return new DummyConfigurable2();
- }
-
- public JPanel getConfigurationPanel() {
- // TODO Auto-generated method stub
- return null;
- }
-
- static class DummyConfigurable2 implements Configurable {
-
- public void deleteProperty(String key) {
- // TODO Auto-generated method stub
-
- }
-
- public String getCategory() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Map<String, String> getDefaultPropertyMap() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getProperty(String key) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Map<String, String> getInternalPropertyMap() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public List<String> getPropertyStringList(String key) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getUUID() {
- return "456";
- }
-
- public void restoreDefaults() {
- // TODO Auto-generated method stub
-
- }
-
- public void setProperty(String key, String value) {
- // TODO Auto-generated method stub
-
- }
-
- public void setPropertyStringList(String key, List<String> value) {
- // TODO Auto-generated method stub
-
- }
-
- public String getDefaultProperty(String key) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void clear() {
- // TODO Auto-generated method stub
-
- }
-
- public Set<String> getKeys() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getDisplayName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getFilePrefix() {
- // TODO Auto-generated method stub
- return null;
- }
-
-
-
- }
-
-}
[02/17] incubator-taverna-osgi git commit:
uk.org.taverna.configuration.app -> org.apache.taverna.configuration.app
Posted by st...@apache.org.
uk.org.taverna.configuration.app -> org.apache.taverna.configuration.app
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/98e26a2c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/98e26a2c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/98e26a2c
Branch: refs/heads/master
Commit: 98e26a2c51f6dc5e610763e88aeb2580934f51e3
Parents: a1422f8
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Oct 18 13:27:47 2015 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Oct 18 13:27:47 2015 +0100
----------------------------------------------------------------------
.../app/ApplicationConfiguration.java | 62 ++++++++++++++++++++
.../app/ApplicationConfiguration.java | 62 --------------------
taverna-app-configuration-impl/pom.xml | 2 +-
.../app/impl/ApplicationConfigurationImpl.java | 2 +-
.../app/impl/Log4JConfiguration.java | 3 +-
.../spring/configuration-context-osgi.xml | 2 +-
.../META-INF/spring/configuration-context.xml | 4 +-
.../impl/ConfigurationManagerImpl.java | 2 +-
.../spring/configuration-context-osgi.xml | 2 +-
.../impl/ConfigurationManagerImplTest.java | 2 +-
.../commons/plugin/impl/PluginManagerImpl.java | 2 +-
.../plugin/impl/PluginSiteManagerImpl.java | 2 +-
.../META-INF/spring/plugin-context-osgi.xml | 2 +-
.../plugin/impl/PluginSiteManagerImplTest.java | 4 +-
.../commons/update/impl/UpdateManagerImpl.java | 2 +-
.../META-INF/spring/update-context-osgi.xml | 2 +-
16 files changed, 78 insertions(+), 79 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/98e26a2c/taverna-app-configuration-api/src/main/java/org/apache/taverna/configuration/app/ApplicationConfiguration.java
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-api/src/main/java/org/apache/taverna/configuration/app/ApplicationConfiguration.java b/taverna-app-configuration-api/src/main/java/org/apache/taverna/configuration/app/ApplicationConfiguration.java
new file mode 100644
index 0000000..b71726b
--- /dev/null
+++ b/taverna-app-configuration-api/src/main/java/org/apache/taverna/configuration/app/ApplicationConfiguration.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * 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 org.apache.taverna.configuration.app;
+
+import java.io.File;
+
+import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
+
+/**
+ * Represent the application config as it has been specified in
+ * {@value #PROPERTIES}. This configuration specifies the application's name
+ * and title, etc.
+ * <p>
+ * An application would typically provide the {@value #PROPERTIES} file on the classpath under
+ * a <code>conf</code> directory, or in a <code>conf</code> directory in the
+ * application's distribution directory.
+ *
+ * @author Stian Soiland-Reyes
+ * @author David Withers
+ */
+public interface ApplicationConfiguration {
+
+ public static final String CONF_DIR = "conf/";
+ public static final String PLUGINS_DIR = "plugins";
+
+ public String getName();
+
+ public String getTitle();
+
+ public File getStartupDir();
+
+ public File getApplicationHomeDir();
+
+ public File getUserPluginDir();
+
+ public File getSystemPluginDir();
+
+ public File getLogFile();
+
+ public File getLogDir();
+
+ public ApplicationProfile getApplicationProfile();
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/98e26a2c/taverna-app-configuration-api/src/main/java/uk/org/taverna/configuration/app/ApplicationConfiguration.java
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-api/src/main/java/uk/org/taverna/configuration/app/ApplicationConfiguration.java b/taverna-app-configuration-api/src/main/java/uk/org/taverna/configuration/app/ApplicationConfiguration.java
deleted file mode 100644
index b372598..0000000
--- a/taverna-app-configuration-api/src/main/java/uk/org/taverna/configuration/app/ApplicationConfiguration.java
+++ /dev/null
@@ -1,62 +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 uk.org.taverna.configuration.app;
-
-import java.io.File;
-
-import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
-
-/**
- * Represent the application config as it has been specified in
- * {@value #PROPERTIES}. This configuration specifies the application's name
- * and title, etc.
- * <p>
- * An application would typically provide the {@value #PROPERTIES} file on the classpath under
- * a <code>conf</code> directory, or in a <code>conf</code> directory in the
- * application's distribution directory.
- *
- * @author Stian Soiland-Reyes
- * @author David Withers
- */
-public interface ApplicationConfiguration {
-
- public static final String CONF_DIR = "conf/";
- public static final String PLUGINS_DIR = "plugins";
-
- public String getName();
-
- public String getTitle();
-
- public File getStartupDir();
-
- public File getApplicationHomeDir();
-
- public File getUserPluginDir();
-
- public File getSystemPluginDir();
-
- public File getLogFile();
-
- public File getLogDir();
-
- public ApplicationProfile getApplicationProfile();
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/98e26a2c/taverna-app-configuration-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/pom.xml b/taverna-app-configuration-impl/pom.xml
index 55bab09..7f87c78 100644
--- a/taverna-app-configuration-impl/pom.xml
+++ b/taverna-app-configuration-impl/pom.xml
@@ -16,7 +16,7 @@
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
- <Import-Package>uk.org.taverna.configuration.app;provide:=true,*</Import-Package>
+ <Import-Package>org.apache.taverna.configuration.app;provide:=true,*</Import-Package>
</instructions>
</configuration>
</plugin>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/98e26a2c/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/ApplicationConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/ApplicationConfigurationImpl.java b/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/ApplicationConfigurationImpl.java
index b45f36f..8230e85 100644
--- a/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/ApplicationConfigurationImpl.java
+++ b/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/ApplicationConfigurationImpl.java
@@ -38,9 +38,9 @@ import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import org.apache.log4j.Logger;
+import org.apache.taverna.configuration.app.ApplicationConfiguration;
import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
-import uk.org.taverna.configuration.app.ApplicationConfiguration;
/**
* Represent the application config as it has been specified in {@value #PROPERTIES}. This
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/98e26a2c/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/Log4JConfiguration.java
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/Log4JConfiguration.java b/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/Log4JConfiguration.java
index f0e88c2..3585815 100644
--- a/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/Log4JConfiguration.java
+++ b/taverna-app-configuration-impl/src/main/java/uk/org/taverna/configuration/app/impl/Log4JConfiguration.java
@@ -32,8 +32,7 @@ import org.apache.log4j.LogManager;
import org.apache.log4j.PatternLayout;
import org.apache.log4j.PropertyConfigurator;
import org.apache.log4j.RollingFileAppender;
-
-import uk.org.taverna.configuration.app.ApplicationConfiguration;
+import org.apache.taverna.configuration.app.ApplicationConfiguration;
public class Log4JConfiguration {
public final static String LOG4J_PROPERTIES = "log4j.properties";
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/98e26a2c/taverna-app-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml b/taverna-app-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml
index 86cb988..e389ba1 100644
--- a/taverna-app-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml
+++ b/taverna-app-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml
@@ -6,6 +6,6 @@
http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd">
- <service ref="applicationConfiguration" interface="uk.org.taverna.configuration.app.ApplicationConfiguration" />
+ <service ref="applicationConfiguration" interface="org.apache.taverna.configuration.app.ApplicationConfiguration" />
</beans:beans>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/98e26a2c/taverna-app-configuration-impl/src/main/resources/META-INF/spring/configuration-context.xml
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/src/main/resources/META-INF/spring/configuration-context.xml b/taverna-app-configuration-impl/src/main/resources/META-INF/spring/configuration-context.xml
index db9645e..b5190e2 100644
--- a/taverna-app-configuration-impl/src/main/resources/META-INF/spring/configuration-context.xml
+++ b/taverna-app-configuration-impl/src/main/resources/META-INF/spring/configuration-context.xml
@@ -4,8 +4,8 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
- <bean id="applicationConfiguration" class="uk.org.taverna.configuration.app.impl.ApplicationConfigurationImpl" />
- <bean id="log4JConfiguration" class="uk.org.taverna.configuration.app.impl.Log4JConfiguration" init-method="prepareLog4J">
+ <bean id="applicationConfiguration" class="org.apache.taverna.configuration.app.impl.ApplicationConfigurationImpl" />
+ <bean id="log4JConfiguration" class="org.apache.taverna.configuration.app.impl.Log4JConfiguration" init-method="prepareLog4J">
<property name="applicationConfiguration">
<ref local="applicationConfiguration" />
</property>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/98e26a2c/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/impl/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/impl/ConfigurationManagerImpl.java b/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/impl/ConfigurationManagerImpl.java
index 823155c..b538a7d 100644
--- a/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/impl/ConfigurationManagerImpl.java
+++ b/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/impl/ConfigurationManagerImpl.java
@@ -27,10 +27,10 @@ import java.util.Map;
import java.util.Properties;
import org.apache.log4j.Logger;
+import org.apache.taverna.configuration.app.ApplicationConfiguration;
import uk.org.taverna.configuration.Configurable;
import uk.org.taverna.configuration.ConfigurationManager;
-import uk.org.taverna.configuration.app.ApplicationConfiguration;
/**
* Handles the configuration for a {@link Configurable} object
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/98e26a2c/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml b/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml
index 0236d73..f99894c 100644
--- a/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml
+++ b/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml
@@ -9,6 +9,6 @@
<service ref="configurationManager" interface="uk.org.taverna.configuration.ConfigurationManager" />
<service ref="httpProxyConfiguration" interface="uk.org.taverna.configuration.proxy.HttpProxyConfiguration" />
- <reference id="applicationConfiguration" interface="uk.org.taverna.configuration.app.ApplicationConfiguration" />
+ <reference id="applicationConfiguration" interface="org.apache.taverna.configuration.app.ApplicationConfiguration" />
</beans:beans>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/98e26a2c/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/ConfigurationManagerImplTest.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/ConfigurationManagerImplTest.java b/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/ConfigurationManagerImplTest.java
index e09ffb6..4bdaf08 100644
--- a/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/ConfigurationManagerImplTest.java
+++ b/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/ConfigurationManagerImplTest.java
@@ -30,6 +30,7 @@ import java.io.FileInputStream;
import java.util.Properties;
import java.util.UUID;
+import org.apache.taverna.configuration.app.ApplicationConfiguration;
import org.junit.Before;
import org.junit.Test;
@@ -37,7 +38,6 @@ import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
import uk.org.taverna.configuration.AbstractConfigurable;
import uk.org.taverna.configuration.Configurable;
import uk.org.taverna.configuration.DummyConfigurable;
-import uk.org.taverna.configuration.app.ApplicationConfiguration;
public class ConfigurationManagerImplTest {
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/98e26a2c/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginManagerImpl.java b/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginManagerImpl.java
index 364551c..738ed60 100644
--- a/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginManagerImpl.java
+++ b/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginManagerImpl.java
@@ -40,6 +40,7 @@ import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import org.apache.log4j.Logger;
+import org.apache.taverna.configuration.app.ApplicationConfiguration;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@@ -58,7 +59,6 @@ import uk.org.taverna.commons.plugin.PluginSiteManager;
import uk.org.taverna.commons.plugin.xml.jaxb.PluginInfo;
import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
-import uk.org.taverna.configuration.app.ApplicationConfiguration;
/**
* PluginManager implementation.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/98e26a2c/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImpl.java b/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImpl.java
index 1634d98..df8bfa8 100644
--- a/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImpl.java
+++ b/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImpl.java
@@ -33,6 +33,7 @@ import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import org.apache.log4j.Logger;
+import org.apache.taverna.configuration.app.ApplicationConfiguration;
import uk.org.taverna.commons.download.DownloadException;
import uk.org.taverna.commons.download.DownloadManager;
@@ -43,7 +44,6 @@ import uk.org.taverna.commons.plugin.PluginSiteManager;
import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
import uk.org.taverna.commons.plugin.xml.jaxb.Plugins;
import uk.org.taverna.commons.profile.xml.jaxb.Updates;
-import uk.org.taverna.configuration.app.ApplicationConfiguration;
/**
* PluginSiteManager implementation.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/98e26a2c/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml b/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml
index cd235f5..c3b751d 100644
--- a/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml
+++ b/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml
@@ -9,7 +9,7 @@
<service ref="pluginManager" interface="uk.org.taverna.commons.plugin.PluginManager" />
<service ref="pluginSiteManager" interface="uk.org.taverna.commons.plugin.PluginSiteManager" />
- <reference id="applicationConfiguration" interface="uk.org.taverna.configuration.app.ApplicationConfiguration" />
+ <reference id="applicationConfiguration" interface="org.apache.taverna.configuration.app.ApplicationConfiguration" />
<reference id="downloadManager" interface="uk.org.taverna.commons.download.DownloadManager" />
<reference id="eventAdmin" interface="org.osgi.service.event.EventAdmin" />
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/98e26a2c/taverna-plugin-impl/src/test/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImplTest.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/test/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImplTest.java b/taverna-plugin-impl/src/test/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImplTest.java
index 0ca9485..fc8b442 100644
--- a/taverna-plugin-impl/src/test/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImplTest.java
+++ b/taverna-plugin-impl/src/test/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImplTest.java
@@ -27,6 +27,7 @@ import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
+import org.apache.taverna.configuration.app.ApplicationConfiguration;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
@@ -34,7 +35,6 @@ import org.junit.Test;
import uk.org.taverna.commons.download.DownloadException;
import uk.org.taverna.commons.download.DownloadManager;
import uk.org.taverna.commons.plugin.PluginException;
-import uk.org.taverna.configuration.app.ApplicationConfiguration;
/**
*
@@ -124,7 +124,7 @@ public class PluginSiteManagerImplTest {
}
/**
- * Test method for {@link uk.org.taverna.commons.plugin.impl.PluginSiteManagerImpl#setApplicationConfiguration(uk.org.taverna.configuration.app.ApplicationConfiguration)}.
+ * Test method for {@link uk.org.taverna.commons.plugin.impl.PluginSiteManagerImpl#setApplicationConfiguration(org.apache.taverna.configuration.app.ApplicationConfiguration)}.
*/
@Test
public void testSetApplicationConfiguration() {
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/98e26a2c/taverna-update-impl/src/main/java/uk/org/taverna/commons/update/impl/UpdateManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-update-impl/src/main/java/uk/org/taverna/commons/update/impl/UpdateManagerImpl.java b/taverna-update-impl/src/main/java/uk/org/taverna/commons/update/impl/UpdateManagerImpl.java
index 98d3257..d635036 100644
--- a/taverna-update-impl/src/main/java/uk/org/taverna/commons/update/impl/UpdateManagerImpl.java
+++ b/taverna-update-impl/src/main/java/uk/org/taverna/commons/update/impl/UpdateManagerImpl.java
@@ -36,6 +36,7 @@ import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import org.apache.commons.io.FileUtils;
+import org.apache.taverna.configuration.app.ApplicationConfiguration;
import org.osgi.service.event.EventAdmin;
import uk.org.taverna.commons.download.DownloadException;
@@ -48,7 +49,6 @@ import uk.org.taverna.commons.update.UpdateException;
import uk.org.taverna.commons.update.UpdateManager;
import uk.org.taverna.commons.versions.xml.jaxb.Version;
import uk.org.taverna.commons.versions.xml.jaxb.Versions;
-import uk.org.taverna.configuration.app.ApplicationConfiguration;
/**
* Implementation of the Taverna Update Manager.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/98e26a2c/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml b/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml
index 53f3c33..6234a5d 100644
--- a/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml
+++ b/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml
@@ -8,7 +8,7 @@
<service ref="updateManager" interface="uk.org.taverna.commons.update.UpdateManager" />
- <reference id="applicationConfiguration" interface="uk.org.taverna.configuration.app.ApplicationConfiguration" />
+ <reference id="applicationConfiguration" interface="org.apache.taverna.configuration.app.ApplicationConfiguration" />
<reference id="downloadManager" interface="uk.org.taverna.commons.download.DownloadManager" />
<!-- <reference id="eventAdmin" interface="org.osgi.service.event.EventAdmin" /> -->
[10/17] incubator-taverna-osgi git commit:
org.apache.taverna.xmltransformer
Posted by st...@apache.org.
org.apache.taverna.xmltransformer
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/e7b6fc00
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/e7b6fc00
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/e7b6fc00
Branch: refs/heads/master
Commit: e7b6fc00821a03a32d347e6ad358ed5dcdf78b97
Parents: 39180b3
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Oct 18 13:37:17 2015 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Oct 18 13:37:17 2015 +0100
----------------------------------------------------------------------
xml-transformer-service/pom.xml | 4 +-
.../xmltransformer/XMLTransformerActivator.java | 147 +++++++++++++++++++
.../services/xml/XMLTransformerActivator.java | 147 -------------------
3 files changed, 149 insertions(+), 149 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/e7b6fc00/xml-transformer-service/pom.xml
----------------------------------------------------------------------
diff --git a/xml-transformer-service/pom.xml b/xml-transformer-service/pom.xml
index dc58a2e..1677297 100644
--- a/xml-transformer-service/pom.xml
+++ b/xml-transformer-service/pom.xml
@@ -18,8 +18,8 @@
<configuration>
<instructions>
<Import-Package>javax.xml.transform;version="0.0.0",org.apache.xalan.processor,*</Import-Package>
- <Private-Package>uk.org.taverna.osgi.services.xml</Private-Package>
- <Bundle-Activator>uk.org.taverna.osgi.services.xml.XMLTransformerActivator</Bundle-Activator>
+ <Private-Package>org.apache.taverna.xmltransformer</Private-Package>
+ <Bundle-Activator>org.apache.taverna.xmltransformer.XMLTransformerActivator</Bundle-Activator>
</instructions>
</configuration>
</plugin>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/e7b6fc00/xml-transformer-service/src/main/java/org/apache/taverna/xmltransformer/XMLTransformerActivator.java
----------------------------------------------------------------------
diff --git a/xml-transformer-service/src/main/java/org/apache/taverna/xmltransformer/XMLTransformerActivator.java b/xml-transformer-service/src/main/java/org/apache/taverna/xmltransformer/XMLTransformerActivator.java
new file mode 100644
index 0000000..8051a54
--- /dev/null
+++ b/xml-transformer-service/src/main/java/org/apache/taverna/xmltransformer/XMLTransformerActivator.java
@@ -0,0 +1,147 @@
+/*******************************************************************************
+ * Copyright (C) 2011 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 org.apache.taverna.xmltransformer;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.transform.TransformerFactoryConfigurationError;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceFactory;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * A BundleActivator class that allows XML Transformers to register as an OSGi service.
+ *
+ * @author David Withers
+ */
+public class XMLTransformerActivator implements BundleActivator, ServiceFactory {
+
+ private static final Logger logger = Logger.getLogger(XMLTransformerActivator.class.getName());
+
+ private BundleContext context;
+
+ private static final String FACTORY_INTERFACE = "javax.xml.transform.TransformerFactory";
+
+ private static final String SERVICES_DIRECTORY = "/META-INF/services/";
+
+ private static final String FACTORY_IMPLEMENTATIONS_FILE = SERVICES_DIRECTORY
+ + FACTORY_INTERFACE;
+
+ private static final String FACTORY_DESCRIPTION = "An XML Transformer";
+
+ private static final String FACTORY_NAMEKEY = "transformer.factoryname";
+
+ @Override
+ public Object getService(Bundle bundle, ServiceRegistration registration) {
+ ServiceReference serviceReference = registration.getReference();
+ String transformerFactoryClassName = (String) serviceReference.getProperty(FACTORY_NAMEKEY);
+ try {
+ return createFactory(transformerFactoryClassName);
+ } catch (TransformerFactoryConfigurationError fce) {
+ logger.log(Level.WARNING, "Error while creating TransformerFactory", fce);
+ return null;
+ }
+ }
+
+ @Override
+ public void ungetService(Bundle bundle, ServiceRegistration registration, Object service) {
+ }
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ this.context = context;
+ Bundle bundle = context.getBundle();
+ try {
+ registerFactories(getFactoryClassNames(bundle.getResource(FACTORY_IMPLEMENTATIONS_FILE)));
+ } catch (IOException ioe) {
+ throw new TransformerFactoryConfigurationError(ioe);
+ }
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ }
+
+ private List<String> getFactoryClassNames(URL implementationsURL) throws IOException {
+ List<String> classNames = new ArrayList<String>();
+ if (implementationsURL != null) {
+ InputStream is = implementationsURL.openStream();
+ BufferedReader br = new BufferedReader(new InputStreamReader(is));
+ String line = null;
+ while ((line = br.readLine()) != null) {
+ line = line.trim();
+ if (line.length() == 0) {
+ continue; // blank line
+ }
+ int commentPosition = line.indexOf("#");
+ if (commentPosition == 0) { // comment line
+ continue;
+ } else if (commentPosition < 0) { // no comment
+ classNames.add(line);
+ } else {
+ classNames.add(line.substring(0, commentPosition).trim());
+ }
+ }
+ }
+ return classNames;
+ }
+
+ private void registerFactories(List<String> factoryClassNames)
+ throws TransformerFactoryConfigurationError {
+ for (int index = 0; factoryClassNames.size() > index; index++) {
+ String factoryClassName = factoryClassNames.get(index);
+ Hashtable<String, String> properties = new Hashtable<String, String>();
+ properties.put(Constants.SERVICE_DESCRIPTION, FACTORY_DESCRIPTION);
+ properties.put(Constants.SERVICE_PID, FACTORY_INTERFACE + "."
+ + context.getBundle().getBundleId() + "." + index);
+ properties.put(FACTORY_NAMEKEY, factoryClassName);
+ context.registerService(FACTORY_INTERFACE, this, properties);
+ }
+ }
+
+ private Object createFactory(String factoryClassName)
+ throws TransformerFactoryConfigurationError {
+ try {
+ return Class.forName(factoryClassName).newInstance();
+ } catch (InstantiationException e) {
+ throw new TransformerFactoryConfigurationError(e);
+ } catch (IllegalAccessException e) {
+ throw new TransformerFactoryConfigurationError(e);
+ } catch (ClassNotFoundException e) {
+ throw new TransformerFactoryConfigurationError(e);
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/e7b6fc00/xml-transformer-service/src/main/java/uk/org/taverna/osgi/services/xml/XMLTransformerActivator.java
----------------------------------------------------------------------
diff --git a/xml-transformer-service/src/main/java/uk/org/taverna/osgi/services/xml/XMLTransformerActivator.java b/xml-transformer-service/src/main/java/uk/org/taverna/osgi/services/xml/XMLTransformerActivator.java
deleted file mode 100644
index dc197d9..0000000
--- a/xml-transformer-service/src/main/java/uk/org/taverna/osgi/services/xml/XMLTransformerActivator.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2011 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 uk.org.taverna.osgi.services.xml;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.xml.transform.TransformerFactoryConfigurationError;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceFactory;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.ServiceRegistration;
-
-/**
- * A BundleActivator class that allows XML Transformers to register as an OSGi service.
- *
- * @author David Withers
- */
-public class XMLTransformerActivator implements BundleActivator, ServiceFactory {
-
- private static final Logger logger = Logger.getLogger(XMLTransformerActivator.class.getName());
-
- private BundleContext context;
-
- private static final String FACTORY_INTERFACE = "javax.xml.transform.TransformerFactory";
-
- private static final String SERVICES_DIRECTORY = "/META-INF/services/";
-
- private static final String FACTORY_IMPLEMENTATIONS_FILE = SERVICES_DIRECTORY
- + FACTORY_INTERFACE;
-
- private static final String FACTORY_DESCRIPTION = "An XML Transformer";
-
- private static final String FACTORY_NAMEKEY = "transformer.factoryname";
-
- @Override
- public Object getService(Bundle bundle, ServiceRegistration registration) {
- ServiceReference serviceReference = registration.getReference();
- String transformerFactoryClassName = (String) serviceReference.getProperty(FACTORY_NAMEKEY);
- try {
- return createFactory(transformerFactoryClassName);
- } catch (TransformerFactoryConfigurationError fce) {
- logger.log(Level.WARNING, "Error while creating TransformerFactory", fce);
- return null;
- }
- }
-
- @Override
- public void ungetService(Bundle bundle, ServiceRegistration registration, Object service) {
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- this.context = context;
- Bundle bundle = context.getBundle();
- try {
- registerFactories(getFactoryClassNames(bundle.getResource(FACTORY_IMPLEMENTATIONS_FILE)));
- } catch (IOException ioe) {
- throw new TransformerFactoryConfigurationError(ioe);
- }
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- }
-
- private List<String> getFactoryClassNames(URL implementationsURL) throws IOException {
- List<String> classNames = new ArrayList<String>();
- if (implementationsURL != null) {
- InputStream is = implementationsURL.openStream();
- BufferedReader br = new BufferedReader(new InputStreamReader(is));
- String line = null;
- while ((line = br.readLine()) != null) {
- line = line.trim();
- if (line.length() == 0) {
- continue; // blank line
- }
- int commentPosition = line.indexOf("#");
- if (commentPosition == 0) { // comment line
- continue;
- } else if (commentPosition < 0) { // no comment
- classNames.add(line);
- } else {
- classNames.add(line.substring(0, commentPosition).trim());
- }
- }
- }
- return classNames;
- }
-
- private void registerFactories(List<String> factoryClassNames)
- throws TransformerFactoryConfigurationError {
- for (int index = 0; factoryClassNames.size() > index; index++) {
- String factoryClassName = factoryClassNames.get(index);
- Hashtable<String, String> properties = new Hashtable<String, String>();
- properties.put(Constants.SERVICE_DESCRIPTION, FACTORY_DESCRIPTION);
- properties.put(Constants.SERVICE_PID, FACTORY_INTERFACE + "."
- + context.getBundle().getBundleId() + "." + index);
- properties.put(FACTORY_NAMEKEY, factoryClassName);
- context.registerService(FACTORY_INTERFACE, this, properties);
- }
- }
-
- private Object createFactory(String factoryClassName)
- throws TransformerFactoryConfigurationError {
- try {
- return Class.forName(factoryClassName).newInstance();
- } catch (InstantiationException e) {
- throw new TransformerFactoryConfigurationError(e);
- } catch (IllegalAccessException e) {
- throw new TransformerFactoryConfigurationError(e);
- } catch (ClassNotFoundException e) {
- throw new TransformerFactoryConfigurationError(e);
- }
- }
-
-}
[07/17] incubator-taverna-osgi git commit:
uk.org.taverna.commons.plugin -> org.apache.taverna.plugin
Posted by st...@apache.org.
uk.org.taverna.commons.plugin -> org.apache.taverna.plugin
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/7b43b8c7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/7b43b8c7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/7b43b8c7
Branch: refs/heads/master
Commit: 7b43b8c72047f3173033f14167ad74b1d009c3c5
Parents: 6dabe91
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Oct 18 13:32:30 2015 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Oct 18 13:32:30 2015 +0100
----------------------------------------------------------------------
.../java/org/apache/taverna/plugin/Plugin.java | 88 ++++
.../apache/taverna/plugin/PluginException.java | 45 ++
.../apache/taverna/plugin/PluginManager.java | 105 +++++
.../org/apache/taverna/plugin/PluginSite.java | 65 +++
.../taverna/plugin/PluginSiteManager.java | 86 ++++
.../uk/org/taverna/commons/plugin/Plugin.java | 88 ----
.../taverna/commons/plugin/PluginException.java | 45 --
.../taverna/commons/plugin/PluginManager.java | 105 -----
.../org/taverna/commons/plugin/PluginSite.java | 65 ---
.../commons/plugin/PluginSiteManager.java | 86 ----
taverna-plugin-impl/pom.xml | 2 +-
.../plugin/impl/PluginDirectoryWatcher.java | 105 +++++
.../apache/taverna/plugin/impl/PluginImpl.java | 183 ++++++++
.../taverna/plugin/impl/PluginManagerImpl.java | 466 +++++++++++++++++++
.../taverna/plugin/impl/PluginSiteImpl.java | 76 +++
.../plugin/impl/PluginSiteManagerImpl.java | 190 ++++++++
.../apache/taverna/plugin/impl/PluginSites.java | 50 ++
.../plugin/impl/PluginDirectoryWatcher.java | 106 -----
.../taverna/commons/plugin/impl/PluginImpl.java | 183 --------
.../commons/plugin/impl/PluginManagerImpl.java | 466 -------------------
.../commons/plugin/impl/PluginSiteImpl.java | 76 ---
.../plugin/impl/PluginSiteManagerImpl.java | 190 --------
.../commons/plugin/impl/PluginSites.java | 50 --
.../META-INF/spring/plugin-context-osgi.xml | 4 +-
.../META-INF/spring/plugin-context.xml | 8 +-
.../taverna/plugin/impl/PluginSiteImplTest.java | 72 +++
.../plugin/impl/PluginSiteManagerImplTest.java | 143 ++++++
.../commons/plugin/impl/PluginSiteImplTest.java | 72 ---
.../plugin/impl/PluginSiteManagerImplTest.java | 142 ------
29 files changed, 1681 insertions(+), 1681 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/Plugin.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/Plugin.java b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/Plugin.java
new file mode 100644
index 0000000..9caa2f8
--- /dev/null
+++ b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/Plugin.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.plugin;
+
+import java.io.File;
+import java.util.Set;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Version;
+
+/**
+ * A plugin adds functionality to the application by providing implementations of application
+ * services.
+ *
+ * @author David Withers
+ */
+public interface Plugin {
+
+ public static enum State {
+ UNINSTALLED, INSTALLED, STARTED, STOPPED
+ }
+
+ public String getId();
+
+ public String getName();
+
+ public String getDescription();
+
+ public String getOrganization();
+
+ public Version getVersion();
+
+ /**
+ * Returns the state of the plugin.
+ *
+ * @return the state of the plugin
+ */
+ public State getState();
+
+ /**
+ * Starts the plugin and sets the state to STARTED.
+ * <p>
+ * If the plugin state is STARTED this method will have no effect.
+ * <p>
+ * All plugin bundles are not currently started will be started.
+ *
+ * @throws PluginException
+ * if the plugin state is UNINSTALLED or any of the plugin bundles cannot be started
+ */
+ public void start() throws PluginException;
+
+ /**
+ * Stops the plugin and sets the state to STOPPED.
+ * <p>
+ * If the plugin state is not STARTED this method will have no effect.
+ * <p>
+ * All plugin bundles not used elsewhere will be stopped.
+ *
+ * @throws PluginException
+ * if any of the plugin bundles cannot be stopped
+ */
+ public void stop() throws PluginException;
+
+ public void uninstall() throws PluginException;
+
+ public File getFile();
+
+ public Set<Bundle> getBundles();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginException.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginException.java b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginException.java
new file mode 100644
index 0000000..5b57656
--- /dev/null
+++ b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginException.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.plugin;
+
+/**
+ *
+ *
+ * @author David Withers
+ */
+public class PluginException extends Exception {
+
+ public PluginException() {
+ }
+
+ public PluginException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public PluginException(String message) {
+ super(message);
+ }
+
+ public PluginException(Throwable cause) {
+ super(cause);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginManager.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginManager.java b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginManager.java
new file mode 100644
index 0000000..2d52d04
--- /dev/null
+++ b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginManager.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.plugin;
+
+import java.io.File;
+import java.util.List;
+
+import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
+
+/**
+ * Manages installing plugins and checking for plugin updates.
+ *
+ * @author David Withers
+ */
+public interface PluginManager {
+
+ public static final String EVENT_TOPIC_ROOT = "uk/org/taverna/commons/plugin/PluginManager/";
+ public static final String PLUGIN_INSTALLED = EVENT_TOPIC_ROOT + "PLUGIN_INSTALLED";
+ public static final String PLUGIN_UNINSTALLED = EVENT_TOPIC_ROOT + "PLUGIN_UNINSTALLED";
+ public static final String UPDATES_AVAILABLE = EVENT_TOPIC_ROOT + "UPDATES_AVAILABLE";
+
+ /**
+ * Loads plugins from the system and user plugin directories.
+ * <p>
+ * If the plugins are not already installed they will be installed and started.
+ *
+ * @throws PluginException
+ */
+ public void loadPlugins() throws PluginException;
+
+ /**
+ * Check if there are new versions of installed plugins available.
+ * <p>
+ * If updates are available and event with topic {@link UPDATES_AVAILABLE} will be posted.
+ *
+ * @throws PluginException
+ */
+ public void checkForUpdates() throws PluginException;
+
+ /**
+ * Returns updated versions of installed plugins.
+ * <p>
+ * Only plugins that the user has permission to update are returned.
+ *
+ * @return
+ */
+ public List<PluginVersions> getPluginUpdates() throws PluginException;
+
+ /**
+ * Returns new plugins available from all plugin sites.
+ *
+ * @return new plugins available from all plugin sites.
+ * @throws PluginException
+ */
+ public List<PluginVersions> getAvailablePlugins() throws PluginException;
+
+ /**
+ * Returns all the installed plugins.
+ *
+ * @return
+ * @throws PluginException
+ */
+ public List<Plugin> getInstalledPlugins() throws PluginException;
+
+ /**
+ * Installs a plugin from a plugin file.
+ *
+ * @param pluginFile
+ * the file to install the plugin from
+ * @return the installed plugin
+ * @throws PluginException
+ */
+ public Plugin installPlugin(File pluginFile) throws PluginException;
+
+ /**
+ * Installs a plugin from an update site.
+ *
+ * @param pluginSiteURL
+ * @param pluginFile
+ * @return
+ * @throws PluginException
+ */
+ public Plugin installPlugin(String pluginSiteURL, String pluginFile) throws PluginException;
+
+ public Plugin updatePlugin(PluginVersions pluginVersions) throws PluginException;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSite.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSite.java b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSite.java
new file mode 100644
index 0000000..9c69c46
--- /dev/null
+++ b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSite.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.plugin;
+
+/**
+ * A plugin site specifies the location of a site that contains plugins.
+ * <p>
+ * There are two types of plugin site:
+ * <dl>
+ * <dt>SYSTEM</dt>
+ * <dd>plugin sites specified by the application profile</dd>
+ * <dt>USER</dt>
+ * <dd>plugin sites that can be added and removed by the user</dd>
+ * </dl>
+ *
+ * @author David Withers
+ */
+public interface PluginSite {
+
+ public static enum PluginSiteType {
+ SYSTEM, USER
+ };
+
+ /**
+ * Returns the name of the plugin site.
+ *
+ * @return the name of the plugin site
+ */
+ public String getName();
+
+ /**
+ * Returns the URL of the plugin site.
+ *
+ * @return the URL of the plugin site
+ */
+ public String getUrl();
+
+ /**
+ * Returns the type of the plugin site.
+ * <p>
+ * The type is either {@code SYSTEM} or {@code USER}
+ *
+ * @return the type of the plugin site
+ */
+ public PluginSiteType getType();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSiteManager.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSiteManager.java b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSiteManager.java
new file mode 100644
index 0000000..fd7820d
--- /dev/null
+++ b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSiteManager.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.plugin;
+
+import java.net.URL;
+import java.util.List;
+
+import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
+
+/**
+ * Manages plugin sites.
+ *
+ * @author David Withers
+ */
+public interface PluginSiteManager {
+
+ /**
+ * Returns all the managed plugin sites.
+ * <p>
+ * If there are no plugin sites an empty list is returned.
+ *
+ * @return all the managed plugin sites
+ * @throws PluginException
+ */
+ public List<PluginSite> getPluginSites();
+
+ /**
+ * Contacts the plugin site at the specified URL and return a new plugin site.
+ *
+ * @param pluginSiteURL the plugin site URL
+ * @throws PluginException if there is a problem contacting the plugin site
+ */
+ public PluginSite createPluginSite(URL pluginSiteURL) throws PluginException;
+
+ /**
+ * Adds a plugin site.
+ * <p>
+ * If the plugin site already exists this method does nothing.
+ *
+ * @param pluginSite the plugin site to add
+ * @throws PluginException
+ */
+ public void addPluginSite(PluginSite pluginSite) throws PluginException;
+
+ /**
+ * Removes a plugin site.
+ * <p>
+ * If the plugin site does not exist this method does nothing.
+ *
+ * @param pluginSite the plugin site to remove
+ * @throws PluginException
+ */
+ public void removePluginSite(PluginSite pluginSite) throws PluginException;
+
+ /**
+ * Returns all the plugins available at the specified plugin site.
+ * <p>
+ * If no plugins are available an empty list is returned.
+ *
+ * @param pluginSite
+ * the plugin site to contact
+ * @return all the plugins available at the specified plugin site
+ * @throws PluginException
+ * if there is a plroblem contacting the plugin site
+ */
+ public List<PluginVersions> getPlugins(PluginSite pluginSite) throws PluginException;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/Plugin.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/Plugin.java b/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/Plugin.java
deleted file mode 100644
index e9ea0a4..0000000
--- a/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/Plugin.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 uk.org.taverna.commons.plugin;
-
-import java.io.File;
-import java.util.Set;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.Version;
-
-/**
- * A plugin adds functionality to the application by providing implementations of application
- * services.
- *
- * @author David Withers
- */
-public interface Plugin {
-
- public static enum State {
- UNINSTALLED, INSTALLED, STARTED, STOPPED
- }
-
- public String getId();
-
- public String getName();
-
- public String getDescription();
-
- public String getOrganization();
-
- public Version getVersion();
-
- /**
- * Returns the state of the plugin.
- *
- * @return the state of the plugin
- */
- public State getState();
-
- /**
- * Starts the plugin and sets the state to STARTED.
- * <p>
- * If the plugin state is STARTED this method will have no effect.
- * <p>
- * All plugin bundles are not currently started will be started.
- *
- * @throws PluginException
- * if the plugin state is UNINSTALLED or any of the plugin bundles cannot be started
- */
- public void start() throws PluginException;
-
- /**
- * Stops the plugin and sets the state to STOPPED.
- * <p>
- * If the plugin state is not STARTED this method will have no effect.
- * <p>
- * All plugin bundles not used elsewhere will be stopped.
- *
- * @throws PluginException
- * if any of the plugin bundles cannot be stopped
- */
- public void stop() throws PluginException;
-
- public void uninstall() throws PluginException;
-
- public File getFile();
-
- public Set<Bundle> getBundles();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/PluginException.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/PluginException.java b/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/PluginException.java
deleted file mode 100644
index 6bc3fe0..0000000
--- a/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/PluginException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 uk.org.taverna.commons.plugin;
-
-/**
- *
- *
- * @author David Withers
- */
-public class PluginException extends Exception {
-
- public PluginException() {
- }
-
- public PluginException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public PluginException(String message) {
- super(message);
- }
-
- public PluginException(Throwable cause) {
- super(cause);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/PluginManager.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/PluginManager.java b/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/PluginManager.java
deleted file mode 100644
index e9b2f83..0000000
--- a/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/PluginManager.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 uk.org.taverna.commons.plugin;
-
-import java.io.File;
-import java.util.List;
-
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
-
-/**
- * Manages installing plugins and checking for plugin updates.
- *
- * @author David Withers
- */
-public interface PluginManager {
-
- public static final String EVENT_TOPIC_ROOT = "uk/org/taverna/commons/plugin/PluginManager/";
- public static final String PLUGIN_INSTALLED = EVENT_TOPIC_ROOT + "PLUGIN_INSTALLED";
- public static final String PLUGIN_UNINSTALLED = EVENT_TOPIC_ROOT + "PLUGIN_UNINSTALLED";
- public static final String UPDATES_AVAILABLE = EVENT_TOPIC_ROOT + "UPDATES_AVAILABLE";
-
- /**
- * Loads plugins from the system and user plugin directories.
- * <p>
- * If the plugins are not already installed they will be installed and started.
- *
- * @throws PluginException
- */
- public void loadPlugins() throws PluginException;
-
- /**
- * Check if there are new versions of installed plugins available.
- * <p>
- * If updates are available and event with topic {@link UPDATES_AVAILABLE} will be posted.
- *
- * @throws PluginException
- */
- public void checkForUpdates() throws PluginException;
-
- /**
- * Returns updated versions of installed plugins.
- * <p>
- * Only plugins that the user has permission to update are returned.
- *
- * @return
- */
- public List<PluginVersions> getPluginUpdates() throws PluginException;
-
- /**
- * Returns new plugins available from all plugin sites.
- *
- * @return new plugins available from all plugin sites.
- * @throws PluginException
- */
- public List<PluginVersions> getAvailablePlugins() throws PluginException;
-
- /**
- * Returns all the installed plugins.
- *
- * @return
- * @throws PluginException
- */
- public List<Plugin> getInstalledPlugins() throws PluginException;
-
- /**
- * Installs a plugin from a plugin file.
- *
- * @param pluginFile
- * the file to install the plugin from
- * @return the installed plugin
- * @throws PluginException
- */
- public Plugin installPlugin(File pluginFile) throws PluginException;
-
- /**
- * Installs a plugin from an update site.
- *
- * @param pluginSiteURL
- * @param pluginFile
- * @return
- * @throws PluginException
- */
- public Plugin installPlugin(String pluginSiteURL, String pluginFile) throws PluginException;
-
- public Plugin updatePlugin(PluginVersions pluginVersions) throws PluginException;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/PluginSite.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/PluginSite.java b/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/PluginSite.java
deleted file mode 100644
index 54f8e3b..0000000
--- a/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/PluginSite.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 uk.org.taverna.commons.plugin;
-
-/**
- * A plugin site specifies the location of a site that contains plugins.
- * <p>
- * There are two types of plugin site:
- * <dl>
- * <dt>SYSTEM</dt>
- * <dd>plugin sites specified by the application profile</dd>
- * <dt>USER</dt>
- * <dd>plugin sites that can be added and removed by the user</dd>
- * </dl>
- *
- * @author David Withers
- */
-public interface PluginSite {
-
- public static enum PluginSiteType {
- SYSTEM, USER
- };
-
- /**
- * Returns the name of the plugin site.
- *
- * @return the name of the plugin site
- */
- public String getName();
-
- /**
- * Returns the URL of the plugin site.
- *
- * @return the URL of the plugin site
- */
- public String getUrl();
-
- /**
- * Returns the type of the plugin site.
- * <p>
- * The type is either {@code SYSTEM} or {@code USER}
- *
- * @return the type of the plugin site
- */
- public PluginSiteType getType();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/PluginSiteManager.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/PluginSiteManager.java b/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/PluginSiteManager.java
deleted file mode 100644
index 8cd32b5..0000000
--- a/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/PluginSiteManager.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 uk.org.taverna.commons.plugin;
-
-import java.net.URL;
-import java.util.List;
-
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
-
-/**
- * Manages plugin sites.
- *
- * @author David Withers
- */
-public interface PluginSiteManager {
-
- /**
- * Returns all the managed plugin sites.
- * <p>
- * If there are no plugin sites an empty list is returned.
- *
- * @return all the managed plugin sites
- * @throws PluginException
- */
- public List<PluginSite> getPluginSites();
-
- /**
- * Contacts the plugin site at the specified URL and return a new plugin site.
- *
- * @param pluginSiteURL the plugin site URL
- * @throws PluginException if there is a problem contacting the plugin site
- */
- public PluginSite createPluginSite(URL pluginSiteURL) throws PluginException;
-
- /**
- * Adds a plugin site.
- * <p>
- * If the plugin site already exists this method does nothing.
- *
- * @param pluginSite the plugin site to add
- * @throws PluginException
- */
- public void addPluginSite(PluginSite pluginSite) throws PluginException;
-
- /**
- * Removes a plugin site.
- * <p>
- * If the plugin site does not exist this method does nothing.
- *
- * @param pluginSite the plugin site to remove
- * @throws PluginException
- */
- public void removePluginSite(PluginSite pluginSite) throws PluginException;
-
- /**
- * Returns all the plugins available at the specified plugin site.
- * <p>
- * If no plugins are available an empty list is returned.
- *
- * @param pluginSite
- * the plugin site to contact
- * @return all the plugins available at the specified plugin site
- * @throws PluginException
- * if there is a plroblem contacting the plugin site
- */
- public List<PluginVersions> getPlugins(PluginSite pluginSite) throws PluginException;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/pom.xml b/taverna-plugin-impl/pom.xml
index 488e777..57b0bfb 100644
--- a/taverna-plugin-impl/pom.xml
+++ b/taverna-plugin-impl/pom.xml
@@ -16,7 +16,7 @@
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
- <Import-Package>uk.org.taverna.commons.plugin;provide:=true,*</Import-Package>
+ <Import-Package>org.apache.taverna.plugin;provide:=true,*</Import-Package>
</instructions>
</configuration>
</plugin>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginDirectoryWatcher.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginDirectoryWatcher.java b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginDirectoryWatcher.java
new file mode 100644
index 0000000..024c1c7
--- /dev/null
+++ b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginDirectoryWatcher.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.plugin.impl;
+
+import java.io.File;
+
+import org.apache.commons.io.monitor.FileAlterationListenerAdaptor;
+import org.apache.commons.io.monitor.FileAlterationMonitor;
+import org.apache.commons.io.monitor.FileAlterationObserver;
+import org.apache.log4j.Logger;
+import org.apache.taverna.plugin.Plugin;
+import org.apache.taverna.plugin.PluginException;
+
+/**
+ * Watches a plugin directory and adds or removes plugins when plugin files are added or removed
+ * from the directory.
+ *
+ * @author David Withers
+ */
+public class PluginDirectoryWatcher extends FileAlterationListenerAdaptor {
+
+ private static final Logger logger = Logger.getLogger(PluginDirectoryWatcher.class);
+
+ private final PluginManagerImpl pluginManager;
+ private final File directory;
+
+ private FileAlterationMonitor monitor;
+
+ public PluginDirectoryWatcher(PluginManagerImpl pluginManager, File directory) {
+ this.pluginManager = pluginManager;
+ this.directory = directory;
+ FileAlterationObserver observer = new FileAlterationObserver(directory);
+ observer.addListener(this);
+ monitor = new FileAlterationMonitor();
+ monitor.addObserver(observer);
+ }
+
+ /**
+ * Starts watching the plugin directory.
+ *
+ * @throws PluginException
+ */
+ public void start() throws PluginException {
+ try {
+ monitor.start();
+ } catch (Exception e) {
+ throw new PluginException(String.format("Error starting watch on %1$s.",
+ directory.getAbsolutePath()), e);
+ }
+ }
+
+ /**
+ * Stops watching the plugin directory.
+ *
+ * @throws PluginException
+ */
+ public void stop() throws PluginException {
+ try {
+ monitor.stop();
+ } catch (Exception e) {
+ throw new PluginException(String.format("Error stopping watch on %1$s.",
+ directory.getAbsolutePath()), e);
+ }
+ }
+
+ @Override
+ public void onFileCreate(File file) {
+ try {
+ Plugin plugin = pluginManager.installPlugin(file);
+ plugin.start();
+ } catch (PluginException e) {
+ logger.warn("Error loading plugin file " + file, e);
+ }
+ }
+
+ @Override
+ public void onFileChange(File file) {
+ onFileDelete(file);
+ onFileCreate(file);
+ }
+
+ @Override
+ public void onFileDelete(File file) {
+ pluginManager.uninstallPlugin(file);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginImpl.java b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginImpl.java
new file mode 100644
index 0000000..056a67f
--- /dev/null
+++ b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginImpl.java
@@ -0,0 +1,183 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.plugin.impl;
+
+import static org.apache.taverna.plugin.Plugin.State.STARTED;
+import static org.apache.taverna.plugin.Plugin.State.STOPPED;
+import static org.apache.taverna.plugin.Plugin.State.UNINSTALLED;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+import org.apache.taverna.plugin.Plugin;
+import org.apache.taverna.plugin.PluginException;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Version;
+
+import uk.org.taverna.commons.plugin.xml.jaxb.PluginInfo;
+
+/**
+ * @author David Withers
+ */
+public class PluginImpl implements Plugin {
+
+ private static final Logger logger = Logger.getLogger(PluginImpl.class);
+
+ private PluginManagerImpl pluginManager;
+
+ private State state = UNINSTALLED;
+
+ private File file;
+ private String id, name, description, organization;
+ private Version version;
+ private Set<Bundle> bundles = new HashSet<Bundle>();
+
+ public PluginImpl(PluginManagerImpl pluginManager, File file, PluginInfo pluginInfo) {
+ this.pluginManager = pluginManager;
+ this.file = file;
+ id = pluginInfo.getId();
+ name = pluginInfo.getName();
+ description = pluginInfo.getDescription();
+ organization = pluginInfo.getOrganization();
+ version = Version.parseVersion(pluginInfo.getVersion());
+ }
+
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ @Override
+ public String getOrganization() {
+ return organization;
+ }
+
+ @Override
+ public Version getVersion() {
+ return version;
+ }
+
+ @Override
+ public State getState() {
+ return state;
+ }
+
+ void setState(State state) {
+ this.state = state;
+ }
+
+ @Override
+ public void start() throws PluginException {
+ if (state == STARTED) {
+ return;
+ }
+ if (state == UNINSTALLED) {
+ throw new PluginException("Cannot start an uninstalled plugin");
+ }
+ List<Bundle> startedBundles = new ArrayList<Bundle>();
+ for (Bundle bundle : getBundles()) {
+ if (bundle.getHeaders().get(Constants.FRAGMENT_HOST) == null) {
+ if (bundle.getState() != Bundle.ACTIVE) {
+ try {
+ bundle.start();
+ startedBundles.add(bundle);
+ } catch (BundleException e) {
+ // clean up by stopping bundles already started
+ for (Bundle startedBundle : startedBundles) {
+ try {
+ startedBundle.stop();
+ } catch (BundleException ex) {
+ logger.warn("Error unistalling bundle", ex);
+ }
+ }
+ throw new PluginException(String.format("Error starting bundle %1$s",
+ bundle.getSymbolicName()), e);
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public void stop() throws PluginException {
+ if (state == STARTED) {
+ List<Plugin> installedPlugins = pluginManager.getInstalledPlugins();
+ for (Bundle bundle : getBundles()) {
+ // check if bundle is used by other plugins
+ boolean bundleUsed = false;
+ for (Plugin installedPlugin : installedPlugins) {
+ if (!installedPlugin.equals(this) && installedPlugin.getState() == STARTED) {
+ if (installedPlugin.getBundles().contains(bundle)) {
+ bundleUsed = true;
+ break;
+ }
+ }
+ }
+ if (!bundleUsed) {
+ try {
+ logger.info("Stopping bundle " + bundle.getSymbolicName());
+ bundle.stop();
+ } catch (BundleException e) {
+ logger.warn(
+ String.format("Error stopping bundle %1$s for plugin %2$s",
+ bundle.getSymbolicName(), getName()), e);
+ }
+ }
+ }
+ state = STOPPED;
+ }
+ }
+
+ @Override
+ public void uninstall() throws PluginException {
+ if (state != UNINSTALLED) {
+ pluginManager.uninstallPlugin(this);
+ state = UNINSTALLED;
+ }
+ }
+
+ @Override
+ public File getFile() {
+ return file;
+ }
+
+ @Override
+ public Set<Bundle> getBundles() {
+ return bundles;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginManagerImpl.java b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginManagerImpl.java
new file mode 100644
index 0000000..08afbba
--- /dev/null
+++ b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginManagerImpl.java
@@ -0,0 +1,466 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.plugin.impl;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+
+import org.apache.log4j.Logger;
+import org.apache.taverna.commons.download.DownloadException;
+import org.apache.taverna.commons.download.DownloadManager;
+import org.apache.taverna.configuration.app.ApplicationConfiguration;
+import org.apache.taverna.plugin.Plugin;
+import org.apache.taverna.plugin.PluginException;
+import org.apache.taverna.plugin.PluginManager;
+import org.apache.taverna.plugin.PluginSite;
+import org.apache.taverna.plugin.PluginSiteManager;
+import org.apache.taverna.plugin.Plugin.State;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Version;
+import org.osgi.service.event.Event;
+import org.osgi.service.event.EventAdmin;
+
+import uk.org.taverna.commons.plugin.xml.jaxb.PluginInfo;
+import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
+import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
+
+/**
+ * PluginManager implementation.
+ *
+ * @author David Withers
+ */
+public class PluginManagerImpl implements PluginManager {
+
+ private static final String DIGEST_ALGORITHM = "MD5";
+ private static final String PLUGIN_FILE_NAME = "META-INF/taverna/plugin.xml";
+
+ private static final Logger logger = Logger.getLogger(PluginManagerImpl.class);
+
+ private EventAdmin eventAdmin;
+ private ApplicationConfiguration applicationConfiguration;
+ private BundleContext bundleContext;
+ private DownloadManager downloadManager;
+ private PluginSiteManager pluginSiteManager;
+
+ private Map<String, Plugin> installedPlugins = new TreeMap<String, Plugin>();
+ private Map<String, PluginVersions> availablePlugins = new TreeMap<String, PluginVersions>();
+ private Map<String, PluginVersions> pluginUpdates = new TreeMap<String, PluginVersions>();
+
+ private boolean updateAvailablePlugins = true;
+
+ private Map<File, PluginDirectoryWatcher> pluginDirectoryWatchers = new HashMap<File, PluginDirectoryWatcher>();
+
+ private Set<Bundle> installedBundles = new HashSet<Bundle>();
+
+ private Unmarshaller unmarshaller;
+
+ public PluginManagerImpl() throws PluginException {
+ try {
+ JAXBContext jaxbContext = JAXBContext.newInstance(PluginInfo.class);
+ unmarshaller = jaxbContext.createUnmarshaller();
+ } catch (JAXBException e) {
+ throw new PluginException("Error creating JAXBContext", e);
+ }
+ }
+
+ @Override
+ public void checkForUpdates() throws PluginException {
+ boolean updatesFound = false;
+ synchronized (pluginUpdates) {
+ pluginUpdates.clear();
+ for (PluginSite pluginSite : pluginSiteManager.getPluginSites()) {
+ List<PluginVersions> plugins = pluginSiteManager.getPlugins(pluginSite);
+ for (PluginVersions plugin : plugins) {
+ if (installedPlugins.containsKey(plugin.getId())) {
+ Plugin installedPlugin = installedPlugins.get(plugin.getId());
+ if (installedPlugin.getFile().canWrite()) {
+ Version latestVersion = Version.parseVersion(plugin.getLatestVersion()
+ .getVersion());
+ if (latestVersion.compareTo(installedPlugin.getVersion()) > 0) {
+ pluginUpdates.put(plugin.getId(), plugin);
+ updatesFound = true;
+ }
+ }
+ }
+ }
+ }
+ }
+ if (updatesFound) {
+ postEvent(PluginManager.UPDATES_AVAILABLE);
+ }
+ }
+
+ @Override
+ public List<PluginVersions> getPluginUpdates() throws PluginException {
+ synchronized (pluginUpdates) {
+ return new ArrayList<PluginVersions>(pluginUpdates.values());
+ }
+ }
+
+ @Override
+ public void loadPlugins() throws PluginException {
+ loadPlugins(applicationConfiguration.getSystemPluginDir());
+ loadPlugins(applicationConfiguration.getUserPluginDir());
+ }
+
+ @Override
+ public List<PluginVersions> getAvailablePlugins() throws PluginException {
+ if (updateAvailablePlugins) {
+ synchronized (availablePlugins) {
+ availablePlugins = new HashMap<String, PluginVersions>();
+ for (PluginSite pluginSite : pluginSiteManager.getPluginSites()) {
+ List<PluginVersions> plugins = pluginSiteManager.getPlugins(pluginSite);
+ for (PluginVersions plugin : plugins) {
+ if (!installedPlugins.containsKey(plugin.getId())) {
+ availablePlugins.put(plugin.getId(), plugin);
+ }
+ }
+ }
+ }
+ updateAvailablePlugins = false;
+ }
+ return new ArrayList<PluginVersions>(availablePlugins.values());
+ }
+
+ @Override
+ public List<Plugin> getInstalledPlugins() throws PluginException {
+ return new ArrayList<Plugin>(installedPlugins.values());
+ }
+
+ @Override
+ public Plugin installPlugin(File pluginFile) throws PluginException {
+ // check if already installed
+ synchronized (installedPlugins) {
+ for (Plugin plugin : installedPlugins.values()) {
+ if (plugin.getFile().equals(pluginFile)) {
+ return plugin;
+ }
+ }
+ // check plugin file
+ if (pluginFile.exists()) {
+ new PluginException(String.format("Plugin file %1$s does not exist", pluginFile));
+ }
+ if (pluginFile.isFile()) {
+ new PluginException(String.format("Plugin file %1$s is not a file", pluginFile));
+ }
+ if (!pluginFile.canRead()) {
+ new PluginException(String.format("Plugin file %1$s is not readable", pluginFile));
+ }
+ // install plugin from plugin file
+ logger.info(String.format("Installing plugin from '%s'", pluginFile));
+ JarFile jarFile;
+ try {
+ jarFile = new JarFile(pluginFile);
+ } catch (IOException e) {
+ throw new PluginException(String.format("Error reading plugin file %1$s",
+ pluginFile), e);
+ }
+ Plugin plugin = installPlugin(jarFile);
+ installedPlugins.put(plugin.getId(), plugin);
+ availablePlugins.remove(plugin.getId());
+ postEvent(PluginManager.PLUGIN_INSTALLED);
+ return plugin;
+ }
+ }
+
+ @Override
+ public Plugin installPlugin(String pluginSiteURL, String pluginFileName) throws PluginException {
+ File pluginFile = getPluginFile(pluginSiteURL, pluginFileName);
+ return installPlugin(pluginFile);
+ }
+
+ @Override
+ public Plugin updatePlugin(PluginVersions pluginVersions) throws PluginException {
+ String pluginId = pluginVersions.getId();
+ String pluginSiteUrl = pluginVersions.getPluginSiteUrl();
+ String pluginFile = pluginVersions.getLatestVersion().getFile();
+ Plugin plugin = installedPlugins.get(pluginId);
+ plugin.stop();
+ Plugin newPlugin;
+ try {
+ newPlugin = installPlugin(pluginSiteUrl, pluginFile);
+ } catch (PluginException e) {
+ plugin.start();
+ throw new PluginException("Failed to update plugin " + pluginId, e);
+ }
+ synchronized (pluginUpdates) {
+ pluginUpdates.remove(pluginId);
+ }
+ uninstallPlugin(plugin);
+ return newPlugin;
+ }
+
+ void uninstallPlugin(File pluginFile) {
+ synchronized (installedPlugins) {
+ for (Plugin plugin : installedPlugins.values()) {
+ if (plugin.getFile().equals(pluginFile)) {
+ uninstallPlugin(plugin);
+ break;
+ }
+ }
+ }
+ }
+
+ void uninstallPlugin(Plugin plugin) {
+ synchronized (installedPlugins) {
+ if (installedPlugins.containsKey(plugin.getId())) {
+ for (Bundle bundle : plugin.getBundles()) {
+ if (installedBundles.contains(bundle)) {
+ // check if bundle is used by other plugins
+ boolean bundleInUse = false;
+ for (Plugin installedPlugin : installedPlugins.values()) {
+ if (!installedPlugin.equals(plugin)) {
+ if (installedPlugin.getBundles().contains(bundle)) {
+ bundleInUse = true;
+ break;
+ }
+ }
+ }
+ if (!bundleInUse) {
+ try {
+ logger.info("Uninstalling bundle " + bundle.getSymbolicName());
+ bundle.uninstall();
+ installedBundles.remove(bundle);
+ System.out.println("Remove " + bundle.getSymbolicName());
+ } catch (BundleException e) {
+ logger.warn(String.format(
+ "Error uninstalling bundle %1$s for plugin %2$s",
+ bundle.getSymbolicName(), plugin.getName()), e);
+ }
+ }
+ }
+ }
+ installedPlugins.remove(plugin.getId());
+ pluginUpdates.remove(plugin.getId());
+ updateAvailablePlugins = true;
+ postEvent(PluginManager.PLUGIN_UNINSTALLED);
+ }
+ }
+ }
+
+ public void loadPlugins(File pluginDir) throws PluginException {
+ if (checkPluginDirectory(pluginDir, false)) {
+ for (File pluginFile : pluginDir.listFiles()) {
+ if (pluginFile.isFile() && pluginFile.canRead() && !pluginFile.isHidden()) {
+ try {
+ installPlugin(pluginFile).start();
+ } catch (PluginException e) {
+ logger.warn(String.format("Error loading plugin from '%s'", pluginFile), e);
+ }
+ }
+ }
+ }
+ startWatchingPluginDirectory(pluginDir);
+ }
+
+ private Plugin installPlugin(JarFile jarFile) throws PluginException {
+ PluginInfo pluginInfo = getPluginInfo(jarFile);
+
+ PluginImpl plugin = new PluginImpl(this, new File(jarFile.getName()), pluginInfo);
+
+ // check bundles exist in jar
+ for (BundleInfo bundleInfo : pluginInfo.getBundle()) {
+ // find the bundle in the plugin jar
+ JarEntry entry = jarFile.getJarEntry(bundleInfo.getFileName());
+ if (entry == null) {
+ throw new PluginException(String.format(
+ "Plugin file '%1$s' does not contain bundle file '%2$s'.",
+ jarFile.getName(), bundleInfo.getFileName()));
+ }
+ }
+
+ // install plugin bundles
+ Set<Bundle> pluginBundles = plugin.getBundles();
+ for (BundleInfo bundleInfo : pluginInfo.getBundle()) {
+ Bundle installedBundle = getInstalledBundle(bundleInfo);
+ if (installedBundle == null) {
+ // install the bundle from the jar
+ JarEntry entry = jarFile.getJarEntry(bundleInfo.getFileName());
+ String bundleURL = jarEntryToURL(jarFile, entry);
+ try {
+ Bundle bundle = bundleContext.installBundle(bundleURL);
+ pluginBundles.add(bundle);
+ installedBundles.add(bundle);
+ System.out.println("Add " + bundle.getSymbolicName());
+ } catch (BundleException e) {
+ // clean up by removing bundles already installed
+ for (Bundle bundle : pluginBundles) {
+ try {
+ bundle.uninstall();
+ installedBundles.remove(bundle);
+ } catch (BundleException ex) {
+ logger.warn("Error unistalling bundle", ex);
+ }
+ }
+ throw new PluginException(String.format("Error installing bundle file %1$s",
+ bundleURL), e);
+ }
+ } else {
+ pluginBundles.add(installedBundle);
+ }
+ }
+ plugin.setState(State.INSTALLED);
+ return plugin;
+ }
+
+ private Bundle getInstalledBundle(BundleInfo bundleInfo) {
+ for (Bundle installedBundle : bundleContext.getBundles()) {
+ if (installedBundle.getSymbolicName().equals(bundleInfo.getSymbolicName())) {
+ org.osgi.framework.Version installedVersion = installedBundle.getVersion();
+ if (installedVersion
+ .equals(new org.osgi.framework.Version(bundleInfo.getVersion()))) {
+ return installedBundle;
+ }
+ }
+ }
+ return null;
+ }
+
+ public PluginInfo getPluginInfo(JarFile jarFile) throws PluginException {
+ // TODO check manifest for non standard plugin info file
+ JarEntry pluginEntry = jarFile.getJarEntry(PLUGIN_FILE_NAME);
+ if (pluginEntry == null) {
+ throw new PluginException(String.format(
+ "Plugin file '%1$s' does not contain a %2$s file.", jarFile.getName(),
+ PLUGIN_FILE_NAME));
+ }
+ try {
+ InputStream inputStream = jarFile.getInputStream(pluginEntry);
+ return (PluginInfo) unmarshaller.unmarshal(inputStream);
+ } catch (JAXBException e) {
+ throw new PluginException(String.format("Error reading plugin file %1$s from %2$s",
+ pluginEntry, jarFile.getName()), e);
+ } catch (IOException e) {
+ throw new PluginException(String.format("Error reading plugin file %1$s from %2$s",
+ pluginEntry, jarFile.getName()), e);
+ }
+ }
+
+ private File getPluginFile(String pluginSiteURL, String pluginFileName) throws PluginException {
+ File pluginFile = new File(getPluginDirectory(), pluginFileName);
+ String pluginFileURL = pluginSiteURL + "/" + pluginFileName;
+ try {
+ downloadManager.download(new URL(pluginFileURL), pluginFile, DIGEST_ALGORITHM);
+ } catch (DownloadException e) {
+ throw new PluginException("Error downloading plugin file " + pluginFile, e);
+ } catch (MalformedURLException e) {
+ throw new PluginException("Invalid plugin file URL " + pluginFileURL, e);
+ }
+ return pluginFile;
+ }
+
+ public void startWatchingPluginDirectory(File pluginDir) throws PluginException {
+ if (!pluginDirectoryWatchers.containsKey(pluginDir)) {
+ pluginDirectoryWatchers.put(pluginDir, new PluginDirectoryWatcher(this, pluginDir));
+ }
+ pluginDirectoryWatchers.get(pluginDir).start();
+ }
+
+ public void stopWatchingPluginDirectory(File pluginDir) throws PluginException {
+ if (pluginDirectoryWatchers.containsKey(pluginDir)) {
+ pluginDirectoryWatchers.get(pluginDir).stop();
+ }
+ }
+
+ private File getPluginDirectory() throws PluginException {
+ File systemPluginsDir = applicationConfiguration.getSystemPluginDir();
+ if (checkPluginDirectory(systemPluginsDir, true)) {
+ return systemPluginsDir;
+ }
+ File userPluginsDir = applicationConfiguration.getUserPluginDir();
+ if (checkPluginDirectory(userPluginsDir, true)) {
+ return userPluginsDir;
+ }
+ throw new PluginException("No plugin directory avaliable");
+ }
+
+ public void setEventAdmin(EventAdmin eventAdmin) {
+ this.eventAdmin = eventAdmin;
+ }
+
+ public void setApplicationConfiguration(ApplicationConfiguration applicationConfiguration) {
+ this.applicationConfiguration = applicationConfiguration;
+ }
+
+ public void setBundleContext(BundleContext bundleContext) {
+ this.bundleContext = bundleContext;
+ }
+
+ public void setDownloadManager(DownloadManager downloadManager) {
+ this.downloadManager = downloadManager;
+ }
+
+ public void setPluginSiteManager(PluginSiteManager pluginSiteManager) {
+ this.pluginSiteManager = pluginSiteManager;
+ }
+
+ private boolean checkPluginDirectory(File pluginDirectory, boolean checkWritable) {
+ if (pluginDirectory == null) {
+ return false;
+ }
+ if (!pluginDirectory.exists()) {
+ logger.debug(String.format("Plugin directory %1$s does not exist", pluginDirectory));
+ return false;
+ }
+ if (!pluginDirectory.isDirectory()) {
+ logger.warn(String.format("Plugin directory %1$s is not a directory", pluginDirectory));
+ return false;
+ }
+ if (!pluginDirectory.canRead()) {
+ logger.debug(String.format("Plugin directory %1$s is not readable", pluginDirectory));
+ return false;
+ }
+ if (checkWritable && !pluginDirectory.canWrite()) {
+ logger.debug(String.format("Plugin directory %1$s is not writeable", pluginDirectory));
+ return false;
+ }
+ return true;
+ }
+
+ private String jarEntryToURL(JarFile jarFile, JarEntry jarEntry) {
+ File file = new File(jarFile.getName());
+ return "jar:" + file.toURI() + "!/" + jarEntry.getName();
+ }
+
+ private void postEvent(String topic) {
+ Event event = new Event(topic, new HashMap());
+ eventAdmin.postEvent(event);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteImpl.java b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteImpl.java
new file mode 100644
index 0000000..06c9237
--- /dev/null
+++ b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteImpl.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.plugin.impl;
+
+import org.apache.taverna.plugin.PluginSite;
+
+/**
+ * PluginSite implementation.
+ *
+ * @author David Withers
+ */
+public class PluginSiteImpl implements PluginSite {
+
+ private String name, url;
+
+ private PluginSiteType type;
+
+ public PluginSiteImpl() {
+ }
+
+ public PluginSiteImpl(String name, String url) {
+ this(name, url, PluginSiteType.USER);
+ }
+
+ public PluginSiteImpl(String name, String url, PluginSiteType type) {
+ this.name = name;
+ this.url = url;
+ this.type = type;
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ @Override
+ public PluginSiteType getType() {
+ return type;
+ }
+
+ public void setType(PluginSiteType type) {
+ this.type = type;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteManagerImpl.java b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteManagerImpl.java
new file mode 100644
index 0000000..bc6852a
--- /dev/null
+++ b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteManagerImpl.java
@@ -0,0 +1,190 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.plugin.impl;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+
+import org.apache.log4j.Logger;
+import org.apache.taverna.commons.download.DownloadException;
+import org.apache.taverna.commons.download.DownloadManager;
+import org.apache.taverna.configuration.app.ApplicationConfiguration;
+import org.apache.taverna.plugin.PluginException;
+import org.apache.taverna.plugin.PluginSite;
+import org.apache.taverna.plugin.PluginSiteManager;
+import org.apache.taverna.plugin.PluginSite.PluginSiteType;
+
+import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
+import uk.org.taverna.commons.plugin.xml.jaxb.Plugins;
+import uk.org.taverna.commons.profile.xml.jaxb.Updates;
+
+/**
+ * PluginSiteManager implementation.
+ *
+ * @author David Withers
+ */
+public class PluginSiteManagerImpl implements PluginSiteManager {
+
+ private static final String PLUGIN_SITES_FILE = "plugin-sites.xml";
+ private static final String DIGEST_ALGORITHM = "MD5";
+ private static final String PLUGINS_FILE = "plugins.xml";
+
+ private static final Logger logger = Logger.getLogger(PluginSiteManagerImpl.class);
+
+ private ApplicationConfiguration applicationConfiguration;
+ private DownloadManager downloadManager;
+
+ private Unmarshaller unmarshaller;
+ private Marshaller marshaller;
+
+ private List<PluginSite> pluginSites;
+
+ public PluginSiteManagerImpl() throws PluginException {
+ try {
+ JAXBContext jaxbContext = JAXBContext.newInstance(Plugins.class, PluginSites.class);
+ unmarshaller = jaxbContext.createUnmarshaller();
+ marshaller = jaxbContext.createMarshaller();
+ } catch (JAXBException e) {
+ throw new PluginException("Error creating JAXBContext", e);
+ }
+ }
+
+ @Override
+ public List<PluginSite> getPluginSites() {
+ if (pluginSites == null) {
+ readPluginSitesFile();
+ if (pluginSites == null) {
+ pluginSites = new ArrayList<PluginSite>();
+ pluginSites.addAll(getSystemPluginSites());
+ }
+ }
+ return pluginSites;
+ }
+
+ @Override
+ public PluginSite createPluginSite(URL pluginSiteURL) throws PluginException {
+ try {
+ File tempFile = File.createTempFile("plugins", null);
+ tempFile.deleteOnExit();
+ URL pluginFileURL = new URL(pluginSiteURL + "/" + PLUGINS_FILE);
+ downloadManager.download(pluginFileURL, tempFile, DIGEST_ALGORITHM);
+ return new PluginSiteImpl("", pluginSiteURL.toExternalForm());
+ } catch (MalformedURLException e) {
+ throw new PluginException(String.format("Invalid plugin site URL %1$s", pluginSiteURL), e);
+ } catch (DownloadException e) {
+ throw new PluginException(String.format("Error contacting plugin site at %1$s", pluginSiteURL), e);
+ } catch (IOException e) {
+ throw new PluginException(String.format("Error contacting plugin site at %1$s", pluginSiteURL), e);
+ }
+ }
+
+ @Override
+ public void addPluginSite(PluginSite pluginSite) throws PluginException {
+ getPluginSites().add(pluginSite);
+ writePluginSitesFile();
+ }
+
+ @Override
+ public void removePluginSite(PluginSite pluginSite) throws PluginException {
+ getPluginSites().remove(pluginSite);
+ writePluginSitesFile();
+ }
+
+ @Override
+ public List<PluginVersions> getPlugins(PluginSite pluginSite) throws PluginException {
+ List<PluginVersions> plugins = new ArrayList<PluginVersions>();
+ try {
+ URL pluginSiteURL = new URL(pluginSite.getUrl() + "/" + PLUGINS_FILE);
+ File pluginsFile = new File(getDataDirectory(), PLUGINS_FILE);
+ downloadManager.download(pluginSiteURL, pluginsFile, DIGEST_ALGORITHM);
+ Plugins pluginsXML = (Plugins) unmarshaller.unmarshal(pluginsFile);
+ for (PluginVersions plugin : pluginsXML.getPlugin()) {
+ plugin.setPluginSiteUrl(pluginSite.getUrl());
+ plugins.add(plugin);
+ }
+ } catch (MalformedURLException e) {
+ throw new PluginException(String.format("Plugin site %1$s has an invalid location",
+ pluginSite.getName()), e);
+ } catch (DownloadException e) {
+ throw new PluginException(String.format("Error downloading from plugin site %1$s",
+ pluginSite.getName()), e);
+ } catch (JAXBException e) {
+ throw new PluginException(String.format("Error getting plugins from plugin site %1$s",
+ pluginSite.getName()), e);
+ }
+ return plugins;
+ }
+
+ private List<PluginSite> getSystemPluginSites() {
+ List<PluginSite> systemPluginSites = new ArrayList<PluginSite>();
+ Updates updates = applicationConfiguration.getApplicationProfile().getUpdates();
+ systemPluginSites
+ .add(new PluginSiteImpl("", updates.getPluginSite(), PluginSiteType.SYSTEM));
+ return systemPluginSites;
+ }
+
+ private void writePluginSitesFile() {
+ File pluginSitesFile = new File(getDataDirectory(), PLUGIN_SITES_FILE);
+ try {
+ marshaller.marshal(pluginSites, pluginSitesFile);
+ } catch (JAXBException e) {
+ logger.error("Error writing file " + pluginSitesFile, e);
+ }
+ }
+
+ private void readPluginSitesFile() {
+ File pluginSitesFile = new File(getDataDirectory(), PLUGIN_SITES_FILE);
+ if (pluginSitesFile.exists()) {
+ try {
+ pluginSites = new ArrayList<PluginSite>();
+ PluginSites pluginSitesStore = (PluginSites) unmarshaller
+ .unmarshal(pluginSitesFile);
+ for (PluginSiteImpl pluginSiteImpl : pluginSitesStore.getPluginSites()) {
+ pluginSites.add(pluginSiteImpl);
+ }
+ } catch (JAXBException e) {
+ logger.error("Error reading file " + pluginSitesFile, e);
+ }
+ }
+ }
+
+ private File getDataDirectory() {
+ return new File(applicationConfiguration.getApplicationHomeDir(), "plugin-data");
+ }
+
+ public void setApplicationConfiguration(ApplicationConfiguration applicationConfiguration) {
+ this.applicationConfiguration = applicationConfiguration;
+ }
+
+ public void setDownloadManager(DownloadManager downloadManager) {
+ this.downloadManager = downloadManager;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSites.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSites.java b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSites.java
new file mode 100644
index 0000000..2f9da5a
--- /dev/null
+++ b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSites.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.plugin.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ *
+ *
+ * @author David Withers
+ */
+@XmlRootElement
+public class PluginSites {
+
+ private List<PluginSiteImpl> pluginSites;
+
+ public List<PluginSiteImpl> getPluginSites() {
+ if (pluginSites == null) {
+ pluginSites = new ArrayList<PluginSiteImpl>();
+ }
+ return pluginSites;
+ }
+
+ public void setPluginSites(List<PluginSiteImpl> pluginSites) {
+ this.pluginSites = pluginSites;
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginDirectoryWatcher.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginDirectoryWatcher.java b/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginDirectoryWatcher.java
deleted file mode 100644
index 9419d4e..0000000
--- a/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginDirectoryWatcher.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 uk.org.taverna.commons.plugin.impl;
-
-import java.io.File;
-
-import org.apache.commons.io.monitor.FileAlterationListenerAdaptor;
-import org.apache.commons.io.monitor.FileAlterationMonitor;
-import org.apache.commons.io.monitor.FileAlterationObserver;
-import org.apache.log4j.Logger;
-
-import uk.org.taverna.commons.plugin.Plugin;
-import uk.org.taverna.commons.plugin.PluginException;
-
-/**
- * Watches a plugin directory and adds or removes plugins when plugin files are added or removed
- * from the directory.
- *
- * @author David Withers
- */
-public class PluginDirectoryWatcher extends FileAlterationListenerAdaptor {
-
- private static final Logger logger = Logger.getLogger(PluginDirectoryWatcher.class);
-
- private final PluginManagerImpl pluginManager;
- private final File directory;
-
- private FileAlterationMonitor monitor;
-
- public PluginDirectoryWatcher(PluginManagerImpl pluginManager, File directory) {
- this.pluginManager = pluginManager;
- this.directory = directory;
- FileAlterationObserver observer = new FileAlterationObserver(directory);
- observer.addListener(this);
- monitor = new FileAlterationMonitor();
- monitor.addObserver(observer);
- }
-
- /**
- * Starts watching the plugin directory.
- *
- * @throws PluginException
- */
- public void start() throws PluginException {
- try {
- monitor.start();
- } catch (Exception e) {
- throw new PluginException(String.format("Error starting watch on %1$s.",
- directory.getAbsolutePath()), e);
- }
- }
-
- /**
- * Stops watching the plugin directory.
- *
- * @throws PluginException
- */
- public void stop() throws PluginException {
- try {
- monitor.stop();
- } catch (Exception e) {
- throw new PluginException(String.format("Error stopping watch on %1$s.",
- directory.getAbsolutePath()), e);
- }
- }
-
- @Override
- public void onFileCreate(File file) {
- try {
- Plugin plugin = pluginManager.installPlugin(file);
- plugin.start();
- } catch (PluginException e) {
- logger.warn("Error loading plugin file " + file, e);
- }
- }
-
- @Override
- public void onFileChange(File file) {
- onFileDelete(file);
- onFileCreate(file);
- }
-
- @Override
- public void onFileDelete(File file) {
- pluginManager.uninstallPlugin(file);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginImpl.java b/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginImpl.java
deleted file mode 100644
index 5f31472..0000000
--- a/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginImpl.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 uk.org.taverna.commons.plugin.impl;
-
-import static uk.org.taverna.commons.plugin.Plugin.State.STARTED;
-import static uk.org.taverna.commons.plugin.Plugin.State.STOPPED;
-import static uk.org.taverna.commons.plugin.Plugin.State.UNINSTALLED;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.log4j.Logger;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-import org.osgi.framework.Version;
-
-import uk.org.taverna.commons.plugin.Plugin;
-import uk.org.taverna.commons.plugin.PluginException;
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginInfo;
-
-/**
- * @author David Withers
- */
-public class PluginImpl implements Plugin {
-
- private static final Logger logger = Logger.getLogger(PluginImpl.class);
-
- private PluginManagerImpl pluginManager;
-
- private State state = UNINSTALLED;
-
- private File file;
- private String id, name, description, organization;
- private Version version;
- private Set<Bundle> bundles = new HashSet<Bundle>();
-
- public PluginImpl(PluginManagerImpl pluginManager, File file, PluginInfo pluginInfo) {
- this.pluginManager = pluginManager;
- this.file = file;
- id = pluginInfo.getId();
- name = pluginInfo.getName();
- description = pluginInfo.getDescription();
- organization = pluginInfo.getOrganization();
- version = Version.parseVersion(pluginInfo.getVersion());
- }
-
- @Override
- public String getId() {
- return id;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public String getDescription() {
- return description;
- }
-
- @Override
- public String getOrganization() {
- return organization;
- }
-
- @Override
- public Version getVersion() {
- return version;
- }
-
- @Override
- public State getState() {
- return state;
- }
-
- void setState(State state) {
- this.state = state;
- }
-
- @Override
- public void start() throws PluginException {
- if (state == STARTED) {
- return;
- }
- if (state == UNINSTALLED) {
- throw new PluginException("Cannot start an uninstalled plugin");
- }
- List<Bundle> startedBundles = new ArrayList<Bundle>();
- for (Bundle bundle : getBundles()) {
- if (bundle.getHeaders().get(Constants.FRAGMENT_HOST) == null) {
- if (bundle.getState() != Bundle.ACTIVE) {
- try {
- bundle.start();
- startedBundles.add(bundle);
- } catch (BundleException e) {
- // clean up by stopping bundles already started
- for (Bundle startedBundle : startedBundles) {
- try {
- startedBundle.stop();
- } catch (BundleException ex) {
- logger.warn("Error unistalling bundle", ex);
- }
- }
- throw new PluginException(String.format("Error starting bundle %1$s",
- bundle.getSymbolicName()), e);
- }
- }
- }
- }
- }
-
- @Override
- public void stop() throws PluginException {
- if (state == STARTED) {
- List<Plugin> installedPlugins = pluginManager.getInstalledPlugins();
- for (Bundle bundle : getBundles()) {
- // check if bundle is used by other plugins
- boolean bundleUsed = false;
- for (Plugin installedPlugin : installedPlugins) {
- if (!installedPlugin.equals(this) && installedPlugin.getState() == STARTED) {
- if (installedPlugin.getBundles().contains(bundle)) {
- bundleUsed = true;
- break;
- }
- }
- }
- if (!bundleUsed) {
- try {
- logger.info("Stopping bundle " + bundle.getSymbolicName());
- bundle.stop();
- } catch (BundleException e) {
- logger.warn(
- String.format("Error stopping bundle %1$s for plugin %2$s",
- bundle.getSymbolicName(), getName()), e);
- }
- }
- }
- state = STOPPED;
- }
- }
-
- @Override
- public void uninstall() throws PluginException {
- if (state != UNINSTALLED) {
- pluginManager.uninstallPlugin(this);
- state = UNINSTALLED;
- }
- }
-
- @Override
- public File getFile() {
- return file;
- }
-
- @Override
- public Set<Bundle> getBundles() {
- return bundles;
- }
-
-}
[05/17] incubator-taverna-osgi git commit:
org.apache.taverna.commons.download
Posted by st...@apache.org.
org.apache.taverna.commons.download
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/6dabe91d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/6dabe91d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/6dabe91d
Branch: refs/heads/master
Commit: 6dabe91d925b5edd26d0764086d6926de12cd51a
Parents: cdd4547
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Oct 18 13:31:01 2015 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Oct 18 13:31:01 2015 +0100
----------------------------------------------------------------------
.../commons/download/DownloadException.java | 45 +++++++
.../commons/download/DownloadManager.java | 116 ++++++++++++++++++
.../commons/download/DownloadException.java | 45 -------
.../commons/download/DownloadManager.java | 116 ------------------
taverna-download-impl/pom.xml | 2 +-
.../download/impl/DownloadManagerImpl.java | 119 ++++++++++++++++++
.../download/impl/DownloadManagerImpl.java | 120 -------------------
.../META-INF/spring/download-context-osgi.xml | 2 +-
.../META-INF/spring/download-context.xml | 2 +-
.../commons/plugin/impl/PluginManagerImpl.java | 4 +-
.../plugin/impl/PluginSiteManagerImpl.java | 4 +-
.../META-INF/spring/plugin-context-osgi.xml | 2 +-
.../plugin/impl/PluginSiteManagerImplTest.java | 6 +-
.../commons/update/impl/UpdateManagerImpl.java | 4 +-
.../META-INF/spring/update-context-osgi.xml | 2 +-
15 files changed, 294 insertions(+), 295 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/6dabe91d/taverna-download-api/src/main/java/org/apache/taverna/commons/download/DownloadException.java
----------------------------------------------------------------------
diff --git a/taverna-download-api/src/main/java/org/apache/taverna/commons/download/DownloadException.java b/taverna-download-api/src/main/java/org/apache/taverna/commons/download/DownloadException.java
new file mode 100644
index 0000000..b394ec0
--- /dev/null
+++ b/taverna-download-api/src/main/java/org/apache/taverna/commons/download/DownloadException.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.commons.download;
+
+/**
+ *
+ *
+ * @author David Withers
+ */
+public class DownloadException extends Exception {
+
+ public DownloadException() {
+ }
+
+ public DownloadException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public DownloadException(String message) {
+ super(message);
+ }
+
+ public DownloadException(Throwable cause) {
+ super(cause);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/6dabe91d/taverna-download-api/src/main/java/org/apache/taverna/commons/download/DownloadManager.java
----------------------------------------------------------------------
diff --git a/taverna-download-api/src/main/java/org/apache/taverna/commons/download/DownloadManager.java b/taverna-download-api/src/main/java/org/apache/taverna/commons/download/DownloadManager.java
new file mode 100644
index 0000000..f0f406a
--- /dev/null
+++ b/taverna-download-api/src/main/java/org/apache/taverna/commons/download/DownloadManager.java
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.commons.download;
+
+import java.io.File;
+import java.net.URL;
+
+/**
+ * Download Manager for handling file download and checking the integrity of the download.
+ *
+ * @author David Withers
+ */
+public interface DownloadManager {
+
+ /**
+ * Downloads a file from a URL.
+ * <p>
+ * The destination file will be created if it does not exist. If it does exist it will be
+ * overwritten.
+ *
+ * @param source
+ * the file to download
+ * @param destination
+ * the file to write to
+ * @throws DownloadException
+ * if
+ * <ul>
+ * <li>the source does not exist</li> <li>the source cannot be downloaded</li> <li>
+ * the destination is not a file</li> <li>the destination cannot be written to</li>
+ * </ul>
+ */
+ public void download(URL source, File destination) throws DownloadException;
+
+ /**
+ * Downloads a file from a URL and checks the integrity of the download by downloading and
+ * verifying the a checksum using the specified algorithm.
+ * <p>
+ * Every implementation is required to support the following standard algorithms:
+ * <ul>
+ * <li>MD5</li>
+ * <li>SHA-1</li>
+ * <li>SHA-256</li>
+ * </ul>
+ * <p>
+ * The checksum source will be calculated by appending the algorithm name to the source. e.g.
+ * for an MD5 algorithm and a source of http://www.example.com/test.xml the checksum will be
+ * downloaded from http://www.example.com/test.xml.md5
+ *
+ * @param source
+ * the file to download
+ * @param destination
+ * the file to write to
+ * @param digestAlgorithm
+ * the digest algorithm to use
+ * @throws DownloadException
+ * if
+ * <ul>
+ * <li>the source does not exist</li> <li>the digest source does not exist</li> <li>
+ * the source cannot be downloaded</li> <li>the destination cannot be written to
+ * </li> <li>the destination is not a file</li> <li>the checksums do no match</li>
+ * </ul>
+ */
+ public void download(URL source, File destination, String digestAlgorithm)
+ throws DownloadException;
+
+ /**
+ * Downloads a file from a URL and checks the integrity of the download by downloading and
+ * verifying the a checksum using the specified algorithm.
+ * <p>
+ * Every implementation is required to support the following standard algorithms:
+ * <ul>
+ * <li>MD5</li>
+ * <li>SHA-1</li>
+ * <li>SHA-256</li>
+ * </ul>
+ * <p>
+ *
+ * @param source
+ * the file to download
+ * @param destination
+ * the file to write to
+ * @param digestAlgorithm
+ * the digest algorithm to use
+ * @param digestSource
+ * the digest file to check
+ * @throws DownloadException
+ * if
+ * <ul>
+ * <li>the source does not exist</li> <li>the digest source does not exist</li>
+ * <li> the source cannot be downloaded</li> <li>the destination cannot be
+ * written to</li> <li>the destination is not a file</li> <li>the digestSource
+ * does not exist</li> <li>the checksums do no match</li>
+ * </ul>
+ */
+ public void download(URL source, File destination, String digestAlgorithm, URL digestSource)
+ throws DownloadException;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/6dabe91d/taverna-download-api/src/main/java/uk/org/taverna/commons/download/DownloadException.java
----------------------------------------------------------------------
diff --git a/taverna-download-api/src/main/java/uk/org/taverna/commons/download/DownloadException.java b/taverna-download-api/src/main/java/uk/org/taverna/commons/download/DownloadException.java
deleted file mode 100644
index 83c5e74..0000000
--- a/taverna-download-api/src/main/java/uk/org/taverna/commons/download/DownloadException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 uk.org.taverna.commons.download;
-
-/**
- *
- *
- * @author David Withers
- */
-public class DownloadException extends Exception {
-
- public DownloadException() {
- }
-
- public DownloadException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public DownloadException(String message) {
- super(message);
- }
-
- public DownloadException(Throwable cause) {
- super(cause);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/6dabe91d/taverna-download-api/src/main/java/uk/org/taverna/commons/download/DownloadManager.java
----------------------------------------------------------------------
diff --git a/taverna-download-api/src/main/java/uk/org/taverna/commons/download/DownloadManager.java b/taverna-download-api/src/main/java/uk/org/taverna/commons/download/DownloadManager.java
deleted file mode 100644
index a94389c..0000000
--- a/taverna-download-api/src/main/java/uk/org/taverna/commons/download/DownloadManager.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 uk.org.taverna.commons.download;
-
-import java.io.File;
-import java.net.URL;
-
-/**
- * Download Manager for handling file download and checking the integrity of the download.
- *
- * @author David Withers
- */
-public interface DownloadManager {
-
- /**
- * Downloads a file from a URL.
- * <p>
- * The destination file will be created if it does not exist. If it does exist it will be
- * overwritten.
- *
- * @param source
- * the file to download
- * @param destination
- * the file to write to
- * @throws DownloadException
- * if
- * <ul>
- * <li>the source does not exist</li> <li>the source cannot be downloaded</li> <li>
- * the destination is not a file</li> <li>the destination cannot be written to</li>
- * </ul>
- */
- public void download(URL source, File destination) throws DownloadException;
-
- /**
- * Downloads a file from a URL and checks the integrity of the download by downloading and
- * verifying the a checksum using the specified algorithm.
- * <p>
- * Every implementation is required to support the following standard algorithms:
- * <ul>
- * <li>MD5</li>
- * <li>SHA-1</li>
- * <li>SHA-256</li>
- * </ul>
- * <p>
- * The checksum source will be calculated by appending the algorithm name to the source. e.g.
- * for an MD5 algorithm and a source of http://www.example.com/test.xml the checksum will be
- * downloaded from http://www.example.com/test.xml.md5
- *
- * @param source
- * the file to download
- * @param destination
- * the file to write to
- * @param digestAlgorithm
- * the digest algorithm to use
- * @throws DownloadException
- * if
- * <ul>
- * <li>the source does not exist</li> <li>the digest source does not exist</li> <li>
- * the source cannot be downloaded</li> <li>the destination cannot be written to
- * </li> <li>the destination is not a file</li> <li>the checksums do no match</li>
- * </ul>
- */
- public void download(URL source, File destination, String digestAlgorithm)
- throws DownloadException;
-
- /**
- * Downloads a file from a URL and checks the integrity of the download by downloading and
- * verifying the a checksum using the specified algorithm.
- * <p>
- * Every implementation is required to support the following standard algorithms:
- * <ul>
- * <li>MD5</li>
- * <li>SHA-1</li>
- * <li>SHA-256</li>
- * </ul>
- * <p>
- *
- * @param source
- * the file to download
- * @param destination
- * the file to write to
- * @param digestAlgorithm
- * the digest algorithm to use
- * @param digestSource
- * the digest file to check
- * @throws DownloadException
- * if
- * <ul>
- * <li>the source does not exist</li> <li>the digest source does not exist</li>
- * <li> the source cannot be downloaded</li> <li>the destination cannot be
- * written to</li> <li>the destination is not a file</li> <li>the digestSource
- * does not exist</li> <li>the checksums do no match</li>
- * </ul>
- */
- public void download(URL source, File destination, String digestAlgorithm, URL digestSource)
- throws DownloadException;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/6dabe91d/taverna-download-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-download-impl/pom.xml b/taverna-download-impl/pom.xml
index c472494..5c660f3 100644
--- a/taverna-download-impl/pom.xml
+++ b/taverna-download-impl/pom.xml
@@ -16,7 +16,7 @@
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
- <Import-Package>uk.org.taverna.commons.download;provide:=true,*</Import-Package>
+ <Import-Package>org.apache.taverna.commons.download;provide:=true,*</Import-Package>
</instructions>
</configuration>
</plugin>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/6dabe91d/taverna-download-impl/src/main/java/org/apache/taverna/commons/download/impl/DownloadManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-download-impl/src/main/java/org/apache/taverna/commons/download/impl/DownloadManagerImpl.java b/taverna-download-impl/src/main/java/org/apache/taverna/commons/download/impl/DownloadManagerImpl.java
new file mode 100644
index 0000000..48358fc
--- /dev/null
+++ b/taverna-download-impl/src/main/java/org/apache/taverna/commons/download/impl/DownloadManagerImpl.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.commons.download.impl;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.io.FileUtils;
+import org.apache.log4j.Logger;
+import org.apache.taverna.commons.download.DownloadException;
+import org.apache.taverna.commons.download.DownloadManager;
+
+/**
+ *
+ *
+ * @author David Withers
+ */
+public class DownloadManagerImpl implements DownloadManager {
+
+ private static final Logger logger = Logger.getLogger(DownloadManagerImpl.class);
+
+ public void download(URL source, File destination) throws DownloadException {
+ download(source, destination, null);
+ }
+
+ public void download(URL source, File destination, String digestAlgorithm) throws DownloadException {
+ // TODO Use MessageDigest when Java 7 available
+ if (digestAlgorithm != null && !digestAlgorithm.equals("MD5")) {
+ throw new IllegalArgumentException("Only MD5 supported");
+ }
+ URL digestSource = null;
+ if (digestAlgorithm != null) {
+ try {
+ digestSource = new URL(source.toString() + mapAlgorithmToFileExtension(digestAlgorithm));
+ } catch (MalformedURLException e) {
+ throw new DownloadException("Error creating digest URL", e);
+ }
+ }
+ download(source, destination, digestAlgorithm, digestSource);
+ }
+
+ public void download(URL source, File destination, String digestAlgorithm, URL digestSource)
+ throws DownloadException {
+ // TODO Use MessageDigest when Java 7 available
+ if (digestAlgorithm != null && !digestAlgorithm.equals("MD5")) {
+ throw new IllegalArgumentException("Only MD5 supported");
+ }
+ // download the file
+ File tempFile;
+ try {
+ tempFile = File.createTempFile("DownloadManager", "tmp");
+ tempFile.deleteOnExit();
+ logger.info(String.format("Downloading %1$s to %2$s", source, tempFile));
+ FileUtils.copyURLToFile(source, tempFile, 30, 30);
+ } catch (IOException e) {
+ throw new DownloadException(String.format("Error downloading %1$s to %2$s.", source, destination), e);
+ }
+ if (digestSource != null) {
+ // download the digest file
+ File digestFile;
+ try {
+ digestFile = File.createTempFile("DownloadManager", "tmp");
+ digestFile.deleteOnExit();
+ logger.info(String.format("Downloading %1$s to %2$s", digestSource, digestFile));
+ FileUtils.copyURLToFile(digestSource, digestFile, 30, 30);
+ } catch (IOException e) {
+ throw new DownloadException(String.format("Error checking digest for %1$s.", source), e);
+ }
+ // check the digest matches
+ try {
+ String digestString1 = DigestUtils.md5Hex(new FileInputStream(tempFile));
+ String digestString2 = FileUtils.readFileToString(digestFile);
+ if (!digestString1.equals(digestString2)) {
+ throw new DownloadException(String.format(
+ "Error downloading file: digsests not equal. (%1$s != %2$s)",
+ digestString1, digestString2));
+ }
+ } catch (IOException e) {
+ throw new DownloadException(String.format("Error checking digest for %1$s", destination),
+ e);
+ }
+ }
+ // copy file to destination
+ try {
+ logger.info(String.format("Copying %1$s to %2$s", tempFile, destination));
+ FileUtils.copyFile(tempFile, destination);
+ } catch (IOException e) {
+ throw new DownloadException(String.format("Error downloading %1$s to %2$s.", source, destination), e);
+ }
+
+ }
+
+ private String mapAlgorithmToFileExtension(String algorithm) {
+ return "." + algorithm.toLowerCase().replaceAll("-", "");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/6dabe91d/taverna-download-impl/src/main/java/uk/org/taverna/commons/download/impl/DownloadManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-download-impl/src/main/java/uk/org/taverna/commons/download/impl/DownloadManagerImpl.java b/taverna-download-impl/src/main/java/uk/org/taverna/commons/download/impl/DownloadManagerImpl.java
deleted file mode 100644
index 5fc42d9..0000000
--- a/taverna-download-impl/src/main/java/uk/org/taverna/commons/download/impl/DownloadManagerImpl.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 uk.org.taverna.commons.download.impl;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.commons.io.FileUtils;
-import org.apache.log4j.Logger;
-
-import uk.org.taverna.commons.download.DownloadException;
-import uk.org.taverna.commons.download.DownloadManager;
-
-/**
- *
- *
- * @author David Withers
- */
-public class DownloadManagerImpl implements DownloadManager {
-
- private static final Logger logger = Logger.getLogger(DownloadManagerImpl.class);
-
- public void download(URL source, File destination) throws DownloadException {
- download(source, destination, null);
- }
-
- public void download(URL source, File destination, String digestAlgorithm) throws DownloadException {
- // TODO Use MessageDigest when Java 7 available
- if (digestAlgorithm != null && !digestAlgorithm.equals("MD5")) {
- throw new IllegalArgumentException("Only MD5 supported");
- }
- URL digestSource = null;
- if (digestAlgorithm != null) {
- try {
- digestSource = new URL(source.toString() + mapAlgorithmToFileExtension(digestAlgorithm));
- } catch (MalformedURLException e) {
- throw new DownloadException("Error creating digest URL", e);
- }
- }
- download(source, destination, digestAlgorithm, digestSource);
- }
-
- public void download(URL source, File destination, String digestAlgorithm, URL digestSource)
- throws DownloadException {
- // TODO Use MessageDigest when Java 7 available
- if (digestAlgorithm != null && !digestAlgorithm.equals("MD5")) {
- throw new IllegalArgumentException("Only MD5 supported");
- }
- // download the file
- File tempFile;
- try {
- tempFile = File.createTempFile("DownloadManager", "tmp");
- tempFile.deleteOnExit();
- logger.info(String.format("Downloading %1$s to %2$s", source, tempFile));
- FileUtils.copyURLToFile(source, tempFile, 30, 30);
- } catch (IOException e) {
- throw new DownloadException(String.format("Error downloading %1$s to %2$s.", source, destination), e);
- }
- if (digestSource != null) {
- // download the digest file
- File digestFile;
- try {
- digestFile = File.createTempFile("DownloadManager", "tmp");
- digestFile.deleteOnExit();
- logger.info(String.format("Downloading %1$s to %2$s", digestSource, digestFile));
- FileUtils.copyURLToFile(digestSource, digestFile, 30, 30);
- } catch (IOException e) {
- throw new DownloadException(String.format("Error checking digest for %1$s.", source), e);
- }
- // check the digest matches
- try {
- String digestString1 = DigestUtils.md5Hex(new FileInputStream(tempFile));
- String digestString2 = FileUtils.readFileToString(digestFile);
- if (!digestString1.equals(digestString2)) {
- throw new DownloadException(String.format(
- "Error downloading file: digsests not equal. (%1$s != %2$s)",
- digestString1, digestString2));
- }
- } catch (IOException e) {
- throw new DownloadException(String.format("Error checking digest for %1$s", destination),
- e);
- }
- }
- // copy file to destination
- try {
- logger.info(String.format("Copying %1$s to %2$s", tempFile, destination));
- FileUtils.copyFile(tempFile, destination);
- } catch (IOException e) {
- throw new DownloadException(String.format("Error downloading %1$s to %2$s.", source, destination), e);
- }
-
- }
-
- private String mapAlgorithmToFileExtension(String algorithm) {
- return "." + algorithm.toLowerCase().replaceAll("-", "");
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/6dabe91d/taverna-download-impl/src/main/resources/META-INF/spring/download-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-download-impl/src/main/resources/META-INF/spring/download-context-osgi.xml b/taverna-download-impl/src/main/resources/META-INF/spring/download-context-osgi.xml
index 305de8f..7db9625 100644
--- a/taverna-download-impl/src/main/resources/META-INF/spring/download-context-osgi.xml
+++ b/taverna-download-impl/src/main/resources/META-INF/spring/download-context-osgi.xml
@@ -6,6 +6,6 @@
http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd">
- <service ref="downloadManager" interface="uk.org.taverna.commons.download.DownloadManager" />
+ <service ref="downloadManager" interface="org.apache.taverna.commons.download.DownloadManager" />
</beans:beans>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/6dabe91d/taverna-download-impl/src/main/resources/META-INF/spring/download-context.xml
----------------------------------------------------------------------
diff --git a/taverna-download-impl/src/main/resources/META-INF/spring/download-context.xml b/taverna-download-impl/src/main/resources/META-INF/spring/download-context.xml
index 8213b00..ff0394f 100644
--- a/taverna-download-impl/src/main/resources/META-INF/spring/download-context.xml
+++ b/taverna-download-impl/src/main/resources/META-INF/spring/download-context.xml
@@ -4,6 +4,6 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
- <bean id="downloadManager" class="uk.org.taverna.commons.download.impl.DownloadManagerImpl" />
+ <bean id="downloadManager" class="org.apache.taverna.commons.download.impl.DownloadManagerImpl" />
</beans>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/6dabe91d/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginManagerImpl.java b/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginManagerImpl.java
index 738ed60..c47a30b 100644
--- a/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginManagerImpl.java
+++ b/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginManagerImpl.java
@@ -40,6 +40,8 @@ import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import org.apache.log4j.Logger;
+import org.apache.taverna.commons.download.DownloadException;
+import org.apache.taverna.commons.download.DownloadManager;
import org.apache.taverna.configuration.app.ApplicationConfiguration;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -48,8 +50,6 @@ import org.osgi.framework.Version;
import org.osgi.service.event.Event;
import org.osgi.service.event.EventAdmin;
-import uk.org.taverna.commons.download.DownloadException;
-import uk.org.taverna.commons.download.DownloadManager;
import uk.org.taverna.commons.plugin.Plugin;
import uk.org.taverna.commons.plugin.Plugin.State;
import uk.org.taverna.commons.plugin.PluginException;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/6dabe91d/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImpl.java b/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImpl.java
index df8bfa8..365c6c5 100644
--- a/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImpl.java
+++ b/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImpl.java
@@ -33,10 +33,10 @@ import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import org.apache.log4j.Logger;
+import org.apache.taverna.commons.download.DownloadException;
+import org.apache.taverna.commons.download.DownloadManager;
import org.apache.taverna.configuration.app.ApplicationConfiguration;
-import uk.org.taverna.commons.download.DownloadException;
-import uk.org.taverna.commons.download.DownloadManager;
import uk.org.taverna.commons.plugin.PluginException;
import uk.org.taverna.commons.plugin.PluginSite;
import uk.org.taverna.commons.plugin.PluginSite.PluginSiteType;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/6dabe91d/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml b/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml
index c3b751d..f936db3 100644
--- a/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml
+++ b/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml
@@ -10,7 +10,7 @@
<service ref="pluginSiteManager" interface="uk.org.taverna.commons.plugin.PluginSiteManager" />
<reference id="applicationConfiguration" interface="org.apache.taverna.configuration.app.ApplicationConfiguration" />
- <reference id="downloadManager" interface="uk.org.taverna.commons.download.DownloadManager" />
+ <reference id="downloadManager" interface="org.apache.taverna.commons.download.DownloadManager" />
<reference id="eventAdmin" interface="org.osgi.service.event.EventAdmin" />
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/6dabe91d/taverna-plugin-impl/src/test/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImplTest.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/test/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImplTest.java b/taverna-plugin-impl/src/test/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImplTest.java
index fc8b442..63e7a8b 100644
--- a/taverna-plugin-impl/src/test/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImplTest.java
+++ b/taverna-plugin-impl/src/test/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImplTest.java
@@ -27,13 +27,13 @@ import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
+import org.apache.taverna.commons.download.DownloadException;
+import org.apache.taverna.commons.download.DownloadManager;
import org.apache.taverna.configuration.app.ApplicationConfiguration;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
-import uk.org.taverna.commons.download.DownloadException;
-import uk.org.taverna.commons.download.DownloadManager;
import uk.org.taverna.commons.plugin.PluginException;
/**
@@ -132,7 +132,7 @@ public class PluginSiteManagerImplTest {
}
/**
- * Test method for {@link uk.org.taverna.commons.plugin.impl.PluginSiteManagerImpl#setDownloadManager(uk.org.taverna.commons.download.DownloadManager)}.
+ * Test method for {@link uk.org.taverna.commons.plugin.impl.PluginSiteManagerImpl#setDownloadManager(org.apache.taverna.commons.download.DownloadManager)}.
*/
@Test
public void testSetDownloadManager() {
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/6dabe91d/taverna-update-impl/src/main/java/uk/org/taverna/commons/update/impl/UpdateManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-update-impl/src/main/java/uk/org/taverna/commons/update/impl/UpdateManagerImpl.java b/taverna-update-impl/src/main/java/uk/org/taverna/commons/update/impl/UpdateManagerImpl.java
index d635036..bda904c 100644
--- a/taverna-update-impl/src/main/java/uk/org/taverna/commons/update/impl/UpdateManagerImpl.java
+++ b/taverna-update-impl/src/main/java/uk/org/taverna/commons/update/impl/UpdateManagerImpl.java
@@ -36,11 +36,11 @@ import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import org.apache.commons.io.FileUtils;
+import org.apache.taverna.commons.download.DownloadException;
+import org.apache.taverna.commons.download.DownloadManager;
import org.apache.taverna.configuration.app.ApplicationConfiguration;
import org.osgi.service.event.EventAdmin;
-import uk.org.taverna.commons.download.DownloadException;
-import uk.org.taverna.commons.download.DownloadManager;
import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
import uk.org.taverna.commons.profile.xml.jaxb.UpdateSite;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/6dabe91d/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml b/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml
index 6234a5d..e042cb3 100644
--- a/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml
+++ b/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml
@@ -9,7 +9,7 @@
<service ref="updateManager" interface="uk.org.taverna.commons.update.UpdateManager" />
<reference id="applicationConfiguration" interface="org.apache.taverna.configuration.app.ApplicationConfiguration" />
- <reference id="downloadManager" interface="uk.org.taverna.commons.download.DownloadManager" />
+ <reference id="downloadManager" interface="org.apache.taverna.commons.download.DownloadManager" />
<!-- <reference id="eventAdmin" interface="org.osgi.service.event.EventAdmin" /> -->
[09/17] incubator-taverna-osgi git commit: org.apache.taverna.update
Posted by st...@apache.org.
org.apache.taverna.update
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/39180b38
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/39180b38
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/39180b38
Branch: refs/heads/master
Commit: 39180b38f4c3a326f16f9aba3a0cfd75f2584f15
Parents: 16a5517
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Oct 18 13:35:58 2015 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Oct 18 13:35:58 2015 +0100
----------------------------------------------------------------------
.../apache/taverna/update/UpdateException.java | 47 ++++
.../apache/taverna/update/UpdateManager.java | 34 +++
.../taverna/commons/update/UpdateException.java | 47 ----
.../taverna/commons/update/UpdateManager.java | 34 ---
taverna-update-impl/pom.xml | 2 +-
.../taverna/update/impl/UpdateManagerImpl.java | 270 +++++++++++++++++++
.../commons/update/impl/UpdateManagerImpl.java | 270 -------------------
.../META-INF/spring/update-context-osgi.xml | 2 +-
.../META-INF/spring/update-context.xml | 6 +-
9 files changed, 356 insertions(+), 356 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/39180b38/taverna-update-api/src/main/java/org/apache/taverna/update/UpdateException.java
----------------------------------------------------------------------
diff --git a/taverna-update-api/src/main/java/org/apache/taverna/update/UpdateException.java b/taverna-update-api/src/main/java/org/apache/taverna/update/UpdateException.java
new file mode 100644
index 0000000..0794de1
--- /dev/null
+++ b/taverna-update-api/src/main/java/org/apache/taverna/update/UpdateException.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.update;
+
+/**
+ * Thrown when an update fails.
+ *
+ * @author David Withers
+ */
+public class UpdateException extends Exception {
+
+ private static final long serialVersionUID = -5852543170339969041L;
+
+ public UpdateException() {
+ }
+
+ public UpdateException(String message) {
+ super(message);
+ }
+
+ public UpdateException(Throwable cause) {
+ super(cause);
+ }
+
+ public UpdateException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/39180b38/taverna-update-api/src/main/java/org/apache/taverna/update/UpdateManager.java
----------------------------------------------------------------------
diff --git a/taverna-update-api/src/main/java/org/apache/taverna/update/UpdateManager.java b/taverna-update-api/src/main/java/org/apache/taverna/update/UpdateManager.java
new file mode 100644
index 0000000..690bd2d
--- /dev/null
+++ b/taverna-update-api/src/main/java/org/apache/taverna/update/UpdateManager.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.update;
+
+/**
+ * Manager for updating Tavana Applications.
+ *
+ * @author David Withers
+ */
+public interface UpdateManager {
+
+ public boolean checkForUpdates() throws UpdateException;
+
+ public boolean update() throws UpdateException;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/39180b38/taverna-update-api/src/main/java/uk/org/taverna/commons/update/UpdateException.java
----------------------------------------------------------------------
diff --git a/taverna-update-api/src/main/java/uk/org/taverna/commons/update/UpdateException.java b/taverna-update-api/src/main/java/uk/org/taverna/commons/update/UpdateException.java
deleted file mode 100644
index 54019fc..0000000
--- a/taverna-update-api/src/main/java/uk/org/taverna/commons/update/UpdateException.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 uk.org.taverna.commons.update;
-
-/**
- * Thrown when an update fails.
- *
- * @author David Withers
- */
-public class UpdateException extends Exception {
-
- private static final long serialVersionUID = -5852543170339969041L;
-
- public UpdateException() {
- }
-
- public UpdateException(String message) {
- super(message);
- }
-
- public UpdateException(Throwable cause) {
- super(cause);
- }
-
- public UpdateException(String message, Throwable cause) {
- super(message, cause);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/39180b38/taverna-update-api/src/main/java/uk/org/taverna/commons/update/UpdateManager.java
----------------------------------------------------------------------
diff --git a/taverna-update-api/src/main/java/uk/org/taverna/commons/update/UpdateManager.java b/taverna-update-api/src/main/java/uk/org/taverna/commons/update/UpdateManager.java
deleted file mode 100644
index 29415cc..0000000
--- a/taverna-update-api/src/main/java/uk/org/taverna/commons/update/UpdateManager.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 uk.org.taverna.commons.update;
-
-/**
- * Manager for updating Tavana Applications.
- *
- * @author David Withers
- */
-public interface UpdateManager {
-
- public boolean checkForUpdates() throws UpdateException;
-
- public boolean update() throws UpdateException;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/39180b38/taverna-update-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-update-impl/pom.xml b/taverna-update-impl/pom.xml
index ee081a2..10a7524 100644
--- a/taverna-update-impl/pom.xml
+++ b/taverna-update-impl/pom.xml
@@ -16,7 +16,7 @@
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
- <Import-Package>uk.org.taverna.commons.update;provide:=true,*</Import-Package>
+ <Import-Package>org.apache.taverna.update;provide:=true,*</Import-Package>
</instructions>
</configuration>
</plugin>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/39180b38/taverna-update-impl/src/main/java/org/apache/taverna/update/impl/UpdateManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-update-impl/src/main/java/org/apache/taverna/update/impl/UpdateManagerImpl.java b/taverna-update-impl/src/main/java/org/apache/taverna/update/impl/UpdateManagerImpl.java
new file mode 100644
index 0000000..81396d1
--- /dev/null
+++ b/taverna-update-impl/src/main/java/org/apache/taverna/update/impl/UpdateManagerImpl.java
@@ -0,0 +1,270 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.update.impl;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.taverna.configuration.app.ApplicationConfiguration;
+import org.apache.taverna.download.DownloadException;
+import org.apache.taverna.download.DownloadManager;
+import org.apache.taverna.update.UpdateException;
+import org.apache.taverna.update.UpdateManager;
+import org.osgi.service.event.EventAdmin;
+
+import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
+import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
+import uk.org.taverna.commons.profile.xml.jaxb.UpdateSite;
+import uk.org.taverna.commons.profile.xml.jaxb.Updates;
+import uk.org.taverna.commons.versions.xml.jaxb.Version;
+import uk.org.taverna.commons.versions.xml.jaxb.Versions;
+
+/**
+ * Implementation of the Taverna Update Manager.
+ *
+ * @author David Withers
+ */
+public class UpdateManagerImpl implements UpdateManager {
+
+ private static final String DIGEST_ALGORITHM = "MD5";
+
+ private EventAdmin eventAdmin;
+
+ private int checkIntervalSeconds;
+
+ private ApplicationConfiguration applicationConfiguration;
+
+ private DownloadManager downloadManager;
+
+ private long lastCheckTime;
+ private boolean updateAvailable;
+ private Unmarshaller unmarshaller;
+
+ private Versions applicationVersions;
+ private Version latestVersion;
+
+ public UpdateManagerImpl() throws UpdateException {
+ try {
+ JAXBContext jaxbContext = JAXBContext.newInstance(UpdateSite.class, ApplicationProfile.class);
+ unmarshaller = jaxbContext.createUnmarshaller();
+ } catch (JAXBException e) {
+ throw new UpdateException("Error creating JAXBContext", e);
+ }
+ }
+
+ @Override
+ public boolean checkForUpdates() throws UpdateException {
+ ApplicationProfile applicationProfile = applicationConfiguration.getApplicationProfile();
+ String version = applicationProfile.getVersion();
+ Updates updates = applicationProfile.getUpdates();
+
+ URL updatesURL;
+ try {
+ URI updateSiteURI = new URI(updates.getUpdateSite());
+ updatesURL = updateSiteURI.resolve(updates.getUpdatesFile()).toURL();
+ } catch (MalformedURLException e) {
+ throw new UpdateException(String.format("Update site URL (%s) is not a valid URL",
+ updates.getUpdateSite()), e);
+ } catch (URISyntaxException e) {
+ throw new UpdateException(String.format("Update site URL (%s) is not a valid URL",
+ updates.getUpdateSite()), e);
+ }
+ File updateDirectory = new File(applicationConfiguration.getApplicationHomeDir(), "updates");
+ updateDirectory.mkdirs();
+ File updatesFile = new File(updateDirectory, updates.getUpdatesFile());
+ try {
+ downloadManager.download(updatesURL, updatesFile, DIGEST_ALGORITHM);
+ } catch (DownloadException e) {
+ throw new UpdateException(String.format("Error downloading %1$s",
+ updatesURL), e);
+ }
+
+ try {
+ UpdateSite updateSite = (UpdateSite) unmarshaller
+ .unmarshal(updatesFile);
+ applicationVersions = updateSite.getVersions();
+ latestVersion = applicationVersions.getLatestVersion();
+ updateAvailable = isHigherVersion(latestVersion.getVersion(), version);
+ } catch (JAXBException e) {
+ throw new UpdateException(String.format("Error reading %s",
+ updatesFile.getName()), e);
+ }
+ lastCheckTime = System.currentTimeMillis();
+ return updateAvailable;
+ }
+
+ @Override
+ public boolean update() throws UpdateException {
+ if (updateAvailable) {
+ ApplicationProfile applicationProfile = applicationConfiguration.getApplicationProfile();
+ Updates updates = applicationProfile.getUpdates();
+ URL profileURL;
+ try {
+ URI updateSiteURI = new URI(updates.getUpdateSite());
+ profileURL = updateSiteURI.resolve(latestVersion.getFile()).toURL();
+ } catch (MalformedURLException e) {
+ throw new UpdateException(String.format(
+ "Application profile URL (%s) is not a valid URL",
+ latestVersion.getFile()), e);
+ } catch (URISyntaxException e) {
+ throw new UpdateException(String.format("Update site URL (%s) is not a valid URL",
+ updates.getUpdateSite()), e);
+ }
+
+ File updateDirectory = new File(applicationConfiguration.getApplicationHomeDir(),
+ "updates");
+ updateDirectory.mkdirs();
+ File latestProfileFile = new File(updateDirectory, "ApplicationProfile-"
+ + latestVersion.getVersion() + ".xml");
+ try {
+ downloadManager.download(profileURL, latestProfileFile, DIGEST_ALGORITHM);
+ } catch (DownloadException e) {
+ throw new UpdateException(String.format("Error downloading %1$s",
+ profileURL), e);
+ }
+
+ ApplicationProfile latestProfile;
+ try {
+ latestProfile = (ApplicationProfile) unmarshaller.unmarshal(latestProfileFile);
+ } catch (JAXBException e) {
+ throw new UpdateException(String.format("Error reading %s",
+ latestProfileFile.getName()), e);
+ }
+
+ Set<BundleInfo> requiredBundles = getRequiredBundles(
+ applicationConfiguration.getApplicationProfile(), latestProfile);
+ downloadBundles(latestProfile, requiredBundles, new File(applicationConfiguration.getStartupDir(), "lib"));
+ File applicationProfileFile = new File(applicationConfiguration.getStartupDir(), "ApplicationProfile.xml");
+ try {
+ FileUtils.copyFile(latestProfileFile, applicationProfileFile);
+ } catch (IOException e) {
+ throw new UpdateException(String.format("Error copying %1$s to %2$s",
+ latestProfileFile.getName(), applicationProfileFile.getName()), e);
+ }
+// eventAdmin.postEvent(new Event("UpdateManagerEvent", new HashMap()));
+ updateAvailable = false;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @param requiredBundles
+ * @param file
+ * @throws UpdateException
+ */
+ private void downloadBundles(ApplicationProfile profile, Set<BundleInfo> requiredBundles, File file) throws UpdateException {
+ Updates updates = profile.getUpdates();
+ String updateSite = updates.getUpdateSite();
+ String libDirectory = updates.getLibDirectory();
+ if (!libDirectory.endsWith("/")) {
+ libDirectory = libDirectory + "/";
+ }
+
+ URI updateLibDirectory;
+ try {
+ updateLibDirectory = new URI(updateSite).resolve(libDirectory);
+ } catch (URISyntaxException e) {
+ throw new UpdateException(String.format("Update site URL (%s) is not a valid URL",
+ updates.getUpdateSite()), e);
+ }
+ for (BundleInfo bundle : requiredBundles) {
+ URL bundleURL;
+ URI bundleURI = updateLibDirectory.resolve(bundle.getFileName());
+ try {
+ bundleURL = bundleURI.toURL();
+ } catch (MalformedURLException e) {
+ throw new UpdateException(String.format("Bundle URL (%s) is not a valid URL",
+ bundleURI), e);
+ }
+ File bundleDestination = new File(file, bundle.getFileName());
+ try {
+ downloadManager.download(bundleURL, new File(file, bundle.getFileName()), DIGEST_ALGORITHM);
+ } catch (DownloadException e) {
+ throw new UpdateException(String.format("Error downloading %1$s to %2$s",
+ bundleURL, bundleDestination), e);
+ }
+ }
+ }
+
+ /**
+ * Returns the new bundles required for the new application profile.
+ *
+ * @param currentProfile
+ * @param newProfile
+ * @return the new bundles required for the new application profile
+ */
+ private Set<BundleInfo> getRequiredBundles(ApplicationProfile currentProfile,
+ ApplicationProfile newProfile) {
+ Set<BundleInfo> requiredBundles = new HashSet<BundleInfo>();
+ Map<String, BundleInfo> currentBundles = new HashMap<String, BundleInfo>();
+ for (BundleInfo bundle : currentProfile.getBundle()) {
+ currentBundles.put(bundle.getSymbolicName(), bundle);
+ }
+ for (BundleInfo bundle : newProfile.getBundle()) {
+ if (currentBundles.containsKey(bundle.getSymbolicName())) {
+ BundleInfo currentBundle = currentBundles.get(bundle.getSymbolicName());
+ if (!bundle.getVersion().equals(currentBundle.getVersion())) {
+ requiredBundles.add(bundle);
+ }
+ } else {
+ requiredBundles.add(bundle);
+ }
+ }
+ return requiredBundles;
+ }
+
+ private boolean isHigherVersion(String version1, String version2) {
+ org.osgi.framework.Version semanticVersion1 = org.osgi.framework.Version.parseVersion(version1);
+ org.osgi.framework.Version semanticVersion2 = org.osgi.framework.Version.parseVersion(version2);
+ return semanticVersion1.compareTo(semanticVersion2) > 0;
+ }
+
+ public void setEventAdmin(EventAdmin eventAdmin) {
+ this.eventAdmin = eventAdmin;
+ }
+
+ public void setCheckIntervalSeconds(int checkIntervalSeconds) {
+ this.checkIntervalSeconds = checkIntervalSeconds;
+ }
+
+ public void setApplicationConfiguration(ApplicationConfiguration applicationConfiguration) {
+ this.applicationConfiguration = applicationConfiguration;
+ }
+
+ public void setDownloadManager(DownloadManager downloadManager) {
+ this.downloadManager = downloadManager;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/39180b38/taverna-update-impl/src/main/java/uk/org/taverna/commons/update/impl/UpdateManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-update-impl/src/main/java/uk/org/taverna/commons/update/impl/UpdateManagerImpl.java b/taverna-update-impl/src/main/java/uk/org/taverna/commons/update/impl/UpdateManagerImpl.java
deleted file mode 100644
index 59a536d..0000000
--- a/taverna-update-impl/src/main/java/uk/org/taverna/commons/update/impl/UpdateManagerImpl.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 uk.org.taverna.commons.update.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.taverna.configuration.app.ApplicationConfiguration;
-import org.apache.taverna.download.DownloadException;
-import org.apache.taverna.download.DownloadManager;
-import org.osgi.service.event.EventAdmin;
-
-import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
-import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
-import uk.org.taverna.commons.profile.xml.jaxb.UpdateSite;
-import uk.org.taverna.commons.profile.xml.jaxb.Updates;
-import uk.org.taverna.commons.update.UpdateException;
-import uk.org.taverna.commons.update.UpdateManager;
-import uk.org.taverna.commons.versions.xml.jaxb.Version;
-import uk.org.taverna.commons.versions.xml.jaxb.Versions;
-
-/**
- * Implementation of the Taverna Update Manager.
- *
- * @author David Withers
- */
-public class UpdateManagerImpl implements UpdateManager {
-
- private static final String DIGEST_ALGORITHM = "MD5";
-
- private EventAdmin eventAdmin;
-
- private int checkIntervalSeconds;
-
- private ApplicationConfiguration applicationConfiguration;
-
- private DownloadManager downloadManager;
-
- private long lastCheckTime;
- private boolean updateAvailable;
- private Unmarshaller unmarshaller;
-
- private Versions applicationVersions;
- private Version latestVersion;
-
- public UpdateManagerImpl() throws UpdateException {
- try {
- JAXBContext jaxbContext = JAXBContext.newInstance(UpdateSite.class, ApplicationProfile.class);
- unmarshaller = jaxbContext.createUnmarshaller();
- } catch (JAXBException e) {
- throw new UpdateException("Error creating JAXBContext", e);
- }
- }
-
- @Override
- public boolean checkForUpdates() throws UpdateException {
- ApplicationProfile applicationProfile = applicationConfiguration.getApplicationProfile();
- String version = applicationProfile.getVersion();
- Updates updates = applicationProfile.getUpdates();
-
- URL updatesURL;
- try {
- URI updateSiteURI = new URI(updates.getUpdateSite());
- updatesURL = updateSiteURI.resolve(updates.getUpdatesFile()).toURL();
- } catch (MalformedURLException e) {
- throw new UpdateException(String.format("Update site URL (%s) is not a valid URL",
- updates.getUpdateSite()), e);
- } catch (URISyntaxException e) {
- throw new UpdateException(String.format("Update site URL (%s) is not a valid URL",
- updates.getUpdateSite()), e);
- }
- File updateDirectory = new File(applicationConfiguration.getApplicationHomeDir(), "updates");
- updateDirectory.mkdirs();
- File updatesFile = new File(updateDirectory, updates.getUpdatesFile());
- try {
- downloadManager.download(updatesURL, updatesFile, DIGEST_ALGORITHM);
- } catch (DownloadException e) {
- throw new UpdateException(String.format("Error downloading %1$s",
- updatesURL), e);
- }
-
- try {
- UpdateSite updateSite = (UpdateSite) unmarshaller
- .unmarshal(updatesFile);
- applicationVersions = updateSite.getVersions();
- latestVersion = applicationVersions.getLatestVersion();
- updateAvailable = isHigherVersion(latestVersion.getVersion(), version);
- } catch (JAXBException e) {
- throw new UpdateException(String.format("Error reading %s",
- updatesFile.getName()), e);
- }
- lastCheckTime = System.currentTimeMillis();
- return updateAvailable;
- }
-
- @Override
- public boolean update() throws UpdateException {
- if (updateAvailable) {
- ApplicationProfile applicationProfile = applicationConfiguration.getApplicationProfile();
- Updates updates = applicationProfile.getUpdates();
- URL profileURL;
- try {
- URI updateSiteURI = new URI(updates.getUpdateSite());
- profileURL = updateSiteURI.resolve(latestVersion.getFile()).toURL();
- } catch (MalformedURLException e) {
- throw new UpdateException(String.format(
- "Application profile URL (%s) is not a valid URL",
- latestVersion.getFile()), e);
- } catch (URISyntaxException e) {
- throw new UpdateException(String.format("Update site URL (%s) is not a valid URL",
- updates.getUpdateSite()), e);
- }
-
- File updateDirectory = new File(applicationConfiguration.getApplicationHomeDir(),
- "updates");
- updateDirectory.mkdirs();
- File latestProfileFile = new File(updateDirectory, "ApplicationProfile-"
- + latestVersion.getVersion() + ".xml");
- try {
- downloadManager.download(profileURL, latestProfileFile, DIGEST_ALGORITHM);
- } catch (DownloadException e) {
- throw new UpdateException(String.format("Error downloading %1$s",
- profileURL), e);
- }
-
- ApplicationProfile latestProfile;
- try {
- latestProfile = (ApplicationProfile) unmarshaller.unmarshal(latestProfileFile);
- } catch (JAXBException e) {
- throw new UpdateException(String.format("Error reading %s",
- latestProfileFile.getName()), e);
- }
-
- Set<BundleInfo> requiredBundles = getRequiredBundles(
- applicationConfiguration.getApplicationProfile(), latestProfile);
- downloadBundles(latestProfile, requiredBundles, new File(applicationConfiguration.getStartupDir(), "lib"));
- File applicationProfileFile = new File(applicationConfiguration.getStartupDir(), "ApplicationProfile.xml");
- try {
- FileUtils.copyFile(latestProfileFile, applicationProfileFile);
- } catch (IOException e) {
- throw new UpdateException(String.format("Error copying %1$s to %2$s",
- latestProfileFile.getName(), applicationProfileFile.getName()), e);
- }
-// eventAdmin.postEvent(new Event("UpdateManagerEvent", new HashMap()));
- updateAvailable = false;
- return true;
- }
- return false;
- }
-
- /**
- * @param requiredBundles
- * @param file
- * @throws UpdateException
- */
- private void downloadBundles(ApplicationProfile profile, Set<BundleInfo> requiredBundles, File file) throws UpdateException {
- Updates updates = profile.getUpdates();
- String updateSite = updates.getUpdateSite();
- String libDirectory = updates.getLibDirectory();
- if (!libDirectory.endsWith("/")) {
- libDirectory = libDirectory + "/";
- }
-
- URI updateLibDirectory;
- try {
- updateLibDirectory = new URI(updateSite).resolve(libDirectory);
- } catch (URISyntaxException e) {
- throw new UpdateException(String.format("Update site URL (%s) is not a valid URL",
- updates.getUpdateSite()), e);
- }
- for (BundleInfo bundle : requiredBundles) {
- URL bundleURL;
- URI bundleURI = updateLibDirectory.resolve(bundle.getFileName());
- try {
- bundleURL = bundleURI.toURL();
- } catch (MalformedURLException e) {
- throw new UpdateException(String.format("Bundle URL (%s) is not a valid URL",
- bundleURI), e);
- }
- File bundleDestination = new File(file, bundle.getFileName());
- try {
- downloadManager.download(bundleURL, new File(file, bundle.getFileName()), DIGEST_ALGORITHM);
- } catch (DownloadException e) {
- throw new UpdateException(String.format("Error downloading %1$s to %2$s",
- bundleURL, bundleDestination), e);
- }
- }
- }
-
- /**
- * Returns the new bundles required for the new application profile.
- *
- * @param currentProfile
- * @param newProfile
- * @return the new bundles required for the new application profile
- */
- private Set<BundleInfo> getRequiredBundles(ApplicationProfile currentProfile,
- ApplicationProfile newProfile) {
- Set<BundleInfo> requiredBundles = new HashSet<BundleInfo>();
- Map<String, BundleInfo> currentBundles = new HashMap<String, BundleInfo>();
- for (BundleInfo bundle : currentProfile.getBundle()) {
- currentBundles.put(bundle.getSymbolicName(), bundle);
- }
- for (BundleInfo bundle : newProfile.getBundle()) {
- if (currentBundles.containsKey(bundle.getSymbolicName())) {
- BundleInfo currentBundle = currentBundles.get(bundle.getSymbolicName());
- if (!bundle.getVersion().equals(currentBundle.getVersion())) {
- requiredBundles.add(bundle);
- }
- } else {
- requiredBundles.add(bundle);
- }
- }
- return requiredBundles;
- }
-
- private boolean isHigherVersion(String version1, String version2) {
- org.osgi.framework.Version semanticVersion1 = org.osgi.framework.Version.parseVersion(version1);
- org.osgi.framework.Version semanticVersion2 = org.osgi.framework.Version.parseVersion(version2);
- return semanticVersion1.compareTo(semanticVersion2) > 0;
- }
-
- public void setEventAdmin(EventAdmin eventAdmin) {
- this.eventAdmin = eventAdmin;
- }
-
- public void setCheckIntervalSeconds(int checkIntervalSeconds) {
- this.checkIntervalSeconds = checkIntervalSeconds;
- }
-
- public void setApplicationConfiguration(ApplicationConfiguration applicationConfiguration) {
- this.applicationConfiguration = applicationConfiguration;
- }
-
- public void setDownloadManager(DownloadManager downloadManager) {
- this.downloadManager = downloadManager;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/39180b38/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml b/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml
index 663bae4..44dba6e 100644
--- a/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml
+++ b/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml
@@ -6,7 +6,7 @@
http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd">
- <service ref="updateManager" interface="uk.org.taverna.commons.update.UpdateManager" />
+ <service ref="updateManager" interface="org.apache.taverna.update.UpdateManager" />
<reference id="applicationConfiguration" interface="org.apache.taverna.configuration.app.ApplicationConfiguration" />
<reference id="downloadManager" interface="org.apache.taverna.download.DownloadManager" />
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/39180b38/taverna-update-impl/src/main/resources/META-INF/spring/update-context.xml
----------------------------------------------------------------------
diff --git a/taverna-update-impl/src/main/resources/META-INF/spring/update-context.xml b/taverna-update-impl/src/main/resources/META-INF/spring/update-context.xml
index 4b58267..c0d9b75 100644
--- a/taverna-update-impl/src/main/resources/META-INF/spring/update-context.xml
+++ b/taverna-update-impl/src/main/resources/META-INF/spring/update-context.xml
@@ -7,15 +7,15 @@
http://www.springframework.org/schema/osgi-compendium
http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd">
- <!-- <osgix:cm-properties id="cfg.with.defaults" persistent-id="uk.org.taverna.commons.update.impl.UpdateManagerImpl">
+ <!-- <osgix:cm-properties id="cfg.with.defaults" persistent-id="org.apache.taverna.update.impl.UpdateManagerImpl">
<prop key="checkIntervalSeconds">300</prop>
</osgix:cm-properties> -->
- <bean id="updateManager" class="uk.org.taverna.commons.update.impl.UpdateManagerImpl">
+ <bean id="updateManager" class="org.apache.taverna.update.impl.UpdateManagerImpl">
<!-- <property name="eventAdmin" ref="eventAdmin" /> -->
<property name="applicationConfiguration" ref="applicationConfiguration" />
<property name="downloadManager" ref="downloadManager" />
- <!-- <osgix:managed-properties persistent-id="uk.org.taverna.commons.update.impl.UpdateManagerImpl" /> -->
+ <!-- <osgix:managed-properties persistent-id="org.apache.taverna.update.impl.UpdateManagerImpl" /> -->
</bean>
</beans>
[06/17] incubator-taverna-osgi git commit:
uk.org.taverna.commons.plugin -> org.apache.taverna.plugin
Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginManagerImpl.java b/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginManagerImpl.java
deleted file mode 100644
index c47a30b..0000000
--- a/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginManagerImpl.java
+++ /dev/null
@@ -1,466 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 uk.org.taverna.commons.plugin.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
-
-import org.apache.log4j.Logger;
-import org.apache.taverna.commons.download.DownloadException;
-import org.apache.taverna.commons.download.DownloadManager;
-import org.apache.taverna.configuration.app.ApplicationConfiguration;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Version;
-import org.osgi.service.event.Event;
-import org.osgi.service.event.EventAdmin;
-
-import uk.org.taverna.commons.plugin.Plugin;
-import uk.org.taverna.commons.plugin.Plugin.State;
-import uk.org.taverna.commons.plugin.PluginException;
-import uk.org.taverna.commons.plugin.PluginManager;
-import uk.org.taverna.commons.plugin.PluginSite;
-import uk.org.taverna.commons.plugin.PluginSiteManager;
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginInfo;
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
-import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
-
-/**
- * PluginManager implementation.
- *
- * @author David Withers
- */
-public class PluginManagerImpl implements PluginManager {
-
- private static final String DIGEST_ALGORITHM = "MD5";
- private static final String PLUGIN_FILE_NAME = "META-INF/taverna/plugin.xml";
-
- private static final Logger logger = Logger.getLogger(PluginManagerImpl.class);
-
- private EventAdmin eventAdmin;
- private ApplicationConfiguration applicationConfiguration;
- private BundleContext bundleContext;
- private DownloadManager downloadManager;
- private PluginSiteManager pluginSiteManager;
-
- private Map<String, Plugin> installedPlugins = new TreeMap<String, Plugin>();
- private Map<String, PluginVersions> availablePlugins = new TreeMap<String, PluginVersions>();
- private Map<String, PluginVersions> pluginUpdates = new TreeMap<String, PluginVersions>();
-
- private boolean updateAvailablePlugins = true;
-
- private Map<File, PluginDirectoryWatcher> pluginDirectoryWatchers = new HashMap<File, PluginDirectoryWatcher>();
-
- private Set<Bundle> installedBundles = new HashSet<Bundle>();
-
- private Unmarshaller unmarshaller;
-
- public PluginManagerImpl() throws PluginException {
- try {
- JAXBContext jaxbContext = JAXBContext.newInstance(PluginInfo.class);
- unmarshaller = jaxbContext.createUnmarshaller();
- } catch (JAXBException e) {
- throw new PluginException("Error creating JAXBContext", e);
- }
- }
-
- @Override
- public void checkForUpdates() throws PluginException {
- boolean updatesFound = false;
- synchronized (pluginUpdates) {
- pluginUpdates.clear();
- for (PluginSite pluginSite : pluginSiteManager.getPluginSites()) {
- List<PluginVersions> plugins = pluginSiteManager.getPlugins(pluginSite);
- for (PluginVersions plugin : plugins) {
- if (installedPlugins.containsKey(plugin.getId())) {
- Plugin installedPlugin = installedPlugins.get(plugin.getId());
- if (installedPlugin.getFile().canWrite()) {
- Version latestVersion = Version.parseVersion(plugin.getLatestVersion()
- .getVersion());
- if (latestVersion.compareTo(installedPlugin.getVersion()) > 0) {
- pluginUpdates.put(plugin.getId(), plugin);
- updatesFound = true;
- }
- }
- }
- }
- }
- }
- if (updatesFound) {
- postEvent(PluginManager.UPDATES_AVAILABLE);
- }
- }
-
- @Override
- public List<PluginVersions> getPluginUpdates() throws PluginException {
- synchronized (pluginUpdates) {
- return new ArrayList<PluginVersions>(pluginUpdates.values());
- }
- }
-
- @Override
- public void loadPlugins() throws PluginException {
- loadPlugins(applicationConfiguration.getSystemPluginDir());
- loadPlugins(applicationConfiguration.getUserPluginDir());
- }
-
- @Override
- public List<PluginVersions> getAvailablePlugins() throws PluginException {
- if (updateAvailablePlugins) {
- synchronized (availablePlugins) {
- availablePlugins = new HashMap<String, PluginVersions>();
- for (PluginSite pluginSite : pluginSiteManager.getPluginSites()) {
- List<PluginVersions> plugins = pluginSiteManager.getPlugins(pluginSite);
- for (PluginVersions plugin : plugins) {
- if (!installedPlugins.containsKey(plugin.getId())) {
- availablePlugins.put(plugin.getId(), plugin);
- }
- }
- }
- }
- updateAvailablePlugins = false;
- }
- return new ArrayList<PluginVersions>(availablePlugins.values());
- }
-
- @Override
- public List<Plugin> getInstalledPlugins() throws PluginException {
- return new ArrayList<Plugin>(installedPlugins.values());
- }
-
- @Override
- public Plugin installPlugin(File pluginFile) throws PluginException {
- // check if already installed
- synchronized (installedPlugins) {
- for (Plugin plugin : installedPlugins.values()) {
- if (plugin.getFile().equals(pluginFile)) {
- return plugin;
- }
- }
- // check plugin file
- if (pluginFile.exists()) {
- new PluginException(String.format("Plugin file %1$s does not exist", pluginFile));
- }
- if (pluginFile.isFile()) {
- new PluginException(String.format("Plugin file %1$s is not a file", pluginFile));
- }
- if (!pluginFile.canRead()) {
- new PluginException(String.format("Plugin file %1$s is not readable", pluginFile));
- }
- // install plugin from plugin file
- logger.info(String.format("Installing plugin from '%s'", pluginFile));
- JarFile jarFile;
- try {
- jarFile = new JarFile(pluginFile);
- } catch (IOException e) {
- throw new PluginException(String.format("Error reading plugin file %1$s",
- pluginFile), e);
- }
- Plugin plugin = installPlugin(jarFile);
- installedPlugins.put(plugin.getId(), plugin);
- availablePlugins.remove(plugin.getId());
- postEvent(PluginManager.PLUGIN_INSTALLED);
- return plugin;
- }
- }
-
- @Override
- public Plugin installPlugin(String pluginSiteURL, String pluginFileName) throws PluginException {
- File pluginFile = getPluginFile(pluginSiteURL, pluginFileName);
- return installPlugin(pluginFile);
- }
-
- @Override
- public Plugin updatePlugin(PluginVersions pluginVersions) throws PluginException {
- String pluginId = pluginVersions.getId();
- String pluginSiteUrl = pluginVersions.getPluginSiteUrl();
- String pluginFile = pluginVersions.getLatestVersion().getFile();
- Plugin plugin = installedPlugins.get(pluginId);
- plugin.stop();
- Plugin newPlugin;
- try {
- newPlugin = installPlugin(pluginSiteUrl, pluginFile);
- } catch (PluginException e) {
- plugin.start();
- throw new PluginException("Failed to update plugin " + pluginId, e);
- }
- synchronized (pluginUpdates) {
- pluginUpdates.remove(pluginId);
- }
- uninstallPlugin(plugin);
- return newPlugin;
- }
-
- void uninstallPlugin(File pluginFile) {
- synchronized (installedPlugins) {
- for (Plugin plugin : installedPlugins.values()) {
- if (plugin.getFile().equals(pluginFile)) {
- uninstallPlugin(plugin);
- break;
- }
- }
- }
- }
-
- void uninstallPlugin(Plugin plugin) {
- synchronized (installedPlugins) {
- if (installedPlugins.containsKey(plugin.getId())) {
- for (Bundle bundle : plugin.getBundles()) {
- if (installedBundles.contains(bundle)) {
- // check if bundle is used by other plugins
- boolean bundleInUse = false;
- for (Plugin installedPlugin : installedPlugins.values()) {
- if (!installedPlugin.equals(plugin)) {
- if (installedPlugin.getBundles().contains(bundle)) {
- bundleInUse = true;
- break;
- }
- }
- }
- if (!bundleInUse) {
- try {
- logger.info("Uninstalling bundle " + bundle.getSymbolicName());
- bundle.uninstall();
- installedBundles.remove(bundle);
- System.out.println("Remove " + bundle.getSymbolicName());
- } catch (BundleException e) {
- logger.warn(String.format(
- "Error uninstalling bundle %1$s for plugin %2$s",
- bundle.getSymbolicName(), plugin.getName()), e);
- }
- }
- }
- }
- installedPlugins.remove(plugin.getId());
- pluginUpdates.remove(plugin.getId());
- updateAvailablePlugins = true;
- postEvent(PluginManager.PLUGIN_UNINSTALLED);
- }
- }
- }
-
- public void loadPlugins(File pluginDir) throws PluginException {
- if (checkPluginDirectory(pluginDir, false)) {
- for (File pluginFile : pluginDir.listFiles()) {
- if (pluginFile.isFile() && pluginFile.canRead() && !pluginFile.isHidden()) {
- try {
- installPlugin(pluginFile).start();
- } catch (PluginException e) {
- logger.warn(String.format("Error loading plugin from '%s'", pluginFile), e);
- }
- }
- }
- }
- startWatchingPluginDirectory(pluginDir);
- }
-
- private Plugin installPlugin(JarFile jarFile) throws PluginException {
- PluginInfo pluginInfo = getPluginInfo(jarFile);
-
- PluginImpl plugin = new PluginImpl(this, new File(jarFile.getName()), pluginInfo);
-
- // check bundles exist in jar
- for (BundleInfo bundleInfo : pluginInfo.getBundle()) {
- // find the bundle in the plugin jar
- JarEntry entry = jarFile.getJarEntry(bundleInfo.getFileName());
- if (entry == null) {
- throw new PluginException(String.format(
- "Plugin file '%1$s' does not contain bundle file '%2$s'.",
- jarFile.getName(), bundleInfo.getFileName()));
- }
- }
-
- // install plugin bundles
- Set<Bundle> pluginBundles = plugin.getBundles();
- for (BundleInfo bundleInfo : pluginInfo.getBundle()) {
- Bundle installedBundle = getInstalledBundle(bundleInfo);
- if (installedBundle == null) {
- // install the bundle from the jar
- JarEntry entry = jarFile.getJarEntry(bundleInfo.getFileName());
- String bundleURL = jarEntryToURL(jarFile, entry);
- try {
- Bundle bundle = bundleContext.installBundle(bundleURL);
- pluginBundles.add(bundle);
- installedBundles.add(bundle);
- System.out.println("Add " + bundle.getSymbolicName());
- } catch (BundleException e) {
- // clean up by removing bundles already installed
- for (Bundle bundle : pluginBundles) {
- try {
- bundle.uninstall();
- installedBundles.remove(bundle);
- } catch (BundleException ex) {
- logger.warn("Error unistalling bundle", ex);
- }
- }
- throw new PluginException(String.format("Error installing bundle file %1$s",
- bundleURL), e);
- }
- } else {
- pluginBundles.add(installedBundle);
- }
- }
- plugin.setState(State.INSTALLED);
- return plugin;
- }
-
- private Bundle getInstalledBundle(BundleInfo bundleInfo) {
- for (Bundle installedBundle : bundleContext.getBundles()) {
- if (installedBundle.getSymbolicName().equals(bundleInfo.getSymbolicName())) {
- org.osgi.framework.Version installedVersion = installedBundle.getVersion();
- if (installedVersion
- .equals(new org.osgi.framework.Version(bundleInfo.getVersion()))) {
- return installedBundle;
- }
- }
- }
- return null;
- }
-
- public PluginInfo getPluginInfo(JarFile jarFile) throws PluginException {
- // TODO check manifest for non standard plugin info file
- JarEntry pluginEntry = jarFile.getJarEntry(PLUGIN_FILE_NAME);
- if (pluginEntry == null) {
- throw new PluginException(String.format(
- "Plugin file '%1$s' does not contain a %2$s file.", jarFile.getName(),
- PLUGIN_FILE_NAME));
- }
- try {
- InputStream inputStream = jarFile.getInputStream(pluginEntry);
- return (PluginInfo) unmarshaller.unmarshal(inputStream);
- } catch (JAXBException e) {
- throw new PluginException(String.format("Error reading plugin file %1$s from %2$s",
- pluginEntry, jarFile.getName()), e);
- } catch (IOException e) {
- throw new PluginException(String.format("Error reading plugin file %1$s from %2$s",
- pluginEntry, jarFile.getName()), e);
- }
- }
-
- private File getPluginFile(String pluginSiteURL, String pluginFileName) throws PluginException {
- File pluginFile = new File(getPluginDirectory(), pluginFileName);
- String pluginFileURL = pluginSiteURL + "/" + pluginFileName;
- try {
- downloadManager.download(new URL(pluginFileURL), pluginFile, DIGEST_ALGORITHM);
- } catch (DownloadException e) {
- throw new PluginException("Error downloading plugin file " + pluginFile, e);
- } catch (MalformedURLException e) {
- throw new PluginException("Invalid plugin file URL " + pluginFileURL, e);
- }
- return pluginFile;
- }
-
- public void startWatchingPluginDirectory(File pluginDir) throws PluginException {
- if (!pluginDirectoryWatchers.containsKey(pluginDir)) {
- pluginDirectoryWatchers.put(pluginDir, new PluginDirectoryWatcher(this, pluginDir));
- }
- pluginDirectoryWatchers.get(pluginDir).start();
- }
-
- public void stopWatchingPluginDirectory(File pluginDir) throws PluginException {
- if (pluginDirectoryWatchers.containsKey(pluginDir)) {
- pluginDirectoryWatchers.get(pluginDir).stop();
- }
- }
-
- private File getPluginDirectory() throws PluginException {
- File systemPluginsDir = applicationConfiguration.getSystemPluginDir();
- if (checkPluginDirectory(systemPluginsDir, true)) {
- return systemPluginsDir;
- }
- File userPluginsDir = applicationConfiguration.getUserPluginDir();
- if (checkPluginDirectory(userPluginsDir, true)) {
- return userPluginsDir;
- }
- throw new PluginException("No plugin directory avaliable");
- }
-
- public void setEventAdmin(EventAdmin eventAdmin) {
- this.eventAdmin = eventAdmin;
- }
-
- public void setApplicationConfiguration(ApplicationConfiguration applicationConfiguration) {
- this.applicationConfiguration = applicationConfiguration;
- }
-
- public void setBundleContext(BundleContext bundleContext) {
- this.bundleContext = bundleContext;
- }
-
- public void setDownloadManager(DownloadManager downloadManager) {
- this.downloadManager = downloadManager;
- }
-
- public void setPluginSiteManager(PluginSiteManager pluginSiteManager) {
- this.pluginSiteManager = pluginSiteManager;
- }
-
- private boolean checkPluginDirectory(File pluginDirectory, boolean checkWritable) {
- if (pluginDirectory == null) {
- return false;
- }
- if (!pluginDirectory.exists()) {
- logger.debug(String.format("Plugin directory %1$s does not exist", pluginDirectory));
- return false;
- }
- if (!pluginDirectory.isDirectory()) {
- logger.warn(String.format("Plugin directory %1$s is not a directory", pluginDirectory));
- return false;
- }
- if (!pluginDirectory.canRead()) {
- logger.debug(String.format("Plugin directory %1$s is not readable", pluginDirectory));
- return false;
- }
- if (checkWritable && !pluginDirectory.canWrite()) {
- logger.debug(String.format("Plugin directory %1$s is not writeable", pluginDirectory));
- return false;
- }
- return true;
- }
-
- private String jarEntryToURL(JarFile jarFile, JarEntry jarEntry) {
- File file = new File(jarFile.getName());
- return "jar:" + file.toURI() + "!/" + jarEntry.getName();
- }
-
- private void postEvent(String topic) {
- Event event = new Event(topic, new HashMap());
- eventAdmin.postEvent(event);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSiteImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSiteImpl.java b/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSiteImpl.java
deleted file mode 100644
index 6458341..0000000
--- a/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSiteImpl.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 uk.org.taverna.commons.plugin.impl;
-
-import uk.org.taverna.commons.plugin.PluginSite;
-
-/**
- * PluginSite implementation.
- *
- * @author David Withers
- */
-public class PluginSiteImpl implements PluginSite {
-
- private String name, url;
-
- private PluginSiteType type;
-
- public PluginSiteImpl() {
- }
-
- public PluginSiteImpl(String name, String url) {
- this(name, url, PluginSiteType.USER);
- }
-
- public PluginSiteImpl(String name, String url, PluginSiteType type) {
- this.name = name;
- this.url = url;
- this.type = type;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public String getUrl() {
- return url;
- }
-
- public void setUrl(String url) {
- this.url = url;
- }
-
- @Override
- public PluginSiteType getType() {
- return type;
- }
-
- public void setType(PluginSiteType type) {
- this.type = type;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImpl.java b/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImpl.java
deleted file mode 100644
index 365c6c5..0000000
--- a/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImpl.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 uk.org.taverna.commons.plugin.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-
-import org.apache.log4j.Logger;
-import org.apache.taverna.commons.download.DownloadException;
-import org.apache.taverna.commons.download.DownloadManager;
-import org.apache.taverna.configuration.app.ApplicationConfiguration;
-
-import uk.org.taverna.commons.plugin.PluginException;
-import uk.org.taverna.commons.plugin.PluginSite;
-import uk.org.taverna.commons.plugin.PluginSite.PluginSiteType;
-import uk.org.taverna.commons.plugin.PluginSiteManager;
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
-import uk.org.taverna.commons.plugin.xml.jaxb.Plugins;
-import uk.org.taverna.commons.profile.xml.jaxb.Updates;
-
-/**
- * PluginSiteManager implementation.
- *
- * @author David Withers
- */
-public class PluginSiteManagerImpl implements PluginSiteManager {
-
- private static final String PLUGIN_SITES_FILE = "plugin-sites.xml";
- private static final String DIGEST_ALGORITHM = "MD5";
- private static final String PLUGINS_FILE = "plugins.xml";
-
- private static final Logger logger = Logger.getLogger(PluginSiteManagerImpl.class);
-
- private ApplicationConfiguration applicationConfiguration;
- private DownloadManager downloadManager;
-
- private Unmarshaller unmarshaller;
- private Marshaller marshaller;
-
- private List<PluginSite> pluginSites;
-
- public PluginSiteManagerImpl() throws PluginException {
- try {
- JAXBContext jaxbContext = JAXBContext.newInstance(Plugins.class, PluginSites.class);
- unmarshaller = jaxbContext.createUnmarshaller();
- marshaller = jaxbContext.createMarshaller();
- } catch (JAXBException e) {
- throw new PluginException("Error creating JAXBContext", e);
- }
- }
-
- @Override
- public List<PluginSite> getPluginSites() {
- if (pluginSites == null) {
- readPluginSitesFile();
- if (pluginSites == null) {
- pluginSites = new ArrayList<PluginSite>();
- pluginSites.addAll(getSystemPluginSites());
- }
- }
- return pluginSites;
- }
-
- @Override
- public PluginSite createPluginSite(URL pluginSiteURL) throws PluginException {
- try {
- File tempFile = File.createTempFile("plugins", null);
- tempFile.deleteOnExit();
- URL pluginFileURL = new URL(pluginSiteURL + "/" + PLUGINS_FILE);
- downloadManager.download(pluginFileURL, tempFile, DIGEST_ALGORITHM);
- return new PluginSiteImpl("", pluginSiteURL.toExternalForm());
- } catch (MalformedURLException e) {
- throw new PluginException(String.format("Invalid plugin site URL %1$s", pluginSiteURL), e);
- } catch (DownloadException e) {
- throw new PluginException(String.format("Error contacting plugin site at %1$s", pluginSiteURL), e);
- } catch (IOException e) {
- throw new PluginException(String.format("Error contacting plugin site at %1$s", pluginSiteURL), e);
- }
- }
-
- @Override
- public void addPluginSite(PluginSite pluginSite) throws PluginException {
- getPluginSites().add(pluginSite);
- writePluginSitesFile();
- }
-
- @Override
- public void removePluginSite(PluginSite pluginSite) throws PluginException {
- getPluginSites().remove(pluginSite);
- writePluginSitesFile();
- }
-
- @Override
- public List<PluginVersions> getPlugins(PluginSite pluginSite) throws PluginException {
- List<PluginVersions> plugins = new ArrayList<PluginVersions>();
- try {
- URL pluginSiteURL = new URL(pluginSite.getUrl() + "/" + PLUGINS_FILE);
- File pluginsFile = new File(getDataDirectory(), PLUGINS_FILE);
- downloadManager.download(pluginSiteURL, pluginsFile, DIGEST_ALGORITHM);
- Plugins pluginsXML = (Plugins) unmarshaller.unmarshal(pluginsFile);
- for (PluginVersions plugin : pluginsXML.getPlugin()) {
- plugin.setPluginSiteUrl(pluginSite.getUrl());
- plugins.add(plugin);
- }
- } catch (MalformedURLException e) {
- throw new PluginException(String.format("Plugin site %1$s has an invalid location",
- pluginSite.getName()), e);
- } catch (DownloadException e) {
- throw new PluginException(String.format("Error downloading from plugin site %1$s",
- pluginSite.getName()), e);
- } catch (JAXBException e) {
- throw new PluginException(String.format("Error getting plugins from plugin site %1$s",
- pluginSite.getName()), e);
- }
- return plugins;
- }
-
- private List<PluginSite> getSystemPluginSites() {
- List<PluginSite> systemPluginSites = new ArrayList<PluginSite>();
- Updates updates = applicationConfiguration.getApplicationProfile().getUpdates();
- systemPluginSites
- .add(new PluginSiteImpl("", updates.getPluginSite(), PluginSiteType.SYSTEM));
- return systemPluginSites;
- }
-
- private void writePluginSitesFile() {
- File pluginSitesFile = new File(getDataDirectory(), PLUGIN_SITES_FILE);
- try {
- marshaller.marshal(pluginSites, pluginSitesFile);
- } catch (JAXBException e) {
- logger.error("Error writing file " + pluginSitesFile, e);
- }
- }
-
- private void readPluginSitesFile() {
- File pluginSitesFile = new File(getDataDirectory(), PLUGIN_SITES_FILE);
- if (pluginSitesFile.exists()) {
- try {
- pluginSites = new ArrayList<PluginSite>();
- PluginSites pluginSitesStore = (PluginSites) unmarshaller
- .unmarshal(pluginSitesFile);
- for (PluginSiteImpl pluginSiteImpl : pluginSitesStore.getPluginSites()) {
- pluginSites.add(pluginSiteImpl);
- }
- } catch (JAXBException e) {
- logger.error("Error reading file " + pluginSitesFile, e);
- }
- }
- }
-
- private File getDataDirectory() {
- return new File(applicationConfiguration.getApplicationHomeDir(), "plugin-data");
- }
-
- public void setApplicationConfiguration(ApplicationConfiguration applicationConfiguration) {
- this.applicationConfiguration = applicationConfiguration;
- }
-
- public void setDownloadManager(DownloadManager downloadManager) {
- this.downloadManager = downloadManager;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSites.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSites.java b/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSites.java
deleted file mode 100644
index 1e5203f..0000000
--- a/taverna-plugin-impl/src/main/java/uk/org/taverna/commons/plugin/impl/PluginSites.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 uk.org.taverna.commons.plugin.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- *
- *
- * @author David Withers
- */
-@XmlRootElement
-public class PluginSites {
-
- private List<PluginSiteImpl> pluginSites;
-
- public List<PluginSiteImpl> getPluginSites() {
- if (pluginSites == null) {
- pluginSites = new ArrayList<PluginSiteImpl>();
- }
- return pluginSites;
- }
-
- public void setPluginSites(List<PluginSiteImpl> pluginSites) {
- this.pluginSites = pluginSites;
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml b/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml
index f936db3..b974991 100644
--- a/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml
+++ b/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml
@@ -6,8 +6,8 @@
http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd">
- <service ref="pluginManager" interface="uk.org.taverna.commons.plugin.PluginManager" />
- <service ref="pluginSiteManager" interface="uk.org.taverna.commons.plugin.PluginSiteManager" />
+ <service ref="pluginManager" interface="org.apache.taverna.plugin.PluginManager" />
+ <service ref="pluginSiteManager" interface="org.apache.taverna.plugin.PluginSiteManager" />
<reference id="applicationConfiguration" interface="org.apache.taverna.configuration.app.ApplicationConfiguration" />
<reference id="downloadManager" interface="org.apache.taverna.commons.download.DownloadManager" />
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context.xml
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context.xml b/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context.xml
index 7315a1b..fe1e7e3 100644
--- a/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context.xml
+++ b/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context.xml
@@ -6,11 +6,11 @@
http://www.springframework.org/schema/osgi-compendium
http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd">
- <!-- <osgix:cm-properties id="cfg.with.defaults" persistent-id="uk.org.taverna.commons.plugin.impl.PluginSiteManagerImpl">
+ <!-- <osgix:cm-properties id="cfg.with.defaults" persistent-id="org.apache.taverna.plugin.impl.PluginSiteManagerImpl">
<prop key="checkIntervalSeconds">300</prop>
</osgix:cm-properties> -->
- <bean id="pluginManager" class="uk.org.taverna.commons.plugin.impl.PluginManagerImpl">
+ <bean id="pluginManager" class="org.apache.taverna.plugin.impl.PluginManagerImpl">
<property name="eventAdmin" ref="eventAdmin" />
<property name="applicationConfiguration" ref="applicationConfiguration" />
<property name="bundleContext" ref="bundleContext" />
@@ -22,10 +22,10 @@
</bean>
<bean id="pluginSiteManager"
- class="uk.org.taverna.commons.plugin.impl.PluginSiteManagerImpl">
+ class="org.apache.taverna.plugin.impl.PluginSiteManagerImpl">
<property name="applicationConfiguration" ref="applicationConfiguration" />
<property name="downloadManager" ref="downloadManager" />
- <!-- <osgix:managed-properties persistent-id="uk.org.taverna.commons.plugin.impl.PluginSiteManagerImpl" /> -->
+ <!-- <osgix:managed-properties persistent-id="org.apache.taverna.plugin.impl.PluginSiteManagerImpl" /> -->
</bean>
</beans>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteImplTest.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteImplTest.java b/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteImplTest.java
new file mode 100644
index 0000000..96b8776
--- /dev/null
+++ b/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteImplTest.java
@@ -0,0 +1,72 @@
+package org.apache.taverna.plugin.impl;
+
+import static org.junit.Assert.*;
+
+import org.apache.taverna.plugin.PluginSite.PluginSiteType;
+import org.apache.taverna.plugin.impl.PluginSiteImpl;
+import org.junit.Before;
+import org.junit.Test;
+
+public class PluginSiteImplTest {
+
+ PluginSiteImpl pluginSiteImpl;
+ String name, url;
+ PluginSiteType type;
+
+ @Before
+ public void setUp() throws Exception {
+ name = "test name";
+ url = "test url";
+ type = PluginSiteType.SYSTEM;
+ pluginSiteImpl = new PluginSiteImpl(name, url, type);
+ }
+
+ @Test
+ public void testPluginSiteImpl() {
+ pluginSiteImpl = new PluginSiteImpl();
+ }
+
+ @Test
+ public void testPluginSiteImplStringStringPluginSiteType() {
+ pluginSiteImpl = new PluginSiteImpl(null, null, null);
+ pluginSiteImpl = new PluginSiteImpl("", "", PluginSiteType.USER);
+ }
+
+ @Test
+ public void testGetName() {
+ assertEquals(name, pluginSiteImpl.getName());
+ assertEquals(name, pluginSiteImpl.getName());
+ }
+
+ @Test
+ public void testSetName() {
+ pluginSiteImpl.setName("name");
+ assertEquals("name", pluginSiteImpl.getName());
+ }
+
+ @Test
+ public void testGetUrl() {
+ assertEquals(url, pluginSiteImpl.getUrl());
+ assertEquals(url, pluginSiteImpl.getUrl());
+ }
+
+ @Test
+ public void testSetUrl() {
+ pluginSiteImpl.setName("http://www.example.com/");
+ assertEquals("http://www.example.com/", pluginSiteImpl.getName());
+ }
+
+ @Test
+ public void testGetType() {
+ assertEquals(type, pluginSiteImpl.getType());
+ assertEquals(type, pluginSiteImpl.getType());
+ }
+
+ @Test
+ public void testSetType() {
+ pluginSiteImpl.setType(PluginSiteType.USER);
+ assertEquals(PluginSiteType.USER, pluginSiteImpl.getType());
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteManagerImplTest.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteManagerImplTest.java b/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteManagerImplTest.java
new file mode 100644
index 0000000..c1d1254
--- /dev/null
+++ b/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteManagerImplTest.java
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.plugin.impl;
+
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.*;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.apache.taverna.commons.download.DownloadException;
+import org.apache.taverna.commons.download.DownloadManager;
+import org.apache.taverna.configuration.app.ApplicationConfiguration;
+import org.apache.taverna.plugin.PluginException;
+import org.apache.taverna.plugin.impl.PluginSiteManagerImpl;
+import org.apache.taverna.plugin.impl.org;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ *
+ *
+ * @author David Withers
+ */
+@Ignore
+public class PluginSiteManagerImplTest {
+
+ private PluginSiteManagerImpl pluginSiteManager;
+ private ApplicationConfiguration applicationConfiguration;
+ private DownloadManager downloadManager;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ pluginSiteManager = new PluginSiteManagerImpl();
+ applicationConfiguration = mock(ApplicationConfiguration.class);
+ }
+
+ /**
+ * Test method for {@link org.apache.taverna.plugin.impl.PluginSiteManagerImpl#PluginSiteManagerImpl()}.
+ * @throws Exception
+ */
+ @Test
+ public void testPluginSiteManagerImpl() throws Exception {
+ new PluginSiteManagerImpl();
+ }
+
+ /**
+ * Test method for {@link org.apache.taverna.plugin.impl.PluginSiteManagerImpl#getPluginSites()}.
+ */
+ @Test
+ public void testGetPluginSites() {
+ fail("Not yet implemented");
+ }
+
+ /**
+ * Test method for {@link org.apache.taverna.plugin.impl.PluginSiteManagerImpl#createPluginSite(java.net.URL)}.
+ * @throws DownloadException
+ */
+ @Test
+ public void testCreatePluginSite() throws Exception {
+ downloadManager = mock(DownloadManager.class);
+ doNothing().when(downloadManager).download(new URL("file:///"), null, "");
+
+ pluginSiteManager.setDownloadManager(downloadManager);
+
+ pluginSiteManager.createPluginSite(new URL("file:///"));
+
+ }
+
+ @Test(expected=PluginException.class)
+ public void testCreatePluginSiteDownloadException() throws Exception {
+ downloadManager = mock(DownloadManager.class);
+ doThrow(DownloadException.class).when(downloadManager).download(new URL("file:///"), null, "");
+
+ pluginSiteManager.setDownloadManager(downloadManager);
+
+ pluginSiteManager.createPluginSite(new URL("file:///"));
+ }
+
+ /**
+ * Test method for {@link org.apache.taverna.plugin.impl.PluginSiteManagerImpl#addPluginSite(org.apache.taverna.plugin.PluginSite)}.
+ */
+ @Test
+ public void testAddPluginSite() {
+ fail("Not yet implemented");
+ }
+
+ /**
+ * Test method for {@link org.apache.taverna.plugin.impl.PluginSiteManagerImpl#removePluginSite(org.apache.taverna.plugin.PluginSite)}.
+ */
+ @Test
+ public void testRemovePluginSite() {
+ fail("Not yet implemented");
+ }
+
+ /**
+ * Test method for {@link org.apache.taverna.plugin.impl.PluginSiteManagerImpl#getPlugins(org.apache.taverna.plugin.PluginSite)}.
+ */
+ @Test
+ public void testGetPlugins() {
+ fail("Not yet implemented");
+ }
+
+ /**
+ * Test method for {@link org.apache.taverna.plugin.impl.PluginSiteManagerImpl#setApplicationConfiguration(org.apache.taverna.configuration.app.ApplicationConfiguration)}.
+ */
+ @Test
+ public void testSetApplicationConfiguration() {
+ fail("Not yet implemented");
+ }
+
+ /**
+ * Test method for {@link org.apache.taverna.plugin.impl.PluginSiteManagerImpl#setDownloadManager(org.apache.taverna.commons.download.DownloadManager)}.
+ */
+ @Test
+ public void testSetDownloadManager() {
+ fail("Not yet implemented");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-impl/src/test/java/uk/org/taverna/commons/plugin/impl/PluginSiteImplTest.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/test/java/uk/org/taverna/commons/plugin/impl/PluginSiteImplTest.java b/taverna-plugin-impl/src/test/java/uk/org/taverna/commons/plugin/impl/PluginSiteImplTest.java
deleted file mode 100644
index 02ccb6e..0000000
--- a/taverna-plugin-impl/src/test/java/uk/org/taverna/commons/plugin/impl/PluginSiteImplTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package uk.org.taverna.commons.plugin.impl;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import uk.org.taverna.commons.plugin.PluginSite.PluginSiteType;
-
-public class PluginSiteImplTest {
-
- PluginSiteImpl pluginSiteImpl;
- String name, url;
- PluginSiteType type;
-
- @Before
- public void setUp() throws Exception {
- name = "test name";
- url = "test url";
- type = PluginSiteType.SYSTEM;
- pluginSiteImpl = new PluginSiteImpl(name, url, type);
- }
-
- @Test
- public void testPluginSiteImpl() {
- pluginSiteImpl = new PluginSiteImpl();
- }
-
- @Test
- public void testPluginSiteImplStringStringPluginSiteType() {
- pluginSiteImpl = new PluginSiteImpl(null, null, null);
- pluginSiteImpl = new PluginSiteImpl("", "", PluginSiteType.USER);
- }
-
- @Test
- public void testGetName() {
- assertEquals(name, pluginSiteImpl.getName());
- assertEquals(name, pluginSiteImpl.getName());
- }
-
- @Test
- public void testSetName() {
- pluginSiteImpl.setName("name");
- assertEquals("name", pluginSiteImpl.getName());
- }
-
- @Test
- public void testGetUrl() {
- assertEquals(url, pluginSiteImpl.getUrl());
- assertEquals(url, pluginSiteImpl.getUrl());
- }
-
- @Test
- public void testSetUrl() {
- pluginSiteImpl.setName("http://www.example.com/");
- assertEquals("http://www.example.com/", pluginSiteImpl.getName());
- }
-
- @Test
- public void testGetType() {
- assertEquals(type, pluginSiteImpl.getType());
- assertEquals(type, pluginSiteImpl.getType());
- }
-
- @Test
- public void testSetType() {
- pluginSiteImpl.setType(PluginSiteType.USER);
- assertEquals(PluginSiteType.USER, pluginSiteImpl.getType());
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7b43b8c7/taverna-plugin-impl/src/test/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImplTest.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/test/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImplTest.java b/taverna-plugin-impl/src/test/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImplTest.java
deleted file mode 100644
index 63e7a8b..0000000
--- a/taverna-plugin-impl/src/test/java/uk/org/taverna/commons/plugin/impl/PluginSiteManagerImplTest.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 uk.org.taverna.commons.plugin.impl;
-
-import static org.junit.Assert.*;
-import static org.mockito.Mockito.*;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.apache.taverna.commons.download.DownloadException;
-import org.apache.taverna.commons.download.DownloadManager;
-import org.apache.taverna.configuration.app.ApplicationConfiguration;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import uk.org.taverna.commons.plugin.PluginException;
-
-/**
- *
- *
- * @author David Withers
- */
-@Ignore
-public class PluginSiteManagerImplTest {
-
- private PluginSiteManagerImpl pluginSiteManager;
- private ApplicationConfiguration applicationConfiguration;
- private DownloadManager downloadManager;
-
- /**
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- pluginSiteManager = new PluginSiteManagerImpl();
- applicationConfiguration = mock(ApplicationConfiguration.class);
- }
-
- /**
- * Test method for {@link uk.org.taverna.commons.plugin.impl.PluginSiteManagerImpl#PluginSiteManagerImpl()}.
- * @throws Exception
- */
- @Test
- public void testPluginSiteManagerImpl() throws Exception {
- new PluginSiteManagerImpl();
- }
-
- /**
- * Test method for {@link uk.org.taverna.commons.plugin.impl.PluginSiteManagerImpl#getPluginSites()}.
- */
- @Test
- public void testGetPluginSites() {
- fail("Not yet implemented");
- }
-
- /**
- * Test method for {@link uk.org.taverna.commons.plugin.impl.PluginSiteManagerImpl#createPluginSite(java.net.URL)}.
- * @throws DownloadException
- */
- @Test
- public void testCreatePluginSite() throws Exception {
- downloadManager = mock(DownloadManager.class);
- doNothing().when(downloadManager).download(new URL("file:///"), null, "");
-
- pluginSiteManager.setDownloadManager(downloadManager);
-
- pluginSiteManager.createPluginSite(new URL("file:///"));
-
- }
-
- @Test(expected=PluginException.class)
- public void testCreatePluginSiteDownloadException() throws Exception {
- downloadManager = mock(DownloadManager.class);
- doThrow(DownloadException.class).when(downloadManager).download(new URL("file:///"), null, "");
-
- pluginSiteManager.setDownloadManager(downloadManager);
-
- pluginSiteManager.createPluginSite(new URL("file:///"));
- }
-
- /**
- * Test method for {@link uk.org.taverna.commons.plugin.impl.PluginSiteManagerImpl#addPluginSite(uk.org.taverna.commons.plugin.PluginSite)}.
- */
- @Test
- public void testAddPluginSite() {
- fail("Not yet implemented");
- }
-
- /**
- * Test method for {@link uk.org.taverna.commons.plugin.impl.PluginSiteManagerImpl#removePluginSite(uk.org.taverna.commons.plugin.PluginSite)}.
- */
- @Test
- public void testRemovePluginSite() {
- fail("Not yet implemented");
- }
-
- /**
- * Test method for {@link uk.org.taverna.commons.plugin.impl.PluginSiteManagerImpl#getPlugins(uk.org.taverna.commons.plugin.PluginSite)}.
- */
- @Test
- public void testGetPlugins() {
- fail("Not yet implemented");
- }
-
- /**
- * Test method for {@link uk.org.taverna.commons.plugin.impl.PluginSiteManagerImpl#setApplicationConfiguration(org.apache.taverna.configuration.app.ApplicationConfiguration)}.
- */
- @Test
- public void testSetApplicationConfiguration() {
- fail("Not yet implemented");
- }
-
- /**
- * Test method for {@link uk.org.taverna.commons.plugin.impl.PluginSiteManagerImpl#setDownloadManager(org.apache.taverna.commons.download.DownloadManager)}.
- */
- @Test
- public void testSetDownloadManager() {
- fail("Not yet implemented");
- }
-
-}
[13/17] incubator-taverna-osgi git commit:
org.apache.taverna.*.xml.jaxb in taverna-osgi-schemas
Posted by st...@apache.org.
org.apache.taverna.*.xml.jaxb in taverna-osgi-schemas
e.g.
org.apache.taverna.plugin.xml.jaxb
org.apache.taverna.profile.xml.jaxb
org.apache.taverna.versions.xml.jaxb
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/57bed300
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/57bed300
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/57bed300
Branch: refs/heads/master
Commit: 57bed3005667800861b46aef687d7b13d9aec42f
Parents: 4895df6
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Oct 18 15:26:42 2015 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Oct 18 15:26:42 2015 +0100
----------------------------------------------------------------------
.../configuration/app/ApplicationConfiguration.java | 2 +-
.../app/impl/ApplicationConfigurationImpl.java | 3 +--
.../impl/ConfigurationManagerImplTest.java | 4 +---
.../sf/taverna/t2/maven/plugins/MavenOsgiUtils.java | 2 +-
.../t2/maven/plugins/TavernaPluginDeployFileMojo.java | 9 ++++-----
.../t2/maven/plugins/TavernaPluginDeployMojo.java | 9 ++++-----
.../t2/maven/plugins/TavernaPluginGenerateMojo.java | 5 ++---
.../t2/maven/plugins/TavernaProfileDeployMojo.java | 11 +++++------
.../t2/maven/plugins/TavernaProfileGenerateMojo.java | 9 ++++-----
.../src/main/resources/ApplicationPlugin.xsd | 2 +-
.../src/main/resources/ApplicationProfile.xsd | 2 +-
.../src/main/resources/ApplicationVersions.xsd | 2 +-
.../java/org/apache/taverna/plugin/PluginManager.java | 2 +-
.../org/apache/taverna/plugin/PluginSiteManager.java | 2 +-
.../org/apache/taverna/plugin/impl/PluginImpl.java | 3 +--
.../apache/taverna/plugin/impl/PluginManagerImpl.java | 9 ++++-----
.../taverna/plugin/impl/PluginSiteManagerImpl.java | 8 ++++----
.../apache/taverna/update/impl/UpdateManagerImpl.java | 13 ++++++-------
18 files changed, 43 insertions(+), 54 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/57bed300/taverna-app-configuration-api/src/main/java/org/apache/taverna/configuration/app/ApplicationConfiguration.java
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-api/src/main/java/org/apache/taverna/configuration/app/ApplicationConfiguration.java b/taverna-app-configuration-api/src/main/java/org/apache/taverna/configuration/app/ApplicationConfiguration.java
index b71726b..a343a8a 100644
--- a/taverna-app-configuration-api/src/main/java/org/apache/taverna/configuration/app/ApplicationConfiguration.java
+++ b/taverna-app-configuration-api/src/main/java/org/apache/taverna/configuration/app/ApplicationConfiguration.java
@@ -22,7 +22,7 @@ package org.apache.taverna.configuration.app;
import java.io.File;
-import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
+import org.apache.taverna.profile.xml.jaxb.ApplicationProfile;
/**
* Represent the application config as it has been specified in
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/57bed300/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationConfigurationImpl.java b/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationConfigurationImpl.java
index 9dd1a1b..2f19a78 100644
--- a/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationConfigurationImpl.java
+++ b/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationConfigurationImpl.java
@@ -39,8 +39,7 @@ import javax.xml.bind.Unmarshaller;
import org.apache.log4j.Logger;
import org.apache.taverna.configuration.app.ApplicationConfiguration;
-
-import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
+import org.apache.taverna.profile.xml.jaxb.ApplicationProfile;
/**
* Represent the application config as it has been specified in {@value #PROPERTIES}. This
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/57bed300/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/ConfigurationManagerImplTest.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/ConfigurationManagerImplTest.java b/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/ConfigurationManagerImplTest.java
index d5034b9..a3c06ee 100644
--- a/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/ConfigurationManagerImplTest.java
+++ b/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/ConfigurationManagerImplTest.java
@@ -34,12 +34,10 @@ import org.apache.taverna.configuration.AbstractConfigurable;
import org.apache.taverna.configuration.Configurable;
import org.apache.taverna.configuration.DummyConfigurable;
import org.apache.taverna.configuration.app.ApplicationConfiguration;
-import org.apache.taverna.configuration.impl.ConfigurationManagerImpl;
+import org.apache.taverna.profile.xml.jaxb.ApplicationProfile;
import org.junit.Before;
import org.junit.Test;
-import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
-
public class ConfigurationManagerImplTest {
private File configFile;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/57bed300/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java
index 6901119..851abc1 100644
--- a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java
@@ -45,11 +45,11 @@ import org.apache.maven.project.DependencyResolutionException;
import org.apache.maven.project.DependencyResolutionResult;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectDependenciesResolver;
+import org.apache.taverna.profile.xml.jaxb.BundleInfo;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.graph.DependencyNode;
import org.eclipse.aether.util.filter.ScopeDependencyFilter;
-import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
import aQute.bnd.header.Attrs;
import aQute.bnd.header.OSGiHeader;
import aQute.bnd.header.Parameters;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/57bed300/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java
index cf2034b..43efad2 100644
--- a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java
@@ -45,11 +45,10 @@ import org.apache.maven.wagon.Wagon;
import org.apache.maven.wagon.authentication.AuthenticationException;
import org.apache.maven.wagon.observers.Debug;
import org.apache.maven.wagon.repository.Repository;
-
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginInfo;
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
-import uk.org.taverna.commons.plugin.xml.jaxb.Plugins;
-import uk.org.taverna.commons.versions.xml.jaxb.Version;
+import org.apache.taverna.plugin.xml.jaxb.PluginInfo;
+import org.apache.taverna.plugin.xml.jaxb.PluginVersions;
+import org.apache.taverna.plugin.xml.jaxb.Plugins;
+import org.apache.taverna.versions.xml.jaxb.Version;
/**
* Deploys the Taverna plugin using <code>scp</code> or <code>file</code> protocol to the site URL
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/57bed300/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java
index 8ba1f3d..d29478a 100644
--- a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java
@@ -37,11 +37,10 @@ import org.apache.maven.wagon.Wagon;
import org.apache.maven.wagon.authentication.AuthenticationException;
import org.apache.maven.wagon.observers.Debug;
import org.apache.maven.wagon.repository.Repository;
-
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginInfo;
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
-import uk.org.taverna.commons.plugin.xml.jaxb.Plugins;
-import uk.org.taverna.commons.versions.xml.jaxb.Version;
+import org.apache.taverna.plugin.xml.jaxb.PluginInfo;
+import org.apache.taverna.plugin.xml.jaxb.PluginVersions;
+import org.apache.taverna.plugin.xml.jaxb.Plugins;
+import org.apache.taverna.versions.xml.jaxb.Version;
/**
* Deploys the Taverna plugin using <code>scp</code> or <code>file</code> protocol to the site URL
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/57bed300/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java
index 0ec94f4..a5706dd 100644
--- a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java
@@ -42,11 +42,10 @@ import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectDependenciesResolver;
import org.apache.maven.shared.osgi.DefaultMaven2OsgiConverter;
import org.apache.maven.shared.osgi.Maven2OsgiConverter;
+import org.apache.taverna.plugin.xml.jaxb.PluginInfo;
+import org.apache.taverna.profile.xml.jaxb.BundleInfo;
import org.eclipse.aether.RepositorySystemSession;
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginInfo;
-import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
-
/**
* Generates a Taverna plugin definition file.
*
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/57bed300/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileDeployMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileDeployMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileDeployMojo.java
index fce4ded..4244084 100644
--- a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileDeployMojo.java
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileDeployMojo.java
@@ -41,12 +41,11 @@ import org.apache.maven.wagon.Wagon;
import org.apache.maven.wagon.authentication.AuthenticationException;
import org.apache.maven.wagon.observers.Debug;
import org.apache.maven.wagon.repository.Repository;
-
-import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
-import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
-import uk.org.taverna.commons.profile.xml.jaxb.UpdateSite;
-import uk.org.taverna.commons.versions.xml.jaxb.Version;
-import uk.org.taverna.commons.versions.xml.jaxb.Versions;
+import org.apache.taverna.profile.xml.jaxb.ApplicationProfile;
+import org.apache.taverna.profile.xml.jaxb.BundleInfo;
+import org.apache.taverna.profile.xml.jaxb.UpdateSite;
+import org.apache.taverna.versions.xml.jaxb.Version;
+import org.apache.taverna.versions.xml.jaxb.Versions;
/**
* Deploys the application profile using <code>scp</code> or <code>file</code> protocol to the site
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/57bed300/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java
index 1a0e9a0..d9330cf 100644
--- a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java
@@ -44,13 +44,12 @@ import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectDependenciesResolver;
import org.apache.maven.shared.osgi.DefaultMaven2OsgiConverter;
import org.apache.maven.shared.osgi.Maven2OsgiConverter;
+import org.apache.taverna.profile.xml.jaxb.ApplicationProfile;
+import org.apache.taverna.profile.xml.jaxb.BundleInfo;
+import org.apache.taverna.profile.xml.jaxb.FrameworkConfiguration;
+import org.apache.taverna.profile.xml.jaxb.Updates;
import org.eclipse.aether.RepositorySystemSession;
-import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
-import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
-import uk.org.taverna.commons.profile.xml.jaxb.FrameworkConfiguration;
-import uk.org.taverna.commons.profile.xml.jaxb.Updates;
-
/**
* Generates an application profile file.
*
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/57bed300/taverna-osgi-schemas/src/main/resources/ApplicationPlugin.xsd
----------------------------------------------------------------------
diff --git a/taverna-osgi-schemas/src/main/resources/ApplicationPlugin.xsd b/taverna-osgi-schemas/src/main/resources/ApplicationPlugin.xsd
index 180c8c2..8b5847d 100644
--- a/taverna-osgi-schemas/src/main/resources/ApplicationPlugin.xsd
+++ b/taverna-osgi-schemas/src/main/resources/ApplicationPlugin.xsd
@@ -10,7 +10,7 @@
<xs:annotation>
<xs:appinfo>
<jxb:schemaBindings>
- <jxb:package name="uk.org.taverna.commons.plugin.xml.jaxb" />
+ <jxb:package name="org.apache.taverna.plugin.xml.jaxb" />
</jxb:schemaBindings>
</xs:appinfo>
</xs:annotation>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/57bed300/taverna-osgi-schemas/src/main/resources/ApplicationProfile.xsd
----------------------------------------------------------------------
diff --git a/taverna-osgi-schemas/src/main/resources/ApplicationProfile.xsd b/taverna-osgi-schemas/src/main/resources/ApplicationProfile.xsd
index 78073a2..7071b19 100644
--- a/taverna-osgi-schemas/src/main/resources/ApplicationProfile.xsd
+++ b/taverna-osgi-schemas/src/main/resources/ApplicationProfile.xsd
@@ -8,7 +8,7 @@
<xs:annotation>
<xs:appinfo>
<jxb:schemaBindings>
- <jxb:package name="uk.org.taverna.commons.profile.xml.jaxb" />
+ <jxb:package name="org.apache.taverna.profile.xml.jaxb" />
</jxb:schemaBindings>
</xs:appinfo>
</xs:annotation>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/57bed300/taverna-osgi-schemas/src/main/resources/ApplicationVersions.xsd
----------------------------------------------------------------------
diff --git a/taverna-osgi-schemas/src/main/resources/ApplicationVersions.xsd b/taverna-osgi-schemas/src/main/resources/ApplicationVersions.xsd
index 706423c..768754a 100644
--- a/taverna-osgi-schemas/src/main/resources/ApplicationVersions.xsd
+++ b/taverna-osgi-schemas/src/main/resources/ApplicationVersions.xsd
@@ -8,7 +8,7 @@
<xs:annotation>
<xs:appinfo>
<jxb:schemaBindings>
- <jxb:package name="uk.org.taverna.commons.versions.xml.jaxb" />
+ <jxb:package name="org.apache.taverna.versions.xml.jaxb" />
</jxb:schemaBindings>
</xs:appinfo>
</xs:annotation>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/57bed300/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginManager.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginManager.java b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginManager.java
index 2d52d04..d550e40 100644
--- a/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginManager.java
+++ b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginManager.java
@@ -23,7 +23,7 @@ package org.apache.taverna.plugin;
import java.io.File;
import java.util.List;
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
+import org.apache.taverna.plugin.xml.jaxb.PluginVersions;
/**
* Manages installing plugins and checking for plugin updates.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/57bed300/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSiteManager.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSiteManager.java b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSiteManager.java
index fd7820d..6e7bd30 100644
--- a/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSiteManager.java
+++ b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSiteManager.java
@@ -23,7 +23,7 @@ package org.apache.taverna.plugin;
import java.net.URL;
import java.util.List;
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
+import org.apache.taverna.plugin.xml.jaxb.PluginVersions;
/**
* Manages plugin sites.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/57bed300/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginImpl.java b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginImpl.java
index 056a67f..9958092 100644
--- a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginImpl.java
+++ b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginImpl.java
@@ -33,13 +33,12 @@ import java.util.Set;
import org.apache.log4j.Logger;
import org.apache.taverna.plugin.Plugin;
import org.apache.taverna.plugin.PluginException;
+import org.apache.taverna.plugin.xml.jaxb.PluginInfo;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
import org.osgi.framework.Version;
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginInfo;
-
/**
* @author David Withers
*/
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/57bed300/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginManagerImpl.java b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginManagerImpl.java
index e349909..85f2727 100644
--- a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginManagerImpl.java
+++ b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginManagerImpl.java
@@ -44,11 +44,14 @@ import org.apache.taverna.configuration.app.ApplicationConfiguration;
import org.apache.taverna.download.DownloadException;
import org.apache.taverna.download.DownloadManager;
import org.apache.taverna.plugin.Plugin;
+import org.apache.taverna.plugin.Plugin.State;
import org.apache.taverna.plugin.PluginException;
import org.apache.taverna.plugin.PluginManager;
import org.apache.taverna.plugin.PluginSite;
import org.apache.taverna.plugin.PluginSiteManager;
-import org.apache.taverna.plugin.Plugin.State;
+import org.apache.taverna.plugin.xml.jaxb.PluginInfo;
+import org.apache.taverna.plugin.xml.jaxb.PluginVersions;
+import org.apache.taverna.profile.xml.jaxb.BundleInfo;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@@ -56,10 +59,6 @@ import org.osgi.framework.Version;
import org.osgi.service.event.Event;
import org.osgi.service.event.EventAdmin;
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginInfo;
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
-import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
-
/**
* PluginManager implementation.
*
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/57bed300/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteManagerImpl.java b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteManagerImpl.java
index 712c103..5643182 100644
--- a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteManagerImpl.java
+++ b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteManagerImpl.java
@@ -38,12 +38,12 @@ import org.apache.taverna.download.DownloadException;
import org.apache.taverna.download.DownloadManager;
import org.apache.taverna.plugin.PluginException;
import org.apache.taverna.plugin.PluginSite;
-import org.apache.taverna.plugin.PluginSiteManager;
import org.apache.taverna.plugin.PluginSite.PluginSiteType;
+import org.apache.taverna.plugin.PluginSiteManager;
+import org.apache.taverna.plugin.xml.jaxb.PluginVersions;
+import org.apache.taverna.plugin.xml.jaxb.Plugins;
+import org.apache.taverna.profile.xml.jaxb.Updates;
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
-import uk.org.taverna.commons.plugin.xml.jaxb.Plugins;
-import uk.org.taverna.commons.profile.xml.jaxb.Updates;
/**
* PluginSiteManager implementation.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/57bed300/taverna-update-impl/src/main/java/org/apache/taverna/update/impl/UpdateManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-update-impl/src/main/java/org/apache/taverna/update/impl/UpdateManagerImpl.java b/taverna-update-impl/src/main/java/org/apache/taverna/update/impl/UpdateManagerImpl.java
index 81396d1..55113fb 100644
--- a/taverna-update-impl/src/main/java/org/apache/taverna/update/impl/UpdateManagerImpl.java
+++ b/taverna-update-impl/src/main/java/org/apache/taverna/update/impl/UpdateManagerImpl.java
@@ -39,17 +39,16 @@ import org.apache.commons.io.FileUtils;
import org.apache.taverna.configuration.app.ApplicationConfiguration;
import org.apache.taverna.download.DownloadException;
import org.apache.taverna.download.DownloadManager;
+import org.apache.taverna.profile.xml.jaxb.ApplicationProfile;
+import org.apache.taverna.profile.xml.jaxb.BundleInfo;
+import org.apache.taverna.profile.xml.jaxb.UpdateSite;
+import org.apache.taverna.profile.xml.jaxb.Updates;
import org.apache.taverna.update.UpdateException;
import org.apache.taverna.update.UpdateManager;
+import org.apache.taverna.versions.xml.jaxb.Version;
+import org.apache.taverna.versions.xml.jaxb.Versions;
import org.osgi.service.event.EventAdmin;
-import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
-import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
-import uk.org.taverna.commons.profile.xml.jaxb.UpdateSite;
-import uk.org.taverna.commons.profile.xml.jaxb.Updates;
-import uk.org.taverna.commons.versions.xml.jaxb.Version;
-import uk.org.taverna.commons.versions.xml.jaxb.Versions;
-
/**
* Implementation of the Taverna Update Manager.
*
[14/17] incubator-taverna-osgi git commit: README: describe modules
Posted by st...@apache.org.
README: describe modules
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/ec75650b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/ec75650b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/ec75650b
Branch: refs/heads/master
Commit: ec75650b933315f35251b9fbbef54948487e5c5f
Parents: 57bed30
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Oct 18 16:29:59 2015 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Oct 18 16:30:05 2015 +0100
----------------------------------------------------------------------
README.md | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/ec75650b/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 81d135a..55ad19c 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,6 @@ probably usable for any OSGi-based command line/desktop product.
## License
(c) 2007-2014 University of Manchester
-
(c) 2014-2015 Apache Software Foundation
This product includes software developed at The [Apache Software
@@ -104,3 +103,27 @@ Apache Taverna project, you may not want to run the
that enforces Apache headers in every source file - to disable it, try:
mvn clean install -Drat.skip=true
+
+# Modules
+
+The Taverna OSGi modules are split into `-api` and `-impl`. `-api` contain
+Java interfaces and abstract classes and minimal dependencies, while `-impl`
+contain the corresponding implementation(s).
+
+* [taverna-app-configuration-api](taverna-app-configuration-api/) - Apache Taverna Application Configuration API
+* [taverna-app-configuration-impl](taverna-app-configuration-impl/) - Apache Taverna Application Configuration implementation
+* [taverna-configuration-api](taverna-configuration-api/) - Apache Taverna Configuration API
+* [taverna-configuration-impl](taverna-configuration-impl/) - Apache Taverna Configuration implementation
+* [taverna-download-api](taverna-download-api/) - Apache Taverna Download API
+* [taverna-download-impl](taverna-download-impl/) - Apache Taverna Download implementation
+* [taverna-maven-plugin](taverna-maven-plugin/) - Apache Taverna Maven plugin for packaging and deploying Taverna plugins
+* [taverna-osgi-schemas](taverna-osgi-schemas/) - Apache Taverna Taverna's OSGi XML schemas and JAXB bindings
+* [taverna-plugin-api](taverna-plugin-api/) - Apache Taverna Plugin API
+* [taverna-plugin-impl](taverna-plugin-impl/) - Apache Taverna Plugin implementation
+* [taverna-update-api](taverna-update-api/) - Apache Taverna Update API
+* [taverna-update-impl](taverna-update-impl/) - Apache Taverna Update implementation
+* [osgi-launcher](osgi-launcher/) - Apache Taverna OSGi Framework Launcher
+* [xml-parser-service](xml-parser-service/) - Apache Taverna XML Parser Service for OSGi
+* [xml-transformer-service](xml-transformer-service/) - Apache Taverna XML Transformer Service for OSGi
+
+
[08/17] incubator-taverna-osgi git commit:
org.apache.taverna.commons.download -> org.apache.taverna.download
Posted by st...@apache.org.
org.apache.taverna.commons.download -> org.apache.taverna.download
..to avoid confusion with Apache Commons
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/16a55174
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/16a55174
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/16a55174
Branch: refs/heads/master
Commit: 16a5517433099c01d02442ccbd6a8d3a90d4c2b3
Parents: 7b43b8c
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Oct 18 13:33:54 2015 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Oct 18 13:33:54 2015 +0100
----------------------------------------------------------------------
.../commons/download/DownloadException.java | 45 -------
.../commons/download/DownloadManager.java | 116 ------------------
.../taverna/download/DownloadException.java | 45 +++++++
.../taverna/download/DownloadManager.java | 116 ++++++++++++++++++
taverna-download-impl/pom.xml | 2 +-
.../download/impl/DownloadManagerImpl.java | 119 -------------------
.../download/impl/DownloadManagerImpl.java | 119 +++++++++++++++++++
.../META-INF/spring/download-context-osgi.xml | 2 +-
.../META-INF/spring/download-context.xml | 2 +-
.../taverna/plugin/impl/PluginManagerImpl.java | 4 +-
.../plugin/impl/PluginSiteManagerImpl.java | 4 +-
.../META-INF/spring/plugin-context-osgi.xml | 2 +-
.../plugin/impl/PluginSiteManagerImplTest.java | 6 +-
.../commons/update/impl/UpdateManagerImpl.java | 4 +-
.../META-INF/spring/update-context-osgi.xml | 2 +-
15 files changed, 294 insertions(+), 294 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/16a55174/taverna-download-api/src/main/java/org/apache/taverna/commons/download/DownloadException.java
----------------------------------------------------------------------
diff --git a/taverna-download-api/src/main/java/org/apache/taverna/commons/download/DownloadException.java b/taverna-download-api/src/main/java/org/apache/taverna/commons/download/DownloadException.java
deleted file mode 100644
index b394ec0..0000000
--- a/taverna-download-api/src/main/java/org/apache/taverna/commons/download/DownloadException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 org.apache.taverna.commons.download;
-
-/**
- *
- *
- * @author David Withers
- */
-public class DownloadException extends Exception {
-
- public DownloadException() {
- }
-
- public DownloadException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public DownloadException(String message) {
- super(message);
- }
-
- public DownloadException(Throwable cause) {
- super(cause);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/16a55174/taverna-download-api/src/main/java/org/apache/taverna/commons/download/DownloadManager.java
----------------------------------------------------------------------
diff --git a/taverna-download-api/src/main/java/org/apache/taverna/commons/download/DownloadManager.java b/taverna-download-api/src/main/java/org/apache/taverna/commons/download/DownloadManager.java
deleted file mode 100644
index f0f406a..0000000
--- a/taverna-download-api/src/main/java/org/apache/taverna/commons/download/DownloadManager.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 org.apache.taverna.commons.download;
-
-import java.io.File;
-import java.net.URL;
-
-/**
- * Download Manager for handling file download and checking the integrity of the download.
- *
- * @author David Withers
- */
-public interface DownloadManager {
-
- /**
- * Downloads a file from a URL.
- * <p>
- * The destination file will be created if it does not exist. If it does exist it will be
- * overwritten.
- *
- * @param source
- * the file to download
- * @param destination
- * the file to write to
- * @throws DownloadException
- * if
- * <ul>
- * <li>the source does not exist</li> <li>the source cannot be downloaded</li> <li>
- * the destination is not a file</li> <li>the destination cannot be written to</li>
- * </ul>
- */
- public void download(URL source, File destination) throws DownloadException;
-
- /**
- * Downloads a file from a URL and checks the integrity of the download by downloading and
- * verifying the a checksum using the specified algorithm.
- * <p>
- * Every implementation is required to support the following standard algorithms:
- * <ul>
- * <li>MD5</li>
- * <li>SHA-1</li>
- * <li>SHA-256</li>
- * </ul>
- * <p>
- * The checksum source will be calculated by appending the algorithm name to the source. e.g.
- * for an MD5 algorithm and a source of http://www.example.com/test.xml the checksum will be
- * downloaded from http://www.example.com/test.xml.md5
- *
- * @param source
- * the file to download
- * @param destination
- * the file to write to
- * @param digestAlgorithm
- * the digest algorithm to use
- * @throws DownloadException
- * if
- * <ul>
- * <li>the source does not exist</li> <li>the digest source does not exist</li> <li>
- * the source cannot be downloaded</li> <li>the destination cannot be written to
- * </li> <li>the destination is not a file</li> <li>the checksums do no match</li>
- * </ul>
- */
- public void download(URL source, File destination, String digestAlgorithm)
- throws DownloadException;
-
- /**
- * Downloads a file from a URL and checks the integrity of the download by downloading and
- * verifying the a checksum using the specified algorithm.
- * <p>
- * Every implementation is required to support the following standard algorithms:
- * <ul>
- * <li>MD5</li>
- * <li>SHA-1</li>
- * <li>SHA-256</li>
- * </ul>
- * <p>
- *
- * @param source
- * the file to download
- * @param destination
- * the file to write to
- * @param digestAlgorithm
- * the digest algorithm to use
- * @param digestSource
- * the digest file to check
- * @throws DownloadException
- * if
- * <ul>
- * <li>the source does not exist</li> <li>the digest source does not exist</li>
- * <li> the source cannot be downloaded</li> <li>the destination cannot be
- * written to</li> <li>the destination is not a file</li> <li>the digestSource
- * does not exist</li> <li>the checksums do no match</li>
- * </ul>
- */
- public void download(URL source, File destination, String digestAlgorithm, URL digestSource)
- throws DownloadException;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/16a55174/taverna-download-api/src/main/java/org/apache/taverna/download/DownloadException.java
----------------------------------------------------------------------
diff --git a/taverna-download-api/src/main/java/org/apache/taverna/download/DownloadException.java b/taverna-download-api/src/main/java/org/apache/taverna/download/DownloadException.java
new file mode 100644
index 0000000..483b5d1
--- /dev/null
+++ b/taverna-download-api/src/main/java/org/apache/taverna/download/DownloadException.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.download;
+
+/**
+ *
+ *
+ * @author David Withers
+ */
+public class DownloadException extends Exception {
+
+ public DownloadException() {
+ }
+
+ public DownloadException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public DownloadException(String message) {
+ super(message);
+ }
+
+ public DownloadException(Throwable cause) {
+ super(cause);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/16a55174/taverna-download-api/src/main/java/org/apache/taverna/download/DownloadManager.java
----------------------------------------------------------------------
diff --git a/taverna-download-api/src/main/java/org/apache/taverna/download/DownloadManager.java b/taverna-download-api/src/main/java/org/apache/taverna/download/DownloadManager.java
new file mode 100644
index 0000000..76e4608
--- /dev/null
+++ b/taverna-download-api/src/main/java/org/apache/taverna/download/DownloadManager.java
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.download;
+
+import java.io.File;
+import java.net.URL;
+
+/**
+ * Download Manager for handling file download and checking the integrity of the download.
+ *
+ * @author David Withers
+ */
+public interface DownloadManager {
+
+ /**
+ * Downloads a file from a URL.
+ * <p>
+ * The destination file will be created if it does not exist. If it does exist it will be
+ * overwritten.
+ *
+ * @param source
+ * the file to download
+ * @param destination
+ * the file to write to
+ * @throws DownloadException
+ * if
+ * <ul>
+ * <li>the source does not exist</li> <li>the source cannot be downloaded</li> <li>
+ * the destination is not a file</li> <li>the destination cannot be written to</li>
+ * </ul>
+ */
+ public void download(URL source, File destination) throws DownloadException;
+
+ /**
+ * Downloads a file from a URL and checks the integrity of the download by downloading and
+ * verifying the a checksum using the specified algorithm.
+ * <p>
+ * Every implementation is required to support the following standard algorithms:
+ * <ul>
+ * <li>MD5</li>
+ * <li>SHA-1</li>
+ * <li>SHA-256</li>
+ * </ul>
+ * <p>
+ * The checksum source will be calculated by appending the algorithm name to the source. e.g.
+ * for an MD5 algorithm and a source of http://www.example.com/test.xml the checksum will be
+ * downloaded from http://www.example.com/test.xml.md5
+ *
+ * @param source
+ * the file to download
+ * @param destination
+ * the file to write to
+ * @param digestAlgorithm
+ * the digest algorithm to use
+ * @throws DownloadException
+ * if
+ * <ul>
+ * <li>the source does not exist</li> <li>the digest source does not exist</li> <li>
+ * the source cannot be downloaded</li> <li>the destination cannot be written to
+ * </li> <li>the destination is not a file</li> <li>the checksums do no match</li>
+ * </ul>
+ */
+ public void download(URL source, File destination, String digestAlgorithm)
+ throws DownloadException;
+
+ /**
+ * Downloads a file from a URL and checks the integrity of the download by downloading and
+ * verifying the a checksum using the specified algorithm.
+ * <p>
+ * Every implementation is required to support the following standard algorithms:
+ * <ul>
+ * <li>MD5</li>
+ * <li>SHA-1</li>
+ * <li>SHA-256</li>
+ * </ul>
+ * <p>
+ *
+ * @param source
+ * the file to download
+ * @param destination
+ * the file to write to
+ * @param digestAlgorithm
+ * the digest algorithm to use
+ * @param digestSource
+ * the digest file to check
+ * @throws DownloadException
+ * if
+ * <ul>
+ * <li>the source does not exist</li> <li>the digest source does not exist</li>
+ * <li> the source cannot be downloaded</li> <li>the destination cannot be
+ * written to</li> <li>the destination is not a file</li> <li>the digestSource
+ * does not exist</li> <li>the checksums do no match</li>
+ * </ul>
+ */
+ public void download(URL source, File destination, String digestAlgorithm, URL digestSource)
+ throws DownloadException;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/16a55174/taverna-download-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-download-impl/pom.xml b/taverna-download-impl/pom.xml
index 5c660f3..c8e6196 100644
--- a/taverna-download-impl/pom.xml
+++ b/taverna-download-impl/pom.xml
@@ -16,7 +16,7 @@
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
- <Import-Package>org.apache.taverna.commons.download;provide:=true,*</Import-Package>
+ <Import-Package>org.apache.taverna.download;provide:=true,*</Import-Package>
</instructions>
</configuration>
</plugin>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/16a55174/taverna-download-impl/src/main/java/org/apache/taverna/commons/download/impl/DownloadManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-download-impl/src/main/java/org/apache/taverna/commons/download/impl/DownloadManagerImpl.java b/taverna-download-impl/src/main/java/org/apache/taverna/commons/download/impl/DownloadManagerImpl.java
deleted file mode 100644
index 48358fc..0000000
--- a/taverna-download-impl/src/main/java/org/apache/taverna/commons/download/impl/DownloadManagerImpl.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 org.apache.taverna.commons.download.impl;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.commons.io.FileUtils;
-import org.apache.log4j.Logger;
-import org.apache.taverna.commons.download.DownloadException;
-import org.apache.taverna.commons.download.DownloadManager;
-
-/**
- *
- *
- * @author David Withers
- */
-public class DownloadManagerImpl implements DownloadManager {
-
- private static final Logger logger = Logger.getLogger(DownloadManagerImpl.class);
-
- public void download(URL source, File destination) throws DownloadException {
- download(source, destination, null);
- }
-
- public void download(URL source, File destination, String digestAlgorithm) throws DownloadException {
- // TODO Use MessageDigest when Java 7 available
- if (digestAlgorithm != null && !digestAlgorithm.equals("MD5")) {
- throw new IllegalArgumentException("Only MD5 supported");
- }
- URL digestSource = null;
- if (digestAlgorithm != null) {
- try {
- digestSource = new URL(source.toString() + mapAlgorithmToFileExtension(digestAlgorithm));
- } catch (MalformedURLException e) {
- throw new DownloadException("Error creating digest URL", e);
- }
- }
- download(source, destination, digestAlgorithm, digestSource);
- }
-
- public void download(URL source, File destination, String digestAlgorithm, URL digestSource)
- throws DownloadException {
- // TODO Use MessageDigest when Java 7 available
- if (digestAlgorithm != null && !digestAlgorithm.equals("MD5")) {
- throw new IllegalArgumentException("Only MD5 supported");
- }
- // download the file
- File tempFile;
- try {
- tempFile = File.createTempFile("DownloadManager", "tmp");
- tempFile.deleteOnExit();
- logger.info(String.format("Downloading %1$s to %2$s", source, tempFile));
- FileUtils.copyURLToFile(source, tempFile, 30, 30);
- } catch (IOException e) {
- throw new DownloadException(String.format("Error downloading %1$s to %2$s.", source, destination), e);
- }
- if (digestSource != null) {
- // download the digest file
- File digestFile;
- try {
- digestFile = File.createTempFile("DownloadManager", "tmp");
- digestFile.deleteOnExit();
- logger.info(String.format("Downloading %1$s to %2$s", digestSource, digestFile));
- FileUtils.copyURLToFile(digestSource, digestFile, 30, 30);
- } catch (IOException e) {
- throw new DownloadException(String.format("Error checking digest for %1$s.", source), e);
- }
- // check the digest matches
- try {
- String digestString1 = DigestUtils.md5Hex(new FileInputStream(tempFile));
- String digestString2 = FileUtils.readFileToString(digestFile);
- if (!digestString1.equals(digestString2)) {
- throw new DownloadException(String.format(
- "Error downloading file: digsests not equal. (%1$s != %2$s)",
- digestString1, digestString2));
- }
- } catch (IOException e) {
- throw new DownloadException(String.format("Error checking digest for %1$s", destination),
- e);
- }
- }
- // copy file to destination
- try {
- logger.info(String.format("Copying %1$s to %2$s", tempFile, destination));
- FileUtils.copyFile(tempFile, destination);
- } catch (IOException e) {
- throw new DownloadException(String.format("Error downloading %1$s to %2$s.", source, destination), e);
- }
-
- }
-
- private String mapAlgorithmToFileExtension(String algorithm) {
- return "." + algorithm.toLowerCase().replaceAll("-", "");
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/16a55174/taverna-download-impl/src/main/java/org/apache/taverna/download/impl/DownloadManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-download-impl/src/main/java/org/apache/taverna/download/impl/DownloadManagerImpl.java b/taverna-download-impl/src/main/java/org/apache/taverna/download/impl/DownloadManagerImpl.java
new file mode 100644
index 0000000..1d6adee
--- /dev/null
+++ b/taverna-download-impl/src/main/java/org/apache/taverna/download/impl/DownloadManagerImpl.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.download.impl;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.io.FileUtils;
+import org.apache.log4j.Logger;
+import org.apache.taverna.download.DownloadException;
+import org.apache.taverna.download.DownloadManager;
+
+/**
+ *
+ *
+ * @author David Withers
+ */
+public class DownloadManagerImpl implements DownloadManager {
+
+ private static final Logger logger = Logger.getLogger(DownloadManagerImpl.class);
+
+ public void download(URL source, File destination) throws DownloadException {
+ download(source, destination, null);
+ }
+
+ public void download(URL source, File destination, String digestAlgorithm) throws DownloadException {
+ // TODO Use MessageDigest when Java 7 available
+ if (digestAlgorithm != null && !digestAlgorithm.equals("MD5")) {
+ throw new IllegalArgumentException("Only MD5 supported");
+ }
+ URL digestSource = null;
+ if (digestAlgorithm != null) {
+ try {
+ digestSource = new URL(source.toString() + mapAlgorithmToFileExtension(digestAlgorithm));
+ } catch (MalformedURLException e) {
+ throw new DownloadException("Error creating digest URL", e);
+ }
+ }
+ download(source, destination, digestAlgorithm, digestSource);
+ }
+
+ public void download(URL source, File destination, String digestAlgorithm, URL digestSource)
+ throws DownloadException {
+ // TODO Use MessageDigest when Java 7 available
+ if (digestAlgorithm != null && !digestAlgorithm.equals("MD5")) {
+ throw new IllegalArgumentException("Only MD5 supported");
+ }
+ // download the file
+ File tempFile;
+ try {
+ tempFile = File.createTempFile("DownloadManager", "tmp");
+ tempFile.deleteOnExit();
+ logger.info(String.format("Downloading %1$s to %2$s", source, tempFile));
+ FileUtils.copyURLToFile(source, tempFile, 30, 30);
+ } catch (IOException e) {
+ throw new DownloadException(String.format("Error downloading %1$s to %2$s.", source, destination), e);
+ }
+ if (digestSource != null) {
+ // download the digest file
+ File digestFile;
+ try {
+ digestFile = File.createTempFile("DownloadManager", "tmp");
+ digestFile.deleteOnExit();
+ logger.info(String.format("Downloading %1$s to %2$s", digestSource, digestFile));
+ FileUtils.copyURLToFile(digestSource, digestFile, 30, 30);
+ } catch (IOException e) {
+ throw new DownloadException(String.format("Error checking digest for %1$s.", source), e);
+ }
+ // check the digest matches
+ try {
+ String digestString1 = DigestUtils.md5Hex(new FileInputStream(tempFile));
+ String digestString2 = FileUtils.readFileToString(digestFile);
+ if (!digestString1.equals(digestString2)) {
+ throw new DownloadException(String.format(
+ "Error downloading file: digsests not equal. (%1$s != %2$s)",
+ digestString1, digestString2));
+ }
+ } catch (IOException e) {
+ throw new DownloadException(String.format("Error checking digest for %1$s", destination),
+ e);
+ }
+ }
+ // copy file to destination
+ try {
+ logger.info(String.format("Copying %1$s to %2$s", tempFile, destination));
+ FileUtils.copyFile(tempFile, destination);
+ } catch (IOException e) {
+ throw new DownloadException(String.format("Error downloading %1$s to %2$s.", source, destination), e);
+ }
+
+ }
+
+ private String mapAlgorithmToFileExtension(String algorithm) {
+ return "." + algorithm.toLowerCase().replaceAll("-", "");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/16a55174/taverna-download-impl/src/main/resources/META-INF/spring/download-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-download-impl/src/main/resources/META-INF/spring/download-context-osgi.xml b/taverna-download-impl/src/main/resources/META-INF/spring/download-context-osgi.xml
index 7db9625..3bf3756 100644
--- a/taverna-download-impl/src/main/resources/META-INF/spring/download-context-osgi.xml
+++ b/taverna-download-impl/src/main/resources/META-INF/spring/download-context-osgi.xml
@@ -6,6 +6,6 @@
http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd">
- <service ref="downloadManager" interface="org.apache.taverna.commons.download.DownloadManager" />
+ <service ref="downloadManager" interface="org.apache.taverna.download.DownloadManager" />
</beans:beans>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/16a55174/taverna-download-impl/src/main/resources/META-INF/spring/download-context.xml
----------------------------------------------------------------------
diff --git a/taverna-download-impl/src/main/resources/META-INF/spring/download-context.xml b/taverna-download-impl/src/main/resources/META-INF/spring/download-context.xml
index ff0394f..500f979 100644
--- a/taverna-download-impl/src/main/resources/META-INF/spring/download-context.xml
+++ b/taverna-download-impl/src/main/resources/META-INF/spring/download-context.xml
@@ -4,6 +4,6 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
- <bean id="downloadManager" class="org.apache.taverna.commons.download.impl.DownloadManagerImpl" />
+ <bean id="downloadManager" class="org.apache.taverna.download.impl.DownloadManagerImpl" />
</beans>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/16a55174/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginManagerImpl.java b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginManagerImpl.java
index 08afbba..e349909 100644
--- a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginManagerImpl.java
+++ b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginManagerImpl.java
@@ -40,9 +40,9 @@ import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import org.apache.log4j.Logger;
-import org.apache.taverna.commons.download.DownloadException;
-import org.apache.taverna.commons.download.DownloadManager;
import org.apache.taverna.configuration.app.ApplicationConfiguration;
+import org.apache.taverna.download.DownloadException;
+import org.apache.taverna.download.DownloadManager;
import org.apache.taverna.plugin.Plugin;
import org.apache.taverna.plugin.PluginException;
import org.apache.taverna.plugin.PluginManager;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/16a55174/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteManagerImpl.java b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteManagerImpl.java
index bc6852a..712c103 100644
--- a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteManagerImpl.java
+++ b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteManagerImpl.java
@@ -33,9 +33,9 @@ import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import org.apache.log4j.Logger;
-import org.apache.taverna.commons.download.DownloadException;
-import org.apache.taverna.commons.download.DownloadManager;
import org.apache.taverna.configuration.app.ApplicationConfiguration;
+import org.apache.taverna.download.DownloadException;
+import org.apache.taverna.download.DownloadManager;
import org.apache.taverna.plugin.PluginException;
import org.apache.taverna.plugin.PluginSite;
import org.apache.taverna.plugin.PluginSiteManager;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/16a55174/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml b/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml
index b974991..3643318 100644
--- a/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml
+++ b/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml
@@ -10,7 +10,7 @@
<service ref="pluginSiteManager" interface="org.apache.taverna.plugin.PluginSiteManager" />
<reference id="applicationConfiguration" interface="org.apache.taverna.configuration.app.ApplicationConfiguration" />
- <reference id="downloadManager" interface="org.apache.taverna.commons.download.DownloadManager" />
+ <reference id="downloadManager" interface="org.apache.taverna.download.DownloadManager" />
<reference id="eventAdmin" interface="org.osgi.service.event.EventAdmin" />
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/16a55174/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteManagerImplTest.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteManagerImplTest.java b/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteManagerImplTest.java
index c1d1254..2083283 100644
--- a/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteManagerImplTest.java
+++ b/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteManagerImplTest.java
@@ -27,9 +27,9 @@ import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
-import org.apache.taverna.commons.download.DownloadException;
-import org.apache.taverna.commons.download.DownloadManager;
import org.apache.taverna.configuration.app.ApplicationConfiguration;
+import org.apache.taverna.download.DownloadException;
+import org.apache.taverna.download.DownloadManager;
import org.apache.taverna.plugin.PluginException;
import org.apache.taverna.plugin.impl.PluginSiteManagerImpl;
import org.apache.taverna.plugin.impl.org;
@@ -133,7 +133,7 @@ public class PluginSiteManagerImplTest {
}
/**
- * Test method for {@link org.apache.taverna.plugin.impl.PluginSiteManagerImpl#setDownloadManager(org.apache.taverna.commons.download.DownloadManager)}.
+ * Test method for {@link org.apache.taverna.plugin.impl.PluginSiteManagerImpl#setDownloadManager(org.apache.taverna.download.DownloadManager)}.
*/
@Test
public void testSetDownloadManager() {
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/16a55174/taverna-update-impl/src/main/java/uk/org/taverna/commons/update/impl/UpdateManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-update-impl/src/main/java/uk/org/taverna/commons/update/impl/UpdateManagerImpl.java b/taverna-update-impl/src/main/java/uk/org/taverna/commons/update/impl/UpdateManagerImpl.java
index bda904c..59a536d 100644
--- a/taverna-update-impl/src/main/java/uk/org/taverna/commons/update/impl/UpdateManagerImpl.java
+++ b/taverna-update-impl/src/main/java/uk/org/taverna/commons/update/impl/UpdateManagerImpl.java
@@ -36,9 +36,9 @@ import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import org.apache.commons.io.FileUtils;
-import org.apache.taverna.commons.download.DownloadException;
-import org.apache.taverna.commons.download.DownloadManager;
import org.apache.taverna.configuration.app.ApplicationConfiguration;
+import org.apache.taverna.download.DownloadException;
+import org.apache.taverna.download.DownloadManager;
import org.osgi.service.event.EventAdmin;
import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/16a55174/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml b/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml
index e042cb3..663bae4 100644
--- a/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml
+++ b/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml
@@ -9,7 +9,7 @@
<service ref="updateManager" interface="uk.org.taverna.commons.update.UpdateManager" />
<reference id="applicationConfiguration" interface="org.apache.taverna.configuration.app.ApplicationConfiguration" />
- <reference id="downloadManager" interface="org.apache.taverna.commons.download.DownloadManager" />
+ <reference id="downloadManager" interface="org.apache.taverna.download.DownloadManager" />
<!-- <reference id="eventAdmin" interface="org.osgi.service.event.EventAdmin" /> -->
[17/17] incubator-taverna-osgi git commit: Apache license file headers
Posted by st...@apache.org.
Apache license file headers
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/84b5025d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/84b5025d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/84b5025d
Branch: refs/heads/master
Commit: 84b5025db831b3d0cae8276cfc686958e9a2d3f8
Parents: ec75650
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Oct 18 16:36:56 2015 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Oct 18 16:36:56 2015 +0100
----------------------------------------------------------------------
.travis.yml | 14 ++++++++
osgi-launcher/pom.xml | 18 ++++++++++
.../taverna/osgilauncher/OsgiLauncher.java | 32 ++++++++---------
pom.xml | 18 ++++++++++
taverna-app-configuration-api/pom.xml | 18 ++++++++++
.../app/ApplicationConfiguration.java | 32 ++++++++---------
taverna-app-configuration-impl/pom.xml | 18 ++++++++++
.../app/impl/ApplicationConfigurationImpl.java | 32 ++++++++---------
.../app/impl/ApplicationUserHome.java | 32 ++++++++---------
.../app/impl/Log4JConfiguration.java | 32 ++++++++---------
.../spring/configuration-context-osgi.xml | 18 ++++++++++
.../META-INF/spring/configuration-context.xml | 18 ++++++++++
taverna-configuration-api/pom.xml | 18 ++++++++++
.../configuration/AbstractConfigurable.java | 32 ++++++++---------
.../taverna/configuration/Configurable.java | 36 +++++++++-----------
.../configuration/ConfigurationManager.java | 32 ++++++++---------
.../configuration/ConfigurationUIFactory.java | 36 +++++++++-----------
.../apache/taverna/configuration/package.html | 18 ++++++++++
.../proxy/HttpProxyConfiguration.java | 32 ++++++++---------
.../configuration/AbstractConfigurableTest.java | 32 ++++++++---------
.../configuration/DummyConfigurable.java | 32 ++++++++---------
taverna-configuration-impl/pom.xml | 18 ++++++++++
.../impl/ConfigurationManagerImpl.java | 32 ++++++++---------
.../proxy/impl/HttpProxyConfigurationImpl.java | 32 ++++++++---------
.../spring/configuration-context-osgi.xml | 18 ++++++++++
.../META-INF/spring/configuration-context.xml | 18 ++++++++++
.../impl/ConfigurationManagerImplTest.java | 32 ++++++++---------
.../configuration/impl/DummyUIFactory1.java | 32 ++++++++---------
.../configuration/impl/DummyUIFactory2.java | 32 ++++++++---------
taverna-download-api/pom.xml | 18 ++++++++++
.../taverna/download/DownloadException.java | 32 ++++++++---------
.../taverna/download/DownloadManager.java | 32 ++++++++---------
taverna-download-impl/pom.xml | 18 ++++++++++
.../download/impl/DownloadManagerImpl.java | 32 ++++++++---------
.../META-INF/spring/download-context-osgi.xml | 18 ++++++++++
.../META-INF/spring/download-context.xml | 18 ++++++++++
taverna-maven-plugin/pom.xml | 18 ++++++++++
.../t2/maven/plugins/AbstractDeployMojo.java | 32 ++++++++---------
.../t2/maven/plugins/AbstractWagonMojo.java | 32 ++++++++---------
.../t2/maven/plugins/BundleArtifact.java | 32 ++++++++---------
.../t2/maven/plugins/MavenOsgiUtils.java | 32 ++++++++---------
.../sf/taverna/t2/maven/plugins/Package.java | 32 ++++++++---------
.../t2/maven/plugins/PackageVersion.java | 32 ++++++++---------
.../plugins/TavernaPluginDeployFileMojo.java | 32 ++++++++---------
.../maven/plugins/TavernaPluginDeployMojo.java | 32 ++++++++---------
.../plugins/TavernaPluginGenerateMojo.java | 32 ++++++++---------
.../TavernaPluginPrepareBundlesMojo.java | 32 ++++++++---------
.../maven/plugins/TavernaProfileDeployMojo.java | 32 ++++++++---------
.../plugins/TavernaProfileGenerateMojo.java | 32 ++++++++---------
.../net/sf/taverna/t2/maven/plugins/Utils.java | 32 ++++++++---------
.../resources/META-INF/plexus/components.xml | 18 ++++++++++
.../plugins/TavernaPluginGenerateMojoTest.java | 32 ++++++++---------
.../src/test/resources/unit/plugin-config.xml | 18 ++++++++++
taverna-osgi-schemas/pom.xml | 18 ++++++++++
.../src/main/resources/ApplicationPlugin.xsd | 18 ++++++++++
.../src/main/resources/ApplicationProfile.xsd | 18 ++++++++++
.../src/main/resources/ApplicationVersions.xsd | 18 ++++++++++
taverna-plugin-api/pom.xml | 18 ++++++++++
.../java/org/apache/taverna/plugin/Plugin.java | 32 ++++++++---------
.../apache/taverna/plugin/PluginException.java | 32 ++++++++---------
.../apache/taverna/plugin/PluginManager.java | 32 ++++++++---------
.../org/apache/taverna/plugin/PluginSite.java | 32 ++++++++---------
.../taverna/plugin/PluginSiteManager.java | 32 ++++++++---------
taverna-plugin-impl/pom.xml | 18 ++++++++++
.../plugin/impl/PluginDirectoryWatcher.java | 32 ++++++++---------
.../apache/taverna/plugin/impl/PluginImpl.java | 32 ++++++++---------
.../taverna/plugin/impl/PluginManagerImpl.java | 32 ++++++++---------
.../taverna/plugin/impl/PluginSiteImpl.java | 32 ++++++++---------
.../plugin/impl/PluginSiteManagerImpl.java | 32 ++++++++---------
.../apache/taverna/plugin/impl/PluginSites.java | 32 ++++++++---------
.../META-INF/spring/plugin-context-osgi.xml | 18 ++++++++++
.../META-INF/spring/plugin-context.xml | 18 ++++++++++
.../taverna/plugin/impl/PluginSiteImplTest.java | 16 +++++++++
.../plugin/impl/PluginSiteManagerImplTest.java | 32 ++++++++---------
taverna-update-api/pom.xml | 18 ++++++++++
.../apache/taverna/update/UpdateException.java | 32 ++++++++---------
.../apache/taverna/update/UpdateManager.java | 32 ++++++++---------
taverna-update-impl/pom.xml | 18 ++++++++++
.../taverna/update/impl/UpdateManagerImpl.java | 32 ++++++++---------
.../META-INF/spring/update-context-osgi.xml | 18 ++++++++++
.../META-INF/spring/update-context.xml | 18 ++++++++++
xml-parser-service/pom.xml | 18 ++++++++++
xml-transformer-service/pom.xml | 18 ++++++++++
.../xmltransformer/XMLTransformerActivator.java | 32 ++++++++---------
84 files changed, 1310 insertions(+), 904 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index dff5f3a..fcb1e97 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1 +1,15 @@
+# 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.
language: java
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/osgi-launcher/pom.xml
----------------------------------------------------------------------
diff --git a/osgi-launcher/pom.xml b/osgi-launcher/pom.xml
index f2c6996..e2aa647 100644
--- a/osgi-launcher/pom.xml
+++ b/osgi-launcher/pom.xml
@@ -1,3 +1,21 @@
+<!--
+
+ 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/osgi-launcher/src/main/java/org/apache/taverna/osgilauncher/OsgiLauncher.java
----------------------------------------------------------------------
diff --git a/osgi-launcher/src/main/java/org/apache/taverna/osgilauncher/OsgiLauncher.java b/osgi-launcher/src/main/java/org/apache/taverna/osgilauncher/OsgiLauncher.java
index cc47bb0..2ae272f 100644
--- a/osgi-launcher/src/main/java/org/apache/taverna/osgilauncher/OsgiLauncher.java
+++ b/osgi-launcher/src/main/java/org/apache/taverna/osgilauncher/OsgiLauncher.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.osgilauncher;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 1232175..39d0186 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,3 +1,21 @@
+<!--
+
+ 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-app-configuration-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-api/pom.xml b/taverna-app-configuration-api/pom.xml
index 020cea7..bebd7e6 100644
--- a/taverna-app-configuration-api/pom.xml
+++ b/taverna-app-configuration-api/pom.xml
@@ -1,3 +1,21 @@
+<!--
+
+ 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-app-configuration-api/src/main/java/org/apache/taverna/configuration/app/ApplicationConfiguration.java
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-api/src/main/java/org/apache/taverna/configuration/app/ApplicationConfiguration.java b/taverna-app-configuration-api/src/main/java/org/apache/taverna/configuration/app/ApplicationConfiguration.java
index a343a8a..fac5112 100644
--- a/taverna-app-configuration-api/src/main/java/org/apache/taverna/configuration/app/ApplicationConfiguration.java
+++ b/taverna-app-configuration-api/src/main/java/org/apache/taverna/configuration/app/ApplicationConfiguration.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.configuration.app;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-app-configuration-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/pom.xml b/taverna-app-configuration-impl/pom.xml
index 7f87c78..c5112d8 100644
--- a/taverna-app-configuration-impl/pom.xml
+++ b/taverna-app-configuration-impl/pom.xml
@@ -1,3 +1,21 @@
+<!--
+
+ 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationConfigurationImpl.java b/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationConfigurationImpl.java
index 2f19a78..fd0d251 100644
--- a/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationConfigurationImpl.java
+++ b/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationConfigurationImpl.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.configuration.app.impl;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationUserHome.java
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationUserHome.java b/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationUserHome.java
index fa95a97..07e4b40 100644
--- a/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationUserHome.java
+++ b/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationUserHome.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.configuration.app.impl;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/Log4JConfiguration.java
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/Log4JConfiguration.java b/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/Log4JConfiguration.java
index 7f0c43f..2100ba6 100644
--- a/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/Log4JConfiguration.java
+++ b/taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/Log4JConfiguration.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
+/**
+ * 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
*
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.configuration.app.impl;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-app-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml b/taverna-app-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml
index e389ba1..198c7d9 100644
--- a/taverna-app-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml
+++ b/taverna-app-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml
@@ -1,4 +1,22 @@
<?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.
+
+-->
<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-app-configuration-impl/src/main/resources/META-INF/spring/configuration-context.xml
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/src/main/resources/META-INF/spring/configuration-context.xml b/taverna-app-configuration-impl/src/main/resources/META-INF/spring/configuration-context.xml
index b5190e2..05a2793 100644
--- a/taverna-app-configuration-impl/src/main/resources/META-INF/spring/configuration-context.xml
+++ b/taverna-app-configuration-impl/src/main/resources/META-INF/spring/configuration-context.xml
@@ -1,4 +1,22 @@
<?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.
+
+-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-configuration-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/pom.xml b/taverna-configuration-api/pom.xml
index a2b6460..cb1441c 100644
--- a/taverna-configuration-api/pom.xml
+++ b/taverna-configuration-api/pom.xml
@@ -1,3 +1,21 @@
+<!--
+
+ 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/AbstractConfigurable.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/AbstractConfigurable.java b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/AbstractConfigurable.java
index a1850fd..d23d035 100644
--- a/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/AbstractConfigurable.java
+++ b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/AbstractConfigurable.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.configuration;
import java.io.IOException;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/Configurable.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/Configurable.java b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/Configurable.java
index 6574ef6..e5a1ece 100644
--- a/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/Configurable.java
+++ b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/Configurable.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * 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
- ******************************************************************************/
+/**
+ * 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.configuration;
import java.util.List;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/ConfigurationManager.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/ConfigurationManager.java b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/ConfigurationManager.java
index c177b35..bbf2e5e 100644
--- a/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/ConfigurationManager.java
+++ b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/ConfigurationManager.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2011 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.configuration;
/**
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/ConfigurationUIFactory.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/ConfigurationUIFactory.java b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/ConfigurationUIFactory.java
index 1b97997..df080a4 100644
--- a/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/ConfigurationUIFactory.java
+++ b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/ConfigurationUIFactory.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * 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
- ******************************************************************************/
+/**
+ * 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.configuration;
import javax.swing.JPanel;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/package.html
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/package.html b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/package.html
index cff8d0a..db54002 100644
--- a/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/package.html
+++ b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/package.html
@@ -1,3 +1,21 @@
+<!--
+
+ 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.
+
+-->
<body>
Contains classes related to general configuration management.
</body>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/proxy/HttpProxyConfiguration.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/proxy/HttpProxyConfiguration.java b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/proxy/HttpProxyConfiguration.java
index 55efe9b..3929d74 100644
--- a/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/proxy/HttpProxyConfiguration.java
+++ b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/proxy/HttpProxyConfiguration.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.configuration.proxy;
import org.apache.taverna.configuration.Configurable;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-configuration-api/src/test/java/org/apache/taverna/configuration/AbstractConfigurableTest.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/test/java/org/apache/taverna/configuration/AbstractConfigurableTest.java b/taverna-configuration-api/src/test/java/org/apache/taverna/configuration/AbstractConfigurableTest.java
index 75543af..0031e53 100644
--- a/taverna-configuration-api/src/test/java/org/apache/taverna/configuration/AbstractConfigurableTest.java
+++ b/taverna-configuration-api/src/test/java/org/apache/taverna/configuration/AbstractConfigurableTest.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
+/**
+ * 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
*
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.configuration;
import static org.junit.Assert.assertEquals;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-configuration-api/src/test/java/org/apache/taverna/configuration/DummyConfigurable.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/test/java/org/apache/taverna/configuration/DummyConfigurable.java b/taverna-configuration-api/src/test/java/org/apache/taverna/configuration/DummyConfigurable.java
index 57911e8..0cb1eb4 100644
--- a/taverna-configuration-api/src/test/java/org/apache/taverna/configuration/DummyConfigurable.java
+++ b/taverna-configuration-api/src/test/java/org/apache/taverna/configuration/DummyConfigurable.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.
+ */
/**
*
*/
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-configuration-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/pom.xml b/taverna-configuration-impl/pom.xml
index c056da9..0cc0a9f 100644
--- a/taverna-configuration-impl/pom.xml
+++ b/taverna-configuration-impl/pom.xml
@@ -1,3 +1,21 @@
+<!--
+
+ 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-configuration-impl/src/main/java/org/apache/taverna/configuration/impl/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/main/java/org/apache/taverna/configuration/impl/ConfigurationManagerImpl.java b/taverna-configuration-impl/src/main/java/org/apache/taverna/configuration/impl/ConfigurationManagerImpl.java
index 67ae6f8..cb1b07d 100644
--- a/taverna-configuration-impl/src/main/java/org/apache/taverna/configuration/impl/ConfigurationManagerImpl.java
+++ b/taverna-configuration-impl/src/main/java/org/apache/taverna/configuration/impl/ConfigurationManagerImpl.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.configuration.impl;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-configuration-impl/src/main/java/org/apache/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/main/java/org/apache/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java b/taverna-configuration-impl/src/main/java/org/apache/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java
index 983e712..453b3f3 100644
--- a/taverna-configuration-impl/src/main/java/org/apache/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java
+++ b/taverna-configuration-impl/src/main/java/org/apache/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.configuration.proxy.impl;
import java.util.HashMap;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml b/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml
index 22f877b..9d88cda 100644
--- a/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml
+++ b/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml
@@ -1,4 +1,22 @@
<?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.
+
+-->
<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context.xml
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context.xml b/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context.xml
index 5026586..c302e96 100644
--- a/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context.xml
+++ b/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context.xml
@@ -1,4 +1,22 @@
<?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.
+
+-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/ConfigurationManagerImplTest.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/ConfigurationManagerImplTest.java b/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/ConfigurationManagerImplTest.java
index a3c06ee..dc7f0ce 100644
--- a/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/ConfigurationManagerImplTest.java
+++ b/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/ConfigurationManagerImplTest.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
+/**
+ * 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
*
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.configuration.impl;
import static org.junit.Assert.assertEquals;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/DummyUIFactory1.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/DummyUIFactory1.java b/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/DummyUIFactory1.java
index 8dc55e5..2e77e36 100644
--- a/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/DummyUIFactory1.java
+++ b/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/DummyUIFactory1.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
+/**
+ * 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
*
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.configuration.impl;
import java.util.List;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/DummyUIFactory2.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/DummyUIFactory2.java b/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/DummyUIFactory2.java
index 9d7d284..98b12d1 100644
--- a/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/DummyUIFactory2.java
+++ b/taverna-configuration-impl/src/test/java/org/apache/taverna/configuration/impl/DummyUIFactory2.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
+/**
+ * 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
*
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.configuration.impl;
import java.util.List;
import java.util.Map;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-download-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-download-api/pom.xml b/taverna-download-api/pom.xml
index b5dbcd7..6c6e955 100644
--- a/taverna-download-api/pom.xml
+++ b/taverna-download-api/pom.xml
@@ -1,3 +1,21 @@
+<!--
+
+ 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-download-api/src/main/java/org/apache/taverna/download/DownloadException.java
----------------------------------------------------------------------
diff --git a/taverna-download-api/src/main/java/org/apache/taverna/download/DownloadException.java b/taverna-download-api/src/main/java/org/apache/taverna/download/DownloadException.java
index 483b5d1..330fae3 100644
--- a/taverna-download-api/src/main/java/org/apache/taverna/download/DownloadException.java
+++ b/taverna-download-api/src/main/java/org/apache/taverna/download/DownloadException.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.download;
/**
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-download-api/src/main/java/org/apache/taverna/download/DownloadManager.java
----------------------------------------------------------------------
diff --git a/taverna-download-api/src/main/java/org/apache/taverna/download/DownloadManager.java b/taverna-download-api/src/main/java/org/apache/taverna/download/DownloadManager.java
index 76e4608..7992d85 100644
--- a/taverna-download-api/src/main/java/org/apache/taverna/download/DownloadManager.java
+++ b/taverna-download-api/src/main/java/org/apache/taverna/download/DownloadManager.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.download;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-download-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-download-impl/pom.xml b/taverna-download-impl/pom.xml
index c8e6196..0c56d95 100644
--- a/taverna-download-impl/pom.xml
+++ b/taverna-download-impl/pom.xml
@@ -1,3 +1,21 @@
+<!--
+
+ 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-download-impl/src/main/java/org/apache/taverna/download/impl/DownloadManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-download-impl/src/main/java/org/apache/taverna/download/impl/DownloadManagerImpl.java b/taverna-download-impl/src/main/java/org/apache/taverna/download/impl/DownloadManagerImpl.java
index 1d6adee..eee6ff4 100644
--- a/taverna-download-impl/src/main/java/org/apache/taverna/download/impl/DownloadManagerImpl.java
+++ b/taverna-download-impl/src/main/java/org/apache/taverna/download/impl/DownloadManagerImpl.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.download.impl;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-download-impl/src/main/resources/META-INF/spring/download-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-download-impl/src/main/resources/META-INF/spring/download-context-osgi.xml b/taverna-download-impl/src/main/resources/META-INF/spring/download-context-osgi.xml
index 3bf3756..5c0a3b3 100644
--- a/taverna-download-impl/src/main/resources/META-INF/spring/download-context-osgi.xml
+++ b/taverna-download-impl/src/main/resources/META-INF/spring/download-context-osgi.xml
@@ -1,4 +1,22 @@
<?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.
+
+-->
<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-download-impl/src/main/resources/META-INF/spring/download-context.xml
----------------------------------------------------------------------
diff --git a/taverna-download-impl/src/main/resources/META-INF/spring/download-context.xml b/taverna-download-impl/src/main/resources/META-INF/spring/download-context.xml
index 500f979..a5e9d12 100644
--- a/taverna-download-impl/src/main/resources/META-INF/spring/download-context.xml
+++ b/taverna-download-impl/src/main/resources/META-INF/spring/download-context.xml
@@ -1,4 +1,22 @@
<?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.
+
+-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/pom.xml b/taverna-maven-plugin/pom.xml
index cf7c17c..688b185 100644
--- a/taverna-maven-plugin/pom.xml
+++ b/taverna-maven-plugin/pom.xml
@@ -1,3 +1,21 @@
+<!--
+
+ 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>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractDeployMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractDeployMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractDeployMojo.java
index d3e98cf..7d24e82 100644
--- a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractDeployMojo.java
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractDeployMojo.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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 net.sf.taverna.t2.maven.plugins;
import java.io.File;
[04/17] incubator-taverna-osgi git commit:
org.apache.taverna.configuration
Posted by st...@apache.org.
org.apache.taverna.configuration
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/cdd45474
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/cdd45474
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/cdd45474
Branch: refs/heads/master
Commit: cdd4547448199bda08e1d018b610d927ebc51a40
Parents: fec32df
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Oct 18 13:30:10 2015 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Oct 18 13:30:10 2015 +0100
----------------------------------------------------------------------
.../configuration/AbstractConfigurable.java | 184 ++++++++++++++
.../taverna/configuration/Configurable.java | 118 +++++++++
.../configuration/ConfigurationManager.java | 51 ++++
.../configuration/ConfigurationUIFactory.java | 29 +++
.../apache/taverna/configuration/package.html | 3 +
.../proxy/HttpProxyConfiguration.java | 79 ++++++
.../configuration/AbstractConfigurable.java | 184 --------------
.../org/taverna/configuration/Configurable.java | 118 ---------
.../configuration/ConfigurationManager.java | 51 ----
.../configuration/ConfigurationUIFactory.java | 29 ---
.../uk/org/taverna/configuration/package.html | 3 -
.../proxy/HttpProxyConfiguration.java | 79 ------
.../configuration/AbstractConfigurableTest.java | 247 +++++++++++++++++++
.../configuration/DummyConfigurable.java | 65 +++++
.../configuration/AbstractConfigurableTest.java | 244 ------------------
.../configuration/DummyConfigurable.java | 65 -----
taverna-configuration-impl/pom.xml | 4 +-
.../impl/ConfigurationManagerImpl.java | 5 +-
.../proxy/impl/HttpProxyConfigurationImpl.java | 7 +-
.../spring/configuration-context-osgi.xml | 4 +-
.../META-INF/spring/configuration-context.xml | 4 +-
.../impl/ConfigurationManagerImplTest.java | 6 +-
.../configuration/impl/DummyUIFactory1.java | 4 +-
.../configuration/impl/DummyUIFactory2.java | 4 +-
24 files changed, 794 insertions(+), 793 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/AbstractConfigurable.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/AbstractConfigurable.java b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/AbstractConfigurable.java
new file mode 100644
index 0000000..a1850fd
--- /dev/null
+++ b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/AbstractConfigurable.java
@@ -0,0 +1,184 @@
+/*******************************************************************************
+ * 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 org.apache.taverna.configuration;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.csv.CSVParser;
+import org.apache.commons.csv.CSVPrinter;
+import org.apache.log4j.Logger;
+
+/**
+ * A utility abstract class that simplifies implementing a Configurable.
+ * <br>
+ * <p>A concrete version of this class needs to define the name,category,
+ * UUID string and the set of default values.</p>
+ *
+ * @author Stuart Owen
+ *
+ */
+public abstract class AbstractConfigurable implements Configurable {
+
+ private Map<String,String> propertyMap = new HashMap<String, String>();
+
+ private static Logger logger = Logger.getLogger(AbstractConfigurable.class);
+
+ public static final String DELETED_VALUE_CODE = "~~DELETED~~";
+
+ private ConfigurationManager configurationManager;
+
+ public Set<String> getKeys() {
+ return getInternalPropertyMap().keySet();
+ }
+
+ /**
+ * Constructs the AbstractConfigurable by either reading from a previously stored set of properties,
+ * or by using the default values which results in them being stored for subsequent usage.
+ */
+ public AbstractConfigurable(ConfigurationManager configurationManager) {
+ this.configurationManager = configurationManager;
+ try {
+ configurationManager.populate(this);
+ } catch (Exception e) {
+ logger.error("There was an error reading the properties for the Configurable:"+getFilePrefix(),e);
+ }
+ }
+
+ public synchronized String getProperty(String key) {
+ String val = getInternalPropertyMap().get(key);
+ if (val==null) val=getDefaultProperty(key);
+ if (DELETED_VALUE_CODE.equals(val)) val=null;
+ return val;
+ }
+
+ public String getDefaultProperty(String key) {
+ return getDefaultPropertyMap().get(key);
+ }
+
+ protected void store() {
+ try {
+ configurationManager.store(this);
+ } catch (Exception e) {
+ logger.error("There was an error storing the new configuration for: "+this.getFilePrefix(),e);
+ }
+ }
+
+ public void clear() {
+ getInternalPropertyMap().clear();
+ }
+
+ public synchronized void setProperty(String key, String value) {
+ Object oldValue = getInternalPropertyMap().get(key);
+ if (value==null) {
+ deleteProperty(key);
+ }
+ else {
+ getInternalPropertyMap().put(key,value);
+ }
+ if (value==null || !value.equals(oldValue)) {
+ store();
+ }
+ }
+
+ /**
+ * Provides access to the internal map.
+ * <br>
+ * Note that this map will contain entries for deleted values that also have corresponding default values.
+ * For this reason using this map directly is discouraged, and #getProperty(String)} should be used instead.
+ * @return
+ */
+ public Map<String, String> getInternalPropertyMap() {
+ return propertyMap;
+ }
+
+
+ public void restoreDefaults() {
+ propertyMap.clear();
+ propertyMap.putAll(getDefaultPropertyMap());
+ store();
+ }
+
+ public void deleteProperty(String key) {
+ if (getDefaultPropertyMap().containsKey(key)) {
+ propertyMap.put(key, DELETED_VALUE_CODE);
+ }
+ else {
+ propertyMap.remove(key);
+ }
+ }
+
+ /**
+ * Returns an unmodifiable List<String> for the given key. Internally the value is stored as a single String, but converted to a list when calling this method.
+ * <br>
+ * The list is unmodifiable to prevent the mistake of trying <pre>getPropertyStringList(..).add("new element");</pre> which will not affect the stored
+ * list. For the property to be updated this{@link #setPropertyStringList(String, List)} must be used.
+ */
+ public List<String> getPropertyStringList(String key) {
+ String value = getProperty(key);
+ if (value!=null) {
+ return Collections.unmodifiableList(fromListText(value));
+ }
+ else {
+ return null;
+ }
+ }
+
+ private List<String> fromListText(String property) {
+ List<String> result = new ArrayList<String>();
+ if (property.length()>0) { //an empty string as assumed to be an empty list, rather than a list with 1 empty string in it!
+ StringReader reader = new StringReader(property);
+ CSVParser csvReader = new CSVParser(reader);
+ try {
+ for (String v : csvReader.getLine()) {
+ result.add(v);
+ }
+ } catch (IOException e) {
+ logger.error("Exception occurred parsing CSV properties:"+property,e);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Set a value that is known to be a list. The value can be retrieved using this{@link #getPropertyStringList(String)}
+ * <br>
+ * Within the file, the value is stored as a single Comma Separated Value
+ */
+ public void setPropertyStringList(String key, List<String> value) {
+ setProperty(key, toListText(value));
+ }
+
+ private String toListText(List<String> values) {
+ StringWriter writer = new StringWriter();
+ CSVPrinter csvWriter = new CSVPrinter(writer);
+ csvWriter.println(values.toArray(new String[]{}));
+ return writer.getBuffer().toString().trim();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/Configurable.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/Configurable.java b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/Configurable.java
new file mode 100644
index 0000000..6574ef6
--- /dev/null
+++ b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/Configurable.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * 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 org.apache.taverna.configuration;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * An interface that defines an Object as being configurable.
+ * It supports the core properties that allows this items configuration to be stored and re-populated by the ConfigurationManager
+ *
+ * @author Stuart Owen
+ *
+ */
+public interface Configurable {
+
+ /**
+ * @return a Map containing the default value/key pairs of the configured properties
+ */
+ Map<String,String> getDefaultPropertyMap();
+ /**
+ * @return a globally unique identifier that ensures that when stored this items configuration details will never clash with another
+ */
+ String getUUID();
+
+ /**
+ * @return a friendly name for the item
+ */
+ String getDisplayName();
+
+ /**
+ * return a file-system suitable prefix
+ */
+ String getFilePrefix();
+
+ /**
+ * @return a String defining the category of configurations that this item belongs to.
+ */
+ String getCategory();
+ /**
+ * Restore the default property map
+ */
+ void restoreDefaults();
+
+ /**
+ * Provides the default property for a given key
+ *
+ * @param key
+ * @return
+ */
+ String getDefaultProperty(String key);
+
+ Set<String> getKeys();
+
+ void clear();
+
+ /**
+ * Provides access to the internal map.
+ * <br>
+ * Note that this map may contain internal identifiers for deleted entries for deleted values that also have corresponding default values.
+ * For this reason using this map directly is discouraged, and #getProperty(String)} should be used instead.
+ * @return
+ */
+ Map<String, String> getInternalPropertyMap();
+
+ /**
+ * Looks up the property for the given key.
+ * <br>
+ * Using this method is preferable to using the property map directly.
+ * @param key
+ * @return the String represented by the key, the default value, or null
+ */
+ String getProperty(String key);
+
+ /**
+ * Overwrites or applies a new value against the given key in the property map.
+ * <br>
+ * Setting a value to null is equivalent to calling this{@link #deleteProperty(String)}
+ * <br>
+ * If the value is new, or changed, the the property map is stored.
+ * <br>
+ * Using this method is preferable to using the property map directly.
+ * @param key
+ * @param value
+ */
+ void setProperty(String key, String value);
+
+ /**
+ * Deletes a property value for a given key.
+ * <br>
+ * Subsequent calls to this{@link #getProperty(String)} will return null.
+ * @param key
+ */
+ void deleteProperty(String key);
+
+ public List<String> getPropertyStringList(String key);
+
+ public void setPropertyStringList(String key, List<String>value);
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/ConfigurationManager.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/ConfigurationManager.java b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/ConfigurationManager.java
new file mode 100644
index 0000000..c177b35
--- /dev/null
+++ b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/ConfigurationManager.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (C) 2011 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 org.apache.taverna.configuration;
+
+/**
+ * Handles the configuration for a {@link Configurable} object
+ *
+ * @author David Withers
+ */
+public interface ConfigurationManager {
+
+ /**
+ * Write out the properties configuration to disk based on the UUID of the
+ * {@link Configurable}
+ * <br>
+ * Default values are not stored within the file, but only those that have been changed or deleted.
+ *
+ * @param configurable
+ * @throws Exception
+ */
+ public void store(Configurable configurable) throws Exception;
+
+ /**
+ * Loads the configuration details from disk or from memory and populates the provided Configurable
+ *
+ * @param configurable
+ * @return
+ * @throws Exception
+ * if there are no configuration details available
+ */
+ public void populate(Configurable configurable) throws Exception;
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/ConfigurationUIFactory.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/ConfigurationUIFactory.java b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/ConfigurationUIFactory.java
new file mode 100644
index 0000000..1b97997
--- /dev/null
+++ b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/ConfigurationUIFactory.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * 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 org.apache.taverna.configuration;
+
+import javax.swing.JPanel;
+
+public interface ConfigurationUIFactory {
+ public boolean canHandle(String uuid);
+ public JPanel getConfigurationPanel();
+ public Configurable getConfigurable();
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/package.html
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/package.html b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/package.html
new file mode 100644
index 0000000..cff8d0a
--- /dev/null
+++ b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/package.html
@@ -0,0 +1,3 @@
+<body>
+Contains classes related to general configuration management.
+</body>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/proxy/HttpProxyConfiguration.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/proxy/HttpProxyConfiguration.java b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/proxy/HttpProxyConfiguration.java
new file mode 100644
index 0000000..55efe9b
--- /dev/null
+++ b/taverna-configuration-api/src/main/java/org/apache/taverna/configuration/proxy/HttpProxyConfiguration.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (C) 2013 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 org.apache.taverna.configuration.proxy;
+
+import org.apache.taverna.configuration.Configurable;
+
+/**
+ * The HttpProxyConfiguration handles the configuration of HTTP
+ * proxy when Taverna is launched.
+ *
+ * @author David Withers
+ */
+public interface HttpProxyConfiguration extends Configurable {
+
+ /**
+ * The acceptable values for which proxy values to use
+ */
+ public static String USE_SYSTEM_PROPERTIES_OPTION = "useSystemProperties";
+ public static String USE_NO_PROXY_OPTION = "useNoProxy";
+ public static String USE_SPECIFIED_VALUES_OPTION = "useSpecifiedValues";
+
+ /**
+ * The key within the Properties where the value will indicate which set of
+ * proxy values to use
+ */
+ public static String PROXY_USE_OPTION = "proxyUseOption";
+
+ /**
+ * The keys within the Properties for the ad hoc Taverna proxy settings
+ */
+ public static String TAVERNA_PROXY_HOST = "tavernaProxyHost";
+ public static String TAVERNA_PROXY_PORT = "tavernaProxyPort";
+ public static String TAVERNA_PROXY_USER = "tavernaProxyUser";
+ public static String TAVERNA_PROXY_PASSWORD = "tavernaProxyPassword";
+ public static String TAVERNA_NON_PROXY_HOSTS = "tavernaNonProxyHosts";
+
+ /**
+ * The keys within the Properties for the System proxy settings
+ */
+ public static String SYSTEM_PROXY_HOST = "systemProxyHost";
+ public static String SYSTEM_PROXY_PORT = "systemProxyPort";
+ public static String SYSTEM_PROXY_USER = "systemProxyUser";
+ public static String SYSTEM_PROXY_PASSWORD = "systemProxyPassword";
+ public static String SYSTEM_NON_PROXY_HOSTS = "systemNonProxyHosts";
+
+ /**
+ * The keys within the System Properties that are used for specifying HTTP
+ * proxy information
+ */
+ public static String PROXY_HOST = "http.proxyHost";
+ public static String PROXY_PORT = "http.proxyPort";
+ public static String PROXY_USER = "http.proxyUser";
+ public static String PROXY_PASSWORD = "http.proxyPassword";
+ public static String NON_PROXY_HOSTS = "http.nonProxyHosts";
+
+ /**
+ * Change the System Proxy settings according to the property values.
+ */
+ public void changeProxySettings();
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/AbstractConfigurable.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/AbstractConfigurable.java b/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/AbstractConfigurable.java
deleted file mode 100644
index a00938f..0000000
--- a/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/AbstractConfigurable.java
+++ /dev/null
@@ -1,184 +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 uk.org.taverna.configuration;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.csv.CSVParser;
-import org.apache.commons.csv.CSVPrinter;
-import org.apache.log4j.Logger;
-
-/**
- * A utility abstract class that simplifies implementing a Configurable.
- * <br>
- * <p>A concrete version of this class needs to define the name,category,
- * UUID string and the set of default values.</p>
- *
- * @author Stuart Owen
- *
- */
-public abstract class AbstractConfigurable implements Configurable {
-
- private Map<String,String> propertyMap = new HashMap<String, String>();
-
- private static Logger logger = Logger.getLogger(AbstractConfigurable.class);
-
- public static final String DELETED_VALUE_CODE = "~~DELETED~~";
-
- private ConfigurationManager configurationManager;
-
- public Set<String> getKeys() {
- return getInternalPropertyMap().keySet();
- }
-
- /**
- * Constructs the AbstractConfigurable by either reading from a previously stored set of properties,
- * or by using the default values which results in them being stored for subsequent usage.
- */
- public AbstractConfigurable(ConfigurationManager configurationManager) {
- this.configurationManager = configurationManager;
- try {
- configurationManager.populate(this);
- } catch (Exception e) {
- logger.error("There was an error reading the properties for the Configurable:"+getFilePrefix(),e);
- }
- }
-
- public synchronized String getProperty(String key) {
- String val = getInternalPropertyMap().get(key);
- if (val==null) val=getDefaultProperty(key);
- if (DELETED_VALUE_CODE.equals(val)) val=null;
- return val;
- }
-
- public String getDefaultProperty(String key) {
- return getDefaultPropertyMap().get(key);
- }
-
- protected void store() {
- try {
- configurationManager.store(this);
- } catch (Exception e) {
- logger.error("There was an error storing the new configuration for: "+this.getFilePrefix(),e);
- }
- }
-
- public void clear() {
- getInternalPropertyMap().clear();
- }
-
- public synchronized void setProperty(String key, String value) {
- Object oldValue = getInternalPropertyMap().get(key);
- if (value==null) {
- deleteProperty(key);
- }
- else {
- getInternalPropertyMap().put(key,value);
- }
- if (value==null || !value.equals(oldValue)) {
- store();
- }
- }
-
- /**
- * Provides access to the internal map.
- * <br>
- * Note that this map will contain entries for deleted values that also have corresponding default values.
- * For this reason using this map directly is discouraged, and #getProperty(String)} should be used instead.
- * @return
- */
- public Map<String, String> getInternalPropertyMap() {
- return propertyMap;
- }
-
-
- public void restoreDefaults() {
- propertyMap.clear();
- propertyMap.putAll(getDefaultPropertyMap());
- store();
- }
-
- public void deleteProperty(String key) {
- if (getDefaultPropertyMap().containsKey(key)) {
- propertyMap.put(key, DELETED_VALUE_CODE);
- }
- else {
- propertyMap.remove(key);
- }
- }
-
- /**
- * Returns an unmodifiable List<String> for the given key. Internally the value is stored as a single String, but converted to a list when calling this method.
- * <br>
- * The list is unmodifiable to prevent the mistake of trying <pre>getPropertyStringList(..).add("new element");</pre> which will not affect the stored
- * list. For the property to be updated this{@link #setPropertyStringList(String, List)} must be used.
- */
- public List<String> getPropertyStringList(String key) {
- String value = getProperty(key);
- if (value!=null) {
- return Collections.unmodifiableList(fromListText(value));
- }
- else {
- return null;
- }
- }
-
- private List<String> fromListText(String property) {
- List<String> result = new ArrayList<String>();
- if (property.length()>0) { //an empty string as assumed to be an empty list, rather than a list with 1 empty string in it!
- StringReader reader = new StringReader(property);
- CSVParser csvReader = new CSVParser(reader);
- try {
- for (String v : csvReader.getLine()) {
- result.add(v);
- }
- } catch (IOException e) {
- logger.error("Exception occurred parsing CSV properties:"+property,e);
- }
- }
- return result;
- }
-
- /**
- * Set a value that is known to be a list. The value can be retrieved using this{@link #getPropertyStringList(String)}
- * <br>
- * Within the file, the value is stored as a single Comma Separated Value
- */
- public void setPropertyStringList(String key, List<String> value) {
- setProperty(key, toListText(value));
- }
-
- private String toListText(List<String> values) {
- StringWriter writer = new StringWriter();
- CSVPrinter csvWriter = new CSVPrinter(writer);
- csvWriter.println(values.toArray(new String[]{}));
- return writer.getBuffer().toString().trim();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/Configurable.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/Configurable.java b/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/Configurable.java
deleted file mode 100644
index b9b0642..0000000
--- a/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/Configurable.java
+++ /dev/null
@@ -1,118 +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 uk.org.taverna.configuration;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * An interface that defines an Object as being configurable.
- * It supports the core properties that allows this items configuration to be stored and re-populated by the ConfigurationManager
- *
- * @author Stuart Owen
- *
- */
-public interface Configurable {
-
- /**
- * @return a Map containing the default value/key pairs of the configured properties
- */
- Map<String,String> getDefaultPropertyMap();
- /**
- * @return a globally unique identifier that ensures that when stored this items configuration details will never clash with another
- */
- String getUUID();
-
- /**
- * @return a friendly name for the item
- */
- String getDisplayName();
-
- /**
- * return a file-system suitable prefix
- */
- String getFilePrefix();
-
- /**
- * @return a String defining the category of configurations that this item belongs to.
- */
- String getCategory();
- /**
- * Restore the default property map
- */
- void restoreDefaults();
-
- /**
- * Provides the default property for a given key
- *
- * @param key
- * @return
- */
- String getDefaultProperty(String key);
-
- Set<String> getKeys();
-
- void clear();
-
- /**
- * Provides access to the internal map.
- * <br>
- * Note that this map may contain internal identifiers for deleted entries for deleted values that also have corresponding default values.
- * For this reason using this map directly is discouraged, and #getProperty(String)} should be used instead.
- * @return
- */
- Map<String, String> getInternalPropertyMap();
-
- /**
- * Looks up the property for the given key.
- * <br>
- * Using this method is preferable to using the property map directly.
- * @param key
- * @return the String represented by the key, the default value, or null
- */
- String getProperty(String key);
-
- /**
- * Overwrites or applies a new value against the given key in the property map.
- * <br>
- * Setting a value to null is equivalent to calling this{@link #deleteProperty(String)}
- * <br>
- * If the value is new, or changed, the the property map is stored.
- * <br>
- * Using this method is preferable to using the property map directly.
- * @param key
- * @param value
- */
- void setProperty(String key, String value);
-
- /**
- * Deletes a property value for a given key.
- * <br>
- * Subsequent calls to this{@link #getProperty(String)} will return null.
- * @param key
- */
- void deleteProperty(String key);
-
- public List<String> getPropertyStringList(String key);
-
- public void setPropertyStringList(String key, List<String>value);
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/ConfigurationManager.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/ConfigurationManager.java b/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/ConfigurationManager.java
deleted file mode 100644
index 11ca22a..0000000
--- a/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/ConfigurationManager.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2011 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 uk.org.taverna.configuration;
-
-/**
- * Handles the configuration for a {@link Configurable} object
- *
- * @author David Withers
- */
-public interface ConfigurationManager {
-
- /**
- * Write out the properties configuration to disk based on the UUID of the
- * {@link Configurable}
- * <br>
- * Default values are not stored within the file, but only those that have been changed or deleted.
- *
- * @param configurable
- * @throws Exception
- */
- public void store(Configurable configurable) throws Exception;
-
- /**
- * Loads the configuration details from disk or from memory and populates the provided Configurable
- *
- * @param configurable
- * @return
- * @throws Exception
- * if there are no configuration details available
- */
- public void populate(Configurable configurable) throws Exception;
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/ConfigurationUIFactory.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/ConfigurationUIFactory.java b/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/ConfigurationUIFactory.java
deleted file mode 100644
index 8ff0e8f..0000000
--- a/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/ConfigurationUIFactory.java
+++ /dev/null
@@ -1,29 +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 uk.org.taverna.configuration;
-
-import javax.swing.JPanel;
-
-public interface ConfigurationUIFactory {
- public boolean canHandle(String uuid);
- public JPanel getConfigurationPanel();
- public Configurable getConfigurable();
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/package.html
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/package.html b/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/package.html
deleted file mode 100644
index cff8d0a..0000000
--- a/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/package.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<body>
-Contains classes related to general configuration management.
-</body>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/proxy/HttpProxyConfiguration.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/proxy/HttpProxyConfiguration.java b/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/proxy/HttpProxyConfiguration.java
deleted file mode 100644
index 0fa686b..0000000
--- a/taverna-configuration-api/src/main/java/uk/org/taverna/configuration/proxy/HttpProxyConfiguration.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 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 uk.org.taverna.configuration.proxy;
-
-import uk.org.taverna.configuration.Configurable;
-
-/**
- * The HttpProxyConfiguration handles the configuration of HTTP
- * proxy when Taverna is launched.
- *
- * @author David Withers
- */
-public interface HttpProxyConfiguration extends Configurable {
-
- /**
- * The acceptable values for which proxy values to use
- */
- public static String USE_SYSTEM_PROPERTIES_OPTION = "useSystemProperties";
- public static String USE_NO_PROXY_OPTION = "useNoProxy";
- public static String USE_SPECIFIED_VALUES_OPTION = "useSpecifiedValues";
-
- /**
- * The key within the Properties where the value will indicate which set of
- * proxy values to use
- */
- public static String PROXY_USE_OPTION = "proxyUseOption";
-
- /**
- * The keys within the Properties for the ad hoc Taverna proxy settings
- */
- public static String TAVERNA_PROXY_HOST = "tavernaProxyHost";
- public static String TAVERNA_PROXY_PORT = "tavernaProxyPort";
- public static String TAVERNA_PROXY_USER = "tavernaProxyUser";
- public static String TAVERNA_PROXY_PASSWORD = "tavernaProxyPassword";
- public static String TAVERNA_NON_PROXY_HOSTS = "tavernaNonProxyHosts";
-
- /**
- * The keys within the Properties for the System proxy settings
- */
- public static String SYSTEM_PROXY_HOST = "systemProxyHost";
- public static String SYSTEM_PROXY_PORT = "systemProxyPort";
- public static String SYSTEM_PROXY_USER = "systemProxyUser";
- public static String SYSTEM_PROXY_PASSWORD = "systemProxyPassword";
- public static String SYSTEM_NON_PROXY_HOSTS = "systemNonProxyHosts";
-
- /**
- * The keys within the System Properties that are used for specifying HTTP
- * proxy information
- */
- public static String PROXY_HOST = "http.proxyHost";
- public static String PROXY_PORT = "http.proxyPort";
- public static String PROXY_USER = "http.proxyUser";
- public static String PROXY_PASSWORD = "http.proxyPassword";
- public static String NON_PROXY_HOSTS = "http.nonProxyHosts";
-
- /**
- * Change the System Proxy settings according to the property values.
- */
- public void changeProxySettings();
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-api/src/test/java/org/apache/taverna/configuration/AbstractConfigurableTest.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/test/java/org/apache/taverna/configuration/AbstractConfigurableTest.java b/taverna-configuration-api/src/test/java/org/apache/taverna/configuration/AbstractConfigurableTest.java
new file mode 100644
index 0000000..75543af
--- /dev/null
+++ b/taverna-configuration-api/src/test/java/org/apache/taverna/configuration/AbstractConfigurableTest.java
@@ -0,0 +1,247 @@
+/*******************************************************************************
+ * 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 org.apache.taverna.configuration;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.UUID;
+
+import org.apache.taverna.configuration.AbstractConfigurable;
+import org.apache.taverna.configuration.Configurable;
+import org.apache.taverna.configuration.ConfigurationManager;
+import org.junit.Before;
+import org.junit.Test;
+
+public class AbstractConfigurableTest {
+
+ private ConfigurationManager manager;
+
+ private DummyConfigurable dummyConfigurable;
+
+ @Before
+ public void setup() throws Exception {
+ dummyConfigurable = new DummyConfigurable(manager);
+ File f = new File(System.getProperty("java.io.tmpdir"));
+ File configTestsDir = new File(f,"configTests");
+ if (!configTestsDir.exists()) configTestsDir.mkdir();
+ final File d = new File(configTestsDir,UUID.randomUUID().toString());
+ d.mkdir();
+ manager = new ConfigurationManager() {
+ private Map<String, Map<String, String>> store = new HashMap<String, Map<String, String>>();
+ @Override
+ public void store(Configurable configurable) throws Exception {
+ if (configurable != null) {
+ store.put(configurable.getUUID(), new HashMap<String, String>(configurable.getInternalPropertyMap()));
+ }
+ }
+
+ @Override
+ public void populate(Configurable configurable) throws Exception {
+ Map<String, String> map = store.get(configurable.getUUID());
+ if (map != null) {
+ configurable.clear();
+ for (Entry<String, String> entry : map.entrySet()) {
+ configurable.setProperty(entry.getKey(), entry.getValue());
+ }
+ }
+ }
+
+ };
+ dummyConfigurable.restoreDefaults();
+ }
+
+ @Test
+ public void testName() {
+ assertEquals("Wrong name","dummyName",dummyConfigurable.getDisplayName());
+ }
+
+ @Test
+ public void testCategory() {
+ assertEquals("Wrong category","test",dummyConfigurable.getCategory());
+ }
+
+ @Test
+ public void testUUID() {
+ assertEquals("Wrong uuid","cheese",dummyConfigurable.getUUID());
+ }
+
+ @Test
+ public void testGetProperty() {
+ assertEquals("Should be john","john",dummyConfigurable.getProperty("name"));
+ }
+
+ @Test
+ public void testSetProperty() {
+ assertEquals("Should be blue","blue",dummyConfigurable.getProperty("colour"));
+ assertNull("Should be null",dummyConfigurable.getProperty("new"));
+
+ dummyConfigurable.setProperty("colour", "red");
+ dummyConfigurable.setProperty("new", "new value");
+
+ assertEquals("Should be red","red",dummyConfigurable.getProperty("colour"));
+ assertEquals("Should be new value","new value",dummyConfigurable.getProperty("new"));
+ }
+
+ @Test
+ public void testDeleteValue() {
+ assertEquals("Should be blue","blue",dummyConfigurable.getProperty("colour"));
+ assertNull("Should be null",dummyConfigurable.getProperty("new"));
+
+ dummyConfigurable.setProperty("new", "new value");
+
+ assertEquals("Should be new value","new value",dummyConfigurable.getProperty("new"));
+
+ dummyConfigurable.deleteProperty("new");
+ dummyConfigurable.deleteProperty("colour");
+
+ assertNull("Should be null",dummyConfigurable.getProperty("new"));
+ assertNull("Should be null",dummyConfigurable.getProperty("colour"));
+ }
+
+ @Test
+ public void testDeleteValueBySettingNull() {
+ assertEquals("Should be blue","blue",dummyConfigurable.getProperty("colour"));
+ assertNull("Should be null",dummyConfigurable.getProperty("new"));
+
+ dummyConfigurable.setProperty("new", "new value");
+
+ assertEquals("Should be new value","new value",dummyConfigurable.getProperty("new"));
+
+ dummyConfigurable.setProperty("new",null);
+ dummyConfigurable.setProperty("colour",null);
+
+ assertNull("Should be null",dummyConfigurable.getProperty("new"));
+ assertNull("Should be null",dummyConfigurable.getProperty("colour"));
+ }
+
+ @Test
+ public void testRestoreDefaults() {
+ assertEquals("There should be 2 values",2,dummyConfigurable.getInternalPropertyMap().size());
+
+ dummyConfigurable.setProperty("colour", "red");
+ dummyConfigurable.setProperty("new", "new value");
+
+ assertEquals("There should be 3 values",3,dummyConfigurable.getInternalPropertyMap().size());
+
+ dummyConfigurable.restoreDefaults();
+
+ assertEquals("There should be 2 values",2,dummyConfigurable.getInternalPropertyMap().size());
+
+ assertEquals("Should be john","john",dummyConfigurable.getProperty("name"));
+ assertEquals("Should be john","blue",dummyConfigurable.getProperty("colour"));
+ }
+
+ @Test
+ public void testList() throws Exception {
+ AbstractConfigurable c = dummyConfigurable;
+ c.getInternalPropertyMap().clear();
+ c.setPropertyStringList("list", new ArrayList<String>());
+
+ manager.store(c);
+ assertTrue("Should be an instanceof a list",c.getPropertyStringList("list") instanceof List);
+ assertEquals("there should be 0 items",0,c.getPropertyStringList("list").size());
+ manager.populate(c);
+
+ assertTrue("Should be an instanceof a list",c.getPropertyStringList("list") instanceof List);
+ assertEquals("there should be 0 items",0,c.getPropertyStringList("list").size());
+
+ List<String> list = new ArrayList<String>(c.getPropertyStringList("list"));
+ list.add("fred");
+ c.setPropertyStringList("list", list);
+ assertEquals("there should be 1 item",1,c.getPropertyStringList("list").size());
+
+ manager.store(c);
+ assertEquals("there should be 1 item",1,c.getPropertyStringList("list").size());
+ manager.populate(c);
+
+ assertEquals("there should be 1 item",1,c.getPropertyStringList("list").size());
+ assertEquals("item should be fred","fred",c.getPropertyStringList("list").get(0));
+
+ c.getInternalPropertyMap().clear();
+ c.setProperty("list", "a,b,c");
+ assertEquals("There should be 3 items in the list",3,c.getPropertyStringList("list").size());
+ assertEquals("Item 1 should be a","a",c.getPropertyStringList("list").get(0));
+ assertEquals("Item 1 should be b","b",c.getPropertyStringList("list").get(1));
+ assertEquals("Item 1 should be c","c",c.getPropertyStringList("list").get(2));
+
+ }
+
+ @Test
+ public void testListNotThere() throws Exception {
+ AbstractConfigurable c = dummyConfigurable;
+ c.getInternalPropertyMap().clear();
+ assertNull("the property should be null",c.getProperty("sdflhsdfhsdfjkhsdfkhsdfkhsdfjkh"));
+ assertNull("the list should be null if the property doesn't exist",c.getPropertyStringList("sdflhsdfhsdfjkhsdfkhsdfkhsdfjkh"));
+ }
+
+ @Test
+ public void testListDelimeters() throws Exception {
+ AbstractConfigurable c = dummyConfigurable;
+ c.getInternalPropertyMap().clear();
+ c.setPropertyStringList("list", new ArrayList<String>());
+
+ assertTrue("Should be an instanceof a list",c.getPropertyStringList("list") instanceof List);
+ assertEquals("there should be 0 items",0,((List<String>)c.getPropertyStringList("list")).size());
+
+ List<String> list = new ArrayList<String>(c.getPropertyStringList("list"));
+ list.add("a,b,c");
+ c.setPropertyStringList("list",list);
+ assertEquals("there should be 1 items",1,((List<String>)c.getPropertyStringList("list")).size());
+
+ list = new ArrayList<String>(c.getPropertyStringList("list"));
+ list.add("d");
+ c.setPropertyStringList("list",list);
+ assertEquals("there should be 2 items",2,((List<String>)c.getPropertyStringList("list")).size());
+ assertEquals("The first item should be a,b,c","a,b,c",c.getPropertyStringList("list").get(0));
+ assertEquals("The second item should be d","d",c.getPropertyStringList("list").get(1));
+
+ manager.store(c);
+ assertEquals("there should be 2 items",2,((List<String>)c.getPropertyStringList("list")).size());
+ assertEquals("The first item should be a,b,c","a,b,c",c.getPropertyStringList("list").get(0));
+ assertEquals("The second item should be d","d",c.getPropertyStringList("list").get(1));
+
+ manager.populate(c);
+ assertEquals("there should be 2 items",2,((List<String>)c.getPropertyStringList("list")).size());
+
+ assertEquals("The first item should be a,b,c","a,b,c",c.getPropertyStringList("list").get(0));
+ assertEquals("The second item should be d","d",c.getPropertyStringList("list").get(1));
+
+ }
+
+ @Test(expected=UnsupportedOperationException.class)
+ public void testUnmodifiable() throws Exception {
+
+ AbstractConfigurable c = dummyConfigurable;
+ c.getInternalPropertyMap().clear();
+ c.setPropertyStringList("list", new ArrayList<String>());
+ c.getPropertyStringList("list").add("fred");
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-api/src/test/java/org/apache/taverna/configuration/DummyConfigurable.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/test/java/org/apache/taverna/configuration/DummyConfigurable.java b/taverna-configuration-api/src/test/java/org/apache/taverna/configuration/DummyConfigurable.java
new file mode 100644
index 0000000..57911e8
--- /dev/null
+++ b/taverna-configuration-api/src/test/java/org/apache/taverna/configuration/DummyConfigurable.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * 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 org.apache.taverna.configuration;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.taverna.configuration.AbstractConfigurable;
+import org.apache.taverna.configuration.ConfigurationManager;
+
+public class DummyConfigurable extends AbstractConfigurable {
+
+ public DummyConfigurable(ConfigurationManager configurationManager) {
+ super(configurationManager);
+ }
+
+ Map<String,String> defaults = null;
+
+ public String getCategory() {
+ return "test";
+ }
+
+ public Map<String, String> getDefaultPropertyMap() {
+ if (defaults==null) {
+ defaults = new HashMap<String, String>();
+ defaults.put("name","john");
+ defaults.put("colour","blue");
+ }
+ return defaults;
+ }
+
+ public String getUUID() {
+ return "cheese";
+ }
+
+ public String getDisplayName() {
+ return "dummyName";
+ }
+
+ public String getFilePrefix() {
+ return "dummyPrefix";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-api/src/test/java/uk/org/taverna/configuration/AbstractConfigurableTest.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/test/java/uk/org/taverna/configuration/AbstractConfigurableTest.java b/taverna-configuration-api/src/test/java/uk/org/taverna/configuration/AbstractConfigurableTest.java
deleted file mode 100644
index d679188..0000000
--- a/taverna-configuration-api/src/test/java/uk/org/taverna/configuration/AbstractConfigurableTest.java
+++ /dev/null
@@ -1,244 +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 uk.org.taverna.configuration;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.UUID;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class AbstractConfigurableTest {
-
- private ConfigurationManager manager;
-
- private DummyConfigurable dummyConfigurable;
-
- @Before
- public void setup() throws Exception {
- dummyConfigurable = new DummyConfigurable(manager);
- File f = new File(System.getProperty("java.io.tmpdir"));
- File configTestsDir = new File(f,"configTests");
- if (!configTestsDir.exists()) configTestsDir.mkdir();
- final File d = new File(configTestsDir,UUID.randomUUID().toString());
- d.mkdir();
- manager = new ConfigurationManager() {
- private Map<String, Map<String, String>> store = new HashMap<String, Map<String, String>>();
- @Override
- public void store(Configurable configurable) throws Exception {
- if (configurable != null) {
- store.put(configurable.getUUID(), new HashMap<String, String>(configurable.getInternalPropertyMap()));
- }
- }
-
- @Override
- public void populate(Configurable configurable) throws Exception {
- Map<String, String> map = store.get(configurable.getUUID());
- if (map != null) {
- configurable.clear();
- for (Entry<String, String> entry : map.entrySet()) {
- configurable.setProperty(entry.getKey(), entry.getValue());
- }
- }
- }
-
- };
- dummyConfigurable.restoreDefaults();
- }
-
- @Test
- public void testName() {
- assertEquals("Wrong name","dummyName",dummyConfigurable.getDisplayName());
- }
-
- @Test
- public void testCategory() {
- assertEquals("Wrong category","test",dummyConfigurable.getCategory());
- }
-
- @Test
- public void testUUID() {
- assertEquals("Wrong uuid","cheese",dummyConfigurable.getUUID());
- }
-
- @Test
- public void testGetProperty() {
- assertEquals("Should be john","john",dummyConfigurable.getProperty("name"));
- }
-
- @Test
- public void testSetProperty() {
- assertEquals("Should be blue","blue",dummyConfigurable.getProperty("colour"));
- assertNull("Should be null",dummyConfigurable.getProperty("new"));
-
- dummyConfigurable.setProperty("colour", "red");
- dummyConfigurable.setProperty("new", "new value");
-
- assertEquals("Should be red","red",dummyConfigurable.getProperty("colour"));
- assertEquals("Should be new value","new value",dummyConfigurable.getProperty("new"));
- }
-
- @Test
- public void testDeleteValue() {
- assertEquals("Should be blue","blue",dummyConfigurable.getProperty("colour"));
- assertNull("Should be null",dummyConfigurable.getProperty("new"));
-
- dummyConfigurable.setProperty("new", "new value");
-
- assertEquals("Should be new value","new value",dummyConfigurable.getProperty("new"));
-
- dummyConfigurable.deleteProperty("new");
- dummyConfigurable.deleteProperty("colour");
-
- assertNull("Should be null",dummyConfigurable.getProperty("new"));
- assertNull("Should be null",dummyConfigurable.getProperty("colour"));
- }
-
- @Test
- public void testDeleteValueBySettingNull() {
- assertEquals("Should be blue","blue",dummyConfigurable.getProperty("colour"));
- assertNull("Should be null",dummyConfigurable.getProperty("new"));
-
- dummyConfigurable.setProperty("new", "new value");
-
- assertEquals("Should be new value","new value",dummyConfigurable.getProperty("new"));
-
- dummyConfigurable.setProperty("new",null);
- dummyConfigurable.setProperty("colour",null);
-
- assertNull("Should be null",dummyConfigurable.getProperty("new"));
- assertNull("Should be null",dummyConfigurable.getProperty("colour"));
- }
-
- @Test
- public void testRestoreDefaults() {
- assertEquals("There should be 2 values",2,dummyConfigurable.getInternalPropertyMap().size());
-
- dummyConfigurable.setProperty("colour", "red");
- dummyConfigurable.setProperty("new", "new value");
-
- assertEquals("There should be 3 values",3,dummyConfigurable.getInternalPropertyMap().size());
-
- dummyConfigurable.restoreDefaults();
-
- assertEquals("There should be 2 values",2,dummyConfigurable.getInternalPropertyMap().size());
-
- assertEquals("Should be john","john",dummyConfigurable.getProperty("name"));
- assertEquals("Should be john","blue",dummyConfigurable.getProperty("colour"));
- }
-
- @Test
- public void testList() throws Exception {
- AbstractConfigurable c = dummyConfigurable;
- c.getInternalPropertyMap().clear();
- c.setPropertyStringList("list", new ArrayList<String>());
-
- manager.store(c);
- assertTrue("Should be an instanceof a list",c.getPropertyStringList("list") instanceof List);
- assertEquals("there should be 0 items",0,c.getPropertyStringList("list").size());
- manager.populate(c);
-
- assertTrue("Should be an instanceof a list",c.getPropertyStringList("list") instanceof List);
- assertEquals("there should be 0 items",0,c.getPropertyStringList("list").size());
-
- List<String> list = new ArrayList<String>(c.getPropertyStringList("list"));
- list.add("fred");
- c.setPropertyStringList("list", list);
- assertEquals("there should be 1 item",1,c.getPropertyStringList("list").size());
-
- manager.store(c);
- assertEquals("there should be 1 item",1,c.getPropertyStringList("list").size());
- manager.populate(c);
-
- assertEquals("there should be 1 item",1,c.getPropertyStringList("list").size());
- assertEquals("item should be fred","fred",c.getPropertyStringList("list").get(0));
-
- c.getInternalPropertyMap().clear();
- c.setProperty("list", "a,b,c");
- assertEquals("There should be 3 items in the list",3,c.getPropertyStringList("list").size());
- assertEquals("Item 1 should be a","a",c.getPropertyStringList("list").get(0));
- assertEquals("Item 1 should be b","b",c.getPropertyStringList("list").get(1));
- assertEquals("Item 1 should be c","c",c.getPropertyStringList("list").get(2));
-
- }
-
- @Test
- public void testListNotThere() throws Exception {
- AbstractConfigurable c = dummyConfigurable;
- c.getInternalPropertyMap().clear();
- assertNull("the property should be null",c.getProperty("sdflhsdfhsdfjkhsdfkhsdfkhsdfjkh"));
- assertNull("the list should be null if the property doesn't exist",c.getPropertyStringList("sdflhsdfhsdfjkhsdfkhsdfkhsdfjkh"));
- }
-
- @Test
- public void testListDelimeters() throws Exception {
- AbstractConfigurable c = dummyConfigurable;
- c.getInternalPropertyMap().clear();
- c.setPropertyStringList("list", new ArrayList<String>());
-
- assertTrue("Should be an instanceof a list",c.getPropertyStringList("list") instanceof List);
- assertEquals("there should be 0 items",0,((List<String>)c.getPropertyStringList("list")).size());
-
- List<String> list = new ArrayList<String>(c.getPropertyStringList("list"));
- list.add("a,b,c");
- c.setPropertyStringList("list",list);
- assertEquals("there should be 1 items",1,((List<String>)c.getPropertyStringList("list")).size());
-
- list = new ArrayList<String>(c.getPropertyStringList("list"));
- list.add("d");
- c.setPropertyStringList("list",list);
- assertEquals("there should be 2 items",2,((List<String>)c.getPropertyStringList("list")).size());
- assertEquals("The first item should be a,b,c","a,b,c",c.getPropertyStringList("list").get(0));
- assertEquals("The second item should be d","d",c.getPropertyStringList("list").get(1));
-
- manager.store(c);
- assertEquals("there should be 2 items",2,((List<String>)c.getPropertyStringList("list")).size());
- assertEquals("The first item should be a,b,c","a,b,c",c.getPropertyStringList("list").get(0));
- assertEquals("The second item should be d","d",c.getPropertyStringList("list").get(1));
-
- manager.populate(c);
- assertEquals("there should be 2 items",2,((List<String>)c.getPropertyStringList("list")).size());
-
- assertEquals("The first item should be a,b,c","a,b,c",c.getPropertyStringList("list").get(0));
- assertEquals("The second item should be d","d",c.getPropertyStringList("list").get(1));
-
- }
-
- @Test(expected=UnsupportedOperationException.class)
- public void testUnmodifiable() throws Exception {
-
- AbstractConfigurable c = dummyConfigurable;
- c.getInternalPropertyMap().clear();
- c.setPropertyStringList("list", new ArrayList<String>());
- c.getPropertyStringList("list").add("fred");
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-api/src/test/java/uk/org/taverna/configuration/DummyConfigurable.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/src/test/java/uk/org/taverna/configuration/DummyConfigurable.java b/taverna-configuration-api/src/test/java/uk/org/taverna/configuration/DummyConfigurable.java
deleted file mode 100644
index 1f77ca6..0000000
--- a/taverna-configuration-api/src/test/java/uk/org/taverna/configuration/DummyConfigurable.java
+++ /dev/null
@@ -1,65 +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 uk.org.taverna.configuration;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import uk.org.taverna.configuration.AbstractConfigurable;
-import uk.org.taverna.configuration.ConfigurationManager;
-
-public class DummyConfigurable extends AbstractConfigurable {
-
- public DummyConfigurable(ConfigurationManager configurationManager) {
- super(configurationManager);
- }
-
- Map<String,String> defaults = null;
-
- public String getCategory() {
- return "test";
- }
-
- public Map<String, String> getDefaultPropertyMap() {
- if (defaults==null) {
- defaults = new HashMap<String, String>();
- defaults.put("name","john");
- defaults.put("colour","blue");
- }
- return defaults;
- }
-
- public String getUUID() {
- return "cheese";
- }
-
- public String getDisplayName() {
- return "dummyName";
- }
-
- public String getFilePrefix() {
- return "dummyPrefix";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/pom.xml b/taverna-configuration-impl/pom.xml
index 79143c9..c056da9 100644
--- a/taverna-configuration-impl/pom.xml
+++ b/taverna-configuration-impl/pom.xml
@@ -17,8 +17,8 @@
<configuration>
<instructions>
<Import-Package>
- uk.org.taverna.configuration;provide:=true,
- uk.org.taverna.configuration.proxy;provide:=true,*
+ org.apache.taverna.configuration;provide:=true,
+ org.apache.taverna.configuration.proxy;provide:=true,*
</Import-Package>
</instructions>
</configuration>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/impl/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/impl/ConfigurationManagerImpl.java b/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/impl/ConfigurationManagerImpl.java
index b538a7d..9e33c87 100644
--- a/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/impl/ConfigurationManagerImpl.java
+++ b/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/impl/ConfigurationManagerImpl.java
@@ -27,11 +27,10 @@ import java.util.Map;
import java.util.Properties;
import org.apache.log4j.Logger;
+import org.apache.taverna.configuration.Configurable;
+import org.apache.taverna.configuration.ConfigurationManager;
import org.apache.taverna.configuration.app.ApplicationConfiguration;
-import uk.org.taverna.configuration.Configurable;
-import uk.org.taverna.configuration.ConfigurationManager;
-
/**
* Handles the configuration for a {@link Configurable} object
*
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java b/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java
index ddcdf65..7e7462f 100644
--- a/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java
+++ b/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java
@@ -26,10 +26,9 @@ import java.util.Properties;
//import org.apache.axis.AxisProperties;
import org.apache.log4j.Logger;
-
-import uk.org.taverna.configuration.AbstractConfigurable;
-import uk.org.taverna.configuration.ConfigurationManager;
-import uk.org.taverna.configuration.proxy.HttpProxyConfiguration;
+import org.apache.taverna.configuration.AbstractConfigurable;
+import org.apache.taverna.configuration.ConfigurationManager;
+import org.apache.taverna.configuration.proxy.HttpProxyConfiguration;
/**
* The HttpProxyConfiguration handles the configuration of HTTP
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml b/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml
index f99894c..22f877b 100644
--- a/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml
+++ b/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context-osgi.xml
@@ -6,8 +6,8 @@
http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd">
- <service ref="configurationManager" interface="uk.org.taverna.configuration.ConfigurationManager" />
- <service ref="httpProxyConfiguration" interface="uk.org.taverna.configuration.proxy.HttpProxyConfiguration" />
+ <service ref="configurationManager" interface="org.apache.taverna.configuration.ConfigurationManager" />
+ <service ref="httpProxyConfiguration" interface="org.apache.taverna.configuration.proxy.HttpProxyConfiguration" />
<reference id="applicationConfiguration" interface="org.apache.taverna.configuration.app.ApplicationConfiguration" />
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context.xml
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context.xml b/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context.xml
index c797a8d..5026586 100644
--- a/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context.xml
+++ b/taverna-configuration-impl/src/main/resources/META-INF/spring/configuration-context.xml
@@ -4,11 +4,11 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
- <bean id="configurationManager" class="uk.org.taverna.configuration.impl.ConfigurationManagerImpl" >
+ <bean id="configurationManager" class="org.apache.taverna.configuration.impl.ConfigurationManagerImpl" >
<constructor-arg name="applicationConfiguration" ref="applicationConfiguration" />
</bean>
- <bean id="httpProxyConfiguration" class="uk.org.taverna.configuration.proxy.impl.HttpProxyConfigurationImpl">
+ <bean id="httpProxyConfiguration" class="org.apache.taverna.configuration.proxy.impl.HttpProxyConfigurationImpl">
<constructor-arg name="configurationManager" ref="configurationManager" />
</bean>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/ConfigurationManagerImplTest.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/ConfigurationManagerImplTest.java b/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/ConfigurationManagerImplTest.java
index 4bdaf08..3b66b94 100644
--- a/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/ConfigurationManagerImplTest.java
+++ b/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/ConfigurationManagerImplTest.java
@@ -30,14 +30,14 @@ import java.io.FileInputStream;
import java.util.Properties;
import java.util.UUID;
+import org.apache.taverna.configuration.AbstractConfigurable;
+import org.apache.taverna.configuration.Configurable;
+import org.apache.taverna.configuration.DummyConfigurable;
import org.apache.taverna.configuration.app.ApplicationConfiguration;
import org.junit.Before;
import org.junit.Test;
import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
-import uk.org.taverna.configuration.AbstractConfigurable;
-import uk.org.taverna.configuration.Configurable;
-import uk.org.taverna.configuration.DummyConfigurable;
public class ConfigurationManagerImplTest {
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/DummyUIFactory1.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/DummyUIFactory1.java b/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/DummyUIFactory1.java
index 3cbd1ae..08ca082 100644
--- a/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/DummyUIFactory1.java
+++ b/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/DummyUIFactory1.java
@@ -26,8 +26,8 @@ import java.util.Set;
import javax.swing.JPanel;
-import uk.org.taverna.configuration.Configurable;
-import uk.org.taverna.configuration.ConfigurationUIFactory;
+import org.apache.taverna.configuration.Configurable;
+import org.apache.taverna.configuration.ConfigurationUIFactory;
public class DummyUIFactory1 implements ConfigurationUIFactory {
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/cdd45474/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/DummyUIFactory2.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/DummyUIFactory2.java b/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/DummyUIFactory2.java
index b6b3269..a09ff98 100644
--- a/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/DummyUIFactory2.java
+++ b/taverna-configuration-impl/src/test/java/uk/org/taverna/configuration/impl/DummyUIFactory2.java
@@ -25,8 +25,8 @@ import java.util.Set;
import javax.swing.JPanel;
-import uk.org.taverna.configuration.Configurable;
-import uk.org.taverna.configuration.ConfigurationUIFactory;
+import org.apache.taverna.configuration.Configurable;
+import org.apache.taverna.configuration.ConfigurationUIFactory;
public class DummyUIFactory2 implements ConfigurationUIFactory {
[16/17] incubator-taverna-osgi git commit: Apache license file headers
Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractWagonMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractWagonMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractWagonMojo.java
index a74166a..954d6f2 100644
--- a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractWagonMojo.java
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractWagonMojo.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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 net.sf.taverna.t2.maven.plugins;
import org.apache.maven.artifact.manager.WagonManager;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/BundleArtifact.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/BundleArtifact.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/BundleArtifact.java
index 0226a07..9d04aec 100644
--- a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/BundleArtifact.java
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/BundleArtifact.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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 net.sf.taverna.t2.maven.plugins;
import org.apache.maven.artifact.Artifact;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java
index 851abc1..0baedb4 100644
--- a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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 net.sf.taverna.t2.maven.plugins;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/Package.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/Package.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/Package.java
index 5e4a5e5..5b06032 100644
--- a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/Package.java
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/Package.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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 net.sf.taverna.t2.maven.plugins;
import aQute.bnd.version.VersionRange;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/PackageVersion.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/PackageVersion.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/PackageVersion.java
index 14e0dee..bac7c41 100644
--- a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/PackageVersion.java
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/PackageVersion.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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 net.sf.taverna.t2.maven.plugins;
import org.apache.maven.artifact.Artifact;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java
index 43efad2..8e97a32 100644
--- a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2009 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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 net.sf.taverna.t2.maven.plugins;
import static net.sf.taverna.t2.maven.plugins.TavernaPluginGenerateMojo.META_INF_TAVERNA;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java
index d29478a..0141d71 100644
--- a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2009 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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 net.sf.taverna.t2.maven.plugins;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java
index a5706dd..d2162fe 100644
--- a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2009 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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 net.sf.taverna.t2.maven.plugins;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginPrepareBundlesMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginPrepareBundlesMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginPrepareBundlesMojo.java
index 497151f..66f08ad 100644
--- a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginPrepareBundlesMojo.java
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginPrepareBundlesMojo.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2009 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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 net.sf.taverna.t2.maven.plugins;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileDeployMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileDeployMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileDeployMojo.java
index 4244084..d2f9d75 100644
--- a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileDeployMojo.java
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileDeployMojo.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2009 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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 net.sf.taverna.t2.maven.plugins;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java
index d9330cf..879885e 100644
--- a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2009 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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 net.sf.taverna.t2.maven.plugins;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/Utils.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/Utils.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/Utils.java
index 82f5fee..5393711 100644
--- a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/Utils.java
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/Utils.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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 net.sf.taverna.t2.maven.plugins;
import java.io.BufferedReader;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-maven-plugin/src/main/resources/META-INF/plexus/components.xml
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/resources/META-INF/plexus/components.xml b/taverna-maven-plugin/src/main/resources/META-INF/plexus/components.xml
index d458176..802eebc 100644
--- a/taverna-maven-plugin/src/main/resources/META-INF/plexus/components.xml
+++ b/taverna-maven-plugin/src/main/resources/META-INF/plexus/components.xml
@@ -1,3 +1,21 @@
+<!--
+
+ 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.
+
+-->
<component-set>
<components>
<component>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-maven-plugin/src/test/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojoTest.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/test/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojoTest.java b/taverna-maven-plugin/src/test/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojoTest.java
index 6f21fb1..04e5042 100644
--- a/taverna-maven-plugin/src/test/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojoTest.java
+++ b/taverna-maven-plugin/src/test/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojoTest.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2009 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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 net.sf.taverna.t2.maven.plugins;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-maven-plugin/src/test/resources/unit/plugin-config.xml
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/test/resources/unit/plugin-config.xml b/taverna-maven-plugin/src/test/resources/unit/plugin-config.xml
index 0d23438..31e4cc8 100644
--- a/taverna-maven-plugin/src/test/resources/unit/plugin-config.xml
+++ b/taverna-maven-plugin/src/test/resources/unit/plugin-config.xml
@@ -1,3 +1,21 @@
+<!--
+
+ 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>
<build>
<plugins>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-osgi-schemas/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-osgi-schemas/pom.xml b/taverna-osgi-schemas/pom.xml
index 853ff16..4445e3d 100644
--- a/taverna-osgi-schemas/pom.xml
+++ b/taverna-osgi-schemas/pom.xml
@@ -1,3 +1,21 @@
+<!--
+
+ 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-osgi-schemas/src/main/resources/ApplicationPlugin.xsd
----------------------------------------------------------------------
diff --git a/taverna-osgi-schemas/src/main/resources/ApplicationPlugin.xsd b/taverna-osgi-schemas/src/main/resources/ApplicationPlugin.xsd
index 8b5847d..3f11f45 100644
--- a/taverna-osgi-schemas/src/main/resources/ApplicationPlugin.xsd
+++ b/taverna-osgi-schemas/src/main/resources/ApplicationPlugin.xsd
@@ -1,4 +1,22 @@
<?xml version="1.0"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
<xs:schema xmlns="http://ns.taverna.org.uk/2013/application/plugin"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:versions="http://ns.taverna.org.uk/2013/application/versions"
xmlns:ap="http://ns.taverna.org.uk/2013/application/profile"
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-osgi-schemas/src/main/resources/ApplicationProfile.xsd
----------------------------------------------------------------------
diff --git a/taverna-osgi-schemas/src/main/resources/ApplicationProfile.xsd b/taverna-osgi-schemas/src/main/resources/ApplicationProfile.xsd
index 7071b19..4567f9b 100644
--- a/taverna-osgi-schemas/src/main/resources/ApplicationProfile.xsd
+++ b/taverna-osgi-schemas/src/main/resources/ApplicationProfile.xsd
@@ -1,4 +1,22 @@
<?xml version="1.0"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
<xs:schema xmlns="http://ns.taverna.org.uk/2013/application/profile"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:versions="http://ns.taverna.org.uk/2013/application/versions"
xmlns:ap="http://ns.taverna.org.uk/2013/application/profile" xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-osgi-schemas/src/main/resources/ApplicationVersions.xsd
----------------------------------------------------------------------
diff --git a/taverna-osgi-schemas/src/main/resources/ApplicationVersions.xsd b/taverna-osgi-schemas/src/main/resources/ApplicationVersions.xsd
index 768754a..f1c0c71 100644
--- a/taverna-osgi-schemas/src/main/resources/ApplicationVersions.xsd
+++ b/taverna-osgi-schemas/src/main/resources/ApplicationVersions.xsd
@@ -1,4 +1,22 @@
<?xml version="1.0"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
<xs:schema xmlns="http://ns.taverna.org.uk/2013/application/versions"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:versions="http://ns.taverna.org.uk/2013/application/versions"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb" jxb:version="1.0"
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-plugin-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/pom.xml b/taverna-plugin-api/pom.xml
index 1e7ed02..b2db292 100644
--- a/taverna-plugin-api/pom.xml
+++ b/taverna-plugin-api/pom.xml
@@ -1,3 +1,21 @@
+<!--
+
+ 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/Plugin.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/Plugin.java b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/Plugin.java
index 9caa2f8..6689f8a 100644
--- a/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/Plugin.java
+++ b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/Plugin.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.plugin;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginException.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginException.java b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginException.java
index 5b57656..b1998d1 100644
--- a/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginException.java
+++ b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginException.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.plugin;
/**
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginManager.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginManager.java b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginManager.java
index d550e40..aac1583 100644
--- a/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginManager.java
+++ b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginManager.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.plugin;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSite.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSite.java b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSite.java
index 9c69c46..09187d1 100644
--- a/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSite.java
+++ b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSite.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.plugin;
/**
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSiteManager.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSiteManager.java b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSiteManager.java
index 6e7bd30..ce8ad8e 100644
--- a/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSiteManager.java
+++ b/taverna-plugin-api/src/main/java/org/apache/taverna/plugin/PluginSiteManager.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.plugin;
import java.net.URL;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-plugin-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/pom.xml b/taverna-plugin-impl/pom.xml
index 57b0bfb..e33adb0 100644
--- a/taverna-plugin-impl/pom.xml
+++ b/taverna-plugin-impl/pom.xml
@@ -1,3 +1,21 @@
+<!--
+
+ 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginDirectoryWatcher.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginDirectoryWatcher.java b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginDirectoryWatcher.java
index 024c1c7..8f84c46 100644
--- a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginDirectoryWatcher.java
+++ b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginDirectoryWatcher.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.plugin.impl;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginImpl.java b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginImpl.java
index 9958092..8d3b33a 100644
--- a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginImpl.java
+++ b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginImpl.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.plugin.impl;
import static org.apache.taverna.plugin.Plugin.State.STARTED;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginManagerImpl.java b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginManagerImpl.java
index 85f2727..923ea40 100644
--- a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginManagerImpl.java
+++ b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginManagerImpl.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.plugin.impl;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteImpl.java b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteImpl.java
index 06c9237..7c57cbe 100644
--- a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteImpl.java
+++ b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteImpl.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.plugin.impl;
import org.apache.taverna.plugin.PluginSite;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteManagerImpl.java b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteManagerImpl.java
index 5643182..4aa3826 100644
--- a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteManagerImpl.java
+++ b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSiteManagerImpl.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.plugin.impl;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSites.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSites.java b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSites.java
index 2f9da5a..d187080 100644
--- a/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSites.java
+++ b/taverna-plugin-impl/src/main/java/org/apache/taverna/plugin/impl/PluginSites.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.plugin.impl;
import java.util.ArrayList;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml b/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml
index 3643318..342af59 100644
--- a/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml
+++ b/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context-osgi.xml
@@ -1,4 +1,22 @@
<?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.
+
+-->
<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context.xml
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context.xml b/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context.xml
index fe1e7e3..887e8b1 100644
--- a/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context.xml
+++ b/taverna-plugin-impl/src/main/resources/META-INF/spring/plugin-context.xml
@@ -1,4 +1,22 @@
<?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.
+
+-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteImplTest.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteImplTest.java b/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteImplTest.java
index 96b8776..346357a 100644
--- a/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteImplTest.java
+++ b/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteImplTest.java
@@ -1,3 +1,19 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.taverna.plugin.impl;
import static org.junit.Assert.*;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteManagerImplTest.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteManagerImplTest.java b/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteManagerImplTest.java
index 011bf67..55328c4 100644
--- a/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteManagerImplTest.java
+++ b/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteManagerImplTest.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.plugin.impl;
import static org.junit.Assert.*;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-update-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-update-api/pom.xml b/taverna-update-api/pom.xml
index 2b70a7d..0f13cb7 100644
--- a/taverna-update-api/pom.xml
+++ b/taverna-update-api/pom.xml
@@ -1,3 +1,21 @@
+<!--
+
+ 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-update-api/src/main/java/org/apache/taverna/update/UpdateException.java
----------------------------------------------------------------------
diff --git a/taverna-update-api/src/main/java/org/apache/taverna/update/UpdateException.java b/taverna-update-api/src/main/java/org/apache/taverna/update/UpdateException.java
index 0794de1..6558b1b 100644
--- a/taverna-update-api/src/main/java/org/apache/taverna/update/UpdateException.java
+++ b/taverna-update-api/src/main/java/org/apache/taverna/update/UpdateException.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.update;
/**
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-update-api/src/main/java/org/apache/taverna/update/UpdateManager.java
----------------------------------------------------------------------
diff --git a/taverna-update-api/src/main/java/org/apache/taverna/update/UpdateManager.java b/taverna-update-api/src/main/java/org/apache/taverna/update/UpdateManager.java
index 690bd2d..e61e365 100644
--- a/taverna-update-api/src/main/java/org/apache/taverna/update/UpdateManager.java
+++ b/taverna-update-api/src/main/java/org/apache/taverna/update/UpdateManager.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.update;
/**
[12/17] incubator-taverna-osgi git commit: Fixed broken import
Posted by st...@apache.org.
Fixed broken import
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/4895df6f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/4895df6f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/4895df6f
Branch: refs/heads/master
Commit: 4895df6f87206c5447e8e0f63f6b794650c32078
Parents: b589018
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Oct 18 15:18:21 2015 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Oct 18 15:18:21 2015 +0100
----------------------------------------------------------------------
.../org/apache/taverna/plugin/impl/PluginSiteManagerImplTest.java | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/4895df6f/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteManagerImplTest.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteManagerImplTest.java b/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteManagerImplTest.java
index 2083283..011bf67 100644
--- a/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteManagerImplTest.java
+++ b/taverna-plugin-impl/src/test/java/org/apache/taverna/plugin/impl/PluginSiteManagerImplTest.java
@@ -32,7 +32,6 @@ import org.apache.taverna.download.DownloadException;
import org.apache.taverna.download.DownloadManager;
import org.apache.taverna.plugin.PluginException;
import org.apache.taverna.plugin.impl.PluginSiteManagerImpl;
-import org.apache.taverna.plugin.impl.org;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
[15/17] incubator-taverna-osgi git commit: Apache license file headers
Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-update-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-update-impl/pom.xml b/taverna-update-impl/pom.xml
index 10a7524..d20464a 100644
--- a/taverna-update-impl/pom.xml
+++ b/taverna-update-impl/pom.xml
@@ -1,3 +1,21 @@
+<!--
+
+ 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-update-impl/src/main/java/org/apache/taverna/update/impl/UpdateManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-update-impl/src/main/java/org/apache/taverna/update/impl/UpdateManagerImpl.java b/taverna-update-impl/src/main/java/org/apache/taverna/update/impl/UpdateManagerImpl.java
index 55113fb..6f6b4b5 100644
--- a/taverna-update-impl/src/main/java/org/apache/taverna/update/impl/UpdateManagerImpl.java
+++ b/taverna-update-impl/src/main/java/org/apache/taverna/update/impl/UpdateManagerImpl.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2013 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.update.impl;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml b/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml
index 44dba6e..8fcfbc5 100644
--- a/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml
+++ b/taverna-update-impl/src/main/resources/META-INF/spring/update-context-osgi.xml
@@ -1,4 +1,22 @@
<?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.
+
+-->
<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/taverna-update-impl/src/main/resources/META-INF/spring/update-context.xml
----------------------------------------------------------------------
diff --git a/taverna-update-impl/src/main/resources/META-INF/spring/update-context.xml b/taverna-update-impl/src/main/resources/META-INF/spring/update-context.xml
index c0d9b75..cd506d5 100644
--- a/taverna-update-impl/src/main/resources/META-INF/spring/update-context.xml
+++ b/taverna-update-impl/src/main/resources/META-INF/spring/update-context.xml
@@ -1,4 +1,22 @@
<?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.
+
+-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/xml-parser-service/pom.xml
----------------------------------------------------------------------
diff --git a/xml-parser-service/pom.xml b/xml-parser-service/pom.xml
index 8ded30e..ecf19ba 100644
--- a/xml-parser-service/pom.xml
+++ b/xml-parser-service/pom.xml
@@ -1,3 +1,21 @@
+<!--
+
+ 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/xml-transformer-service/pom.xml
----------------------------------------------------------------------
diff --git a/xml-transformer-service/pom.xml b/xml-transformer-service/pom.xml
index 1677297..da12012 100644
--- a/xml-transformer-service/pom.xml
+++ b/xml-transformer-service/pom.xml
@@ -1,3 +1,21 @@
+<!--
+
+ 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/84b5025d/xml-transformer-service/src/main/java/org/apache/taverna/xmltransformer/XMLTransformerActivator.java
----------------------------------------------------------------------
diff --git a/xml-transformer-service/src/main/java/org/apache/taverna/xmltransformer/XMLTransformerActivator.java b/xml-transformer-service/src/main/java/org/apache/taverna/xmltransformer/XMLTransformerActivator.java
index 8051a54..d0ea084 100644
--- a/xml-transformer-service/src/main/java/org/apache/taverna/xmltransformer/XMLTransformerActivator.java
+++ b/xml-transformer-service/src/main/java/org/apache/taverna/xmltransformer/XMLTransformerActivator.java
@@ -1,23 +1,19 @@
-/*******************************************************************************
- * Copyright (C) 2011 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.
+/**
+ * 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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
- ******************************************************************************/
+ * 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.xmltransformer;
import java.io.BufferedReader;