public final class Threads extends Object
Threadsis a preview API of the Java platform.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
This class consists exclusively of static methods that operate on threads for the purposes of monitoring and management.
currentThreadEnclosingScopespublic static String currentThreadEnclosingScopes()Returns a string that describes the current thread's enclosing scopes or an empty string if there no enclosing scopes.
If there is a security manager set, and describing an enclosing scope requires getting the stack trace of its owner thread, then the security manager's
checkPermissionmethod is called to check the permission
- API Note:
- There is no equivalent at this time to describe the enclosing scopes of other threads.
- Implementation Requirements:
- The default implementation includes the name, owner, and owner stack trace of each enclosing scope.
SecurityException- if denied by the security manager
- See Also:
Threadswhen preview features are enabled.