use of eu.okaeri.platform.core.plan.ExecutionResult in project okaeri-platform by OkaeriPoland.
the class OkaeriBukkitPlugin method onEnable.
@Override
@Deprecated
public void onEnable() {
// execute using plan
this.log("Loading " + this.getClass().getSimpleName());
ExecutionResult result = ExecutionPlan.dispatch(this);
this.log(this.getCreator().getSummaryText(result.getTotalMillis()));
this.plan = result.getPlan();
// compatibility
this.onPlatformEnable();
}
use of eu.okaeri.platform.core.plan.ExecutionResult in project okaeri-platform by OkaeriPoland.
the class OkaeriCliApplication method run.
public static <T extends OkaeriCliApplication> T run(@NonNull T app, @NonNull String[] args) {
OkaeriCliApplication.args = args;
ExecutionResult result = ExecutionPlan.dispatch(app);
app.log(app.getCreator().getSummaryText(result.getTotalMillis()));
Thread shutdownHook = new Thread(() -> result.getPlan().execute(Arrays.asList(PRE_SHUTDOWN, SHUTDOWN, POST_SHUTDOWN)));
Runtime.getRuntime().addShutdownHook(shutdownHook);
return app;
}
use of eu.okaeri.platform.core.plan.ExecutionResult in project okaeri-platform by OkaeriPoland.
the class OkaeriBungeePlugin method onEnable.
@Override
@Deprecated
public void onEnable() {
// execute using plan
this.log("Loading " + this.getClass().getSimpleName());
ExecutionResult result = ExecutionPlan.dispatch(this);
this.log(this.getCreator().getSummaryText(result.getTotalMillis()));
this.plan = result.getPlan();
// compatibility
this.onPlatformEnable();
}
use of eu.okaeri.platform.core.plan.ExecutionResult in project okaeri-platform by OkaeriPoland.
the class OkaeriWebApplication method run.
public static <T extends OkaeriWebApplication> T run(@NonNull T app, @NonNull String[] args) {
ExecutionResult result = ExecutionPlan.dispatch(app);
app.log(app.getCreator().getSummaryText(result.getTotalMillis()));
Thread shutdownHook = new Thread(() -> result.getPlan().execute(Arrays.asList(PRE_SHUTDOWN, SHUTDOWN, POST_SHUTDOWN)));
Runtime.getRuntime().addShutdownHook(shutdownHook);
return app;
}
Aggregations