Search in sources :

Example 1 with NullMetricsModule

use of org.platformlayer.metrics.NullMetricsModule in project platformlayer by platformlayer.

the class KeystoneCliContext method connect.

@Override
public void connect() throws Exception {
    Properties properties = options.getConfigurationProperties();
    ConfigurationImpl configuration = ConfigurationImpl.from(new File("."), properties);
    List<Module> modules = Lists.newArrayList();
    modules.add(new ConfigurationModule(configuration));
    modules.add(new KeystoneJdbcModule());
    modules.add(new NullMetricsModule());
    this.injector = Guice.createInjector(modules);
}
Also used : KeystoneJdbcModule(org.platformlayer.auth.KeystoneJdbcModule) Properties(java.util.Properties) Module(com.google.inject.Module) ConfigurationModule(org.platformlayer.config.ConfigurationModule) KeystoneJdbcModule(org.platformlayer.auth.KeystoneJdbcModule) NullMetricsModule(org.platformlayer.metrics.NullMetricsModule) ConfigurationImpl(com.fathomdb.config.ConfigurationImpl) File(java.io.File) NullMetricsModule(org.platformlayer.metrics.NullMetricsModule) ConfigurationModule(org.platformlayer.config.ConfigurationModule)

Example 2 with NullMetricsModule

use of org.platformlayer.metrics.NullMetricsModule in project platformlayer by platformlayer.

the class StandaloneXaasWebserver method main.

public static void main(String[] args) {
    try {
        // Force GMT
        TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
        Discovery discovery = Discovery.build();
        ConfigurationImpl configuration = ConfigurationImpl.load();
        Extensions extensions = new Extensions(configuration, discovery);
        List<Module> modules = Lists.newArrayList();
        modules.add(new NullMetricsModule());
        modules.add(new GuiceXaasConfig(configuration));
        modules.add(new ConfigurationModule(configuration));
        modules.add(new CacheModule());
        modules.add(new JdbcGuiceModule());
        modules.add(new PlatformLayerServletModule(extensions));
        modules.add(new PlatformlayerValidationModule());
        Injector injector = extensions.createInjector(configuration, modules);
        ResultSetMappersProvider provider = injector.getInstance(ResultSetMappersProvider.class);
        provider.addAll(ItemEntity.class, TagEntity.class, SchedulerRecordEntity.class, JobEntity.class, JobExecutionEntity.class);
        extensions.addEntities(provider);
        StandaloneXaasWebserver server = injector.getInstance(StandaloneXaasWebserver.class);
        // Temporary hack
        if (args.length != 0) {
            log.warn("Insert WAR onto root: " + args[0]);
            File rootWar = new File(args[0]);
            server.wars.put("/", rootWar);
        }
        if (!server.start()) {
            log.error("Failed to start webserver");
            System.exit(1);
        }
    } catch (Throwable e) {
        log.error("Error in initialization", e);
        System.exit(1);
    }
}
Also used : Discovery(com.fathomdb.discovery.Discovery) GuiceXaasConfig(org.platformlayer.xaas.GuiceXaasConfig) CacheModule(org.platformlayer.cache.CacheModule) Extensions(org.platformlayer.extensions.Extensions) NullMetricsModule(org.platformlayer.metrics.NullMetricsModule) ConfigurationModule(org.platformlayer.config.ConfigurationModule) ResultSetMappersProvider(com.fathomdb.jpa.impl.ResultSetMappersProvider) PlatformLayerServletModule(org.platformlayer.xaas.PlatformLayerServletModule) Injector(com.google.inject.Injector) JdbcGuiceModule(com.fathomdb.jdbc.JdbcGuiceModule) Module(com.google.inject.Module) PlatformLayerServletModule(org.platformlayer.xaas.PlatformLayerServletModule) JdbcGuiceModule(com.fathomdb.jdbc.JdbcGuiceModule) CacheModule(org.platformlayer.cache.CacheModule) ConfigurationModule(org.platformlayer.config.ConfigurationModule) NullMetricsModule(org.platformlayer.metrics.NullMetricsModule) ConfigurationImpl(com.fathomdb.config.ConfigurationImpl) File(java.io.File)

Aggregations

ConfigurationImpl (com.fathomdb.config.ConfigurationImpl)2 Module (com.google.inject.Module)2 File (java.io.File)2 ConfigurationModule (org.platformlayer.config.ConfigurationModule)2 NullMetricsModule (org.platformlayer.metrics.NullMetricsModule)2 Discovery (com.fathomdb.discovery.Discovery)1 JdbcGuiceModule (com.fathomdb.jdbc.JdbcGuiceModule)1 ResultSetMappersProvider (com.fathomdb.jpa.impl.ResultSetMappersProvider)1 Injector (com.google.inject.Injector)1 Properties (java.util.Properties)1 KeystoneJdbcModule (org.platformlayer.auth.KeystoneJdbcModule)1 CacheModule (org.platformlayer.cache.CacheModule)1 Extensions (org.platformlayer.extensions.Extensions)1 GuiceXaasConfig (org.platformlayer.xaas.GuiceXaasConfig)1 PlatformLayerServletModule (org.platformlayer.xaas.PlatformLayerServletModule)1