Skip to content

Commit

Permalink
Queue Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
GedMarc committed Jul 2, 2024
1 parent 7397967 commit d13eedf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/com/guicedee/guicedinjection/GuiceContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public class GuiceContext<J extends GuiceContext<J>> implements IGuiceContext
*/
private static boolean configured;

private CompletableFuture<Void> loadingFinished = new CompletableFuture<>();

/**
* Creates a new Guice context. Not necessary
*/
Expand Down Expand Up @@ -140,7 +142,6 @@ public Injector inject()
log.config("Modules - " + Arrays.toString(cModules.toArray()));
GuiceContext.instance().injector = Guice.createInjector(cModules);
GuiceContext.buildingInjector = false;
startup.complete(true);
GuiceContext.instance().loadPostStartups();
GuiceContext.instance().loadPreDestroyServices();
Runtime
Expand All @@ -154,6 +155,7 @@ public void run()
});
LocalDateTime end = LocalDateTime.now();
log.info("System started in " + ChronoUnit.MILLIS.between(start, end) + "ms");
loadingFinished.complete(null);
}
catch (Throwable e)
{
Expand Down Expand Up @@ -337,6 +339,10 @@ private String[] getJarsInclusionList()
return strings.toArray(new String[0]);
}

public CompletableFuture<Void> getLoadingFinished()
{
return loadingFinished;
}

/**
* Starts up Guice and the scanner
Expand Down

0 comments on commit d13eedf

Please sign in to comment.