threadgroup.html

来自「API資料大全」· HTML 代码 · 共 924 行 · 第 1/3 页

HTML
924
字号
</DD></DL><HR><A NAME="activeGroupCount()"><!-- --></A><H3>activeGroupCount</H3><PRE>public int <B>activeGroupCount</B>()</PRE><DL><DD>Returns an estimate of the number of active groups in this thread group.<DD><DL><DT><B>Returns:</B><DD>the number of active thread groups with this thread group as          an ancestor.<DT><B>Since: </B><DD>JDK1.0</DD></DL></DD></DL><HR><A NAME="enumerate(java.lang.ThreadGroup[])"><!-- --></A><H3>enumerate</H3><PRE>public int <B>enumerate</B>(<A HREF="../../java/lang/ThreadGroup.html">ThreadGroup</A>[]&nbsp;list)</PRE><DL><DD>Copies into the specified array references to every active  subgroup in this thread group.  <p> First, the <code>checkAccess</code> method of this thread group is  called with no arguments; this may result in a security exception.  <p> An application should use the <code>activeGroupCount</code>  method to get an estimate of how big the array should be. If the  array is too short to hold all the thread groups, the extra thread  groups are silently ignored.<DD><DL><DT><B>Parameters:</B><DD><CODE>list</CODE> - an array into which to place the list of thread groups.<DT><B>Returns:</B><DD>the number of thread groups put into the array.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if the current thread does not               have permission to enumerate this thread group.<DT><B>Since: </B><DD>JDK1.0</DD><DT><B>See Also: </B><DD><A HREF="../../java/lang/ThreadGroup.html#activeGroupCount()"><CODE>activeGroupCount()</CODE></A>, <A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</CODE></A></DL></DD></DL><HR><A NAME="enumerate(java.lang.ThreadGroup[], boolean)"><!-- --></A><H3>enumerate</H3><PRE>public int <B>enumerate</B>(<A HREF="../../java/lang/ThreadGroup.html">ThreadGroup</A>[]&nbsp;list,                     boolean&nbsp;recurse)</PRE><DL><DD>Copies into the specified array references to every active  subgroup in this thread group. If the <code>recurse</code> flag is  <code>true</code>, references to all active subgroups of the  subgroups and so forth are also included.  <p> First, the <code>checkAccess</code> method of this thread group is  called with no arguments; this may result in a security exception.  <p> An application should use the <code>activeGroupCount</code>  method to get an estimate of how big the array should be.<DD><DL><DT><B>Parameters:</B><DD><CODE>list</CODE> - an array into which to place the list of threads.<DD><CODE>recurse</CODE> - a flag indicating whether to recursively enumerate                    all included thread groups.<DT><B>Returns:</B><DD>the number of thread groups put into the array.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if the current thread does not               have permission to enumerate this thread group.<DT><B>Since: </B><DD>JDK1.0</DD><DT><B>See Also: </B><DD><A HREF="../../java/lang/ThreadGroup.html#activeGroupCount()"><CODE>activeGroupCount()</CODE></A>, <A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</CODE></A></DL></DD></DL><HR><A NAME="stop()"><!-- --></A><H3>stop</H3><PRE>public final void <B>stop</B>()</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>This method is inherently unsafe.  See     <A HREF="../../java/lang/Thread.html#stop()"><CODE>Thread.stop()</CODE></A> for details.</I><P><DD>Stops all threads in this thread group. <p> First, the <code>checkAccess</code> method of this thread group is  called with no arguments; this may result in a security exception.  <p> This method then calls the <code>stop</code> method on all the  threads in this thread group and in all of its subgroups.<DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if the current thread is not allowed               to access this thread group or any of the threads in               the thread group.<DT><B>Since: </B><DD>JDK1.0</DD><DT><B>See Also: </B><DD><A HREF="../../java/lang/SecurityException.html"><CODE>SecurityException</CODE></A>, <A HREF="../../java/lang/Thread.html#stop()"><CODE>Thread.stop()</CODE></A>, <A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</CODE></A></DL></DD></DL><HR><A NAME="interrupt()"><!-- --></A><H3>interrupt</H3><PRE>public final void <B>interrupt</B>()</PRE><DL><DD>Interrupts all threads in this thread group. <p> First, the <code>checkAccess</code> method of this thread group is  called with no arguments; this may result in a security exception.  <p> This method then calls the <code>interrupt</code> method on all the  threads in this thread group and in all of its subgroups.<DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if the current thread is not allowed               to access this thread group or any of the threads in               the thread group.<DT><B>Since: </B><DD>1.2</DD><DT><B>See Also: </B><DD><A HREF="../../java/lang/Thread.html#interrupt()"><CODE>Thread.interrupt()</CODE></A>, <A HREF="../../java/lang/SecurityException.html"><CODE>SecurityException</CODE></A>, <A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</CODE></A></DL></DD></DL><HR><A NAME="suspend()"><!-- --></A><H3>suspend</H3><PRE>public final void <B>suspend</B>()</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>This method is inherently deadlock-prone.  See     <A HREF="../../java/lang/Thread.html#suspend()"><CODE>Thread.suspend()</CODE></A> for details.</I><P><DD>Suspends all threads in this thread group. <p> First, the <code>checkAccess</code> method of this thread group is  called with no arguments; this may result in a security exception.  <p> This method then calls the <code>suspend</code> method on all the  threads in this thread group and in all of its subgroups.<DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if the current thread is not allowed               to access this thread group or any of the threads in               the thread group.<DT><B>Since: </B><DD>JDK1.0</DD><DT><B>See Also: </B><DD><A HREF="../../java/lang/Thread.html#suspend()"><CODE>Thread.suspend()</CODE></A>, <A HREF="../../java/lang/SecurityException.html"><CODE>SecurityException</CODE></A>, <A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</CODE></A></DL></DD></DL><HR><A NAME="resume()"><!-- --></A><H3>resume</H3><PRE>public final void <B>resume</B>()</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>This method is used solely in conjunction with      <tt>Thread.suspend</tt> and <tt>ThreadGroup.suspend</tt>,       both of which have been deprecated, as they are inherently       deadlock-prone.  See <A HREF="../../java/lang/Thread.html#suspend()"><CODE>Thread.suspend()</CODE></A> for details.</I><P><DD>Resumes all threads in this thread group. <p> First, the <code>checkAccess</code> method of this thread group is  called with no arguments; this may result in a security exception.  <p> This method then calls the <code>resume</code> method on all the  threads in this thread group and in all of its sub groups.<DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if the current thread is not allowed to               access this thread group or any of the threads in the               thread group.<DT><B>Since: </B><DD>JDK1.0</DD><DT><B>See Also: </B><DD><A HREF="../../java/lang/SecurityException.html"><CODE>SecurityException</CODE></A>, <A HREF="../../java/lang/Thread.html#resume()"><CODE>Thread.resume()</CODE></A>, <A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</CODE></A></DL></DD></DL><HR><A NAME="destroy()"><!-- --></A><H3>destroy</H3><PRE>public final void <B>destroy</B>()</PRE><DL><DD>Destroys this thread group and all of its subgroups. This thread  group must be empty, indicating that all threads that had been in  this thread group have since stopped.  <p> First, the <code>checkAccess</code> method of this thread group is  called with no arguments; this may result in a security exception.<DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalThreadStateException.html">IllegalThreadStateException</A></CODE> - if the thread group is not               empty or if the thread group has already been destroyed.<DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if the current thread cannot modify this               thread group.<DT><B>Since: </B><DD>JDK1.0</DD><DT><B>See Also: </B><DD><A HREF="../../java/lang/ThreadGroup.html#checkAccess()"><CODE>checkAccess()</CODE></A></DL></DD></DL><HR><A NAME="list()"><!-- --></A><H3>list</H3><PRE>public void <B>list</B>()</PRE><DL><DD>Prints information about this thread group to the standard  output. This method is useful only for debugging.<DD><DL><DT><B>Since: </B><DD>JDK1.0</DD></DL></DD></DL><HR><A NAME="uncaughtException(java.lang.Thread, java.lang.Throwable)"><!-- --></A><H3>uncaughtException</H3><PRE>public void <B>uncaughtException</B>(<A HREF="../../java/lang/Thread.html">Thread</A>&nbsp;t,                              <A HREF="../../java/lang/Throwable.html">Throwable</A>&nbsp;e)</PRE><DL><DD>Called by the Java Virtual Machine when a thread in this  thread group stops because of an uncaught exception.  <p> The <code>uncaughtException</code> method of  <code>ThreadGroup</code> does the following:  <ul> <li>If this thread group has a parent thread group, the     <code>uncaughtException</code> method of that parent is called     with the same two arguments.  <li>Otherwise, this method determines if the <code>Throwable</code>     argument is an instance of <code>ThreadDeath</code>. If so, nothing     special is done. Otherwise, the <code>Throwable</code>'s     <code>printStackTrace</code> method is called to print a stack     backtrace to the standard error stream. </ul> <p> Applications can override this method in subclasses of  <code>ThreadGroup</code> to provide alternative handling of  uncaught exceptions.<DD><DL><DT><B>Parameters:</B><DD><CODE>t</CODE> - the thread that is about to exit.<DD><CODE>e</CODE> - the uncaught exception.<DT><B>Since: </B><DD>JDK1.0</DD><DT><B>See Also: </B><DD><A HREF="../../java/lang/System.html#err"><CODE>System.err</CODE></A>, <A HREF="../../java/lang/ThreadDeath.html"><CODE>ThreadDeath</CODE></A>, <A HREF="../../java/lang/Throwable.html#printStackTrace(java.io.PrintStream)"><CODE>Throwable.printStackTrace(java.io.PrintStream)</CODE></A></DL></DD></DL><HR><A NAME="allowThreadSuspension(boolean)"><!-- --></A><H3>allowThreadSuspension</H3><PRE>public boolean <B>allowThreadSuspension</B>(boolean&nbsp;b)</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>The definition of this call depends on <A HREF="../../java/lang/ThreadGroup.html#suspend()"><CODE>suspend()</CODE></A>,		   which is deprecated.  Further, the behavior of this call		   was never specified.</I><P><DD>Used by VM to control lowmem implicit suspension.<DD><DL><DT><B>Parameters:</B><DD><CODE>b</CODE> - boolean to allow or disallow suspension<DT><B>Returns:</B><DD>true on success<DT><B>Since: </B><DD>JDK1.1</DD></DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>toString</B>()</PRE><DL><DD>Returns a string representation of this Thread group.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#toString()">toString</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a string representation of this thread group.<DT><B>Since: </B><DD>JDK1.0</DD></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ThreadGroup.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../java/lang/Thread.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../java/lang/ThreadLocal.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="ThreadGroup.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation  contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A.  All Rights Reserved.</font></BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?