Search in sources :

Example 1 with JavalinStartTask

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());
}
Also used : WebCreatorRegistry(eu.okaeri.platform.web.component.WebCreatorRegistry) JavalinShutdownTask(eu.okaeri.platform.web.plan.JavalinShutdownTask) Setter(lombok.Setter) Arrays(java.util.Arrays) Getter(lombok.Getter) SneakyThrows(lombok.SneakyThrows) LoggerFactory(org.slf4j.LoggerFactory) ExecutionPlan(eu.okaeri.platform.core.plan.ExecutionPlan) Injector(eu.okaeri.injector.Injector) Javalin(io.javalin.Javalin) SerdesWeb(eu.okaeri.platform.web.meta.serdes.SerdesWeb) SerdesCommons(eu.okaeri.configs.serdes.commons.SerdesCommons) JavalinStartTask(eu.okaeri.platform.web.plan.JavalinStartTask) OkaeriPlatform(eu.okaeri.platform.core.OkaeriPlatform) SystemLocaleProvider(eu.okaeri.platform.standalone.i18n.SystemLocaleProvider) ExecutionResult(eu.okaeri.platform.core.plan.ExecutionResult) ExecutionTask(eu.okaeri.platform.core.plan.ExecutionTask) SimplePlaceholdersFactory(eu.okaeri.platform.core.placeholder.SimplePlaceholdersFactory) Logger(org.slf4j.Logger) YamlSnakeYamlConfigurer(eu.okaeri.configs.yaml.snakeyaml.YamlSnakeYamlConfigurer) NonNull(lombok.NonNull) OkaeriCommands(eu.okaeri.commands.OkaeriCommands) ApplicationComponentCreator(eu.okaeri.platform.standalone.component.ApplicationComponentCreator) File(java.io.File) Objects(java.util.Objects) Placeholders(eu.okaeri.placeholders.Placeholders) ComponentHelper(eu.okaeri.platform.core.component.ComponentHelper) ComponentCreator(eu.okaeri.platform.core.component.creator.ComponentCreator) eu.okaeri.platform.core.plan.task(eu.okaeri.platform.core.plan.task) ConfigurerProvider(eu.okaeri.persistence.document.ConfigurerProvider) JavalinSetupTask(eu.okaeri.platform.web.plan.JavalinSetupTask) ExecutionPhase(eu.okaeri.platform.core.plan.ExecutionPhase) ApplicationComponentCreator(eu.okaeri.platform.standalone.component.ApplicationComponentCreator) ConfigurerProvider(eu.okaeri.persistence.document.ConfigurerProvider) SimplePlaceholdersFactory(eu.okaeri.platform.core.placeholder.SimplePlaceholdersFactory) SerdesCommons(eu.okaeri.configs.serdes.commons.SerdesCommons) OkaeriCommands(eu.okaeri.commands.OkaeriCommands) SystemLocaleProvider(eu.okaeri.platform.standalone.i18n.SystemLocaleProvider) SerdesWeb(eu.okaeri.platform.web.meta.serdes.SerdesWeb) JavalinStartTask(eu.okaeri.platform.web.plan.JavalinStartTask) JavalinShutdownTask(eu.okaeri.platform.web.plan.JavalinShutdownTask) JavalinSetupTask(eu.okaeri.platform.web.plan.JavalinSetupTask) YamlSnakeYamlConfigurer(eu.okaeri.configs.yaml.snakeyaml.YamlSnakeYamlConfigurer) WebCreatorRegistry(eu.okaeri.platform.web.component.WebCreatorRegistry)

Aggregations

OkaeriCommands (eu.okaeri.commands.OkaeriCommands)1 SerdesCommons (eu.okaeri.configs.serdes.commons.SerdesCommons)1 YamlSnakeYamlConfigurer (eu.okaeri.configs.yaml.snakeyaml.YamlSnakeYamlConfigurer)1 Injector (eu.okaeri.injector.Injector)1 ConfigurerProvider (eu.okaeri.persistence.document.ConfigurerProvider)1 Placeholders (eu.okaeri.placeholders.Placeholders)1 OkaeriPlatform (eu.okaeri.platform.core.OkaeriPlatform)1 ComponentHelper (eu.okaeri.platform.core.component.ComponentHelper)1 ComponentCreator (eu.okaeri.platform.core.component.creator.ComponentCreator)1 SimplePlaceholdersFactory (eu.okaeri.platform.core.placeholder.SimplePlaceholdersFactory)1 ExecutionPhase (eu.okaeri.platform.core.plan.ExecutionPhase)1 ExecutionPlan (eu.okaeri.platform.core.plan.ExecutionPlan)1 ExecutionResult (eu.okaeri.platform.core.plan.ExecutionResult)1 ExecutionTask (eu.okaeri.platform.core.plan.ExecutionTask)1 eu.okaeri.platform.core.plan.task (eu.okaeri.platform.core.plan.task)1 ApplicationComponentCreator (eu.okaeri.platform.standalone.component.ApplicationComponentCreator)1 SystemLocaleProvider (eu.okaeri.platform.standalone.i18n.SystemLocaleProvider)1 WebCreatorRegistry (eu.okaeri.platform.web.component.WebCreatorRegistry)1 SerdesWeb (eu.okaeri.platform.web.meta.serdes.SerdesWeb)1 JavalinSetupTask (eu.okaeri.platform.web.plan.JavalinSetupTask)1