use of eu.okaeri.platform.web.plan.JavalinStartTask in project okaeri-platform by OkaeriPoland.
the class OkaeriWebApplication method plan.
@Override
public void plan(@NonNull ExecutionPlan plan) {
plan.add(PRE_SETUP, new InjectorSetupTask());
plan.add(PRE_SETUP, (ExecutionTask<OkaeriWebApplication>) platform -> {
platform.registerInjectable("dataFolder", platform.getDataFolder());
platform.registerInjectable("jarFile", platform.getFile());
platform.registerInjectable("logger", platform.getLogger());
platform.registerInjectable("app", platform);
platform.registerInjectable("javalin", platform.getJavalin());
platform.registerInjectable("jetty", Objects.requireNonNull(platform.getJavalin().jettyServer()));
platform.registerInjectable("placeholders", Placeholders.create(true));
platform.registerInjectable("defaultConfigurerProvider", (ConfigurerProvider) YamlSnakeYamlConfigurer::new);
platform.registerInjectable("defaultConfigurerSerdes", new Class[] { SerdesCommons.class, SerdesWeb.class });
platform.registerInjectable("defaultPlaceholdersFactory", new SimplePlaceholdersFactory());
platform.registerInjectable("i18nLocaleProvider", new SystemLocaleProvider());
});
plan.add(SETUP, new CommandsSetupTask(new OkaeriCommands()));
plan.add(SETUP, new CreatorSetupTask(ApplicationComponentCreator.class, WebCreatorRegistry.class));
plan.add(POST_SETUP, new BeanManifestCreateTask());
plan.add(POST_SETUP, new BeanManifestExecuteTask());
plan.add(POST_SETUP, new JavalinSetupTask());
plan.add(POST_SETUP, new PlatformBannerStartupTask());
plan.add(STARTUP, new JavalinStartTask());
plan.add(SHUTDOWN, new JavalinShutdownTask());
plan.add(SHUTDOWN, new PersistenceShutdownTask());
}
Aggregations