调整下载任务监听器父类接口名

This commit is contained in:
陈斐
2020-07-07 17:13:50 +08:00
parent b5cbbd9d3d
commit 8787030fa6
7 changed files with 16 additions and 14 deletions

View File

@@ -18,7 +18,7 @@ package com.arialyy.aria.core.common;
import com.arialyy.annotations.TaskEnum;
import com.arialyy.aria.core.download.DownloadGroupTaskListener;
import com.arialyy.aria.core.download.DownloadTaskListener;
import com.arialyy.aria.core.scheduler.BaseListenerInterface;
import com.arialyy.aria.core.scheduler.DownloadTaskInternalListenerInterface;
import com.arialyy.aria.core.scheduler.M3U8PeerTaskListenerInterface;
import com.arialyy.aria.core.scheduler.SubTaskListenerInterface;
import com.arialyy.aria.core.upload.UploadTaskListener;
@@ -117,7 +117,7 @@ public class ProxyHelper {
}
private Set<Integer> checkProxyTypeByInterface(Class clazz) {
if (!BaseListenerInterface.class.isAssignableFrom(clazz)) {
if (!DownloadTaskInternalListenerInterface.class.isAssignableFrom(clazz)) {
return null;
}
Set<Integer> result = new HashSet<>();

View File

@@ -1,8 +0,0 @@
package com.arialyy.aria.core.scheduler;
/**
* @author ChenFei(chenfei0928 @ gmail.com)
* @date 2020-07-07 15:18
*/
public interface BaseListenerInterface {
}

View File

@@ -0,0 +1,10 @@
package com.arialyy.aria.core.scheduler;
/**
* 直接实现监听器回调接口的基类,不对外部直接开放,仅作为内部监听器的父接口使用
*
* @author ChenFei(chenfei0928 @ gmail.com)
* @date 2020-07-07 15:18
*/
public interface DownloadTaskInternalListenerInterface {
}

View File

@@ -19,7 +19,7 @@ package com.arialyy.aria.core.scheduler;
* Created by Aria.Lao on 2019/6/26.
* m3u8切片事件回调类
*/
public interface M3U8PeerTaskListenerInterface extends BaseListenerInterface {
public interface M3U8PeerTaskListenerInterface extends DownloadTaskInternalListenerInterface {
public void onPeerStart(final String m3u8Url, final String peerPath, final int peerIndex);

View File

@@ -24,7 +24,7 @@ import com.arialyy.aria.core.task.UploadTask;
* Created by Aria.Lao on 2017/6/7.
* 普通任务事件{@link DownloadTask}、{@link UploadTask}、{@link DownloadGroupTask}回调类
*/
public interface NormalTaskListenerInterface<TASK extends ITask> extends BaseListenerInterface {
public interface NormalTaskListenerInterface<TASK extends ITask> extends DownloadTaskInternalListenerInterface {
/**
* 队列已经满了,继续创建任务,将会回调该方法

View File

@@ -22,7 +22,7 @@ import com.arialyy.aria.core.task.ITask;
* Created by Aria.Lao on 2019/6/26.
* 子任务事件回调类
*/
public interface SubTaskListenerInterface<TASK extends ITask, SUB_ENTITY extends AbsNormalEntity> extends BaseListenerInterface {
public interface SubTaskListenerInterface<TASK extends ITask, SUB_ENTITY extends AbsNormalEntity> extends DownloadTaskInternalListenerInterface {
public void onNoSupportBreakPoint(TASK task);

View File

@@ -106,7 +106,7 @@ public class TaskSchedulers<TASK extends ITask> implements ISchedulers {
}
if (!hasProxyListener(listeners, taskEnum)) {
if (obj instanceof BaseListenerInterface) {
if (obj instanceof DownloadTaskInternalListenerInterface) {
listeners.put(taskEnum, obj);
return;
}