Top Description Fields Constructors Methods
jdk.jfr.consumer

public final Class RecordedThread

extends RecordedObject
Class Inheritance
Imports
jdk.jfr.internal.consumer.ObjectContext

A recorded thread.
Since
9

Field Summary

Modifier and TypeField and Description
private final long
Inherited from jdk.jfr.consumer.RecordedObject:
objectContextobjects

Constructor Summary

AccessConstructor and Description
pack-priv
RecordedThread(ObjectContext objectContext, long id, Object[] values)

Method Summary

Modifier and TypeMethod and Description
public long

Returns:

a unique ID for the thread
getId
()

Returns a unique ID for both native threads and Java threads that can't be reused within the lifespan of the JVM.

public String

Returns:

the Java thread name, or null if doesn't exist
getJavaName
()

Returns the Java thread name, or null if doesn't exist.

public long

Returns:

the Java thread ID, or -1 if it's not a Java thread
getJavaThreadId
()

Returns the Java thread ID, or -1 if it's not a Java thread.

public String

Returns:

the OS thread name, or null if doesn't exist
getOSName
()

Returns the thread name used by the operating system.

public long

Returns:

the OS thread ID, or -1 if doesn't exist
getOSThreadId
()

Returns the thread ID used by the operating system.

public RecordedThreadGroup

Returns:

the thread group, or null if doesn't exist
getThreadGroup
()

Returns the Java thread group, if available.

public boolean

Returns:

true if this is a virtual Thread, false otherwise
isVirtual
()

Returns true if this is a virtual Thread, false otherwise.

Inherited from jdk.jfr.consumer.RecordedObject:
getBooleangetBytegetChargetClassgetDoublegetDurationgetFieldsgetFloatgetInstantgetIntgetLonggetShortgetStringgetThreadgetTypedgetValuehasFieldobjectAttoString

Field Detail

uniqueIdback to summary
private final long uniqueId

Constructor Detail

RecordedThreadback to summary
pack-priv RecordedThread(ObjectContext objectContext, long id, Object[] values)

Method Detail

getIdback to summary
public long getId()

Returns a unique ID for both native threads and Java threads that can't be reused within the lifespan of the JVM.

See getJavaThreadId() for the ID that is returned by java.lang.Thread.threadId().

See getOSThreadId() for the ID that is returned by the operating system.

Returns:long

a unique ID for the thread

getJavaNameback to summary
public String getJavaName()

Returns the Java thread name, or null if doesn't exist.

Returns java.lang.Thread.getName() if the thread has a Java representation. null otherwise.

Returns:String

the Java thread name, or null if doesn't exist

getJavaThreadIdback to summary
public long getJavaThreadId()

Returns the Java thread ID, or -1 if it's not a Java thread.

Returns:long

the Java thread ID, or -1 if it's not a Java thread

See Also
java.lang.Thread#threadId()
getOSNameback to summary
public String getOSName()

Returns the thread name used by the operating system.

Returns:String

the OS thread name, or null if doesn't exist

getOSThreadIdback to summary
public long getOSThreadId()

Returns the thread ID used by the operating system.

Returns:long

the OS thread ID, or -1 if doesn't exist

getThreadGroupback to summary
public RecordedThreadGroup getThreadGroup()

Returns the Java thread group, if available.

Returns:RecordedThreadGroup

the thread group, or null if doesn't exist

isVirtualback to summary
public boolean isVirtual()

Returns true if this is a virtual Thread, false otherwise.

Returns:boolean

true if this is a virtual Thread, false otherwise

Since
21