mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2025-01-03 18:38:26 +01:00
Fix loading into isolated classloaders
This commit is contained in:
parent
2f01d15032
commit
f5b8829de1
@ -89,12 +89,16 @@ public class DependencyLoader {
|
|||||||
|
|
||||||
public IsolatedClassLoader intoIsolated() throws IOException {
|
public IsolatedClassLoader intoIsolated() throws IOException {
|
||||||
IsolatedClassLoader classLoader = new IsolatedClassLoader();
|
IsolatedClassLoader classLoader = new IsolatedClassLoader();
|
||||||
downloadRelocateAndLoad().join();
|
downloadRelocateAndLoad(classLoader).join();
|
||||||
return classLoader;
|
return classLoader;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompletableFuture<Void> downloadRelocateAndLoad() {
|
public CompletableFuture<Void> downloadRelocateAndLoad() {
|
||||||
return download().thenCompose(v -> relocateAndLoad(true));
|
return downloadRelocateAndLoad(classpathAppender);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CompletableFuture<Void> downloadRelocateAndLoad(ClasspathAppender appender) {
|
||||||
|
return download().thenCompose(v -> relocateAndLoad(true, appender));
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompletableFuture<Void> download() {
|
public CompletableFuture<Void> download() {
|
||||||
@ -102,8 +106,12 @@ public class DependencyLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CompletableFuture<Void> relocateAndLoad(boolean useExecutor) {
|
public CompletableFuture<Void> relocateAndLoad(boolean useExecutor) {
|
||||||
|
return relocateAndLoad(useExecutor, classpathAppender);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CompletableFuture<Void> relocateAndLoad(boolean useExecutor, ClasspathAppender appender) {
|
||||||
Executor executorToUse = useExecutor ? executor : null;
|
Executor executorToUse = useExecutor ? executor : null;
|
||||||
return dependencyManager.relocateAll(executorToUse)
|
return dependencyManager.relocateAll(executorToUse)
|
||||||
.thenCompose(v -> dependencyManager.loadAll(executorToUse, classpathAppender));
|
.thenCompose(v -> dependencyManager.loadAll(executorToUse, appender));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user