org.embl.ebi.escience.scufl
Interface IProcessor

All Known Implementing Classes:
APIConsumerProcessor, APProcessor, BeanshellProcessor, BiomartProcessor, BiomobyObjectProcessor, BiomobyProcessor, BiomobyProcessor, BSFProcessor, DependencyProcessor, InfernoProcessor, InternalSinkPortHolder, InternalSourcePortHolder, LocalServiceProcessor, MobyParseDatatypeProcessor, NotificationProcessor, Processor, RDFGeneratorProcessor, RservProcessor, RshellProcessor, SoaplabProcessor, StringConstantProcessor, TalismanProcessor, WorkflowProcessor, WSDLBasedProcessor

public interface IProcessor

Interface for processor implementations

Author:
Tom Oinn

Field Summary
static java.lang.String ENACTOR
          A string representing a resource location within the enactor JVM.
 
Method Summary
 void addAlternate(AlternateProcessor ap)
          Add an alternate processor to this processor definition
 void addAnnotationTemplate(AnnotationTemplate theTemplate)
          Add an annotation template to this processor
 void addBreakpoint()
          Add a breakpoint to the processor
 void addPort(Port the_port)
          Add a new port to this processor
 AnnotationTemplate[] defaultAnnotationTemplates()
          Create a standard annotation template for each pair of bound input / output ports, mostly just to test the metadata store and browser functionality.
 void fireModelEvent(ScuflModelEvent event)
          Fire a change event back to the model
 AlternateProcessor[] getAlternatesArray()
          Return the list of AlternateProcessor holders for this primary processor implementation.
 java.util.List getAlternatesList()
          Return the alternates list object to allow addition or reordering of alternate processors
 AnnotationTemplate[] getAnnotationTemplates()
          Return an array containing all annotation templates for this processor
 double getBackoff()
          Return the factor by which the timeout value will be multiplied for each retry after the first.
 InputPort[] getBoundInputPorts()
          Get an array of the input ports that are bound by data constraints defined within this processor
 OutputPort[] getBoundOutputPorts()
          Get an array of all the output ports that are bound by data constraints and defined within this processor
 boolean getCritical()
          Get whether the Processor is critical.
 int getDefaultWorkers()
          Return the default number of workers for an instance of this processor type
 java.lang.String getDescription()
          Get a description of the processor.
 InputPort[] getInputPorts()
          Get an array containing only input ports
 IterationStrategy getIterationStrategy()
          Get the iteration strategy for this processor, or null if the default should be used
 int getLogLevel()
          Get the log level, this is the effective log level of the processor taking into account possible inheritence of the level from the ScuflModel instance.
 int getMaximumWorkers()
          Return the maximum number of task implementations that should be launched for this processor.
 ScuflModel getModel()
          Get the parent model
 java.lang.String getName()
          Get the name for this processor.
 OutputPort[] getOutputPorts()
          Get an array containing only output ports
 Port[] getPorts()
          Get an array of the ports, input or output, defined within this processor.
 java.util.Properties getProperties()
          Return a properties object containing the processor specific properties for this processor type instance.
 int getRealLogLevel()
          Get the real log level set by this processor, this can be -1 in which case the getLogLevel method will return the log level of the ScuflModel that 'owns' this processor
 java.lang.String getResourceHost()
          If meaningful, obtain the host that the resource is based in.
 int getRetries()
          Return the number of retries after the initial invocation attempt.
 int getRetryDelay()
          Get the number of milliseconds to wait before first retrying an invocation of the task this processor represents.
 int getTimeout()
          Return the time in milliseconds after which an instance of this processor should be regarded as having failed with a timeout.
 int getWorkers()
          Return the number of workers for this instance
 boolean hasBreakpoint()
          Check for a breakpoint
 boolean isBoring()
          Is this processor boring? If so it shouldn't show up by default in the status display
 boolean isOffline()
          Are we in offline mode?
 Port locatePort(java.lang.String port_name)
          Find a particular named port
 Port locatePort(java.lang.String port_name, boolean isInputPort)
          Find a particular named port, input port if boolean flag is true
 void removeAlternate(AlternateProcessor ap)
          Delete an alternate processor from this processor definition
 void removeAnnotationTemplate(AnnotationTemplate theTemplate)
          Remove an annotation template from this processor
 void removePort(Port the_port)
          Remove a port from a processor (only really applicable to the workflow source and sink ports, so be careful when you're using it)
 void rmvBreakpoint()
          Remove a breakpoint to the processor
 void setBackoff(double backoff)
          Set the backoff factor
 void setBoring(boolean boring)
          Set whether this processor is boring
 void setCritical(boolean critical)
          Set whether the Processor is critical.
 void setDescription(java.lang.String the_description)
          Set the description for the processor.
 void setIterationStrategy(IterationStrategy i)
          Set the iteration strategy
 void setLogLevel(int level)
          Set the log level
 void setName(java.lang.String newName)
          Set the name, providing that names doesn't exist within the current workflow that this processor is bound to.
 void setOffline()
           
 void setOnline()
          Allow subclasses to intercept requests to go offline and online, allows e.g.
 void setRetries(int retries)
          Set the number of retries
 void setRetryDelay(int delay)
          Set the retry delay
 void setTimeout(int timeout)
          Set the timeout parameter
 void setWorkers(int workers)
          Set the number of workers
 

Field Detail

ENACTOR

static final java.lang.String ENACTOR
A string representing a resource location within the enactor JVM. This is the case, for example, for the simple string operations and the local service processors.

See Also:
Constant Field Values
Method Detail

isBoring

boolean isBoring()
Is this processor boring? If so it shouldn't show up by default in the status display


setBoring

void setBoring(boolean boring)
Set whether this processor is boring


setOnline

void setOnline()
Allow subclasses to intercept requests to go offline and online, allows e.g. the workflow processor to delegate this to the child workflow


setOffline

void setOffline()

hasBreakpoint

boolean hasBreakpoint()
Check for a breakpoint


addBreakpoint

void addBreakpoint()
Add a breakpoint to the processor


rmvBreakpoint

void rmvBreakpoint()
Remove a breakpoint to the processor


getResourceHost

java.lang.String getResourceHost()
If meaningful, obtain the host that the resource is based in. Of course, not all processor implementations are service based so this may return the string Processor.ENACTOR instead to represent this, and this is the default.


getMaximumWorkers

int getMaximumWorkers()
Return the maximum number of task implementations that should be launched for this processor. This is ignored unless the processor is being iterated over in which case a number of threads up to the value specified are created to process the information. You must be particularly careful that the task implementation is thread safe before changing this from the default specified here, at the current time the web service processor is not thread safe!


getDefaultWorkers

int getDefaultWorkers()
Return the default number of workers for an instance of this processor type


getWorkers

int getWorkers()
Return the number of workers for this instance


setWorkers

void setWorkers(int workers)
Set the number of workers


setName

void setName(java.lang.String newName)
Set the name, providing that names doesn't exist within the current workflow that this processor is bound to. If it does then do nothing


getIterationStrategy

IterationStrategy getIterationStrategy()
Get the iteration strategy for this processor, or null if the default should be used


setIterationStrategy

void setIterationStrategy(IterationStrategy i)
Set the iteration strategy


getAnnotationTemplates

AnnotationTemplate[] getAnnotationTemplates()
Return an array containing all annotation templates for this processor


addAnnotationTemplate

void addAnnotationTemplate(AnnotationTemplate theTemplate)
Add an annotation template to this processor


removeAnnotationTemplate

void removeAnnotationTemplate(AnnotationTemplate theTemplate)
Remove an annotation template from this processor


defaultAnnotationTemplates

AnnotationTemplate[] defaultAnnotationTemplates()
Create a standard annotation template for each pair of bound input / output ports, mostly just to test the metadata store and browser functionality. Removes any existing template definitions!


getAlternatesArray

AlternateProcessor[] getAlternatesArray()
Return the list of AlternateProcessor holders for this primary processor implementation.


getAlternatesList

java.util.List getAlternatesList()
Return the alternates list object to allow addition or reordering of alternate processors


addAlternate

void addAlternate(AlternateProcessor ap)
Add an alternate processor to this processor definition


removeAlternate

void removeAlternate(AlternateProcessor ap)
Delete an alternate processor from this processor definition


getTimeout

int getTimeout()
Return the time in milliseconds after which an instance of this processor should be regarded as having failed with a timeout. If this value is set to zero then no timeout applies.


setTimeout

void setTimeout(int timeout)
Set the timeout parameter


getRetries

int getRetries()
Return the number of retries after the initial invocation attempt. If set to zero then retry behaviour is disabled.


setRetries

void setRetries(int retries)
Set the number of retries


getRetryDelay

int getRetryDelay()
Get the number of milliseconds to wait before first retrying an invocation of the task this processor represents.


setRetryDelay

void setRetryDelay(int delay)
Set the retry delay


getBackoff

double getBackoff()
Return the factor by which the timeout value will be multiplied for each retry after the first. This allows for exponential backoff from failing service instances.


setBackoff

void setBackoff(double backoff)
Set the backoff factor


getCritical

boolean getCritical()
Get whether the Processor is critical. This is true if its execution failure will cause its containing workflow to fail.


setCritical

void setCritical(boolean critical)
Set whether the Processor is critical. When a critical Processor's execution fails, its containing workflow is halted and fails. In contrast, the containing workflow will ignore failures of non-critical Processors and will continue to run.


getLogLevel

int getLogLevel()
Get the log level, this is the effective log level of the processor taking into account possible inheritence of the level from the ScuflModel instance.


getRealLogLevel

int getRealLogLevel()
Get the real log level set by this processor, this can be -1 in which case the getLogLevel method will return the log level of the ScuflModel that 'owns' this processor


setLogLevel

void setLogLevel(int level)
Set the log level


getProperties

java.util.Properties getProperties()
Return a properties object containing the processor specific properties for this processor type instance. This is used by the user interface code to display additional properties for each processor and should be implemented by the subclasses to display useful information.

Returns:
a Properties instance containing all processor-specific properties, or optinally null if there are none

getName

java.lang.String getName()
Get the name for this processor. There is no corresponding set method because names are immutable once created.


getDescription

java.lang.String getDescription()
Get a description of the processor.


setDescription

void setDescription(java.lang.String the_description)
Set the description for the processor.


getPorts

Port[] getPorts()
Get an array of the ports, input or output, defined within this processor.


getBoundInputPorts

InputPort[] getBoundInputPorts()
Get an array of the input ports that are bound by data constraints defined within this processor


getBoundOutputPorts

OutputPort[] getBoundOutputPorts()
Get an array of all the output ports that are bound by data constraints and defined within this processor


locatePort

Port locatePort(java.lang.String port_name)
                throws UnknownPortException
Find a particular named port

Throws:
UnknownPortException

locatePort

Port locatePort(java.lang.String port_name,
                boolean isInputPort)
                throws UnknownPortException
Find a particular named port, input port if boolean flag is true

Throws:
UnknownPortException

getInputPorts

InputPort[] getInputPorts()
Get an array containing only input ports


getOutputPorts

OutputPort[] getOutputPorts()
Get an array containing only output ports


addPort

void addPort(Port the_port)
Add a new port to this processor


removePort

void removePort(Port the_port)
Remove a port from a processor (only really applicable to the workflow source and sink ports, so be careful when you're using it)


getModel

ScuflModel getModel()
Get the parent model


fireModelEvent

void fireModelEvent(ScuflModelEvent event)
Fire a change event back to the model


isOffline

boolean isOffline()
Are we in offline mode?