- java.lang.Object
-
- jdk.jfr.consumer.RecordedObject
-
- jdk.jfr.consumer.RecordedThread
-
public final class RecordedThread extends RecordedObject
A recorded thread.- Since:
- 9
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getId()
Returns a unique id for both native threads and Java threads that can never be reused within the lifespan of the JVM.String
getJavaName()
Returns the Java thread name, ornull
if not available.long
getJavaThreadId()
Returns the Java thread id, or-1
not available.String
getOSName()
Returns the thread name used by the operating system.long
getOSThreadId()
Returns the thread id used by the operating system.RecordedThreadGroup
getThreadGroup()
Returns the Java thread group, if available.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from class jdk.jfr.consumer.RecordedObject
getFields, getValue, hasField, toString
-
-
-
-
Method Detail
-
getOSName
public String getOSName()
Returns the thread name used by the operating system.- Returns:
- OS thread name, or
null
if not available
-
getOSThreadId
public long getOSThreadId()
Returns the thread id used by the operating system.- Returns:
- Java thread id, or
-1
if not available
-
getThreadGroup
public RecordedThreadGroup getThreadGroup()
Returns the Java thread group, if available.- Returns:
- thread group, or
null
if not available
-
getJavaName
public String getJavaName()
Returns the Java thread name, ornull
if not available.Returns java.lang.Thread.getName() if the thread has a Java representation.
null
otherwise.- Returns:
- Java thread name, or
null
if not available
-
getJavaThreadId
public long getJavaThreadId()
Returns the Java thread id, or-1
not available.Returns
java.lang.Thread.getId()
if the thread is a Java thread, otherwise-1
.- Returns:
- thread id, or
-1
if it's not a Java thread
-
getId
public long getId()
Returns a unique id for both native threads and Java threads that can never be reused within the lifespan of the JVM.See
getJavaThreadId()
for the id return byjava.lang.Thread.getId()
- Returns:
- a unique id for the thread
-
-