Java in a Nutshell, 5th Edition [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Java in a Nutshell, 5th Edition [Electronic resources] - نسخه متنی

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید


ThreadGroupjava.lang

Java 1.0

This class represents a
group of threads and allows that group to
be manipulated as a whole. A ThreadGroup can
contain THRead objects, as well as other child
ThreadGroup objects. All
ThreadGroup objects are created as children of
some other THReadGroup, and thus there is a
parent/child hierarchy of ThreadGroup objects. Use
getParent( ) to
obtain the parent ThreadGroup, and use
activeCount( )
,
activeGroupCount( ), and the various
enumerate( ) methods to list the child
Thread and THReadGroup objects.
Most applications can simply rely on the default system thread group.
System-level code and applications such as servers that need to
create a large number of threads may find it convenient to create
their own THReadGroup objects, however.

interrupt( )
interrupts all threads in the group at once. setMaxPriority(
) specifies the maximum priority any thread in the group
can have. checkAccess( ) checks whether the
calling thread has permission to modify the given thread group. The
method throws a SecurityException if the current
thread does not have access. uncaughtException( )
contains the code that is run when a thread terminates because of an
uncaught exception or error. You can customize this method by
subclassing ThreadGroup.


Figure 10-65. java.lang.ThreadGroup

public class

ThreadGroup implements Thread.UncaughtExceptionHandler {
// Public Constructors
public

ThreadGroup (String

name );
public

ThreadGroup (ThreadGroup

parent , String

name );
// Public Instance Methods
public int

activeCount ( );
public int

activeGroupCount ( );
public final void

checkAccess ( );
public final void

destroy ( );
public int

enumerate (ThreadGroup[ ]

list );
public int

enumerate (Thread[ ]

list );
public int

enumerate (Thread[ ]

list , boolean

recurse );
public int

enumerate (ThreadGroup[ ]

list , boolean

recurse );
public final int

getMaxPriority ( );
public final String

getName ( );
public final ThreadGroup

getParent ( );

1.2 public final void

interrupt ( );
public final boolean

isDaemon ( );

1.1 public boolean

isDestroyed ( ); synchronized
public void

list ( );
public final boolean

parentOf (ThreadGroup

g );
public final void

setDaemon (boolean

daemon );
public final void

setMaxPriority (int

pri );
public void

uncaughtException (Thread

t , Throwable

e );
Implements:
Thread.UncaughtExceptionHandler
// Methods Implementing Thread.UncaughtExceptionHandler
public void

uncaughtException (Thread

t , Throwable

e );
// Public Methods Overriding Object
public String

toString ( );
// Deprecated Public Methods

1.1# public boolean

allowThreadSuspension (boolean

b );

# public final void

resume ( );

# public final void

stop ( );

# public final void

suspend ( );
}


Passed To


SecurityManager.checkAccess( ),
THRead.Thread( )

Returned By


SecurityManager.getThreadGroup( ),
THRead.getThreadGroup( )


    / 1191