org.embl.ebi.escience.scuflworkers
Class ProcessorHelper

java.lang.Object
  extended by org.embl.ebi.escience.scuflworkers.ProcessorHelper

public class ProcessorHelper
extends java.lang.Object

Provides rendering and other hints for different processor implementations, including preferred colours and icons. The data used by this class is loaded at classload time from all 'taverna.properties' files found by the system classloader, these files contain the processor specific configuration that this class acts as an interface to. An example for the Soaplab processor type is shown below :

        taverna.processor.soaplabwsdl.class = org.embl.ebi.escience.scuflworkers.soaplab.SoaplabProcessor
        taverna.processor.soaplabwsdl.xml = org.embl.ebi.escience.scuflworkers.soaplab.SoaplabXMLHandler
        taverna.processor.soaplabwsdl.colour = lightgoldenrodyellow
        taverna.processor.soaplabwsdl.icon = org/embl/ebi/escience/scuflui/soaplab.gif
        taverna.processor.soaplabwsdl.taskclass = uk.ac.soton.itinnovation.taverna.enactor.entities.SoaplabTask
 
To load additional processor types for enactment and display within the workbench, you will need to create the appropriate helper classes such as the XML handler and then point to the class names in a 'taverna.properties' file. I suggest you package all these items into a single .jar file, in which case simply ensuring that the classpath contains your .jar should allow everything to work.

Author:
Tom Oinn

Constructor Summary
ProcessorHelper()
           
 
Method Summary
static org.jdom.Element elementForProcessor(Processor p)
          Given a processor instance, return the 'spec' block of XML that represents the processor in the XScufl language.
static org.jdom.Element elementForProcessor(Processor p, boolean decorations)
          Given a processor instance, return the 'spec' block of XML that represents the processor in the XScufl language.
static ProcessorEditor getEditorForTagName(java.lang.String tagName)
          Given a tag name, return the in place editor for the processor
static javax.swing.ImageIcon getIconForTagName(java.lang.String tagName)
          Given a tag name, return the preferred image icon for that tag.
static java.lang.String getPreferredColour(Processor p)
          Given a processor instance, return the preferred colour to be used for UI representations.
static javax.swing.ImageIcon getPreferredIcon(Processor p)
          Given a processor instance, return an image icon to be used in, for example, tree renderer objects.
static java.lang.String getTagNameForClassName(java.lang.String className)
          Given a class name, return the tag name used by this helper class as an index for the other categories such as icons.
static java.lang.String getTaskClassName(Processor p)
          Given a processor instance, return the fully qualified class name of a TavernaTask for the myGrid enactor to invoke the operation represented by the processor
static ProcessorTaskWorker getTaskWorker(Processor p)
          Given a processor instance, return a concrete task worker for that instance.
static XMLHandler getXMLHandlerForTagName(java.lang.String tagname)
          Get the xml handler for a given tag name
static ProcessorFactory loadFactoryFromXML(org.jdom.Element specNode)
          Return a factory capable of producing the supplied spec of processor.
static Processor loadProcessorFromXML(org.jdom.Element processorNode, ScuflModel model, java.lang.String name)
          Spit back a processor given a chunk of xml, the element passed in being the 'processor' tag return null if we can't handle it
static void populateMaps()
          Populates the class level maps and lists with details about the processors and their scavengers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessorHelper

public ProcessorHelper()
Method Detail

populateMaps

public static void populateMaps()
Populates the class level maps and lists with details about the processors and their scavengers


getTaskClassName

public static java.lang.String getTaskClassName(Processor p)
Given a processor instance, return the fully qualified class name of a TavernaTask for the myGrid enactor to invoke the operation represented by the processor


getTaskWorker

public static ProcessorTaskWorker getTaskWorker(Processor p)
Given a processor instance, return a concrete task worker for that instance.

Returns:
a ProcessorTaskWorker implementation or null if none can be found.

getTagNameForClassName

public static java.lang.String getTagNameForClassName(java.lang.String className)
Given a class name, return the tag name used by this helper class as an index for the other categories such as icons.


getEditorForTagName

public static ProcessorEditor getEditorForTagName(java.lang.String tagName)
Given a tag name, return the in place editor for the processor


getXMLHandlerForTagName

public static XMLHandler getXMLHandlerForTagName(java.lang.String tagname)
Get the xml handler for a given tag name


getIconForTagName

public static javax.swing.ImageIcon getIconForTagName(java.lang.String tagName)
Given a tag name, return the preferred image icon for that tag.


getPreferredColour

public static java.lang.String getPreferredColour(Processor p)
Given a processor instance, return the preferred colour to be used for UI representations.


getPreferredIcon

public static javax.swing.ImageIcon getPreferredIcon(Processor p)
Given a processor instance, return an image icon to be used in, for example, tree renderer objects.


elementForProcessor

public static org.jdom.Element elementForProcessor(Processor p)
Given a processor instance, return the 'spec' block of XML that represents the processor in the XScufl language. This is the element directly inside the 's:processor' element and specifies specific information about this particular processor. Returns null if there is no handler.


elementForProcessor

public static org.jdom.Element elementForProcessor(Processor p,
                                                   boolean decorations)
Given a processor instance, return the 'spec' block of XML that represents the processor in the XScufl language. This is the element directly inside the 's:processor' element and specifies specific information about this particular processor. Returns null if there is no handler.

If the decorations flag is set to true this will set the various attributes (maxretries, retrydelay, retrybackoff, critical, breakpoint), otherwise these will not be set. We need to be able to turn this off to allow the comparison to nodes in the services panel to function correctly - this is a textual comparison and these nodes never have these attributes.


loadFactoryFromXML

public static ProcessorFactory loadFactoryFromXML(org.jdom.Element specNode)
Return a factory capable of producing the supplied spec of processor. The element passed in is the 'spec element' refered to in the language reference. Returns null is there is no matching factory implementation bound to this spec element


loadProcessorFromXML

public static Processor loadProcessorFromXML(org.jdom.Element processorNode,
                                             ScuflModel model,
                                             java.lang.String name)
                                      throws ProcessorCreationException,
                                             DuplicateProcessorNameException,
                                             XScuflFormatException
Spit back a processor given a chunk of xml, the element passed in being the 'processor' tag return null if we can't handle it

Throws:
ProcessorCreationException
DuplicateProcessorNameException
XScuflFormatException