Package org.glassfish.pfl.tf.spi
Class EnhancedClassDataBase
- java.lang.Object
-
- org.glassfish.pfl.tf.spi.EnhancedClassDataBase
-
- All Implemented Interfaces:
EnhancedClassData
- Direct Known Subclasses:
EnhancedClassDataASMImpl,EnhancedClassDataReflectiveImpl
public abstract class EnhancedClassDataBase extends java.lang.Object implements EnhancedClassData
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.glassfish.pfl.tf.spi.EnhancedClassData
EnhancedClassData.MethodType
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<java.lang.String>annoNamesForClassprotected java.util.Set<java.lang.String>annotationNamesprotected java.util.Map<java.lang.String,java.lang.String>annoToHolderNameprotected java.lang.StringclassNameprotected java.util.Set<java.lang.String>infoMethodDescsprotected java.util.List<java.lang.String>methodAnnoListprotected java.util.List<java.lang.String>methodDescriptionsprotected java.util.List<java.lang.String>methodNamesprotected java.util.Map<java.lang.String,java.lang.String>methodToAnnoprotected java.util.List<java.lang.String>methodTPNamesprotected java.util.List<TimingPointType>methodTPTsprotected java.util.Set<java.lang.String>mmMethodDescsprotected Utilutil-
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
Constructors Modifier Constructor Description protectedEnhancedClassDataBase(Util util, java.util.Set<java.lang.String> annotationNames)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EnhancedClassData.MethodTypeclassifyMethod(java.lang.String fullMethodDescriptor)Classify the method.java.util.Map<java.lang.String,java.lang.String>getAnnotationToHolderName()Map from MM annotation name to the name of the holder field that contains the SynchronizedHolder for the corresponding MethodMonitor.java.lang.StringgetClassName()Return the internal name of the class.java.util.List<java.lang.String>getDescriptions()List of descriptions of monitored methods and info methods.java.lang.StringgetHolderName(java.lang.String fullMethodDescriptor)Name of the holder fields corresponding to a particular method.intgetMethodIndex(java.lang.String methodName)Index of method name in the list of method names.java.util.List<java.lang.String>getMethodMMAnnotationName()List of annotation names for each info method and monitored method.java.util.List<java.lang.String>getMethodNames()List of method names for all MM methods and info methods in the class.java.util.List<java.lang.String>getTimingPointNames()List of timing point names corresponding to method names.java.util.List<TimingPointType>getTimingPointTypes()List of timing point types of monitored methods and info methods.booleanisTracedClass()Returns true iff this class is monitored.voidupdateInfoDesc()Enhance all of the descriptors for infoMethods.
-
-
-
Field Detail
-
util
protected Util util
-
annotationNames
protected final java.util.Set<java.lang.String> annotationNames
-
className
protected java.lang.String className
-
annoNamesForClass
protected final java.util.Set<java.lang.String> annoNamesForClass
-
annoToHolderName
protected final java.util.Map<java.lang.String,java.lang.String> annoToHolderName
-
methodNames
protected final java.util.List<java.lang.String> methodNames
-
methodDescriptions
protected final java.util.List<java.lang.String> methodDescriptions
-
methodTPTs
protected final java.util.List<TimingPointType> methodTPTs
-
methodTPNames
protected final java.util.List<java.lang.String> methodTPNames
-
methodAnnoList
protected final java.util.List<java.lang.String> methodAnnoList
-
infoMethodDescs
protected final java.util.Set<java.lang.String> infoMethodDescs
-
mmMethodDescs
protected final java.util.Set<java.lang.String> mmMethodDescs
-
methodToAnno
protected final java.util.Map<java.lang.String,java.lang.String> methodToAnno
-
-
Constructor Detail
-
EnhancedClassDataBase
protected EnhancedClassDataBase(Util util, java.util.Set<java.lang.String> annotationNames)
-
-
Method Detail
-
getClassName
public java.lang.String getClassName()
Description copied from interface:EnhancedClassDataReturn the internal name of the class.- Specified by:
getClassNamein interfaceEnhancedClassData- Returns:
- The class name.
-
getAnnotationToHolderName
public java.util.Map<java.lang.String,java.lang.String> getAnnotationToHolderName()
Description copied from interface:EnhancedClassDataMap 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:
getAnnotationToHolderNamein interfaceEnhancedClassData- Returns:
- Map from MM annotations defined on this class to the names of the holder fields.
-
getMethodNames
public java.util.List<java.lang.String> getMethodNames()
Description copied from interface:EnhancedClassDataList 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:
getMethodNamesin interfaceEnhancedClassData- Returns:
- List of all method tracing names in sorted order.
-
getMethodIndex
public int getMethodIndex(java.lang.String methodName)
Description copied from interface:EnhancedClassDataIndex of method name in the list of method names.- Specified by:
getMethodIndexin interfaceEnhancedClassData- Parameters:
methodName- The method name as defined for tracing.- Returns:
- the method index
-
getHolderName
public java.lang.String getHolderName(java.lang.String fullMethodDescriptor)
Description copied from interface:EnhancedClassDataName 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:
getHolderNamein interfaceEnhancedClassData- 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(java.lang.String fullMethodDescriptor)
Description copied from interface:EnhancedClassDataClassify the method.- Specified by:
classifyMethodin interfaceEnhancedClassData- Parameters:
fullMethodDescriptor- The full method descriptor of the method.- Returns:
- The kind of the corresponding method.
-
isTracedClass
public boolean isTracedClass()
Description copied from interface:EnhancedClassDataReturns true iff this class is monitored.- Specified by:
isTracedClassin interfaceEnhancedClassData- Returns:
- true iff this class has one or more MM annotations.
-
updateInfoDesc
public void updateInfoDesc()
Description copied from interface:EnhancedClassDataEnhance all of the descriptors for infoMethods.- Specified by:
updateInfoDescin interfaceEnhancedClassData
-
getDescriptions
public java.util.List<java.lang.String> getDescriptions()
List of descriptions of monitored methods and info methods. If no description was given in the annotations, the value is "".- Specified by:
getDescriptionsin interfaceEnhancedClassData- Returns:
- List of descriptions in the same order as in getMethodTracingNames.
-
getTimingPointTypes
public java.util.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:
getTimingPointTypesin interfaceEnhancedClassData- Returns:
- List of TimingPointTypes in the same order as in getMethodTracingNames.
-
getTimingPointNames
public java.util.List<java.lang.String> getTimingPointNames()
Description copied from interface:EnhancedClassDataList 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:
getTimingPointNamesin interfaceEnhancedClassData- Returns:
- List of timing point names, in the same order as in getMethodTracingNames.
-
getMethodMMAnnotationName
public java.util.List<java.lang.String> getMethodMMAnnotationName()
Description copied from interface:EnhancedClassDataList of annotation names for each info method and monitored method. It is interpreted as follows:- If the entry in the list is not null, it is the only annotation applicable to this method. This is the case for monitored methods.
- If the entry in the list is null, all annotations on the enclosing class apply to this method. This is the case for an InfoMethod, which can be called from any monitored method regardless of the annotation on the monitored method.
- Specified by:
getMethodMMAnnotationNamein interfaceEnhancedClassData- Returns:
- List of annotation names for methods.
-
-