com.ibm.dtfj.analyzer.j2se.wrappers
Class ThreadLocalWrapper
java.lang.Object
TranslatableAnalyzer
com.ibm.dtfj.analyzer.base.SimpleAnalyzerBean
com.ibm.dtfj.analyzer.helpers.ValueWrapper
com.ibm.dtfj.analyzer.helpers.objectwrapper.ObjectWrapper
com.ibm.dtfj.analyzer.helpers.base.MapWrapperBase
com.ibm.dtfj.analyzer.j2se.wrappers.ThreadLocalWrapper
- All Implemented Interfaces:
- IAnalyzerBase, IReport, IWrapper, java.util.Map
public class ThreadLocalWrapper
- extends MapWrapperBase
Extract information from a JavaObject that represents an instance of java.lang.ThreadLocal.
This wrapper can also be used as collection, whose entries are all the (thread,value) pairs
corresponding to all the threads for which this ThreadLocal has a non-null value.
Each thread is represented as a JavaThread, and each value is represented as an ObjectWrapper.
Nested Class Summary |
class |
ThreadLocalWrapper.Data
An inner class used to represent the data contained in the original ThreadLocal for thread. |
Nested classes/interfaces inherited from interface java.util.Map |
java.util.Map.Entry<K,V> |
Method Summary |
java.util.Set |
entrySet()
Return a Set of (thread,value) entries for which this ThreadLocal
has a non-null value. |
ThreadLocalWrapper.Data |
getData()
|
ObjectWrapper |
getValueForThread(com.ibm.dtfj.java.JavaObject threadObject)
Return an object that represents the data contained in the original ThreadLocal
for the specifed thread. |
ObjectWrapper |
getValueForThread(com.ibm.dtfj.java.JavaThread thread)
Return an object that represents the data contained in the original ThreadLocal
for the specifed thread. |
IAnalysisReport |
produceReport()
Generate a report which will be encapsulated in the IAnalysisReport object for later use by
some formatter. |
void |
setParent(java.lang.Object parent)
Set the parent JavaObject underlying this analyzer bean. |
Methods inherited from class com.ibm.dtfj.analyzer.helpers.base.MapWrapperBase |
clear, containsKey, containsValue, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class com.ibm.dtfj.analyzer.helpers.objectwrapper.ObjectWrapper |
checkMaskedField, endPrintGroup, getCachingPriority, getInstance, getValueAtPath, getValueAtPath, getVersion, printCollectionEntriesAtPath, printCollectionEntriesAtPath, printCollectionMapEntryReportsAtPath, printCollectionSizeAtPath, printCollectionValueReportsAtPath, printReportAtPath, printValueAtPath, printValueAtPath, setMaskedFieldPattern, startPrintGroup, toString |
Methods inherited from class com.ibm.dtfj.analyzer.helpers.ValueWrapper |
equals, getBooleanValue, getByteValue, getCharacterValue, getDoubleValue, getFloatValue, getIntegerValue, getJavaClassValue, getJavaObjectValue, getLongValue, getObjectWrapper, getObjectWrapper, getOneJavaClassValue, getOneJavaObjectValue, getRawValue, getShortValue, getStringValue, getTypeSignature, getValueWrapperInstance, hashCode, isBoolean, isByte, isCharacter, isDouble, isFloat, isInstanceOf, isInteger, isJavaClass, isJavaObject, isLong, isShort, isString |
Methods inherited from class com.ibm.dtfj.analyzer.base.SimpleAnalyzerBean |
allocateReport, allocateReportOptions, allocateSecondaryReport, getCategories, getContext, getIdentityString, getInstance, getLogger, getLongDescription, getName, getNextValidObject, getParent, getReportExtensionHelper, getResourceBundleName, getShortDescription, isPrimaryAnalyzer, printEmbeddedReport, printEmbeddedReport, printEmbeddedReportWithOptions, printEmbeddedReportWithOptions, printReportInfoHeader, recordInternalExceptionStatic, setContext |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
ThreadLocalWrapper
public ThreadLocalWrapper()
setParent
public void setParent(java.lang.Object parent)
- Set the parent JavaObject underlying this analyzer bean.
- Specified by:
setParent
in interface IWrapper
- Overrides:
setParent
in class ValueWrapper
- Parameters:
parent
- The parent object to set. Must be of type JavaObject,
and this JavaObject must represent an instance of a ThreadLocal.- See Also:
IWrapper.setParent(java.lang.Object)
getData
public ThreadLocalWrapper.Data getData()
throws com.ibm.dtfj.image.DTFJException
- Returns:
- an object that represents the list of all threads for which this ThreadLocal
has a non-null value
ThreadLocalWrapper.Data
.
- Throws:
com.ibm.dtfj.image.DTFJException
getValueForThread
public ObjectWrapper getValueForThread(com.ibm.dtfj.java.JavaThread thread)
throws com.ibm.dtfj.image.DTFJException
- Return an object that represents the data contained in the original ThreadLocal
for the specifed thread.
See
ThreadLocalWrapper.Data
.
- Parameters:
thread
- a JavaThread that specifies which thread's thread-local data we want to retrieve
- Returns:
- an object that represents the data contained in the original ThreadLocal
for the specified thread.
- Throws:
com.ibm.dtfj.image.DTFJException
getValueForThread
public ObjectWrapper getValueForThread(com.ibm.dtfj.java.JavaObject threadObject)
throws com.ibm.dtfj.image.DTFJException
- Return an object that represents the data contained in the original ThreadLocal
for the specifed thread.
See
ThreadLocalWrapper.Data
.
- Parameters:
threadObject
- a JavaObject that corresponds to the java/lang/Thread instance
for the thread whose thread-local data we want to retrieve
- Returns:
- an object that represents the data contained in the original ThreadLocal
for the specified thread.
- Throws:
com.ibm.dtfj.image.DTFJException
entrySet
public java.util.Set entrySet()
- Return a Set of (thread,value) entries for which this ThreadLocal
has a non-null value. Each entry in the Set is Map.Entry, in which the thread
is represented as a JavaThread and the value is represented as an ObjectWrapper.
- Specified by:
entrySet
in interface java.util.Map
- Specified by:
entrySet
in class MapWrapperBase
- See Also:
Map.entrySet()
produceReport
public IAnalysisReport produceReport()
- Description copied from interface:
IReport
- Generate a report which will be encapsulated in the IAnalysisReport object for later use by
some formatter.
- Specified by:
produceReport
in interface IReport
- Overrides:
produceReport
in class MapWrapperBase
- Returns:
- - the generic report object which will be given to some formatter
- See Also:
IReport.produceReport()
© Copyright IBM Corp. 2007, 2008 All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted
by GSA ADP Schedule Contract with IBM Corp.