Search in sources :

Example 1 with DestroyModule

use of org.eclipse.che.inject.lifecycle.DestroyModule in project che by eclipse.

the class CheBootstrap method getModules.

@Override
protected List<Module> getModules() {
    // based on logic that getServletModule() is called BEFORE getModules() in the EverrestGuiceContextListener
    modules.add(new InitModule(PostConstruct.class));
    modules.add(new DestroyModule(PreDestroy.class, LOG_HANDLER));
    modules.add(new URIConverter());
    modules.add(new URLConverter());
    modules.add(new FileConverter());
    modules.add(new PathConverter());
    modules.add(new StringArrayConverter());
    modules.add(new PairConverter());
    modules.add(new PairArrayConverter());
    modules.addAll(ModuleScanner.findModules());
    Map<String, Set<String>> aliases = readConfigurationAliases();
    Module firstConfigurationPermutation = Modules.override(new WebInfConfiguration(aliases)).with(new ExtConfiguration(aliases));
    Module secondConfigurationPermutation = Modules.override(firstConfigurationPermutation).with(new CheSystemPropertiesConfigurationModule(aliases));
    Module lastConfigurationPermutation = Modules.override(secondConfigurationPermutation).with(new CheEnvironmentVariablesConfigurationModule(aliases));
    modules.add(lastConfigurationPermutation);
    return modules;
}
Also used : DestroyModule(org.eclipse.che.inject.lifecycle.DestroyModule) Collectors.toSet(java.util.stream.Collectors.toSet) Set(java.util.Set) InitModule(org.eclipse.che.inject.lifecycle.InitModule) PreDestroy(javax.annotation.PreDestroy) Module(com.google.inject.Module) DestroyModule(org.eclipse.che.inject.lifecycle.DestroyModule) InitModule(org.eclipse.che.inject.lifecycle.InitModule) ServletModule(com.google.inject.servlet.ServletModule) AbstractModule(com.google.inject.AbstractModule) PostConstruct(javax.annotation.PostConstruct)

Aggregations

AbstractModule (com.google.inject.AbstractModule)1 Module (com.google.inject.Module)1 ServletModule (com.google.inject.servlet.ServletModule)1 Set (java.util.Set)1 Collectors.toSet (java.util.stream.Collectors.toSet)1 PostConstruct (javax.annotation.PostConstruct)1 PreDestroy (javax.annotation.PreDestroy)1 DestroyModule (org.eclipse.che.inject.lifecycle.DestroyModule)1 InitModule (org.eclipse.che.inject.lifecycle.InitModule)1