本文整理汇总了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;
}
示例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());
}
}