scheduledthreadpoolexecutor.html
来自「j2se5-api-zh,java文档的中文版本」· HTML 代码 · 共 828 行 · 第 1/4 页
HTML
828 行
<BR> 获得有关在此执行程序已 <tt>shutdown</tt> 的情况下是否继续执行现有延迟任务的策略。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="BlockingQueue.html" title="java.util.concurrent 中的接口">BlockingQueue</A><<A HREF="../../lang/Runnable.html" title="java.lang 中的接口">Runnable</A>></CODE></FONT></TD><TD><CODE><B><A HREF="ScheduledThreadPoolExecutor.html#getQueue()">getQueue</A></B>()</CODE><BR> 返回此执行程序使用的任务队列。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="ScheduledThreadPoolExecutor.html#remove(java.lang.Runnable)">remove</A></B>(<A HREF="../../lang/Runnable.html" title="java.lang 中的接口">Runnable</A> task)</CODE><BR> 从执行程序的内部队列中移除此任务(如果出现),这样如果尚未开始,则其不再运行。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE><V> <A HREF="ScheduledFuture.html" title="java.util.concurrent 中的接口">ScheduledFuture</A><V></CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B><A HREF="ScheduledThreadPoolExecutor.html#schedule(java.util.concurrent.Callable, long, java.util.concurrent.TimeUnit)">schedule</A></B>(<A HREF="Callable.html" title="java.util.concurrent 中的接口">Callable</A><V> callable, long delay, <A HREF="TimeUnit.html" title="java.util.concurrent 中的枚举">TimeUnit</A> unit)</CODE><BR> 创建并执行在给定延迟后启用的 ScheduledFuture。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="ScheduledFuture.html" title="java.util.concurrent 中的接口">ScheduledFuture</A><?></CODE></FONT></TD><TD><CODE><B><A HREF="ScheduledThreadPoolExecutor.html#schedule(java.lang.Runnable, long, java.util.concurrent.TimeUnit)">schedule</A></B>(<A HREF="../../lang/Runnable.html" title="java.lang 中的接口">Runnable</A> command, long delay, <A HREF="TimeUnit.html" title="java.util.concurrent 中的枚举">TimeUnit</A> unit)</CODE><BR> 创建并执行在给定延迟后启用的一次性操作。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="ScheduledFuture.html" title="java.util.concurrent 中的接口">ScheduledFuture</A><?></CODE></FONT></TD><TD><CODE><B><A HREF="ScheduledThreadPoolExecutor.html#scheduleAtFixedRate(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit)">scheduleAtFixedRate</A></B>(<A HREF="../../lang/Runnable.html" title="java.lang 中的接口">Runnable</A> command, long initialDelay, long period, <A HREF="TimeUnit.html" title="java.util.concurrent 中的枚举">TimeUnit</A> unit)</CODE><BR> 创建并执行一个在给定初始延迟后首次启用的定期操作,后续操作具有给定的周期;也就是将在 <tt>initialDelay</tt> 后开始执行,然后在 <tt>initialDelay+period</tt> 后执行,接着在 <tt>initialDelay + 2 * period</tt> 后执行,依此类推。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="ScheduledFuture.html" title="java.util.concurrent 中的接口">ScheduledFuture</A><?></CODE></FONT></TD><TD><CODE><B><A HREF="ScheduledThreadPoolExecutor.html#scheduleWithFixedDelay(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit)">scheduleWithFixedDelay</A></B>(<A HREF="../../lang/Runnable.html" title="java.lang 中的接口">Runnable</A> command, long initialDelay, long delay, <A HREF="TimeUnit.html" title="java.util.concurrent 中的枚举">TimeUnit</A> unit)</CODE><BR> 创建并执行一个在给定初始延迟后首次启用的定期操作,随后,在每一次执行终止和下一次执行开始之间都存在给定的延迟。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="ScheduledThreadPoolExecutor.html#setContinueExistingPeriodicTasksAfterShutdownPolicy(boolean)">setContinueExistingPeriodicTasksAfterShutdownPolicy</A></B>(boolean value)</CODE><BR> 设置有关在此执行程序已 <tt>shutdown</tt> 的情况下是否继续执行现有定期任务的策略。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="ScheduledThreadPoolExecutor.html#setExecuteExistingDelayedTasksAfterShutdownPolicy(boolean)">setExecuteExistingDelayedTasksAfterShutdownPolicy</A></B>(boolean value)</CODE><BR> 设置有关在此执行程序已 <tt>shutdown</tt> 的情况下是否继续执行现有延迟任务的策略。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="ScheduledThreadPoolExecutor.html#shutdown()">shutdown</A></B>()</CODE><BR> 在以前已提交任务的执行中发起一个有序的关闭,但是不接受新任务。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../List.html" title="java.util 中的接口">List</A><<A HREF="../../lang/Runnable.html" title="java.lang 中的接口">Runnable</A>></CODE></FONT></TD><TD><CODE><B><A HREF="ScheduledThreadPoolExecutor.html#shutdownNow()">shutdownNow</A></B>()</CODE><BR> 尝试停止所有正在执行的任务、暂停等待任务的处理,并返回等待执行的任务列表。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE><T> <A HREF="Future.html" title="java.util.concurrent 中的接口">Future</A><T></CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B><A HREF="ScheduledThreadPoolExecutor.html#submit(java.util.concurrent.Callable)">submit</A></B>(<A HREF="Callable.html" title="java.util.concurrent 中的接口">Callable</A><T> task)</CODE><BR> 提交一个返回值的任务用于执行,返回一个表示任务的未决结果的 Future。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="Future.html" title="java.util.concurrent 中的接口">Future</A><?></CODE></FONT></TD><TD><CODE><B><A HREF="ScheduledThreadPoolExecutor.html#submit(java.lang.Runnable)">submit</A></B>(<A HREF="../../lang/Runnable.html" title="java.lang 中的接口">Runnable</A> task)</CODE><BR> 提交一个 Runnable 任务用于执行,并返回一个表示该任务的 Future。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE><T> <A HREF="Future.html" title="java.util.concurrent 中的接口">Future</A><T></CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B><A HREF="ScheduledThreadPoolExecutor.html#submit(java.lang.Runnable, T)">submit</A></B>(<A HREF="../../lang/Runnable.html" title="java.lang 中的接口">Runnable</A> task, T result)</CODE><BR> 提交一个 Runnable 任务用于执行,并返回一个 Future,该 Future 表示任务一旦完成后即返回给定的结果。</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.util.concurrent.ThreadPoolExecutor"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>从类 java.util.concurrent.<A HREF="ThreadPoolExecutor.html" title="java.util.concurrent 中的类">ThreadPoolExecutor</A> 继承的方法</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="ThreadPoolExecutor.html#afterExecute(java.lang.Runnable, java.lang.Throwable)">afterExecute</A>, <A HREF="ThreadPoolExecutor.html#awaitTermination(long, java.util.concurrent.TimeUnit)">awaitTermination</A>, <A HREF="ThreadPoolExecutor.html#beforeExecute(java.lang.Thread, java.lang.Runnable)">beforeExecute</A>, <A HREF="ThreadPoolExecutor.html#finalize()">finalize</A>, <A HREF="ThreadPoolExecutor.html#getActiveCount()">getActiveCount</A>, <A HREF="ThreadPoolExecutor.html#getCompletedTaskCount()">getCompletedTaskCount</A>, <A HREF="ThreadPoolExecutor.html#getCorePoolSize()">getCorePoolSize</A>, <A HREF="ThreadPoolExecutor.html#getKeepAliveTime(java.util.concurrent.TimeUnit)">getKeepAliveTime</A>, <A HREF="ThreadPoolExecutor.html#getLargestPoolSize()">getLargestPoolSize</A>, <A HREF="ThreadPoolExecutor.html#getMaximumPoolSize()">getMaximumPoolSize</A>, <A HREF="ThreadPoolExecutor.html#getPoolSize()">getPoolSize</A>, <A HREF="ThreadPoolExecutor.html#getRejectedExecutionHandler()">getRejectedExecutionHandler</A>, <A HREF="ThreadPoolExecutor.html#getTaskCount()">getTaskCount</A>, <A HREF="ThreadPoolExecutor.html#getThreadFactory()">getThreadFactory</A>, <A HREF="ThreadPoolExecutor.html#isShutdown()">isShutdown</A>, <A HREF="ThreadPoolExecutor.html#isTerminated()">isTerminated</A>, <A HREF="ThreadPoolExecutor.html#isTerminating()">isTerminating</A>, <A HREF="ThreadPoolExecutor.html#prestartAllCoreThreads()">prestartAllCoreThreads</A>, <A HREF="ThreadPoolExecutor.html#prestartCoreThread()">prestartCoreThread</A>, <A HREF="ThreadPoolExecutor.html#purge()">purge</A>, <A HREF="ThreadPoolExecutor.html#setCorePoolSize(int)">setCorePoolSize</A>, <A HREF="ThreadPoolExecutor.html#setKeepAliveTime(long, java.util.concurrent.TimeUnit)">setKeepAliveTime</A>, <A HREF="ThreadPoolExecutor.html#setMaximumPoolSize(int)">setMaximumPoolSize</A>, <A HREF="ThreadPoolExecutor.html#setRejectedExecutionHandler(java.util.concurrent.RejectedExecutionHandler)">setRejectedExecutionHandler</A>, <A HREF="ThreadPoolExecutor.html#setThreadFactory(java.util.concurrent.ThreadFactory)">setThreadFactory</A>, <A HREF="ThreadPoolExecutor.html#terminated()">terminated</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.util.concurrent.AbstractExecutorService"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>从类 java.util.concurrent.<A HREF="AbstractExecutorService.html" title="java.util.concurrent 中的类">AbstractExecutorService</A> 继承的方法</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="AbstractExecutorService.html#invokeAll(java.util.Collection)">invokeAll</A>, <A HREF="AbstractExecutorService.html#invokeAll(java.util.Collection, long, java.util.concurrent.TimeUnit)">invokeAll</A>, <A HREF="AbstractExecutorService.html#invokeAny(java.util.Collection)">invokeAny</A>, <A HREF="AbstractExecutorService.html#invokeAny(java.util.Collection, long, java.util.concurrent.TimeUnit)">invokeAny</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>从类 java.lang.<A HREF="../../lang/Object.html" title="java.lang 中的类">Object</A> 继承的方法</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../lang/Object.html#clone()">clone</A>, <A HREF="../../lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../lang/Object.html#getClass()">getClass</A>, <A HREF="../../lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../lang/Object.html#notify()">notify</A>, <A HREF="../../lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../lang/Object.html#toString()">toString</A>, <A HREF="../../lang/Object.html#wait()">wait</A>, <A HREF="../../lang/Object.html#wait(long)">wait</A>, <A HREF="../../lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.util.concurrent.ExecutorService"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>从接口 java.util.concurrent.<A HREF="ExecutorService.html" title="java.util.concurrent 中的接口">ExecutorService</A> 继承的方法</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="ExecutorService.html#awaitTermination(long, java.util.concurrent.TimeUnit)">awaitTermination</A>, <A HREF="ExecutorService.html#invokeAll(java.util.Collection)">invokeAll</A>, <A HREF="ExecutorService.html#invokeAll(java.util.Collection, long, java.util.concurrent.TimeUnit)">invokeAll</A>, <A HREF="ExecutorService.html#invokeAny(java.util.Collection)">invokeAny</A>, <A HREF="ExecutorService.html#invokeAny(java.util.Collection, long, java.util.concurrent.TimeUnit)">invokeAny</A>, <A HREF="ExecutorService.html#isShutdown()">isShutdown</A>, <A HREF="ExecutorService.html#isTerminated()">isTerminated</A></CODE></TD></TR></TABLE> <P><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>构造方法详细信息</B></FONT></TH></TR></TABLE><A NAME="ScheduledThreadPoolExecutor(int)"><!-- --></A><H3>ScheduledThreadPoolExecutor</H3><PRE>public <B>ScheduledThreadPoolExecutor</B>(int corePoolSize)</PRE><DL><DD>使用给定核心池大小创建一个新 ScheduledThreadPoolExecutor。<P><DL><DT><B>参数:</B><DD><CODE>corePoolSize</CODE> - 池中所保存的线程数(包括空闲线程)。<DT><B>抛出:</B><DD><CODE><A HREF="../../lang/IllegalArgumentException.html" title="java.lang 中的类">IllegalArgumentException</A></CODE> - 如果 corePoolSize 小于或等于 0。</DL></DL><HR><A NAME="ScheduledThreadPoolExecutor(int, java.util.concurrent.ThreadFactory)"><!-- --></A><H3>ScheduledThreadPoolExecutor</H3><PRE>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?