Search in sources :

Example 1 with ExternalResourceProvider

use of eu.okaeri.platform.core.component.ExternalResourceProvider in project okaeri-platform by OkaeriPoland.

the class BeanManifestExecuteTask method execute.

@Override
public void execute(OkaeriPlatform platform) {
    // find manifest
    BeanManifest beanManifest = platform.getInjector().get("manifest", BeanManifest.class).orElseThrow(() -> new RuntimeException("Cannot execute manifest without manifest being present!"));
    // resolve resource provider
    ExternalResourceProvider resourceProvider = platform.getInjector().get("externalResourceProvider", ExternalResourceProvider.class).orElse(NULL_RESOURCE_PROVIDER);
    // execute component tree and register everything
    beanManifest.execute(platform.getCreator(), platform.getInjector(), resourceProvider);
    // sub-components do not require manual injecting because
    // these are filled at the initialization by the DI itself
    // plugin instance however is not, so here it goes
    ComponentHelper.injectComponentFields(platform, platform.getInjector());
    // call PostConstruct
    ComponentHelper.invokePostConstruct(platform, platform.getInjector());
}
Also used : ExternalResourceProvider(eu.okaeri.platform.core.component.ExternalResourceProvider) BeanManifest(eu.okaeri.platform.core.component.manifest.BeanManifest)

Aggregations

ExternalResourceProvider (eu.okaeri.platform.core.component.ExternalResourceProvider)1 BeanManifest (eu.okaeri.platform.core.component.manifest.BeanManifest)1