1 / 68

C2B2 and geWorkbench present

C2B2 and geWorkbench present. The Tom Garben Anniversary Lecture. Component Configuration Manager (CCM) overview. A look at how users can manage their geWorkbench plugin components and what Java Containers are used in geWorkbench to support the functionality of these components.

betrys
Download Presentation

C2B2 and geWorkbench present

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. C2B2 and geWorkbench present

  2. The Tom Garben Anniversary Lecture

  3. Component Configuration Manager (CCM) overview A look at how users can manage their geWorkbench plugin components and what Java Containers are used in geWorkbench to support the functionality of these components.

  4. CCM GUIFrom the menu bar\Tools\Component Configuration

  5. CCM GUIConfigured with a *.ccm.xml file

  6. CCM GUI • Component Attributes (On/Off, Name, Author, Version, Author URL, Tool URL)

  7. CCM GUI • Component Description. • Also configured in the *.ccm.xml file.

  8. CCM GUI • Filters: • Display - Loaded, Unloaded • Show by type - AnalysisPlugins,Visualizers • Keyword search - Full Context Search

  9. CCM GUI • Extra Detail Buttons: View License, View Documentation, View External Site.

  10. CCM GUI • License acceptance.

  11. CCM GUI • Dependency Checking for required or related components.

  12. CCM GUI • Click Apply after making selections.

  13. User Configuration Files at the Plugin-Component level • User Plugin-Component selections are saved in the following files: ..\[usersettings]\.geworkbench\[componentfolder]\ [componentname]component.ccmproperties • Each Plugin-Component gets its own file.

  14. CCM Folders • Plugin Components are kept in appropriately named folders under geworkbench\components • The name of the folder is not used functionally within geworkbench and the folder name does not show up visually in the GUI. • Components in different folders are loaded via different Class Loaders, so they may be run with their own set of jar files. • If multiple Plugin Components exist in sub folders under a common folder, they will be loaded by one Class Loader and use a common set of jar files.

  15. EnhancerByCGLIB • As part of the geWorkbench messaging system, Plugin Components have been wrapped by a EnhancerByCGLIB class. • Using EnhancerByCGLIB, @publish & @subscribe annotations, the type of the first argument of a method and an Interceptor, the method ComponentRegistry.publishToSubscriberHelper ()is called. • This helper method publishes an Event from one @publish method to all @subscribe methods.

  16. CCM Configuration Files • The Plugin Component configuration file is no longer all.xml, but all.xml is still used for some core components. • Each Plugin Component now has its own configuration file which has a name of the form *.ccm.xml • The *.ccm.xml files are located in the Plugin folders.

  17. CCM Configuration Files • There are three main sections inside the root tag of the *.ccm.xml file • The root tag <geaw-config> • The <component> tag. • The <plugin> tag. • And the <component-descriptor> tag.

  18. CCM Configuration Files • The <Component> tag section has been created to support new functionality of the CCM GUI that was described in the beginning of the presentation.

  19. CCM Configuration Files • The <plugin> tag is of the same format as in the legacy all.xml file. • It is used to configure Plugin Components with attributes need to run within geWorkbench.

  20. CCM Configuration Files • The <component-descriptor> tag is the same as that from the legacy *.cwb.xml file. • This tag contains attributes for configuring the Java Help and the Menu Bar in geWorkbench. • *.cwb.xml files are no longer used.

  21. <geaw-config xmlns:xsi=http://www.w3.org/2001/XMLSchema-instancexsi:noNamespaceSchemaLocation="ConfigurationFile Schema.xsd"> • <component name="AnalysisPanel“ class="org.geworkbench.components.analysis.AnalysisPanel" version="1.0" author="C2B2" authorURL="http://wiki.c2b2.columbia.edu/workbench/index.php/Home" toolURL="http://wiki.c2b2.columbia.edu/workbench/index.php/Home" description="The Analysis Panel component provides a framework which supports numerous, individually loadable analysis methods." loadByDefault="true“ analysis="true“ visualizer=“false" hidden=“false” mustAccept="false" • > <required-component class="org.geworkbench.components.xxx" /> <related-component class="org.geworkbench.components.yyy" /> <license><![CDATA[ <html><head><meta http-equiv=Content-Type content="text/html; charset=windows-1252"></head> <body>----</body> </html> ]]></license> • </component> • <plugin id="AnalysisPanel" name="Analysis Panel" class="org.geworkbench.components.analysis.AnalysisPanel" source="analysis"> <gui-area name="CommandArea"/> • </plugin> • <component-descriptor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Descriptor Schema.xsd"> • <component class="org.geworkbench.components.analysis.AnalysisPanel"> • <online-help helpSet="org/geworkbench/components/analysis/help/clustering/analysisPanelHelpSet.hs"/> • </component> • </component-descriptor> • </geaw-config>

  22. End of Part I • This concludes the GUI, Configuration portion of this presentation. • Feel free to stay for the more technical part of the presentation, • Or run for the door as fast as you can.

  23. Loading Plugin Components • Plugin Components are loaded in one of two ways: • First by UILauncher.main() method on geWorkbench startup. • Second when Apply is clicked in the CCM window by ComponentConfigurationManager.loadSelectedComponents()

  24. Loading Plugin Components • Components are loaded using org.apache.commons.digester.Digester • The Digester Class lets a developer create an object that maps XML tags to Java classes and methods. • When digester.parse((FileInputStream) “..\folderX\x.ccm.xml”) is called, Constructors and Methods, along with configured method arguments, associated with XML tags, get executed in an independent Thread bringing the Plugin Component to life. • Immediately after loading, the Plugin Component is able to be displayed and send/receive events.

  25. geWorkbench Glue • geWorkbench uses the following Containers to manage Plugin Components and communications between them. • Interfaces: List, Map. • Standard Java Container: ArrayList, Vector, HashMap. • Internally built Container: TypeMap TypeMap is a HashMap that supports polymorphism.

  26. geWorkbench Glue • The functionality that is supported by these containers: • To support Component Attribute Management, including a) Component type. (E.g. Visual Component lists.) b) Component resource. (E.g. Folder locations.) c) Component extension points. (Currently not used.) • Maintain Event Publish/Subscribe associations. (@Publish, @Subscribe annotations) • Facilitate the Data Dependant Display of components (E.g. Component/Dataset mappings) • Support Synchronicity Level Based Method Execution.

  27. Container Summary • geWorkbench Classes where containers are stored: • ComponentRegistry • PluginRegistry • PluginClassRegistry • IdentifiableImpl:PluginDescriptor • In general, the term Component refers to Plugin resources, such as folders and class loaders. • In general the term Plugin refers to the actual Plugin Component. • The PluginDescriptor is the main Wrapper for Plugin Components. It contains EnhancerByCGLIB Objects which contain Plugin Components.

  28. Container Summary • ComponentRegistry Member Variables: • listeners • acceptors • synchModels • Components • idToDescriptor • nameToComponentResource

  29. Container Summary • PluginRegistry Member Variables: • extensionPointsMap • visualAreaMap • componentVector • pluginClasses • nameMap

  30. Container Summary • IdentifiableImpl:PluginDescriptor Member Variable: • usedIds

  31. Container Summary • PluginClassRegistry • pluginClasses

  32. 1 ComponentRegistry.listeners • TypeMap< Event.class, List<EnhancerByCGLIB>> • The ComponentRegistry listeners registry, sometimes synonymous with the term subscriber. • - The Map key is the Class of an Event. • - The Map value is a List of Enhanced Components geWorkbench components which have at least one @Subscribe annotated method.

  33. 2 ComponentRegistry.acceptors • HashMap<DSDataSet.class, List<Component.class (unenhanced)>> • This HashMap holds lists of geWorkbench components that are registered to accept specified data types. • Used in Skin.java for deciding which Visual Components are to be displayed when certain data types are selected in the Project Panel. acceptors

  34. 3 ComponentRegistry.synchModels • HashMap< SynchModel.class, SynchModel> • SyncModels allowed when creating Events: • Asynchronous • Overflow • SwingModel • Synchronous

  35. 4 ComponentRegistry.components • List<EnhancerByCGLIB> • A List of Enhanced Components. • Used only in a couple of places.

  36. 5 ComponentRegistry.idToDescriptor • HashMap<String IdentifiableImpl :PluginDescriptor.id, PluginDescriptor> • geWorkbench is now supposed to have its components addressed uniquely via their fully-qualified class name, not their ID. • Deprecation candidate.

  37. 7 PluginRegistry.extensionPointsMap • HashMap<VisualPlugin, String visualAreaName> • None used right now.

  38. 8 PluginRegistry.visualAreaMap • HashMap<VisualPlugin, String visualAreaName> • Used for displaying visualAreaNames in GUI.

  39. 9 PluginRegistry.componentVector • Vector< PluginDescriptor > • Looks redundant to ComponentRegistry.idToDescriptor • HashMap<String IdentifiableImpl :PluginDescriptor.id, PluginDescriptor>

  40. 9 PluginRegistry.nameMap • HashMap<String className, String name> • Stores information about Plugin Component, so a Plugin can query it's own name in it's constructor. • Newly added.

  41. 10 IdentifiableImpl:PluginDescriptor.usedIds • Vector <String IdentifiableImpl:PluginDescriptor.id> • Even though the PluginDescriptor class is primarily used as a Plugin Component wrapper, there is a static Vector of usedIds in its base class IdentifiablImpl. • geWorkbench is now supposed to have its components addressed uniquely via their fully-qualified class name, not their ID. • Deprecation candidate.

  42. 11 PluginClassRegistry.pluginClasses • HashMap <String, PluginClassRegistry> • I don’t see where this is used.

  43. Still Awake • If not, we can stop here. • If so, we can go into more detail about each Container.

  44. OK!! • That’s what I like to hear. • Let’s move on.

  45. 1 ComponentRegistry.listeners • The ComponentRegistry listeners registry, sometimes synonymous with the term subscriber, is of type TypeMap< Event.class, List<EnhancerByCGLIB>> • - The Map key is the Class of an Event. • - The Map value is a List of enhanced components geWorkbench components which have at least one @Subscribe annotated method. • But you’ve seen this already.

  46. 1 ComponentRegistry.listeners • If an Enhanced Component has multiple unique subscriber methods, ie different first Event type areguments, then that Enhanced Component will appear in multiple Lists in ComponentRegistry.listeners. • This TypeMap is loaded, by the PluginObject.finish() method, with Enhanced Objects contained in PluginDescriptors.plugin member variables, which 1) have @Subscribe annotated methods and 2) have an Event as the first argument of the same method. • The “Home Grown” TypeMap extends HashMap and is implemented to support polymorphism. So if a subclass is passed into the TypeMap.get(subClass) method, that value will be returned.

  47. 1 ComponentRegistry.listeners • The ComponentRegistry.registerSubscriptions() method builds the ComponentRegistry.listener by: • Key: A) Using the subclass of Event.class of the first argument of component methods that are annotated with @Subscribe as the TypeMap key. • Value: B) Using the EnhancerByCGLIB wrapped component of PluginDescriptor.plugin, as the TypeMap value. • Note: There is a specific check to see that any subscriber method used has two arguments, when it appears that only the first argument is being used.

  48. 1 ComponentRegistry.listeners • Example from the ProjectPanel.java and AnalysisPanel.java: • @Subscribe public void receive(org.geworkbench.events.PhenotypeSelectorEvent e, Object source) { • Key: • class org.geworkbench.events.PhenotypeSelectorEvent • Value: • [org.geworkbench.builtin.projects.ProjectPanel$$EnhancerByCGLIB$$fbdd@19d09f • …… org.geworkbench.components.analysis.AnalysisPanel$$EnhancerByCGLIB$$36@e992] • Note: $$ indicates a EnhancerByCGLIB wrapped object.

  49. 1 ComponentRegistry.listeners During the publish/subscribe process • The publishToSubscriberHelper() method uses the method Subscriptions.getMethodProfiles() to return a components methods which are annotated with @Subscribe • Then the publishToSubscriberHelper() adds these methods to a synchModel for execution. • Note: Right now the only synchModel used is Synchronous. • Note: A Plugin Component’s Class is used by this method. I wonder if it doesn’t need a CGLIB wrapped Class to publish to all subscribers.

  50. 2 ComponentRegistry.acceptors • HashMap<DSDataSet.class, List<Component.class (unenhanced)>> • This HashMap holds lists of geWorkbench components that are registered to accept specified data types. • Used in Skin.java for deciding which Visual Components are to be displayed when certain data types are selected in the Project Panel. • But you’ve already seen this.

More Related