当前位置: 首页>>代码示例>>Java>>正文


Java FileDownloadStatus.toLaunchPool方法代码示例

本文整理汇总了Java中com.liulishuo.filedownloader.model.FileDownloadStatus.toLaunchPool方法的典型用法代码示例。如果您正苦于以下问题:Java FileDownloadStatus.toLaunchPool方法的具体用法?Java FileDownloadStatus.toLaunchPool怎么用?Java FileDownloadStatus.toLaunchPool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.liulishuo.filedownloader.model.FileDownloadStatus的用法示例。


在下文中一共展示了FileDownloadStatus.toLaunchPool方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getReceiveServiceTaskList

import com.liulishuo.filedownloader.model.FileDownloadStatus; //导入方法依赖的package包/类
List<BaseDownloadTask.IRunningTask> getReceiveServiceTaskList(final int id){
    final List<BaseDownloadTask.IRunningTask> list = new ArrayList<>();
    synchronized (this.mList) {
        for (BaseDownloadTask.IRunningTask task : this.mList) {
            if (task.is(id) && !task.isOver()) {

                final byte status = task.getOrigin().getStatus();
                if (status != FileDownloadStatus.INVALID_STATUS &&
                        status != FileDownloadStatus.toLaunchPool) {

                    list.add(task);
                }
            }
        }
    }

    return list;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:19,代码来源:FileDownloadList.java

示例2: intoLaunchPool

import com.liulishuo.filedownloader.model.FileDownloadStatus; //导入方法依赖的package包/类
@Override
public void intoLaunchPool() {
    synchronized (mPauseLock) {
        if (mStatus != FileDownloadStatus.INVALID_STATUS) {
            FileDownloadLog.w(this, "High concurrent cause, this task %d will not input " +
                            "to launch pool, because of the status isn't idle : %d",
                    getId(), mStatus);
            return;
        }

        mStatus = FileDownloadStatus.toLaunchPool;
    }

    final BaseDownloadTask.IRunningTask runningTask = mTask.getRunningTask();
    final BaseDownloadTask origin = runningTask.getOrigin();

    if (FileDownloadMonitor.isValid()) {
        FileDownloadMonitor.getMonitor().onRequestStart(origin);
    }

    if (FileDownloadLog.NEED_LOG) {
        FileDownloadLog.v(this, "call start " +
                        "Url[%s], Path[%s] Listener[%s], Tag[%s]",
                origin.getUrl(), origin.getPath(), origin.getListener(), origin.getTag());
    }

    boolean ready = true;

    try {
        prepare();
    } catch (Throwable e) {
        ready = false;

        FileDownloadList.getImpl().add(runningTask);
        FileDownloadList.getImpl().remove(runningTask, prepareErrorMessage(e));
    }

    if (ready) {
        FileDownloadTaskLauncher.getImpl().launch(this);
    }

    if (FileDownloadLog.NEED_LOG) {
        FileDownloadLog.v(this, "the task[%d] has been into the launch pool.", getId());
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:46,代码来源:DownloadTaskHunter.java


注:本文中的com.liulishuo.filedownloader.model.FileDownloadStatus.toLaunchPool方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。