⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 future.java

📁 银行项目为后台socket通信写的程序
💻 JAVA
字号:
/****************************************************************************
 * Package		: com.ecSolutions.ecAppServer.server
 * File			: Future.java
 * Create Date  : 2007-7-20
 * Author		: Steven Chen
 * 
 * Copyright(C) 2006 ecSolutions(shanghai) Co.,Limited.All Rights Reserved.
 *			
 ***************************************************************************/
package com.ecSolutions.ecAppServer.server;

/**
 * A Future represents the result of an asynchronous task.
 * 
 * @author Steven Chen
 * @version $Id: Future.java,v 1.2 2007/07/26 04:10:42 stevenchen Exp $
 */
public interface Future {

    /**
     * Get session associated with the future.
     * 
     * @return session
     */
    Session getSession();

    /**
     * Waits if necessary for the task to complete. Warn: Block operate may lead
     * to artificially low throughput.
     * 
     * @return is succeeded
     */
    boolean complete();

    /**
     * Waits if necessary for the task to complete or the timeout period has
     * expired. Warn: Block operate may lead to artificially low throughput.
     * 
     * @param timeout
     *            timeout
     * @return is completed
     */
    boolean complete(int timeout);

    /**
     * Return true if the task completed.
     * 
     * @return is completed
     */
    boolean isCompleted();

    /**
     * Return true if the task completed successful.
     * 
     * @return is succeeded
     */
    boolean isSucceeded();

    /**
     * Add future listener.
     * 
     * @param listener
     *            future listener
     */
    void addListener(FutureListener listener);

    /**
     * Remove future listener.
     * 
     * @param listener
     *            future listener
     */
    void removeListener(FutureListener listener);
}

⌨️ 快捷键说明

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