Merge commit '42b2e5ca519766e37ce6941ba4faecc9691cc403' into upstream
[debian/openrocket] / core / src / net / sf / openrocket / plugin / framework / Service.java
diff --git a/core/src/net/sf/openrocket/plugin/framework/Service.java b/core/src/net/sf/openrocket/plugin/framework/Service.java
new file mode 100644 (file)
index 0000000..ee56b8e
--- /dev/null
@@ -0,0 +1,30 @@
+package net.sf.openrocket.plugin.framework;
+
+import java.util.List;
+
+import net.xeoh.plugins.base.Plugin;
+
+/**
+ * A discovery service that returns plugins of a specified type with
+ * provided arguments.
+ * 
+ * @author Sampo Niskanen <sampo.niskanen@iki.fi>
+ */
+public interface Service extends Plugin {
+       
+       /**
+        * Return the plugins that match the provided type and are applicable
+        * for the arguments.  The arguments depend on the class type.
+        * <p>
+        * This method may return different plugins for different arguments.
+        * For example, if the arguments contain the OpenRocketDocument, the
+        * service may return only plugins applicable for the specified document.
+        * 
+        * @param type  the plugin interface type
+        * @param args  arguments for the interface.
+        * @return              the plugin instances applicable.
+        */
+       public <E> List<E> getPlugins(Class<E> type, Object... args);
+       
+       
+}