UNICORE Plugins - PowerPoint PPT Presentation

About This Presentation
Title:

UNICORE Plugins

Description:

UNICORE Plugins How to Design Application Specific ... It is streamed to NJS. ErrorSet checkContents() method can be used to validate Container data ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 30
Provided by: Wron9
Category:

less

Transcript and Presenter's Notes

Title: UNICORE Plugins


1
UNICORE Plugins How to Design Application
Specific Interfaces
  • Krzysztof Benedyczak
  • Michal Wronski

2
Introduction
  • Plugin types
  • Task Plugin (e.g. Gaussian, Amber)
  • Extension Plugin (DBBrowser, LAJ)
  • Classes
  • public abstract class UnicorePlugable
  • public abstract class TaskPlugable extends
    UnicorePlugable
  • public abstract class ExtensionPlugable extends
    UnicorePlugable

3
TaskPlugin
Job Preparation menu
Job Preparation tree
JPA Panel
4
ExtensionPlugin
Extensions menu
Plugin window
5
UnicorePlugable
  • public abstract void startPlugin()
  • public abstract void stopPlugin()
  • public abstract String getPluginInfo()
  • public JMenuItem getSettingsItem()
  • public HelpSet getHelpSet()
  • protected Client getClient()

6
ExtensionPlugable
7
ExtensionPlugable API
  • public Component getVsiteToolBarComponent()
  • public Component getJPAToolBarComponent()
  • public JMenuItem getCustomMenu()
  • public Object setupSpecialVsiteFeatures(Vsite
    vsite, AbstractJob job)

8
TaskPlugable
9
TaskPlugin JPAPanel
  • End user panel for preparing plugin's input
  • Straightforward integration with client's
    standard panels - mainly for file imports and
    exports

10
TaskPlugin Container
  • Used to simplify low-level AJO creation
  • It is streamed to NJS
  • ErrorSet checkContents()method can be used to
    validate Container data
  • Client offers wide range of Containers most
    commonly used in plugins are
  • UserContainer for executing SoftwareResources
  • GroupContainer for maintaining complex job
    structures

11
TaskPlugin OutcomePanel
  • is used to post process plugin's task output
  • generally it can perform any additional tasks
    (even submit another jobs)

12
TaskPlugable API
  • public abstract String getName()
  • public abstract ActionContainer
    getContainerInstance(GroupContainer parent)
  • public abstract JPAPanel getPanelInstance(ActionCo
    ntainer container)
  • protected String getIconPath()
  • public final Class getContainerClass()
  • public final boolean hasContainerClass(Class cls)

13
TaskPlugin JPAPanel API
  • Extends JPAPanel (thus also extends JPanel)
  • Implements
  • void applyValues() - should setup underlying
    plugin container with GUI's values
  • void resetValues() - just another way round
    fills panel with containers data
  • void updateValues(boolean vsiteChanged) invoked
    every time panel becomes visible

14
TaskPlugin UserContainer
  • Simple scenario
  • extend UserContainer
  • use setPreinstalledSoftware()
  • use addFileImport(), addFileExport()
  • Optionally implement buildExecuteGroup which
  • creates executeGroup instance
  • adds to executeGroup custom AbstarctActions with
    dependences

15
TaskPlugin OutcomePanel API
  • Container implements IPanelProvider interface to
    register additional panel(s) in Client's outcome
    area
  • JPanel getPanel(int i)
  • usually OutcomePanel want to get notifications
    when new data is fetched and when the panel
    becomes visible
  • OutcomePanel implements Applyable interface

16
TaskPlugin JPAPanel code
  • public class DBAccessJPAPanel extends JPAPanel
  • public DBAccessJPAPanel(JFrame parentFrame,
    ScriptContainer container)
  • ...
  • initComponents()
  • / Apply values from GUI to container /
  • public void applyValues()
  • container.setModifiedTime(new
    Date(System.currentTimeMillis()))
  • container.setName(taskTextField.getText())
  • / Fill values from container into gui /
  • public void resetValues()
  • taskTextField.setText(container.getName())
  • scriptTextArea.setText(task.getScript())
  • / Method will be called whenever this panel is
    activated /
  • public void updateValues(boolean vsiteChanged)
  • if (vsiteChanged)

17
TaskPlugin Container code (1)
  • public class ExampleContainer extends
    UserContainer
  • implements IPanelProvider
  • private transient JPanel simpleOutcomePanel
  • public ExampleContainer(GroupContainer parent)
  • super(parent)
  • public ErrorSet checkContents()
  • ErrorSet er super.checkContents()
  • //Does Vsite support needed
    SoftwareResource?
  • NamedResourceSet nrs
  • ResourceManager.getResourceSet(getVsite())
  • if (nrs.findSoftwareResourceByName("our_exe
    cutable") null)
  • er.add(new Uerror(getIdentifier(),"
    Wrong Vsite"))

18
TaskPlugin Container code (2)
  • .....
  • public int getNrOfPanels()
  • return 1
  • public String getPanelTitle(int i)
  • return Simple outcome panel
  • public void finalizePanel()
  • public JPanel getPanel(int i)
  • if (!simpleOutcomePanel)
  • simpleOutcomePanel
  • new ReexSimpleOutcomePanel(this)
  • return simpleOutcomePanel

19
TaskPlugin OutcomePanel code
  • public class SimpleOutcomePanel extends JPanel
    implements Applyable
  • ...
  • public SimpleOutcomePanel(Container container)
  • initComponents()
  • public void applyValues()
  • / Becomes visible /
  • public void updateValues()
  • if (plot null)
  • addPlotPanel()
  • / New outcome /
  • public void resetValues()
  • if (panelReady) return
  • if (plot null) addPlotPanel()

20
Re-usable components
  • Graphical interfaces
  • FileImportPanel, FileExportPanel,
    RemoteTextEditor
  • Container classes
  • UserContainer, GroupContainer
  • Classes to get the outcome of AJO
  • OutcomeManager
  • Classes to manage resources
  • ResourceManager
  • Requests

21
Requests
  • Requests allow to prepare jobs at low level (AJO)
    without using containers
  • but they still hides from programmer many issues
    sending job to Vsite, waiting/checking for reply
    and all certificates related work
  • Requests are often used in ExtensionPlugins
  • There are many out-of-the-box requests in the
    Client. The most interesting
  • GetJobStatus
  • GetFilesFromUspace
  • GetListing

22
How to implement a Request
  • extends ObservableRequestThread
  • add some IObservers to Request object
  • implement run() method where
  • AJO is constructed
  • AJO is sent with desired method (polling or
    nonPolling)
  • if nonPolling() answer was RetrieveOutcomeReply
    then in run() we can get (deserialized) outcome
    else it must be done in IObserver code

23
Summary
  • TaskPlugin
  • used as a component in standard Clients job
  • integrates JPAPanel, Container and OutcomePanel
  • ExtensionPlugin
  • adds any other new functionality to the Client

24
DeviceSteer Plugin (1)
  • Plugin for steering remote devices through
    Unicore infrastructure
  • user friendly GUI
  • Interactivity in Unicore
  • Designed in the way which allows simple
    adaptation to different devices

25
DeviceSteer Plugin (2)
26
DBAccess Plugin (1)
  • Plugin allows for access to SQL databases
  • Features
  • User friendliness
  • Support for the most popular free DBMSes
    PostgreSQL and MySQL
  • Support for SDSC Storage Resource Broker
  • Extensibility

27
DBAccess Plugin (2)
28
References
  • Plugin Programmers Guide
  • Client API documentation
  • Client and plugins source code

29
QUESTIONS ?
Write a Comment
User Comments (0)
About PowerShow.com