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

pull/709/head
陈斐 4 years ago
parent b5cbbd9d3d
commit 8787030fa6
  1. 4
      Aria/src/main/java/com/arialyy/aria/core/common/ProxyHelper.java
  2. 8
      Aria/src/main/java/com/arialyy/aria/core/scheduler/BaseListenerInterface.java
  3. 10
      Aria/src/main/java/com/arialyy/aria/core/scheduler/DownloadTaskInternalListenerInterface.java
  4. 2
      Aria/src/main/java/com/arialyy/aria/core/scheduler/M3U8PeerTaskListenerInterface.java
  5. 2
      Aria/src/main/java/com/arialyy/aria/core/scheduler/NormalTaskListenerInterface.java
  6. 2
      Aria/src/main/java/com/arialyy/aria/core/scheduler/SubTaskListenerInterface.java
  7. 2
      Aria/src/main/java/com/arialyy/aria/core/scheduler/TaskSchedulers.java

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

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

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

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

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

@ -22,7 +22,7 @@ import com.arialyy.aria.core.task.ITask;
* Created by Aria.Lao on 2019/6/26. * 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); public void onNoSupportBreakPoint(TASK task);

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

Loading…
Cancel
Save