forked from Linyuzai/concept
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
162 additions
and
360 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...re/src/main/java/com/github/linyuzai/download/core/compress/AbstractCompressionEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.github.linyuzai.download.core.compress; | ||
|
||
import com.github.linyuzai.download.core.context.DownloadContext; | ||
import com.github.linyuzai.download.core.event.DownloadContextEvent; | ||
import lombok.Getter; | ||
|
||
/** | ||
* {@link Compression} 事件。 | ||
*/ | ||
@Getter | ||
public class AbstractCompressionEvent extends DownloadContextEvent { | ||
|
||
private final Compression compression; | ||
|
||
public AbstractCompressionEvent(DownloadContext context, Compression compression) { | ||
super(context); | ||
this.compression = compression; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 2 additions & 12 deletions
14
...rc/main/java/com/github/linyuzai/download/core/compress/CompressionCacheDeletedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,13 @@ | ||
package com.github.linyuzai.download.core.compress; | ||
|
||
import com.github.linyuzai.download.core.context.DownloadContext; | ||
import com.github.linyuzai.download.core.event.DownloadContextEvent; | ||
import lombok.Getter; | ||
|
||
/** | ||
* {@link Compression} 的缓存删除时会发布该事件。 | ||
*/ | ||
@Getter | ||
public class CompressionCacheDeletedEvent extends DownloadContextEvent { | ||
|
||
/** | ||
* 删除缓存的 {@link Compression} | ||
*/ | ||
private final Compression compression; | ||
public class CompressionCacheDeletedEvent extends AbstractCompressionEvent { | ||
|
||
public CompressionCacheDeletedEvent(DownloadContext context, Compression compression) { | ||
super(context); | ||
setMessage("Compression cache deleted"); | ||
this.compression = compression; | ||
super(context, compression); | ||
} | ||
} |
14 changes: 2 additions & 12 deletions
14
...re/src/main/java/com/github/linyuzai/download/core/compress/CompressionReleasedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,13 @@ | ||
package com.github.linyuzai.download.core.compress; | ||
|
||
import com.github.linyuzai.download.core.context.DownloadContext; | ||
import com.github.linyuzai.download.core.event.DownloadContextEvent; | ||
import lombok.Getter; | ||
|
||
/** | ||
* {@link Compression} 的资源释放时会发布该事件。 | ||
*/ | ||
@Getter | ||
public class CompressionReleasedEvent extends DownloadContextEvent { | ||
|
||
/** | ||
* 被释放资源的 {@link Compression} | ||
*/ | ||
private final Compression compression; | ||
public class CompressionReleasedEvent extends AbstractCompressionEvent { | ||
|
||
public CompressionReleasedEvent(DownloadContext context, Compression compression) { | ||
super(context); | ||
setMessage("Compression resource released"); | ||
this.compression = compression; | ||
super(context, compression); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
...oad-core/src/main/java/com/github/linyuzai/download/core/load/AfterSourceLoadedEvent.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
...d-core/src/main/java/com/github/linyuzai/download/core/load/SourceAlreadyLoadedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
package com.github.linyuzai.download.core.load; | ||
|
||
import com.github.linyuzai.download.core.context.DownloadContext; | ||
import com.github.linyuzai.download.core.source.AbstractSourceEvent; | ||
import com.github.linyuzai.download.core.source.Source; | ||
|
||
/** | ||
* 当加载已经加载过的 {@link Source} 会发布该事件。 | ||
*/ | ||
public class SourceAlreadyLoadedEvent extends AbstractLoadSourceEvent { | ||
public class SourceAlreadyLoadedEvent extends AbstractSourceEvent { | ||
|
||
public SourceAlreadyLoadedEvent(DownloadContext context, Source source) { | ||
super(context, source, "Skip load " + source.getDescription() + " because it has already been loaded"); | ||
super(context, source); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
...core/load/SourceLoadedCacheUsedEvent.java → ...ore/load/SourceLoadedUsingCacheEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
package com.github.linyuzai.download.core.load; | ||
|
||
import com.github.linyuzai.download.core.context.DownloadContext; | ||
import com.github.linyuzai.download.core.source.AbstractSourceEvent; | ||
import com.github.linyuzai.download.core.source.Source; | ||
import lombok.Getter; | ||
|
||
/** | ||
* {@link Source} 加载使用缓存时会发布该事件。 | ||
*/ | ||
@Getter | ||
public class SourceLoadedCacheUsedEvent extends AbstractLoadSourceEvent { | ||
public class SourceLoadedUsingCacheEvent extends AbstractSourceEvent { | ||
|
||
private final String cache; | ||
|
||
public SourceLoadedCacheUsedEvent(DownloadContext context, Source source, String cache) { | ||
super(context, source, "Load " + source.getDescription() + " using cache " + cache); | ||
public SourceLoadedUsingCacheEvent(DownloadContext context, Source source, String cache) { | ||
super(context, source); | ||
this.cache = cache; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.