Each plug-in type is unique, and the component that uses it must know what functions are available from each type of plug-in, typically by forcing it to adhere to some interface. For example, while the Java class for a DOE Technique plug-in extends the base plug-in class, it also implements a specific DOE Technique interface that the DOE component knows about to ensure that it provides the expected functionality. However, the primary means of accessing and dealing with plug-ins from within component code can be described in general. To query the plug-ins of a specified type that are available, the following call can be made: pluginMetaModels = MetaModelManager.instance().browseMetaModelsByPluginTypeName(type); The items in this list are MetaModel objects that contain information about the plug-in, including the name, description, etc. For a given MetaModel (i.e., plug-in), you can access the runtime class that typically contains the functionality for the plug-in by MyPluginIfc pluginInst = ( MyPluginIfc)pluginMM.getRuntimeClass(com.engineous.sdk.runtime.Plugin. class).newInstance(); As mentioned above, the Java class for the plug-in implements a specific interface, in this case MyPluginIfc; therefore, the component can be sure that the required methods can be called. At this point, the component now has access to the necessary functionality. For example, the DOE component accesses a DOE Technique plug-in using the calls listed above and then calls, among many other functions, doeTechPluginInst.generateDesignMatrix() which is specific to DOE Techniques. Use this same mechanism for your plug-ins so that components that want/need to use those plug-ins know what methods they can call. For convenience, a component editor can make use of two GUI widgets provided in the Isight SDK to interact with a list of available plug-ins: com.engineous.sdk.gui.PluginChooserCombo com.engineous.sdk.gui.PluginChooserList Refer to the javadocs in your Isight installation for specific details regarding use of these widgets. When a specific plug-in instance is created and configured, it can be stored with the component in the Isight model by calling: component.addPlugin(pluginInst) You can remove a plug-in from a component by calling component.removePlugin(type) To get a plug-in that is being used by the component, call the output constraints directly: DtPlugin plugin = component.getPlugin(type); MetaModel pluginMM = plugin.getMetaModel(); // Create an instance of the runtime class (the specific interface) MyPluginIfc pluginInst = (MyPluginIfc)pluginMM.getRuntimeClass(com.engineous.sdk.runtime.Plugin .class).newInstance(); Other algorithms work only with the objective and penalty function values. |