Top Description Inners Fields Constructors Methods
org.glassfish.pfl.tf.tools.enhancer

public Class EnhanceTool

extends Object
Class Inheritance
Imports
java.io.File, .IOException, java.util.Date, .Set, org.glassfish.pfl.basic.contain.Pair, org.glassfish.pfl.basic.func.UnaryFunction, org.glassfish.pfl.basic.tools.argparser.ArgParser, .DefaultValue, .Help, org.glassfish.pfl.basic.tools.file.ActionFactory, .FileWrapper, .Recognizer, .Scanner, org.glassfish.pfl.tf.spi.Util, org.glassfish.pfl.tf.timer.spi.TimerFactory, .TimerPointSourceGenerator, .TimingInfoProcessor

Tool for enhancing classes annotated with tracing facility annotations. The processing is divided into two phases:
  1. The first phase adds code to the static initialized of the class to register the class with the TF framework. This phase also modifies all calls to @InfoMethod annotated methods to pass extra arguments needed for tracing. Note that this phase must be done at build time, because it modifies the schema of the class.
  2. The second phase adds the actual trace code to methods annotated with tracing annotations. This does not change the schema, so this phase could be done either at build time, or at runtime. Tracing the code only at runtime may reduce the overhead, since untraced code need not be modified.
This tool can do either phase 1, or phase 1 and 2, against ALL classes reachable from a starting directory.
Author
ken

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
private class
EnhanceTool.EnhancerFileAction

References Deprecated Scanner.Action is deprecated or references (maybe indirectly) at least one deprecated element.
public static enum

Field Summary

Modifier and TypeField and Description
private EnhanceTool.Arguments
private static int
private TimingInfoProcessor
private Util

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
doScan(EnhanceTool.Arguments args, ActionFactory af, Scanner scanner, Scanner.Action classAct)
References Deprecated Scanner.Action is deprecated or references (maybe indirectly) at least one deprecated element.

private void
public static void
main(String[] strs)

private Scanner.Action
makeIgnoreAction(final boolean trace)
References Deprecated Scanner.Action is deprecated or references (maybe indirectly) at least one deprecated element.

public void
run(String[] strs)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

argsback to summary
private EnhanceTool.Arguments args
errorCountback to summary
private static int errorCount
tipback to summary
private TimingInfoProcessor tip
utilback to summary
private Util util

Constructor Detail

EnhanceToolback to summary
public EnhanceTool()

Method Detail

doScanback to summary
private void doScan(EnhanceTool.Arguments args, ActionFactory af, Scanner scanner, Scanner.Action classAct) throws IOException

References Deprecated

Scanner.Action is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

generatePropertiesFileback to summary
private void generatePropertiesFile(EnhanceTool.Arguments args, Set<String> anames) throws IOException
mainback to summary
public static void main(String[] strs)
makeIgnoreActionback to summary
private Scanner.Action makeIgnoreAction(final boolean trace)

References Deprecated

Scanner.Action is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

runback to summary
public void run(String[] strs)
org.glassfish.pfl.tf.tools.enhancer back to summary

public Interface EnhanceTool.Arguments


Method Summary

Modifier and TypeMethod and Description
public boolean
public File
dir()

public boolean
public EnhanceTool.ProcessingMode
mode()

public boolean
public File
rf()

public String
public String
public int

Method Detail

debugback to summary
public boolean debug()
Annotations
@DefaultValue:false
@Help:Debug flag
dirback to summary
public File dir()
Annotations
@DefaultValue:.
@Help:Directory to scan for class file
dryrunback to summary
public boolean dryrun()
Annotations
@DefaultValue:false
@Help:Indicates a run that only prints out actions, but does not perform them
modeback to summary
public EnhanceTool.ProcessingMode mode()
Annotations
@DefaultValue:TimingPoints
@Help:Control the mode of operation: TimingPoints, UpdateSchema, or TraceEnhance
newoutback to summary
public boolean newout()
Annotations
@DefaultValue:false
@Help:If true, write output to a .class.new file
rfback to summary
public File rf()
Annotations
@DefaultValue:tfannotations.properties
@Help:Name of resource file containing information about tf annotations
timingPointClassback to summary
public String timingPointClass()
Annotations
@DefaultValue
@Help:The timing point class name
timingPointDirback to summary
public String timingPointDir()
Annotations
@DefaultValue
@Help:The directory in which to write the TimingPoint file
verboseback to summary
public int verbose()
Annotations
@DefaultValue:0
@Help:Verbose flag
org.glassfish.pfl.tf.tools.enhancer back to summary

private Class EnhanceTool.EnhancerFileAction

extends Object
implements Action
Class Inheritance
  • java.lang.Object
  • org.glassfish.pfl.tf.tools.enhancer.EnhanceTool.EnhancerFileAction
All Implemented Interfaces
org.glassfish.pfl.basic.tools.file.Scanner.Action, org.glassfish.pfl.basic.func.UnaryPredicate, java.util.function.Predicate

References Deprecated

Scanner.Action is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Field Summary

Modifier and TypeField and Description
private UnaryFunction<byte[], byte[]>
ea

References Deprecated UnaryFunction is deprecated or references (maybe indirectly) at least one deprecated element.

Constructor Summary

AccessConstructor and Description
public
EnhancerFileAction(UnaryFunction<byte[], byte[]> ea)
References Deprecated UnaryFunction is deprecated or references (maybe indirectly) at least one deprecated element.

Method Summary

Modifier and TypeMethod and Description
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

eaback to summary
private UnaryFunction<byte[], byte[]> ea

References Deprecated

UnaryFunction is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Constructor Detail

EnhancerFileActionback to summary
public EnhancerFileAction(UnaryFunction<byte[], byte[]> ea)

References Deprecated

UnaryFunction is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Method Detail

evaluateback to summary
public boolean evaluate(FileWrapper fw)

Implements org.glassfish.pfl.basic.func.UnaryPredicate.evaluate.

Annotations
@Override
org.glassfish.pfl.tf.tools.enhancer back to summary

public final Enum EnhanceTool.ProcessingMode

extends Enum<EnhanceTool.ProcessingMode>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final EnhanceTool.ProcessingMode
TimingPoints

Only generate the timing points file: no changes to monitored class bytecode.

public static final EnhanceTool.ProcessingMode
TraceEnhance

Update the class schema and insert tracing code.

public static final EnhanceTool.ProcessingMode
UpdateSchemas

Update the class schemas for monitored classes, but don't insert the tracing code.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static EnhanceTool.ProcessingMode
public static EnhanceTool.ProcessingMode[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

TimingPointsback to summary
public static final EnhanceTool.ProcessingMode TimingPoints

Only generate the timing points file: no changes to monitored class bytecode.

TraceEnhanceback to summary
public static final EnhanceTool.ProcessingMode TraceEnhance

Update the class schema and insert tracing code. Generate the TimingPoints file if the timingPointDir and timingPointClass options are set.

UpdateSchemasback to summary
public static final EnhanceTool.ProcessingMode UpdateSchemas

Update the class schemas for monitored classes, but don't insert the tracing code. Generate the TimingPoints file if the timingPointDir and timingPointClass options are set.

Constructor Detail

ProcessingModeback to summary
private ProcessingMode()

Method Detail

valueOfback to summary
public static EnhanceTool.ProcessingMode valueOf(String name)
valuesback to summary
public static EnhanceTool.ProcessingMode[] values()