org.apache.commons.jelly.tags.threads
Class UseThreadTag

java.lang.Object
  extended byorg.apache.commons.jelly.TagSupport
      extended byorg.apache.commons.jelly.tags.threads.UseThreadTag
All Implemented Interfaces:
org.apache.commons.jelly.Tag
Direct Known Subclasses:
InterruptTag, JoinTag

public abstract class UseThreadTag
extends org.apache.commons.jelly.TagSupport

Base class for tags that will "use" threads.

Author:
Jason Horman

Field Summary
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
UseThreadTag()
           
 
Method Summary
 void doTag(org.apache.commons.jelly.XMLOutput output)
          The default behavior is to either use the set thread or to search for a parent thread to use.
 java.lang.Thread getThread()
          Get a reference to the thread to use
 java.util.List getThreadGroup()
          Get the thread group
 void setSearchForParentThread(boolean searchForParent)
          If true the tag will search for a parent thread tag to "use" if no thread was set via setThread.
 void setThread(java.lang.Thread thread)
          Set the thread to use in some way.
 void setThreadGroup(java.util.List threadGroup)
          Set the thread group to "use".
protected abstract  void useThread(java.lang.Thread thread, org.apache.commons.jelly.XMLOutput output)
          Implement this method to do something with the thread
protected abstract  void useThreadGroup(java.util.List threadGroup, org.apache.commons.jelly.XMLOutput output)
          Implement this method to do something with the threadGroup
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UseThreadTag

public UseThreadTag()
Method Detail

doTag

public void doTag(org.apache.commons.jelly.XMLOutput output)
           throws org.apache.commons.jelly.JellyTagException
The default behavior is to either use the set thread or to search for a parent thread to use.

Throws:
org.apache.commons.jelly.JellyTagException

useThread

protected abstract void useThread(java.lang.Thread thread,
                                  org.apache.commons.jelly.XMLOutput output)
                           throws java.lang.InterruptedException
Implement this method to do something with the thread

Throws:
java.lang.InterruptedException

useThreadGroup

protected abstract void useThreadGroup(java.util.List threadGroup,
                                       org.apache.commons.jelly.XMLOutput output)
                                throws java.lang.InterruptedException
Implement this method to do something with the threadGroup

Throws:
java.lang.InterruptedException

setThread

public void setThread(java.lang.Thread thread)
Set the thread to use in some way.


getThread

public java.lang.Thread getThread()
Get a reference to the thread to use


setThreadGroup

public void setThreadGroup(java.util.List threadGroup)
Set the thread group to "use".

Parameters:
threadGroup - The threadGroup created with the group tag.

getThreadGroup

public java.util.List getThreadGroup()
Get the thread group


setSearchForParentThread

public void setSearchForParentThread(boolean searchForParent)
If true the tag will search for a parent thread tag to "use" if no thread was set via setThread. This is true by default.



Copyright © 2002-2006 Apache Software Foundation. All Rights Reserved.