org.openemcee.microflow.frontend
Class MicroflowFactory

java.lang.Object
  extended byorg.openemcee.microflow.frontend.MicroflowFactory

public class MicroflowFactory
extends java.lang.Object

The Microflow factory is a Façade which provides simplified access to flows.

Author:
Scott Schenkein

Nested Class Summary
 class MicroflowFactory.MicroflowNotFoundException
          The requested microflow was not found.
 
Field Summary
static java.lang.String MICROFLOW_FACTORY_KEY
          Microflows created with the factory will have access to the creating factory, by accessing the named attribute at this key.
 
Constructor Summary
MicroflowFactory(java.lang.String urlBase)
          Creates a new instance of MicroflowLauncher.
 
Method Summary
protected  JobDescriptor getJob(java.lang.String microflowName)
          Access a job from an XML descriptor.
 MicroflowRunner getRunner(java.lang.String microflowName)
          Access a job from an XML job descriptor.
 void setValidating(boolean isValidating)
          Tell the parser to validate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MICROFLOW_FACTORY_KEY

public static final java.lang.String MICROFLOW_FACTORY_KEY
Microflows created with the factory will have access to the creating factory, by accessing the named attribute at this key.

See Also:
Constant Field Values
Constructor Detail

MicroflowFactory

public MicroflowFactory(java.lang.String urlBase)
Creates a new instance of MicroflowLauncher. The urlBase parameter passed here tells us where to look for the Microflows. For example, if your XML was contained in /home/me/workflows (or its subdirectories), you would pass "file:/home/me/workflows" as the input parameters. If it were from an HTTP server "http://myserver.mydomain.tld/workflows", or from a JAR file "jar:file:/home/me/workflows.jar!"

Parameters:
urlBase - The base url relative to which we will look for Microflows.
Method Detail

setValidating

public void setValidating(boolean isValidating)
Tell the parser to validate.

Parameters:
isValidating - True means validate xml, false means don't.

getJob

protected JobDescriptor getJob(java.lang.String microflowName)
                        throws MicroflowFactory.MicroflowNotFoundException
Access a job from an XML descriptor. You pass the name of the flow here if your URLBase was "file:/home/me/workflows", and your workflow XML were created at file:/home/me/workflows/proj1/myworkflow.xml, you would pass "proj1/myworkflow" (without "xml")

Parameters:
microflowName - The name of the microflow relative to the urlBase, without ".xml"
Returns:
This returns the job descriptor which will be use to create a microflow runner.
Throws:
MicroflowFactory.MicroflowNotFoundException - The microflow was not found, or was not compile-able. See msg for more info.

getRunner

public MicroflowRunner getRunner(java.lang.String microflowName)
                          throws MicroflowFactory.MicroflowNotFoundException
Access a job from an XML job descriptor. You pass the name of the flow here if your URLBase was "file:/home/me/workflows", and your workflow XML were created at file:/home/me/workflows/proj1/myworkflow.xml, you would pass "proj1/myworkflow" (without "xml") You should only execute the returned runner only once. It is thread-safe, but not reentrant.

Parameters:
microflowName - The name of the microflow relative to the urlBase, without ".xml"
Returns:
Returns a runner which can execute the requested microflow.
Throws:
MicroflowFactory.MicroflowNotFoundException - The microflow was not found, or was not compile-able. See msg for more info.


OpenEmcee Microflow Engine for Java: All software and content contained herein is subject to the Mozilla public license v1.1.
SourceForge.net Logo