Package ninja

Examples of ninja.Configuration


            modulesToLoad.add(LifecycleSupport.getModule());
            // Scheduling support
            modulesToLoad.add(SchedulerSupport.getModule());

            // Get base configuration of Ninja:
            modulesToLoad.add(new Configuration(ninjaProperties));
            modulesToLoad.add(new AbstractModule() {
                @Override
                protected void configure() {
                    bind(Context.class).to(ContextImpl.class);
                }
View Full Code Here


        NinjaPropertiesImpl ninjaProperties = new NinjaPropertiesImpl(NinjaMode.test);  
       
        ninjaProperties.setProperty(NinjaConstant.CACHE_IMPLEMENTATION, null);
       
        Injector injector = Guice.createInjector(new Configuration(ninjaProperties), LifecycleSupport.getModule());
       
        Logger logger = injector.getInstance(Logger.class);
       
        CacheProvider cacheProvider = new CacheProvider(
                injector,
View Full Code Here

       
        ninjaProperties.setProperty(NinjaConstant.CACHE_IMPLEMENTATION, CacheMemcachedImpl.class.getName());
        // just a dummy to test that loading works
        ninjaProperties.setProperty(NinjaConstant.MEMCACHED_HOST, "127.0.0.1:1234");
       
        Injector injector = Guice.createInjector(new Configuration(ninjaProperties), LifecycleSupport.getModule());
       
        Logger logger = injector.getInstance(Logger.class);
       
        CacheProvider cacheProvider = new CacheProvider(
                injector,
View Full Code Here

        NinjaPropertiesImpl ninjaProperties = new NinjaPropertiesImpl(NinjaMode.test);  
       
        ninjaProperties.setProperty(NinjaConstant.CACHE_IMPLEMENTATION, "not_existing_implementation");
       
        Injector injector = Guice.createInjector(new Configuration(ninjaProperties), LifecycleSupport.getModule());
       
        Logger logger = injector.getInstance(Logger.class);
       
        // this will not work => we expect a runtime exception...
        thrown.expect(RuntimeException.class);
View Full Code Here

TOP

Related Classes of ninja.Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.