Search in sources :

Example 1 with ExecutionPlan

use of eu.okaeri.platform.core.plan.ExecutionPlan in project okaeri-platform by OkaeriPoland.

the class OkaeriBukkitPlugin method plan.

@Override
public void plan(@NonNull ExecutionPlan plan) {
    plan.add(PRE_SETUP, new InjectorSetupTask());
    plan.add(PRE_SETUP, (ExecutionTask<OkaeriBukkitPlugin>) platform -> {
        platform.registerInjectable("server", platform.getServer());
        platform.registerInjectable("dataFolder", platform.getDataFolder());
        platform.registerInjectable("jarFile", platform.getFile());
        platform.registerInjectable("logger", platform.getLogger());
        platform.registerInjectable("plugin", platform);
        platform.registerInjectable("placeholders", BukkitPlaceholders.create(true));
        platform.registerInjectable("scheduler", new PlatformScheduler(platform, platform.getServer().getScheduler()));
        platform.registerInjectable("tasker", BukkitTasker.newPool(platform));
        platform.registerInjectable("pluginManager", platform.getServer().getPluginManager());
        platform.registerInjectable("defaultConfigurerProvider", (ConfigurerProvider) YamlBukkitConfigurer::new);
        platform.registerInjectable("defaultConfigurerSerdes", new Class[] { SerdesCommons.class, SerdesBukkit.class });
        platform.registerInjectable("defaultPlaceholdersFactory", new SimplePlaceholdersFactory());
        platform.registerInjectable("i18nLocaleProvider", new PlayerLocaleProvider());
        platform.registerInjectable("guardian", ReflectGuardian.create(ReflectPlaceholders.create()));
    });
    plan.add(SETUP, new BukkitCommandsSetupTask());
    plan.add(SETUP, new CreatorSetupTask(BukkitComponentCreator.class, BukkitCreatorRegistry.class));
    plan.add(POST_SETUP, new BukkitExternalResourceProviderSetupTask());
    plan.add(POST_SETUP, new BeanManifestCreateTask());
    plan.add(POST_SETUP, new BukkitCommandsI18nManifestTask());
    plan.add(POST_SETUP, new BeanManifestExecuteTask());
    plan.add(POST_SETUP, new CommandsI18nSetupTask());
    plan.add(SHUTDOWN, new PersistenceShutdownTask());
}
Also used : Setter(lombok.Setter) Arrays(java.util.Arrays) BukkitExternalResourceProviderSetupTask(eu.okaeri.platform.bukkit.plan.BukkitExternalResourceProviderSetupTask) Getter(lombok.Getter) ExecutionPlan(eu.okaeri.platform.core.plan.ExecutionPlan) Injector(eu.okaeri.injector.Injector) ReflectPlaceholders(eu.okaeri.placeholders.reflect.ReflectPlaceholders) BukkitComponentCreator(eu.okaeri.platform.bukkit.component.BukkitComponentCreator) BukkitPlaceholders(eu.okaeri.placeholders.bukkit.BukkitPlaceholders) SerdesCommons(eu.okaeri.configs.serdes.commons.SerdesCommons) OkaeriPlatform(eu.okaeri.platform.core.OkaeriPlatform) ExecutionResult(eu.okaeri.platform.core.plan.ExecutionResult) BukkitTasker(eu.okaeri.tasker.bukkit.BukkitTasker) ReflectGuardian(eu.okaeri.acl.reflect.ReflectGuardian) PlatformScheduler(eu.okaeri.platform.bukkit.scheduler.PlatformScheduler) ExecutionTask(eu.okaeri.platform.core.plan.ExecutionTask) SimplePlaceholdersFactory(eu.okaeri.platform.core.placeholder.SimplePlaceholdersFactory) BukkitCreatorRegistry(eu.okaeri.platform.bukkit.component.BukkitCreatorRegistry) NonNull(lombok.NonNull) PlayerLocaleProvider(eu.okaeri.platform.bukkit.i18n.PlayerLocaleProvider) YamlBukkitConfigurer(eu.okaeri.configs.yaml.bukkit.YamlBukkitConfigurer) SerdesBukkit(eu.okaeri.configs.yaml.bukkit.serdes.SerdesBukkit) File(java.io.File) JavaPlugin(org.bukkit.plugin.java.JavaPlugin) BukkitCommandsI18nManifestTask(eu.okaeri.platform.bukkit.plan.BukkitCommandsI18nManifestTask) ComponentCreator(eu.okaeri.platform.core.component.creator.ComponentCreator) JavaPluginLoader(org.bukkit.plugin.java.JavaPluginLoader) eu.okaeri.platform.core.plan.task(eu.okaeri.platform.core.plan.task) CommandsI18nSetupTask(eu.okaeri.platform.minecraft.task.CommandsI18nSetupTask) ConfigurerProvider(eu.okaeri.persistence.document.ConfigurerProvider) BukkitCommandsSetupTask(eu.okaeri.platform.bukkit.plan.BukkitCommandsSetupTask) PluginDescriptionFile(org.bukkit.plugin.PluginDescriptionFile) ExecutionPhase(eu.okaeri.platform.core.plan.ExecutionPhase) BukkitExternalResourceProviderSetupTask(eu.okaeri.platform.bukkit.plan.BukkitExternalResourceProviderSetupTask) ConfigurerProvider(eu.okaeri.persistence.document.ConfigurerProvider) SimplePlaceholdersFactory(eu.okaeri.platform.core.placeholder.SimplePlaceholdersFactory) SerdesCommons(eu.okaeri.configs.serdes.commons.SerdesCommons) PlayerLocaleProvider(eu.okaeri.platform.bukkit.i18n.PlayerLocaleProvider) YamlBukkitConfigurer(eu.okaeri.configs.yaml.bukkit.YamlBukkitConfigurer) BukkitComponentCreator(eu.okaeri.platform.bukkit.component.BukkitComponentCreator) BukkitCommandsI18nManifestTask(eu.okaeri.platform.bukkit.plan.BukkitCommandsI18nManifestTask) CommandsI18nSetupTask(eu.okaeri.platform.minecraft.task.CommandsI18nSetupTask) SerdesBukkit(eu.okaeri.configs.yaml.bukkit.serdes.SerdesBukkit) BukkitCommandsSetupTask(eu.okaeri.platform.bukkit.plan.BukkitCommandsSetupTask) BukkitCreatorRegistry(eu.okaeri.platform.bukkit.component.BukkitCreatorRegistry) PlatformScheduler(eu.okaeri.platform.bukkit.scheduler.PlatformScheduler)

Example 2 with ExecutionPlan

use of eu.okaeri.platform.core.plan.ExecutionPlan 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)

Example 3 with ExecutionPlan

use of eu.okaeri.platform.core.plan.ExecutionPlan in project okaeri-platform by OkaeriPoland.

the class OkaeriBungeePlugin method plan.

@Override
public void plan(@NonNull ExecutionPlan plan) {
    plan.add(PRE_SETUP, new InjectorSetupTask());
    plan.add(PRE_SETUP, (ExecutionTask<OkaeriBungeePlugin>) platform -> {
        platform.registerInjectable("proxy", platform.getProxy());
        platform.registerInjectable("dataFolder", platform.getDataFolder());
        platform.registerInjectable("jarFile", platform.getFile());
        platform.registerInjectable("logger", platform.getLogger());
        platform.registerInjectable("plugin", platform);
        platform.registerInjectable("placeholders", BungeePlaceholders.create(true));
        platform.registerInjectable("scheduler", new PlatformScheduler(platform, platform.getProxy().getScheduler()));
        platform.registerInjectable("pluginManager", platform.getProxy().getPluginManager());
        platform.registerInjectable("defaultConfigurerProvider", (ConfigurerProvider) YamlBungeeConfigurer::new);
        platform.registerInjectable("defaultConfigurerSerdes", new Class[] { SerdesCommons.class, SerdesBungee.class });
        platform.registerInjectable("defaultPlaceholdersFactory", new SimplePlaceholdersFactory());
        platform.registerInjectable("i18nLocaleProvider", new ProxiedPlayerLocaleProvider());
    });
    // plan.add(PRE_SETUP, new BungeeCommandsSetupTask()); TODO
    plan.add(SETUP, new CreatorSetupTask(BungeeComponentCreator.class, BungeeCreatorRegistry.class), "creator");
    plan.add(POST_SETUP, new BungeeExternalResourceProviderSetupTask());
    plan.add(POST_SETUP, new BeanManifestCreateTask());
    plan.add(POST_SETUP, new BeanManifestExecuteTask());
    plan.add(SHUTDOWN, new BungeeSchedulerShutdownTask());
    plan.add(SHUTDOWN, new PersistenceShutdownTask());
}
Also used : Setter(lombok.Setter) Arrays(java.util.Arrays) Getter(lombok.Getter) ExecutionPlan(eu.okaeri.platform.core.plan.ExecutionPlan) Injector(eu.okaeri.injector.Injector) BungeeSchedulerShutdownTask(eu.okaeri.platform.bungee.plan.BungeeSchedulerShutdownTask) SerdesCommons(eu.okaeri.configs.serdes.commons.SerdesCommons) BungeePlaceholders(eu.okaeri.placeholders.bungee.BungeePlaceholders) YamlBungeeConfigurer(eu.okaeri.configs.yaml.bungee.YamlBungeeConfigurer) OkaeriPlatform(eu.okaeri.platform.core.OkaeriPlatform) ExecutionResult(eu.okaeri.platform.core.plan.ExecutionResult) ProxiedPlayerLocaleProvider(eu.okaeri.platform.bungee.i18n.ProxiedPlayerLocaleProvider) ExecutionTask(eu.okaeri.platform.core.plan.ExecutionTask) PlatformScheduler(eu.okaeri.platform.bungee.scheduler.PlatformScheduler) SimplePlaceholdersFactory(eu.okaeri.platform.core.placeholder.SimplePlaceholdersFactory) BungeeCreatorRegistry(eu.okaeri.platform.bungee.component.BungeeCreatorRegistry) NonNull(lombok.NonNull) ProxyServer(net.md_5.bungee.api.ProxyServer) BungeeExternalResourceProviderSetupTask(eu.okaeri.platform.bungee.plan.BungeeExternalResourceProviderSetupTask) PluginDescription(net.md_5.bungee.api.plugin.PluginDescription) BungeeComponentCreator(eu.okaeri.platform.bungee.component.BungeeComponentCreator) ComponentCreator(eu.okaeri.platform.core.component.creator.ComponentCreator) eu.okaeri.platform.core.plan.task(eu.okaeri.platform.core.plan.task) Plugin(net.md_5.bungee.api.plugin.Plugin) SerdesBungee(eu.okaeri.configs.yaml.bukkit.serdes.SerdesBungee) ConfigurerProvider(eu.okaeri.persistence.document.ConfigurerProvider) ExecutionPhase(eu.okaeri.platform.core.plan.ExecutionPhase) BungeeComponentCreator(eu.okaeri.platform.bungee.component.BungeeComponentCreator) ConfigurerProvider(eu.okaeri.persistence.document.ConfigurerProvider) SimplePlaceholdersFactory(eu.okaeri.platform.core.placeholder.SimplePlaceholdersFactory) BungeeCreatorRegistry(eu.okaeri.platform.bungee.component.BungeeCreatorRegistry) SerdesCommons(eu.okaeri.configs.serdes.commons.SerdesCommons) ProxiedPlayerLocaleProvider(eu.okaeri.platform.bungee.i18n.ProxiedPlayerLocaleProvider) SerdesBungee(eu.okaeri.configs.yaml.bukkit.serdes.SerdesBungee) BungeeExternalResourceProviderSetupTask(eu.okaeri.platform.bungee.plan.BungeeExternalResourceProviderSetupTask) YamlBungeeConfigurer(eu.okaeri.configs.yaml.bungee.YamlBungeeConfigurer) PlatformScheduler(eu.okaeri.platform.bungee.scheduler.PlatformScheduler) BungeeSchedulerShutdownTask(eu.okaeri.platform.bungee.plan.BungeeSchedulerShutdownTask)

Aggregations

SerdesCommons (eu.okaeri.configs.serdes.commons.SerdesCommons)3 Injector (eu.okaeri.injector.Injector)3 ConfigurerProvider (eu.okaeri.persistence.document.ConfigurerProvider)3 OkaeriPlatform (eu.okaeri.platform.core.OkaeriPlatform)3 ComponentCreator (eu.okaeri.platform.core.component.creator.ComponentCreator)3 SimplePlaceholdersFactory (eu.okaeri.platform.core.placeholder.SimplePlaceholdersFactory)3 ExecutionPhase (eu.okaeri.platform.core.plan.ExecutionPhase)3 ExecutionPlan (eu.okaeri.platform.core.plan.ExecutionPlan)3 ExecutionResult (eu.okaeri.platform.core.plan.ExecutionResult)3 ExecutionTask (eu.okaeri.platform.core.plan.ExecutionTask)3 eu.okaeri.platform.core.plan.task (eu.okaeri.platform.core.plan.task)3 Arrays (java.util.Arrays)3 Getter (lombok.Getter)3 NonNull (lombok.NonNull)3 Setter (lombok.Setter)3 File (java.io.File)2 ReflectGuardian (eu.okaeri.acl.reflect.ReflectGuardian)1 OkaeriCommands (eu.okaeri.commands.OkaeriCommands)1 YamlBukkitConfigurer (eu.okaeri.configs.yaml.bukkit.YamlBukkitConfigurer)1 SerdesBukkit (eu.okaeri.configs.yaml.bukkit.serdes.SerdesBukkit)1