org.glassfish.pfl.tf.spi
Class EnhancedClassDataBase

java.lang.Object
  extended by org.glassfish.pfl.tf.spi.EnhancedClassDataBase
All Implemented Interfaces:
EnhancedClassData
Direct Known Subclasses:
EnhancedClassDataASMImpl, EnhancedClassDataReflectiveImpl

public abstract class EnhancedClassDataBase
extends Object
implements EnhancedClassData

Author:
ken

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.glassfish.pfl.tf.spi.EnhancedClassData
EnhancedClassData.MethodType
 
Field Summary
protected  Set<String> annoNamesForClass
           
protected  Set<String> annotationNames
           
protected  Map<String,String> annoToHolderName
           
protected  String className
           
protected  Set<String> infoMethodDescs
           
protected  List<String> methodAnnoList
           
protected  List<String> methodDescriptions
           
protected  List<String> methodNames
           
protected  Map<String,String> methodToAnno
           
protected  List<String> methodTPNames
           
protected  List<TimingPointType> methodTPTs
           
protected  Set<String> mmMethodDescs
           
protected  Util util
           
 
Fields inherited from interface org.glassfish.pfl.tf.spi.EnhancedClassData
DESCRIPTION_NAME, INFO_METHOD_NAME, MM_NAME, MM_TYPE, OBJECT_NAME, OBJECT_TYPE, SH_NAME, SH_TYPE
 
Constructor Summary
protected EnhancedClassDataBase(Util util, Set<String> annotationNames)
           
 
Method Summary
 EnhancedClassData.MethodType classifyMethod(String fullMethodDescriptor)
          Classify the method.
 Map<String,String> getAnnotationToHolderName()
          Map from MM annotation name to the name of the holder field that contains the SynchronizedHolder for the corresponding MethodMonitor.
 String getClassName()
          Return the internal name of the class.
 List<String> getDescriptions()
          List of descriptions of monitored methods and info methods.
 String getHolderName(String fullMethodDescriptor)
          Name of the holder fields corresponding to a particular method.
 int getMethodIndex(String methodName)
          Index of method name in the list of method names.
 List<String> getMethodMMAnnotationName()
          List of annotation names for each info method and monitored method.
 List<String> getMethodNames()
          List of method names for all MM methods and info methods in the class.
 List<String> getTimingPointNames()
          List of timing point names corresponding to method names.
 List<TimingPointType> getTimingPointTypes()
          List of timing point types of monitored methods and info methods.
 boolean isTracedClass()
          Returns true iff this class is monitored.
 void updateInfoDesc()
          Enhance all of the descriptors for infoMethods.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

util

protected Util util

annotationNames

protected final Set<String> annotationNames

className

protected String className

annoNamesForClass

protected final Set<String> annoNamesForClass

annoToHolderName

protected final Map<String,String> annoToHolderName

methodNames

protected final List<String> methodNames

methodDescriptions

protected final List<String> methodDescriptions

methodTPTs

protected final List<TimingPointType> methodTPTs

methodTPNames

protected final List<String> methodTPNames

methodAnnoList

protected final List<String> methodAnnoList

infoMethodDescs

protected final Set<String> infoMethodDescs

mmMethodDescs

protected final Set<String> mmMethodDescs

methodToAnno

protected final Map<String,String> methodToAnno
Constructor Detail

EnhancedClassDataBase

protected EnhancedClassDataBase(Util util,
                                Set<String> annotationNames)
Method Detail

getClassName

public String getClassName()
Description copied from interface: EnhancedClassData
Return the internal name of the class.

Specified by:
getClassName in interface EnhancedClassData
Returns:
The class name.

getAnnotationToHolderName

public Map<String,String> getAnnotationToHolderName()
Description copied from interface: EnhancedClassData
Map from MM annotation name to the name of the holder field that contains the SynchronizedHolder for the corresponding MethodMonitor. The domain of this map is the set of MM annotations on this class.

Specified by:
getAnnotationToHolderName in interface EnhancedClassData
Returns:
Map from MM annotations defined on this class to the names of the holder fields.

getMethodNames

public List<String> getMethodNames()
Description copied from interface: EnhancedClassData
List of method names for all MM methods and info methods in the class. Order is significant, as the index of the method in the list is the ordinal used to represent it. This list is in sorted order.

Specified by:
getMethodNames in interface EnhancedClassData
Returns:
List of all method tracing names in sorted order.

getMethodIndex

public int getMethodIndex(String methodName)
Description copied from interface: EnhancedClassData
Index of method name in the list of method names.

Specified by:
getMethodIndex in interface EnhancedClassData
Parameters:
methodName - The method name as defined for tracing.
Returns:
the method index

getHolderName

public String getHolderName(String fullMethodDescriptor)
Description copied from interface: EnhancedClassData
Name of the holder fields corresponding to a particular method. Note that the full descriptor (name + arg/return descriptor) is used to unambiguously identify the method in the class.

Specified by:
getHolderName in interface EnhancedClassData
Parameters:
fullMethodDescriptor - The full method descriptor of the method.
Returns:
The name of the holder field used for this method.

classifyMethod

public EnhancedClassData.MethodType classifyMethod(String fullMethodDescriptor)
Description copied from interface: EnhancedClassData
Classify the method.

Specified by:
classifyMethod in interface EnhancedClassData
Parameters:
fullMethodDescriptor - The full method descriptor of the method.
Returns:
The kind of the corresponding method.

isTracedClass

public boolean isTracedClass()
Description copied from interface: EnhancedClassData
Returns true iff this class is monitored.

Specified by:
isTracedClass in interface EnhancedClassData
Returns:
true iff this class has one or more MM annotations.

updateInfoDesc

public void updateInfoDesc()
Description copied from interface: EnhancedClassData
Enhance all of the descriptors for infoMethods.

Specified by:
updateInfoDesc in interface EnhancedClassData

getDescriptions

public List<String> getDescriptions()
List of descriptions of monitored methods and info methods. If no description was given in the annotations, the value is "".

Specified by:
getDescriptions in interface EnhancedClassData
Returns:
List of descriptions in the same order as in getMethodTracingNames.

getTimingPointTypes

public List<TimingPointType> getTimingPointTypes()
List of timing point types of monitored methods and info methods. The list contains BOTH for a monitored method. An info method that does not represent a timing point is represented by NONE.

Specified by:
getTimingPointTypes in interface EnhancedClassData
Returns:
List of TimingPointTypes in the same order as in getMethodTracingNames.

getTimingPointNames

public List<String> getTimingPointNames()
Description copied from interface: EnhancedClassData
List of timing point names corresponding to method names. For monitored methods, this is just the method name. For info methods whose tpType is not NONE, this is specified in tpName.

Specified by:
getTimingPointNames in interface EnhancedClassData
Returns:
List of timing point names, in the same order as in getMethodTracingNames.

getMethodMMAnnotationName

public List<String> getMethodMMAnnotationName()
Description copied from interface: EnhancedClassData
List of annotation names for each info method and monitored method. It is interpreted as follows:

Specified by:
getMethodMMAnnotationName in interface EnhancedClassData
Returns:
List of annotation names for methods.


Copyright © 2013 Oracle. All Rights Reserved.