com.werken.blissed.jelly
Class SpawnTag

java.lang.Object
  |
  +--org.apache.commons.jelly.TagSupport
        |
        +--com.werken.blissed.jelly.BlissedTagSupport
              |
              +--com.werken.blissed.jelly.RuntimeTagSupport
                    |
                    +--com.werken.blissed.jelly.SpawnTag
All Implemented Interfaces:
org.apache.commons.jelly.Tag

public class SpawnTag
extends RuntimeTagSupport

Spawn a new process.

This may be used to spawn both top-level and child processes. In both cases, a new Thread is created for execution of the process.

The Thread for the process may terminate before the Process itself, if execution stalls.

Version:
$Id: SpawnTag.java,v 1.4 2002/09/18 15:49:17 bob Exp $
Author:
bob mcwhirter

Fields inherited from class com.werken.blissed.jelly.RuntimeTagSupport
PROCESS_CONTEXT_KEY
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
SpawnTag()
          Construct.
 
Method Summary
 void doTag(org.apache.commons.jelly.XMLOutput output)
          Evaluates this tag after all the tags properties have been initialized.
 ProcessEngine getEngine()
          Retrieve the ProcessEngine to use if spawning a non-nested process.
 Process getProcess()
          Retrieve the process.
 java.lang.String getVar()
          Retrieve the variable name in which to store the Activity.
 void setAsync(boolean async)
          Set the async flag.
 void setEngine(ProcessEngine engine)
          Set the ProcessEngine to use if spawning a non-nested process.
 void setProcess(Process process)
          Set the process to perform.
 void setVar(java.lang.String var)
          Set the variable name in which to store the Activity.
 
Methods inherited from class com.werken.blissed.jelly.RuntimeTagSupport
getProcessContext
 
Methods inherited from class com.werken.blissed.jelly.BlissedTagSupport
checkObjectAttribute, checkStringAttribute
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isTrim, setBody, setContext, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpawnTag

public SpawnTag()
Construct.
Method Detail

setProcess

public void setProcess(Process process)
Set the process to perform.
Parameters:
process - The process.

getProcess

public Process getProcess()
                   throws java.lang.Exception
Retrieve the process.
Returns:
The process.
Throws:
java.lang.Exception - If a process library cannot be found.

setEngine

public void setEngine(ProcessEngine engine)
Set the ProcessEngine to use if spawning a non-nested process.
Parameters:
engine - The process engine.

getEngine

public ProcessEngine getEngine()
Retrieve the ProcessEngine to use if spawning a non-nested process.
Returns:
The process engine.

setVar

public void setVar(java.lang.String var)
Set the variable name in which to store the Activity.
Parameters:
var - The variable name.

getVar

public java.lang.String getVar()
Retrieve the variable name in which to store the Activity.
Returns:
The variable name.

setAsync

public void setAsync(boolean async)
Set the async flag.

For top-level, non-nested spawned processes, the async attribute may be specified in order to signal if the spawned process should attempt to use the caller's thread or if it should instead register with the process engine to operate asynchronously.

Even if spawned non-asyncly, once the process blocks, any future work will occur asynchronously within the process engine's thread.

For any process that is spawned as a child of another process, the async attribute is invalid and will throw an exception. All nested processes are spawned asynchronously.

Parameters:
async - The async flag.

doTag

public void doTag(org.apache.commons.jelly.XMLOutput output)
           throws java.lang.Exception
Evaluates this tag after all the tags properties have been initialized.
Parameters:
output - The output sink.
Throws:
java.lang.Exception - if an error occurs.


Copyright © 2002-2002 The Werken Company. All Rights Reserved.