cz.advel.stack.instrument
Class InstrumentationTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by cz.advel.stack.instrument.InstrumentationTask
All Implemented Interfaces:
java.lang.Cloneable

public class InstrumentationTask
extends org.apache.tools.ant.Task

Example usage:

 <target name="instrument-classes">
     <taskdef name="instrument-stack"
         classname="cz.advel.stack.instrument.InstrumentationTask"
         classpath="${run.classpath}">
     </taskdef>
 
     <instrument-stack dest="${build.classes.dir}" packageName="your.package.name">
         <fileset dir="${build.classes.dir}" includes="**/*.class"/>
     </instrument-stack>
 </target>
 
 <target name="-post-compile" depends="instrument-classes">
 </target>
 


Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
InstrumentationTask()
           
 
Method Summary
 void addFileSet(org.apache.tools.ant.types.FileSet fs)
           
 void execute()
           
 void setDest(java.io.File destDir)
           
 void setDisabled(boolean b)
          If true, stack allocation is disabled and every occurence of Stack.alloc() methods are replaced by direct object allocation.
 void setIsolated(boolean isolated)
          Sets isolated mode.
 void setPackageName(java.lang.String packageName)
           
 void setSingleThread(boolean b)
          Sets single thread mode.
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstrumentationTask

public InstrumentationTask()
Method Detail

addFileSet

public void addFileSet(org.apache.tools.ant.types.FileSet fs)

setDest

public void setDest(java.io.File destDir)

setPackageName

public void setPackageName(java.lang.String packageName)

setDisabled

public void setDisabled(boolean b)
If true, stack allocation is disabled and every occurence of Stack.alloc() methods are replaced by direct object allocation.


setSingleThread

public void setSingleThread(boolean b)
Sets single thread mode. If enabled, stack is accessed using static field instead of ThreadLocal. Gives some performance boost if you don't run in more then one thread.


setIsolated

public void setIsolated(boolean isolated)
Sets isolated mode.

If enabled, instrumented bytecode won't have dependency on JStackAlloc library, this disables effect of Stack.cleanCurrentThread() method on stack instances of any library that is compiled with this option.

Library author(s) should provide their own method for cleaning resources for current thread (possibly also cleaning other resources). See Stack.libraryCleanCurrentThread() method.


execute

public void execute()
             throws org.apache.tools.ant.BuildException
Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException