- 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 longgetId()Returns a unique id for both native threads and Java threads that can never be reused within the lifespan of the JVM.StringgetJavaName()Returns the Java thread name, ornullif not available.longgetJavaThreadId()Returns the Java thread id, or-1not available.StringgetOSName()Returns the thread name used by the operating system.longgetOSThreadId()Returns the thread id used by the operating system.RecordedThreadGroupgetThreadGroup()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
nullif not available
-
getOSThreadId
public long getOSThreadId()
Returns the thread id used by the operating system.- Returns:
- Java thread id, or
-1if not available
-
getThreadGroup
public RecordedThreadGroup getThreadGroup()
Returns the Java thread group, if available.- Returns:
- thread group, or
nullif not available
-
getJavaName
public String getJavaName()
Returns the Java thread name, ornullif not available.Returns java.lang.Thread.getName() if the thread has a Java representation.
nullotherwise.- Returns:
- Java thread name, or
nullif not available
-
getJavaThreadId
public long getJavaThreadId()
Returns the Java thread id, or-1not available.Returns
java.lang.Thread.getId()if the thread is a Java thread, otherwise-1.- Returns:
- thread id, or
-1if 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
-
-