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/03/20 15:23:04 UTC
[50/51] [abbrv] [partial] incubator-taverna-workbench git commit:
taverna-workbench-* -> taverna-*
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 8071aff..c4f10e9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,58 +40,58 @@
<module>taverna-disabled-activity-ui</module>
<module>taverna-stringconstant-activity-ui</module>
<module>taverna-unrecognized-activity-ui</module>
- <module>taverna-workbench-activity-icons-api</module>
- <module>taverna-workbench-activity-palette-api</module>
- <module>taverna-workbench-activity-palette-impl</module>
- <module>taverna-workbench-activity-palette-ui</module>
- <module>taverna-workbench-activity-tools</module>
- <module>taverna-workbench-configuration-api</module>
- <module>taverna-workbench-configuration-impl</module>
- <module>taverna-workbench-contextual-views</module>
- <module>taverna-workbench-contextual-views-api</module>
- <module>taverna-workbench-contextual-views-impl</module>
- <module>taverna-workbench-credential-manager-ui</module>
- <module>taverna-workbench-data-management-config-ui</module>
- <module>taverna-workbench-design-ui</module>
- <module>taverna-workbench-edits-api</module>
- <module>taverna-workbench-edits-impl</module>
- <module>taverna-workbench-file-api</module>
- <module>taverna-workbench-file-impl</module>
- <module>taverna-workbench-graph-model</module>
- <module>taverna-workbench-graph-view</module>
- <module>taverna-workbench-helper-api</module>
- <module>taverna-workbench-httpproxy-config</module>
- <module>taverna-workbench-iteration-strategy-ui</module>
- <module>taverna-workbench-loop-ui</module>
- <module>taverna-workbench-menu-api</module>
- <module>taverna-workbench-menu-impl</module>
- <module>taverna-workbench-menu-items</module>
- <module>taverna-workbench-monitor-view</module>
- <module>taverna-workbench-parallelize-ui</module>
- <module>taverna-workbench-perspective-biocatalogue</module>
- <module>taverna-workbench-perspective-design</module>
- <module>taverna-workbench-perspective-myexperiment</module>
- <module>taverna-workbench-perspective-results</module>
- <module>taverna-workbench-plugin-manager</module>
- <module>taverna-workbench-plugins-gui</module>
- <module>taverna-workbench-reference-ui</module>
- <module>taverna-workbench-renderers-api</module>
- <module>taverna-workbench-renderers-exts</module>
- <module>taverna-workbench-renderers-impl</module>
- <module>taverna-workbench-report-api</module>
- <module>taverna-workbench-report-explainer</module>
- <module>taverna-workbench-report-impl</module>
- <module>taverna-workbench-report-view</module>
- <module>taverna-workbench-results-view</module>
- <module>taverna-workbench-retry-ui</module>
- <module>taverna-workbench-run-ui</module>
- <module>taverna-workbench-selection-api</module>
- <module>taverna-workbench-selection-impl</module>
- <module>taverna-workbench-update-manager</module>
- <module>taverna-workbench-workbench-api</module>
- <module>taverna-workbench-workbench-impl</module>
- <module>taverna-workbench-workflow-explorer</module>
- <module>taverna-workbench-workflow-view</module>
+ <module>taverna-activity-icons-api</module>
+ <module>taverna-activity-palette-api</module>
+ <module>taverna-activity-palette-impl</module>
+ <module>taverna-activity-palette-ui</module>
+ <module>taverna-activity-tools</module>
+ <module>taverna-configuration-api</module>
+ <module>taverna-configuration-impl</module>
+ <module>taverna-contextual-views</module>
+ <module>taverna-contextual-views-api</module>
+ <module>taverna-contextual-views-impl</module>
+ <module>taverna-credential-manager-ui</module>
+ <module>taverna-data-management-config-ui</module>
+ <module>taverna-design-ui</module>
+ <module>taverna-edits-api</module>
+ <module>taverna-edits-impl</module>
+ <module>taverna-file-api</module>
+ <module>taverna-file-impl</module>
+ <module>taverna-graph-model</module>
+ <module>taverna-graph-view</module>
+ <module>taverna-helper-api</module>
+ <module>taverna-httpproxy-config</module>
+ <module>taverna-iteration-strategy-ui</module>
+ <module>taverna-loop-ui</module>
+ <module>taverna-menu-api</module>
+ <module>taverna-menu-impl</module>
+ <module>taverna-menu-items</module>
+ <module>taverna-monitor-view</module>
+ <module>taverna-parallelize-ui</module>
+ <module>taverna-perspective-biocatalogue</module>
+ <module>taverna-perspective-design</module>
+ <module>taverna-perspective-myexperiment</module>
+ <module>taverna-perspective-results</module>
+ <module>taverna-plugin-manager</module>
+ <module>taverna-plugins-gui</module>
+ <module>taverna-reference-ui</module>
+ <module>taverna-renderers-api</module>
+ <module>taverna-renderers-exts</module>
+ <module>taverna-renderers-impl</module>
+ <module>taverna-report-api</module>
+ <module>taverna-report-explainer</module>
+ <module>taverna-report-impl</module>
+ <module>taverna-report-view</module>
+ <module>taverna-results-view</module>
+ <module>taverna-retry-ui</module>
+ <module>taverna-run-ui</module>
+ <module>taverna-selection-api</module>
+ <module>taverna-selection-impl</module>
+ <module>taverna-update-manager</module>
+ <module>taverna-workbench-api</module>
+ <module>taverna-workbench-impl</module>
+ <module>taverna-workflow-explorer</module>
+ <module>taverna-workflow-view</module>
<module>taverna-beaninfo</module>
<module>taverna-io</module>
<module>taverna-ui</module>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-icons-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-icons-api/pom.xml b/taverna-activity-icons-api/pom.xml
new file mode 100644
index 0000000..2bf3ffc
--- /dev/null
+++ b/taverna-activity-icons-api/pom.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
+ </parent>
+ <artifactId>taverna-activity-icons-api</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Taverna Activity icon manager API</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.taverna.language</groupId>
+ <artifactId>taverna-scufl2-api</artifactId>
+ <version>${taverna.language.version}</version>
+ </dependency>
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-icons-api/src/main/java/net/sf/taverna/t2/workbench/activityicons/ActivityIconManager.java
----------------------------------------------------------------------
diff --git a/taverna-activity-icons-api/src/main/java/net/sf/taverna/t2/workbench/activityicons/ActivityIconManager.java b/taverna-activity-icons-api/src/main/java/net/sf/taverna/t2/workbench/activityicons/ActivityIconManager.java
new file mode 100644
index 0000000..d2c8fff
--- /dev/null
+++ b/taverna-activity-icons-api/src/main/java/net/sf/taverna/t2/workbench/activityicons/ActivityIconManager.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * 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 net.sf.taverna.t2.workbench.activityicons;
+
+import java.net.URI;
+
+import javax.swing.Icon;
+
+import uk.org.taverna.scufl2.api.activity.Activity;
+
+/**
+ * Manager for activities' icons.
+ *
+ * @author David Withers
+ */
+public interface ActivityIconManager {
+ /** Returns an icon for the Activity. */
+ Icon iconForActivity(URI activityType);
+
+ Icon iconForActivity(Activity activity);
+
+ void resetIcon(URI activityType);
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-icons-api/src/main/java/net/sf/taverna/t2/workbench/activityicons/ActivityIconSPI.java
----------------------------------------------------------------------
diff --git a/taverna-activity-icons-api/src/main/java/net/sf/taverna/t2/workbench/activityicons/ActivityIconSPI.java b/taverna-activity-icons-api/src/main/java/net/sf/taverna/t2/workbench/activityicons/ActivityIconSPI.java
new file mode 100644
index 0000000..7270dfc
--- /dev/null
+++ b/taverna-activity-icons-api/src/main/java/net/sf/taverna/t2/workbench/activityicons/ActivityIconSPI.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.workbench.activityicons;
+
+import java.net.URI;
+
+import javax.swing.Icon;
+
+/**
+ * Defines an interface for getting an icon for an Activity.
+ *
+ * @author Alex Nenadic
+ */
+public interface ActivityIconSPI {
+ /**
+ * A return value for {@link canProvideIconScore()} indicating an SPI cannot
+ * provide an icon for a given activity.
+ */
+ int NO_ICON = 0;
+
+ /**
+ * {@link DefaultActivityIcon} returns this value that will be used when an
+ * activity that has no other SPI providing an icon for. Any SPI shour
+ * return value of at least DEFAULT_ICON + 1 if they want to 'override' the
+ * default icon.
+ */
+ int DEFAULT_ICON = 10;
+
+ /**
+ * Returns a positive number if the class can provide an icon for the given
+ * activity or {@link NO_ICON} otherwise. Out of two SPIs capable of
+ * providing an icon for the same activity, the one returning a higher score
+ * will be used.
+ */
+ int canProvideIconScore(URI activityType);
+
+ /** Returns an icon for the Activity. */
+ Icon getIcon(URI activityType);
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-icons-api/src/main/java/net/sf/taverna/t2/workbench/activityicons/DefaultActivityIcon.java
----------------------------------------------------------------------
diff --git a/taverna-activity-icons-api/src/main/java/net/sf/taverna/t2/workbench/activityicons/DefaultActivityIcon.java b/taverna-activity-icons-api/src/main/java/net/sf/taverna/t2/workbench/activityicons/DefaultActivityIcon.java
new file mode 100644
index 0000000..c474e69
--- /dev/null
+++ b/taverna-activity-icons-api/src/main/java/net/sf/taverna/t2/workbench/activityicons/DefaultActivityIcon.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.workbench.activityicons;
+
+import java.net.URI;
+
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+
+public class DefaultActivityIcon implements ActivityIconSPI {
+ private static final String ICON_RESOURCE = "/default-activity-icon.png";
+
+ @Override
+ public int canProvideIconScore(URI activityType) {
+ // For any activity we can provide a default icon
+ return DEFAULT_ICON;
+ }
+
+ @Override
+ public Icon getIcon(URI activityType) {
+ return getDefaultIcon();
+ }
+
+ public static Icon getDefaultIcon() {
+ return IconLoader.icon;
+ }
+
+ private static class IconLoader {
+ static final Icon icon = loadDefaultIcon();
+
+ private static Icon loadDefaultIcon() {
+ return new ImageIcon(
+ DefaultActivityIcon.class.getResource(ICON_RESOURCE));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-icons-api/src/main/java/net/sf/taverna/t2/workbench/activityicons/impl/ActivityIconManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-activity-icons-api/src/main/java/net/sf/taverna/t2/workbench/activityicons/impl/ActivityIconManagerImpl.java b/taverna-activity-icons-api/src/main/java/net/sf/taverna/t2/workbench/activityicons/impl/ActivityIconManagerImpl.java
new file mode 100644
index 0000000..f8294fc
--- /dev/null
+++ b/taverna-activity-icons-api/src/main/java/net/sf/taverna/t2/workbench/activityicons/impl/ActivityIconManagerImpl.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.workbench.activityicons.impl;
+
+import static net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI.NO_ICON;
+
+import java.net.URI;
+import java.util.List;
+import java.util.WeakHashMap;
+
+import javax.swing.Icon;
+
+import uk.org.taverna.scufl2.api.activity.Activity;
+import net.sf.taverna.t2.workbench.activityicons.ActivityIconManager;
+import net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI;
+
+/**
+ * Manager for activities' icons.
+ *
+ * @author Alex Nenadic
+ * @author Alan R Williams
+ */
+public class ActivityIconManagerImpl implements ActivityIconManager {
+ /** Cache of already obtained icons; maps activities to their icons*/
+ private WeakHashMap<URI, Icon> iconsMap = new WeakHashMap<>();
+
+ private List<ActivityIconSPI> activityIcons;
+
+ /** Returns an icon for the Activity. */
+ @Override
+ public Icon iconForActivity(URI activityType) {
+ Icon icon = iconsMap.get(activityType);
+ if (icon != null)
+ return icon;
+ int bestScore = NO_ICON;
+ ActivityIconSPI bestSPI = null;
+ for (ActivityIconSPI spi : activityIcons) {
+ int spiScore = spi.canProvideIconScore(activityType);
+ if (spiScore > bestScore) {
+ bestSPI = spi;
+ bestScore = spiScore;
+ }
+ }
+ if (bestSPI == null)
+ return null;
+ icon = bestSPI.getIcon(activityType);
+ iconsMap.put(activityType, icon);
+ return icon;
+ }
+
+ @Override
+ public Icon iconForActivity(Activity activity) {
+ return iconForActivity(activity.getType());
+ }
+
+ @Override
+ public void resetIcon(URI activityType) {
+ Icon icon = iconsMap.get(activityType);
+ if (icon != null)
+ iconsMap.remove(activityType);
+ iconForActivity(activityType);
+ }
+
+ public void setActivityIcons(List<ActivityIconSPI> activityIcons) {
+ this.activityIcons = activityIcons;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-icons-api/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI
----------------------------------------------------------------------
diff --git a/taverna-activity-icons-api/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI b/taverna-activity-icons-api/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI
new file mode 100644
index 0000000..d268c81
--- /dev/null
+++ b/taverna-activity-icons-api/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI
@@ -0,0 +1 @@
+net.sf.taverna.t2.workbench.activityicons.DefaultActivityIcon
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-icons-api/src/main/resources/META-INF/spring/activity-icons-api-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-icons-api/src/main/resources/META-INF/spring/activity-icons-api-context-osgi.xml b/taverna-activity-icons-api/src/main/resources/META-INF/spring/activity-icons-api-context-osgi.xml
new file mode 100644
index 0000000..5c67640
--- /dev/null
+++ b/taverna-activity-icons-api/src/main/resources/META-INF/spring/activity-icons-api-context-osgi.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/osgi
+ http://www.springframework.org/schema/osgi/spring-osgi.xsd">
+
+ <service ref="DefaultActivityIcon" interface="net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI" />
+
+ <service ref="ActivityIconManager" interface="net.sf.taverna.t2.workbench.activityicons.ActivityIconManager" />
+
+ <list id="activityIcons" interface="net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI" cardinality="0..N" />
+
+</beans:beans>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-icons-api/src/main/resources/META-INF/spring/activity-icons-api-context.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-icons-api/src/main/resources/META-INF/spring/activity-icons-api-context.xml b/taverna-activity-icons-api/src/main/resources/META-INF/spring/activity-icons-api-context.xml
new file mode 100644
index 0000000..93c98c4
--- /dev/null
+++ b/taverna-activity-icons-api/src/main/resources/META-INF/spring/activity-icons-api-context.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <bean id="DefaultActivityIcon" class="net.sf.taverna.t2.workbench.activityicons.DefaultActivityIcon" />
+
+ <bean id="ActivityIconManager" class="net.sf.taverna.t2.workbench.activityicons.impl.ActivityIconManagerImpl">
+ <property name="activityIcons" ref="activityIcons" />
+ </bean>
+
+
+</beans>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-icons-api/src/main/resources/default-activity-icon.png
----------------------------------------------------------------------
diff --git a/taverna-activity-icons-api/src/main/resources/default-activity-icon.png b/taverna-activity-icons-api/src/main/resources/default-activity-icon.png
new file mode 100644
index 0000000..b7ed3e9
Binary files /dev/null and b/taverna-activity-icons-api/src/main/resources/default-activity-icon.png differ
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/pom.xml b/taverna-activity-palette-api/pom.xml
new file mode 100644
index 0000000..eb21d63
--- /dev/null
+++ b/taverna-activity-palette-api/pom.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
+ </parent>
+ <artifactId>taverna-activity-palette-api</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Taverna Activity Palette API</name>
+ <dependencies>
+ <dependency>
+ <groupId>${project.parent.groupId}</groupId>
+ <artifactId>taverna-workbench-api</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.parent.groupId}</groupId>
+ <artifactId>taverna-edits-api</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.parent.groupId}</groupId>
+ <artifactId>taverna-beans</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-configuration-api</artifactId>
+ <version>${taverna.osgi.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.taverna.language</groupId>
+ <artifactId>taverna-scufl2-api</artifactId>
+ <version>${taverna.language.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/AbstractConfigurableServiceProvider.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/AbstractConfigurableServiceProvider.java b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/AbstractConfigurableServiceProvider.java
new file mode 100644
index 0000000..18cb176
--- /dev/null
+++ b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/AbstractConfigurableServiceProvider.java
@@ -0,0 +1,53 @@
+package net.sf.taverna.t2.servicedescriptions;
+
+import uk.org.taverna.scufl2.api.configurations.Configuration;
+
+public abstract class AbstractConfigurableServiceProvider extends
+ IdentifiedObject implements ConfigurableServiceProvider {
+ protected Configuration serviceProviderConfig;
+
+ /**
+ * Construct configurable service provider.
+ *
+ * @param configTemplate
+ * Template configuration
+ */
+ public AbstractConfigurableServiceProvider(Configuration configTemplate) {
+ if (configTemplate == null)
+ throw new NullPointerException("Default config can't be null");
+ serviceProviderConfig = configTemplate;
+ }
+
+ /**
+ * Package access constructor - only used with {@link #clone()} - otherwise
+ * use {@link #AbstractConfigurableServiceProvider(Object)}
+ */
+ AbstractConfigurableServiceProvider() {
+ }
+
+ @Override
+ public AbstractConfigurableServiceProvider clone() {
+ AbstractConfigurableServiceProvider provider = (AbstractConfigurableServiceProvider) newInstance();
+ Configuration configuration = getConfiguration();
+ if (configuration != null)
+ provider.configure(configuration);
+ return provider;
+ }
+
+ @Override
+ public synchronized void configure(Configuration conf) {
+ if (conf == null)
+ throw new IllegalArgumentException("Config can't be null");
+ this.serviceProviderConfig = conf;
+ }
+
+ @Override
+ public Configuration getConfiguration() {
+ return serviceProviderConfig;
+ }
+
+ @Override
+ public String toString() {
+ return getName() + " " + getConfiguration();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/AbstractTemplateService.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/AbstractTemplateService.java b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/AbstractTemplateService.java
new file mode 100644
index 0000000..d4909b1
--- /dev/null
+++ b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/AbstractTemplateService.java
@@ -0,0 +1,85 @@
+package net.sf.taverna.t2.servicedescriptions;
+
+import static java.util.Collections.singleton;
+
+import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+
+import uk.org.taverna.scufl2.api.configurations.Configuration;
+
+public abstract class AbstractTemplateService implements
+ ServiceDescriptionProvider {
+ protected TemplateServiceDescription templateService = new TemplateServiceDescription();
+
+ @Override
+ public void findServiceDescriptionsAsync(
+ FindServiceDescriptionsCallBack callBack) {
+ callBack.partialResults(singleton(templateService));
+ callBack.finished();
+ }
+
+ @Override
+ public abstract Icon getIcon();
+
+ public URI getActivityType() {
+ return null;
+ }
+
+ public abstract Configuration getActivityConfiguration();
+
+ public class TemplateServiceDescription extends ServiceDescription {
+ @Override
+ public Icon getIcon() {
+ return AbstractTemplateService.this.getIcon();
+ }
+
+ @Override
+ public String getName() {
+ return AbstractTemplateService.this.getName();
+ }
+
+ @Override
+ public List<String> getPath() {
+ return Arrays.asList(SERVICE_TEMPLATES);
+ }
+
+ @Override
+ public boolean isTemplateService() {
+ return true;
+ }
+
+ @Override
+ protected List<Object> getIdentifyingData() {
+ // Do it by object identity
+ return null;
+ }
+
+ @Override
+ public URI getActivityType() {
+ return AbstractTemplateService.this.getActivityType();
+ }
+
+ @Override
+ public Configuration getActivityConfiguration() {
+ return AbstractTemplateService.this.getActivityConfiguration();
+ }
+
+ @Override
+ public String getDescription() {
+ return AbstractTemplateService.this.getDescription();
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "Template service " + getName();
+ }
+
+ public String getDescription() {
+ // Default to an empty string
+ return "";
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/ConfigurableServiceProvider.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/ConfigurableServiceProvider.java b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/ConfigurableServiceProvider.java
new file mode 100644
index 0000000..0bf01bd
--- /dev/null
+++ b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/ConfigurableServiceProvider.java
@@ -0,0 +1,10 @@
+package net.sf.taverna.t2.servicedescriptions;
+
+import uk.org.taverna.scufl2.api.common.Configurable;
+import uk.org.taverna.scufl2.api.configurations.Configuration;
+
+public interface ConfigurableServiceProvider extends
+ ServiceDescriptionProvider, Configurable, Cloneable {
+ void configure(Configuration configuration) throws Exception;
+ Configuration getConfiguration();
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/CustomizedConfigurePanelProvider.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/CustomizedConfigurePanelProvider.java b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/CustomizedConfigurePanelProvider.java
new file mode 100644
index 0000000..8bb5331
--- /dev/null
+++ b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/CustomizedConfigurePanelProvider.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.servicedescriptions;
+
+import uk.org.taverna.scufl2.api.configurations.Configuration;
+
+public interface CustomizedConfigurePanelProvider extends
+ ConfigurableServiceProvider {
+ void createCustomizedConfigurePanel(CustomizedConfigureCallBack callBack);
+
+ interface CustomizedConfigureCallBack {
+ void newProviderConfiguration(Configuration providerConfig);
+
+ Configuration getTemplateConfig();
+
+ ServiceDescriptionRegistry getServiceDescriptionRegistry();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/IdentifiedObject.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/IdentifiedObject.java b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/IdentifiedObject.java
new file mode 100644
index 0000000..596f502
--- /dev/null
+++ b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/IdentifiedObject.java
@@ -0,0 +1,30 @@
+package net.sf.taverna.t2.servicedescriptions;
+
+import java.util.List;
+
+import net.sf.taverna.t2.lang.beans.PropertyAnnotated;
+
+public abstract class IdentifiedObject extends PropertyAnnotated {
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof IdentifiedObject))
+ return false;
+ List<? extends Object> myIdentifyingData = getIdentifyingData();
+ if (myIdentifyingData == null)
+ return super.equals(obj);
+ if (!getClass().isInstance(obj) && obj.getClass().isInstance(this))
+ return false;
+ IdentifiedObject id = (IdentifiedObject) obj;
+ return myIdentifyingData.equals(id.getIdentifyingData());
+ }
+
+ @Override
+ public int hashCode() {
+ List<? extends Object> identifyingData = getIdentifyingData();
+ if (identifyingData == null)
+ return super.hashCode();
+ return identifyingData.hashCode();
+ }
+
+ protected abstract List<? extends Object> getIdentifyingData();
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/ServiceDescription.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/ServiceDescription.java b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/ServiceDescription.java
new file mode 100644
index 0000000..8551934
--- /dev/null
+++ b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/ServiceDescription.java
@@ -0,0 +1,80 @@
+package net.sf.taverna.t2.servicedescriptions;
+
+import java.net.URI;
+import java.util.List;
+
+import javax.swing.Icon;
+
+import net.sf.taverna.t2.lang.beans.PropertyAnnotation;
+import net.sf.taverna.t2.workbench.edits.Edit;
+import uk.org.taverna.scufl2.api.activity.Activity;
+import uk.org.taverna.scufl2.api.configurations.Configuration;
+import uk.org.taverna.scufl2.api.core.Processor;
+import uk.org.taverna.scufl2.api.core.Workflow;
+
+public abstract class ServiceDescription extends IdentifiedObject {
+ public static final String SERVICE_TEMPLATES = "Service templates";
+ private static final String NAME = "Name";
+ private static final String SERVICE_CONFIGURATION = "Service configuration";
+ private static final String SERVICE_IMPLEMENTATION_URI = "Service implementation URI";
+ private static final String DESCRIPTION = "Description";
+ public static final String LOCAL_SERVICES = "Local services";
+
+ private String description = "";
+
+ @PropertyAnnotation(expert = true, displayName = SERVICE_IMPLEMENTATION_URI)
+ public abstract URI getActivityType();
+
+ @PropertyAnnotation(expert = true, displayName = SERVICE_CONFIGURATION)
+ public Configuration getActivityConfiguration() {
+ Configuration configuration = new Configuration();
+ configuration.setType(getActivityType().resolve("#Config"));
+ return configuration;
+ }
+
+ @PropertyAnnotation(displayName = DESCRIPTION)
+ public String getDescription() {
+ return this.description;
+ }
+
+ @PropertyAnnotation(expert = true)
+ public abstract Icon getIcon();
+
+ @PropertyAnnotation(displayName = NAME)
+ public abstract String getName();
+
+ @PropertyAnnotation(expert = true)
+ public abstract List<? extends Comparable<?>> getPath();
+
+ @PropertyAnnotation(hidden = true)
+ public boolean isTemplateService() {
+ return false;
+ }
+
+ /**
+ * @param description
+ * the description to set
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ @Override
+ public String toString() {
+ return "Service description " + getName();
+ }
+
+ /**
+ * Any additional edit that needs to be performed upon insertion of an
+ * instance of the ServiceDescription into the {@link Workflow} within the
+ * specified {@link Processor}
+ *
+ * @param dataflow
+ * @param p
+ * @param a
+ * @return
+ */
+ public Edit<?> getInsertionEdit(Workflow dataflow, Processor p, Activity a) {
+ return null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/ServiceDescriptionProvider.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/ServiceDescriptionProvider.java b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/ServiceDescriptionProvider.java
new file mode 100644
index 0000000..8170819
--- /dev/null
+++ b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/ServiceDescriptionProvider.java
@@ -0,0 +1,61 @@
+package net.sf.taverna.t2.servicedescriptions;
+
+import java.util.Collection;
+
+import javax.swing.Icon;
+
+import net.sf.taverna.t2.lang.beans.PropertyAnnotation;
+
+/**
+ * A provider of service descriptions
+ *
+ * @author Stian Soiland-Reyes
+ */
+public interface ServiceDescriptionProvider {
+ /**
+ * Get all service descriptions.
+ *
+ * @param callBack
+ */
+ void findServiceDescriptionsAsync(FindServiceDescriptionsCallBack callBack);
+
+ /**
+ * @author stain
+ */
+ interface FindServiceDescriptionsCallBack {
+ void partialResults(
+ Collection<? extends ServiceDescription> serviceDescriptions);
+
+ void status(String message);
+
+ void warning(String message);
+
+ void finished();
+
+ void fail(String message, Throwable ex);
+ }
+
+ /**
+ * Name of this service description provider, for instance "BioCatalogue" or
+ * "WSDL". This name is typically used in a "Add service..." menu.
+ *
+ * @return Name of provider
+ */
+ String getName();
+
+ @PropertyAnnotation(expert = true)
+ abstract Icon getIcon();
+
+ /**
+ * @return unique id of this provider.
+ */
+ String getId();
+
+ /**
+ * Create a new copy of this service provider. It <i>need not be
+ * configured</i> at the point where it is returned.
+ *
+ * @return The copy.
+ */
+ ServiceDescriptionProvider newInstance();
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/ServiceDescriptionRegistry.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/ServiceDescriptionRegistry.java b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/ServiceDescriptionRegistry.java
new file mode 100644
index 0000000..e9b6c04
--- /dev/null
+++ b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/ServiceDescriptionRegistry.java
@@ -0,0 +1,50 @@
+package net.sf.taverna.t2.servicedescriptions;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URL;
+import java.util.List;
+import java.util.Set;
+
+import net.sf.taverna.t2.lang.observer.Observable;
+import net.sf.taverna.t2.servicedescriptions.events.ServiceDescriptionRegistryEvent;
+
+public interface ServiceDescriptionRegistry extends
+ Observable<ServiceDescriptionRegistryEvent> {
+ void addServiceDescriptionProvider(ServiceDescriptionProvider provider);
+
+ Set<ServiceDescriptionProvider> getDefaultServiceDescriptionProviders();
+
+ Set<ServiceDescriptionProvider> getServiceDescriptionProviders();
+
+ Set<ServiceDescriptionProvider> getServiceDescriptionProviders(
+ ServiceDescription sd);
+
+ Set<ServiceDescription> getServiceDescriptions();
+
+ ServiceDescription getServiceDescription(URI activityType);
+
+ List<ConfigurableServiceProvider> getUnconfiguredServiceProviders();
+
+ Set<ServiceDescriptionProvider> getUserAddedServiceProviders();
+
+ Set<ServiceDescriptionProvider> getUserRemovedServiceProviders();
+
+ void loadServiceProviders();
+
+ void loadServiceProviders(File serviceProvidersURL);
+
+ void loadServiceProviders(URL serviceProvidersURL);
+
+ void refresh();
+
+ void removeServiceDescriptionProvider(ServiceDescriptionProvider provider);
+
+ void saveServiceDescriptions();
+
+ void saveServiceDescriptions(File serviceDescriptionsFile);
+
+ void exportCurrentServiceDescriptions(File serviceDescriptionsFile);
+
+ boolean isDefaultSystemConfigurableProvidersLoaded();
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/ServiceDescriptionsConfiguration.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/ServiceDescriptionsConfiguration.java b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/ServiceDescriptionsConfiguration.java
new file mode 100644
index 0000000..7fbcbfc
--- /dev/null
+++ b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/ServiceDescriptionsConfiguration.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (C) 2012 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.servicedescriptions;
+
+import uk.org.taverna.configuration.Configurable;
+
+/**
+ * @author David Withers
+ */
+public interface ServiceDescriptionsConfiguration extends Configurable {
+ public boolean isIncludeDefaults();
+
+ public void setIncludeDefaults(boolean includeDefaults);
+
+ public boolean isRemovePermanently();
+
+ public void setRemovePermanently(boolean removePermanently);
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/AbstractProviderEvent.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/AbstractProviderEvent.java b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/AbstractProviderEvent.java
new file mode 100644
index 0000000..1fd224e
--- /dev/null
+++ b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/AbstractProviderEvent.java
@@ -0,0 +1,16 @@
+package net.sf.taverna.t2.servicedescriptions.events;
+
+import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider;
+
+public abstract class AbstractProviderEvent extends
+ ServiceDescriptionRegistryEvent {
+ private final ServiceDescriptionProvider provider;
+
+ public AbstractProviderEvent(ServiceDescriptionProvider provider) {
+ this.provider = provider;
+ }
+
+ public ServiceDescriptionProvider getProvider() {
+ return provider;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/AbstractProviderNotification.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/AbstractProviderNotification.java b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/AbstractProviderNotification.java
new file mode 100644
index 0000000..2cabf90
--- /dev/null
+++ b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/AbstractProviderNotification.java
@@ -0,0 +1,18 @@
+package net.sf.taverna.t2.servicedescriptions.events;
+
+import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider;
+
+public class AbstractProviderNotification extends AbstractProviderEvent {
+
+ private final String message;
+
+ public AbstractProviderNotification(ServiceDescriptionProvider provider, String message) {
+ super(provider);
+ this.message = message;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/AddedProviderEvent.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/AddedProviderEvent.java b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/AddedProviderEvent.java
new file mode 100644
index 0000000..6e003d7
--- /dev/null
+++ b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/AddedProviderEvent.java
@@ -0,0 +1,10 @@
+package net.sf.taverna.t2.servicedescriptions.events;
+
+import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider;
+
+public class AddedProviderEvent extends AbstractProviderEvent {
+
+ public AddedProviderEvent(ServiceDescriptionProvider provider) {
+ super(provider);
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/PartialServiceDescriptionsNotification.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/PartialServiceDescriptionsNotification.java b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/PartialServiceDescriptionsNotification.java
new file mode 100644
index 0000000..3bd8c7f
--- /dev/null
+++ b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/PartialServiceDescriptionsNotification.java
@@ -0,0 +1,22 @@
+package net.sf.taverna.t2.servicedescriptions.events;
+
+import java.util.Collection;
+
+import net.sf.taverna.t2.servicedescriptions.ServiceDescription;
+import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider;
+
+public class PartialServiceDescriptionsNotification extends
+ AbstractProviderNotification {
+ private final Collection<? extends ServiceDescription> serviceDescriptions;
+
+ public PartialServiceDescriptionsNotification(
+ ServiceDescriptionProvider provider,
+ Collection<? extends ServiceDescription> serviceDescriptions) {
+ super(provider, "Found " + serviceDescriptions.size() + " services");
+ this.serviceDescriptions = serviceDescriptions;
+ }
+
+ public Collection<? extends ServiceDescription> getServiceDescriptions() {
+ return serviceDescriptions;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ProviderErrorNotification.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ProviderErrorNotification.java b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ProviderErrorNotification.java
new file mode 100644
index 0000000..a712124
--- /dev/null
+++ b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ProviderErrorNotification.java
@@ -0,0 +1,19 @@
+package net.sf.taverna.t2.servicedescriptions.events;
+
+import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider;
+
+public class ProviderErrorNotification extends AbstractProviderNotification {
+
+ private final Throwable cause;
+
+ public ProviderErrorNotification(ServiceDescriptionProvider provider,
+ String message, Throwable cause) {
+ super(provider, message);
+ this.cause = cause;
+ }
+
+ public Throwable getCause() {
+ return cause;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ProviderStatusNotification.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ProviderStatusNotification.java b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ProviderStatusNotification.java
new file mode 100644
index 0000000..f094e47
--- /dev/null
+++ b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ProviderStatusNotification.java
@@ -0,0 +1,12 @@
+package net.sf.taverna.t2.servicedescriptions.events;
+
+import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider;
+
+public class ProviderStatusNotification extends AbstractProviderNotification {
+
+ public ProviderStatusNotification(ServiceDescriptionProvider provider,
+ String message) {
+ super(provider, message);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ProviderUpdatingNotification.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ProviderUpdatingNotification.java b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ProviderUpdatingNotification.java
new file mode 100644
index 0000000..e2947e1
--- /dev/null
+++ b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ProviderUpdatingNotification.java
@@ -0,0 +1,11 @@
+package net.sf.taverna.t2.servicedescriptions.events;
+
+import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider;
+
+public class ProviderUpdatingNotification extends AbstractProviderNotification {
+
+ public ProviderUpdatingNotification(ServiceDescriptionProvider provider) {
+ super(provider, "Updating");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ProviderWarningNotification.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ProviderWarningNotification.java b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ProviderWarningNotification.java
new file mode 100644
index 0000000..d7476aa
--- /dev/null
+++ b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ProviderWarningNotification.java
@@ -0,0 +1,12 @@
+package net.sf.taverna.t2.servicedescriptions.events;
+
+import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider;
+
+public class ProviderWarningNotification extends AbstractProviderNotification {
+
+ public ProviderWarningNotification(ServiceDescriptionProvider provider,
+ String message) {
+ super(provider, message);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/RemovedProviderEvent.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/RemovedProviderEvent.java b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/RemovedProviderEvent.java
new file mode 100644
index 0000000..a382bdf
--- /dev/null
+++ b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/RemovedProviderEvent.java
@@ -0,0 +1,10 @@
+package net.sf.taverna.t2.servicedescriptions.events;
+
+import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider;
+
+public class RemovedProviderEvent extends AbstractProviderEvent {
+
+ public RemovedProviderEvent(ServiceDescriptionProvider provider) {
+ super(provider);
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ServiceDescriptionProvidedEvent.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ServiceDescriptionProvidedEvent.java b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ServiceDescriptionProvidedEvent.java
new file mode 100644
index 0000000..76ef22d
--- /dev/null
+++ b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ServiceDescriptionProvidedEvent.java
@@ -0,0 +1,20 @@
+package net.sf.taverna.t2.servicedescriptions.events;
+
+import java.util.Set;
+
+import net.sf.taverna.t2.servicedescriptions.ServiceDescription;
+import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider;
+
+public class ServiceDescriptionProvidedEvent extends AbstractProviderEvent {
+ private final Set<ServiceDescription> serviceDescriptions;
+
+ public ServiceDescriptionProvidedEvent(ServiceDescriptionProvider provider,
+ Set<ServiceDescription> serviceDescriptions) {
+ super(provider);
+ this.serviceDescriptions = serviceDescriptions;
+ }
+
+ public Set<ServiceDescription> getServiceDescriptions() {
+ return serviceDescriptions;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ServiceDescriptionRegistryEvent.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ServiceDescriptionRegistryEvent.java b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ServiceDescriptionRegistryEvent.java
new file mode 100644
index 0000000..0604510
--- /dev/null
+++ b/taverna-activity-palette-api/src/main/java/net/sf/taverna/t2/servicedescriptions/events/ServiceDescriptionRegistryEvent.java
@@ -0,0 +1,4 @@
+package net.sf.taverna.t2.servicedescriptions.events;
+
+public abstract class ServiceDescriptionRegistryEvent {
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-impl/pom.xml b/taverna-activity-palette-impl/pom.xml
new file mode 100644
index 0000000..ef85913
--- /dev/null
+++ b/taverna-activity-palette-impl/pom.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
+ </parent>
+ <artifactId>taverna-activity-palette-impl</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Taverna Activity Palette Impl</name>
+ <dependencies>
+ <dependency>
+ <groupId>${project.parent.groupId}</groupId>
+ <artifactId>taverna-activity-palette-api</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.taverna.engine</groupId>
+ <artifactId>taverna-workflowmodel-api</artifactId>
+ <version>${taverna.engine.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.taverna.engine</groupId>
+ <artifactId>taverna-observer</artifactId>
+ <version>${taverna.engine.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-configuration-api</artifactId>
+ <version>${taverna.osgi.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-app-configuration-api</artifactId>
+ <version>${taverna.osgi.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${log4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>${commons.beanutils.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jdom</groupId>
+ <artifactId>com.springsource.org.jdom</artifactId>
+ <version>${jdom.version}</version>
+ </dependency>
+
+ <!-- TODO Remove non-test impl dependency -->
+ <dependency>
+ <groupId>org.apache.taverna.engine</groupId>
+ <artifactId>taverna-workflowmodel-impl</artifactId>
+ <version>${taverna.engine.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-configuration-impl</artifactId>
+ <version>${taverna.osgi.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-app-configuration-impl</artifactId>
+ <version>${taverna.osgi.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-impl/src/main/java/net/sf/taverna/t2/servicedescriptions/impl/ServiceDescriptionConstants.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-impl/src/main/java/net/sf/taverna/t2/servicedescriptions/impl/ServiceDescriptionConstants.java b/taverna-activity-palette-impl/src/main/java/net/sf/taverna/t2/servicedescriptions/impl/ServiceDescriptionConstants.java
new file mode 100644
index 0000000..c5221be
--- /dev/null
+++ b/taverna-activity-palette-impl/src/main/java/net/sf/taverna/t2/servicedescriptions/impl/ServiceDescriptionConstants.java
@@ -0,0 +1,10 @@
+package net.sf.taverna.t2.servicedescriptions.impl;
+
+public interface ServiceDescriptionConstants {
+ String SERVICE_PANEL_CONFIGURATION = "servicePanelConfiguration";
+ String PROVIDERS = "providers";
+ String IGNORED = "ignored";
+ String PROVIDER_ID = "providerID";
+ String CONFIGURATION = "configuration";
+ String TYPE = "type";
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-activity-palette-impl/src/main/java/net/sf/taverna/t2/servicedescriptions/impl/ServiceDescriptionDeserializer.java
----------------------------------------------------------------------
diff --git a/taverna-activity-palette-impl/src/main/java/net/sf/taverna/t2/servicedescriptions/impl/ServiceDescriptionDeserializer.java b/taverna-activity-palette-impl/src/main/java/net/sf/taverna/t2/servicedescriptions/impl/ServiceDescriptionDeserializer.java
new file mode 100644
index 0000000..0a40bda
--- /dev/null
+++ b/taverna-activity-palette-impl/src/main/java/net/sf/taverna/t2/servicedescriptions/impl/ServiceDescriptionDeserializer.java
@@ -0,0 +1,167 @@
+package net.sf.taverna.t2.servicedescriptions.impl;
+
+import static net.sf.taverna.t2.servicedescriptions.impl.ServiceDescriptionConstants.CONFIGURATION;
+import static net.sf.taverna.t2.servicedescriptions.impl.ServiceDescriptionConstants.IGNORED;
+import static net.sf.taverna.t2.servicedescriptions.impl.ServiceDescriptionConstants.PROVIDERS;
+import static net.sf.taverna.t2.servicedescriptions.impl.ServiceDescriptionConstants.PROVIDER_ID;
+import static net.sf.taverna.t2.servicedescriptions.impl.ServiceDescriptionConstants.TYPE;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import uk.org.taverna.scufl2.api.configurations.Configuration;
+import net.sf.taverna.t2.servicedescriptions.ConfigurableServiceProvider;
+import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider;
+import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionRegistry;
+
+import com.fasterxml.jackson.core.JsonFactory;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+class ServiceDescriptionDeserializer {
+ private List<ServiceDescriptionProvider> serviceDescriptionProviders;
+
+ ServiceDescriptionDeserializer(
+ List<ServiceDescriptionProvider> serviceDescriptionProviders) {
+ this.serviceDescriptionProviders = serviceDescriptionProviders;
+ }
+
+ public void deserialize(ServiceDescriptionRegistry registry,
+ File serviceDescriptionsFile) throws DeserializationException {
+ try (FileInputStream serviceDescriptionFileStream = new FileInputStream(
+ serviceDescriptionsFile)) {
+ deserialize(registry, serviceDescriptionFileStream);
+ } catch (FileNotFoundException ex) {
+ throw new DeserializationException("Could not locate file "
+ + serviceDescriptionsFile.getAbsolutePath()
+ + " containing service descriptions.");
+ } catch (IOException ex) {
+ throw new DeserializationException(
+ "Could not read stream containing service descriptions from "
+ + serviceDescriptionsFile.getAbsolutePath(), ex);
+ }
+ }
+
+ public void deserialize(ServiceDescriptionRegistry registry,
+ URL serviceDescriptionsURL) throws DeserializationException {
+ try (InputStream serviceDescriptionInputStream = serviceDescriptionsURL
+ .openStream()) {
+ deserialize(registry, serviceDescriptionInputStream);
+ } catch (FileNotFoundException ex) {
+ throw new DeserializationException("Could not open URL "
+ + serviceDescriptionsURL
+ + " containing service descriptions.");
+ } catch (IOException ex) {
+ throw new DeserializationException(
+ "Could not read stream containing service descriptions from "
+ + serviceDescriptionsURL, ex);
+ }
+ }
+
+ private static final JsonFactory factory = new JsonFactory();
+
+ private void deserialize(ServiceDescriptionRegistry registry,
+ InputStream serviceDescriptionsInputStream) throws IOException,
+ DeserializationException {
+ ObjectNode node = (ObjectNode) new ObjectMapper(factory)
+ .readTree(serviceDescriptionsInputStream);
+ List<ServiceDescriptionProvider> providers = deserializeProviders(node,
+ true);
+ for (ServiceDescriptionProvider provider : providers)
+ registry.addServiceDescriptionProvider(provider);
+ }
+
+ public Collection<? extends ServiceDescriptionProvider> deserializeDefaults(
+ ServiceDescriptionRegistry registry,
+ File defaultConfigurableServiceProvidersFile)
+ throws DeserializationException {
+ ObjectNode node;
+ try (FileInputStream serviceDescriptionStream = new FileInputStream(
+ defaultConfigurableServiceProvidersFile)) {
+ node = (ObjectNode) new ObjectMapper(factory)
+ .readTree(serviceDescriptionStream);
+ } catch (IOException e) {
+ throw new DeserializationException("Can't read "
+ + defaultConfigurableServiceProvidersFile);
+ }
+ return deserializeProviders(node, false);
+ }
+
+ private List<ServiceDescriptionProvider> deserializeProviders(
+ ObjectNode rootNode, boolean obeyIgnored)
+ throws DeserializationException {
+ List<ServiceDescriptionProvider> providers = new ArrayList<>();
+
+ ArrayNode providersNode = (ArrayNode) rootNode.get(PROVIDERS);
+ if (providersNode != null)
+ for (JsonNode provider : providersNode)
+ providers.add(deserializeProvider((ObjectNode) provider));
+
+ if (obeyIgnored) {
+ ArrayNode ignoredNode = (ArrayNode) rootNode.get(IGNORED);
+ if (ignoredNode != null)
+ for (JsonNode provider : ignoredNode)
+ providers
+ .remove(deserializeProvider((ObjectNode) provider));
+ }
+
+ return providers;
+ }
+
+ private ServiceDescriptionProvider deserializeProvider(
+ ObjectNode providerNode) throws DeserializationException {
+ String providerId = providerNode.get(PROVIDER_ID).asText().trim();
+ ServiceDescriptionProvider provider = null;
+ for (ServiceDescriptionProvider serviceProvider : serviceDescriptionProviders)
+ if (serviceProvider.getId().equals(providerId)) {
+ provider = serviceProvider;
+ break;
+ }
+ if (provider == null)
+ throw new DeserializationException(
+ "Could not find provider with id " + providerId);
+
+ /*
+ * So we know the service provider now, but we need a separate instance
+ * of that provider for each providerElem. E.g. we can have 2 or more
+ * WSDL provider elements and need to return a separate provider
+ * instance for each as they will have different configurations.
+ */
+ ServiceDescriptionProvider instance = provider.newInstance();
+
+ if (instance instanceof ConfigurableServiceProvider)
+ try {
+ Configuration config = new Configuration();
+ config.setType(URI.create(providerNode.get(TYPE).textValue()));
+ config.setJson(providerNode.get(CONFIGURATION));
+ if (config != null)
+ ((ConfigurableServiceProvider) instance).configure(config);
+ } catch (Exception e) {
+ throw new DeserializationException(
+ "Could not configure provider " + providerId
+ + " using bean " + providerNode, e);
+ }
+ return instance;
+ }
+
+ @SuppressWarnings("serial")
+ static class DeserializationException extends Exception {
+ public DeserializationException(String string) {
+ super(string);
+ }
+
+ public DeserializationException(String string, Exception ex) {
+ super(string, ex);
+ }
+ }
+}