JavaTM 2 Platform
Standard Ed. 6

介面 java.util.concurrent.ScheduledExecutorService
的使用

使用 ScheduledExecutorService 的軟體套件
java.util.concurrent 在共時程式中很常用的實用工具類別。 
 

java.util.concurrent 中 ScheduledExecutorService 的使用
 

實作 ScheduledExecutorService 的 java.util.concurrent 中的類別
 class ScheduledThreadPoolExecutor
          ThreadPoolExecutor,它可另行安排在給定的延遲後運行命令,或者定期執行命令。
 

返回 ScheduledExecutorService 的 java.util.concurrent 中的方法
static ScheduledExecutorService Executors.newScheduledThreadPool(int corePoolSize)
          創建一個執行緒池,它可安排在給定延遲後運行命令或者定期地執行。
static ScheduledExecutorService Executors.newScheduledThreadPool(int corePoolSize, ThreadFactory threadFactory)
          創建一個執行緒池,它可安排在給定延遲後運行命令或者定期地執行。
static ScheduledExecutorService Executors.newSingleThreadScheduledExecutor()
          創建一個單執行緒執行程序,它可安排在給定延遲後運行命令或者定期地執行。
static ScheduledExecutorService Executors.newSingleThreadScheduledExecutor(ThreadFactory threadFactory)
          創建一個單執行緒執行程序,它可安排在給定延遲後運行命令或者定期地執行。
static ScheduledExecutorService Executors.unconfigurableScheduledExecutorService(ScheduledExecutorService executor)
          返回一個將所有已定義的 ExecutorService 方法委託給指定執行程序的物件,但是使用強制轉換可能無法存取其他方法。
 

參數型別為 ScheduledExecutorService 的 java.util.concurrent 中的方法
static ScheduledExecutorService Executors.unconfigurableScheduledExecutorService(ScheduledExecutorService executor)
          返回一個將所有已定義的 ExecutorService 方法委託給指定執行程序的物件,但是使用強制轉換可能無法存取其他方法。
 


JavaTM 2 Platform
Standard Ed. 6

提交錯誤或意見

版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。