当前位置: 首页>>代码示例>>Java>>正文


Java NinjaProperties类代码示例

本文整理汇总了Java中ninja.utils.NinjaProperties的典型用法代码示例。如果您正苦于以下问题:Java NinjaProperties类的具体用法?Java NinjaProperties怎么用?Java NinjaProperties使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NinjaProperties类属于ninja.utils包,在下文中一共展示了NinjaProperties类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: NinjaVertxServletContext

import ninja.utils.NinjaProperties; //导入依赖的package包/类
@Inject
public NinjaVertxServletContext(
        BodyParserEngineManager bodyParserEngineManager,
        FlashScope flashScope,
        NinjaProperties ninjaProperties,
        ResultHandler resultHandler,
        Session session,
        Validation validation,
        Injector injector,
        ParamParsers paramParsers) {

    super(bodyParserEngineManager,
            flashScope,
            ninjaProperties,
            resultHandler,
            session,
            validation,
            injector,
            paramParsers);
}
 
开发者ID:kuangcao,项目名称:ninja-vertx-standalone,代码行数:21,代码来源:NinjaVertxServletContext.java

示例2: makeSureCorrectPropertiesGetParsed

import ninja.utils.NinjaProperties; //导入依赖的package包/类
/**
     * This tests does three things 
     * 1) Test that stuff in {@link ninja.jooq.NinjaJooqProperties} is correct and without typos
     * 2) Test that default properties are not altered accidentally. 
     * 3) All properties get called assuming they are ready to use inside the lifecycle.
     */
    @Test
    public void makeSureCorrectPropertiesGetParsed() {

        // Setup and spy on the properties
        NinjaProperties ninjaProperties = spy(new NinjaPropertiesImpl(NinjaMode.test));

        NinjaJooqLifecycle ninjaJooqLifecycle = new NinjaJooqLifecycle(logger, ninjaProperties);
//
        // Execute the server startup
        ninjaJooqLifecycle.startServer();

        // InOrder because I couldn't get the tests to pass with just verify.  Mockito would confuse multiple calls
        // to each function with different arguments incorrectly.
        InOrder inOrder = inOrder(ninjaProperties);
        inOrder.verify(ninjaProperties).getBooleanWithDefault("jooq.renderSchema", true);
        inOrder.verify(ninjaProperties).getWithDefault("jooq.renderNameStyle", "QUOTED");
        inOrder.verify(ninjaProperties).getWithDefault("jooq.renderNameStyle", "QUOTED");
        inOrder.verify(ninjaProperties).getWithDefault("jooq.renderKeywordStyle", "LOWER");
        inOrder.verify(ninjaProperties).getBooleanWithDefault("jooq.renderFormatted", false);
        inOrder.verify(ninjaProperties).getWithDefault("jooq.statementType", "PREPARED_STATEMENT");
        inOrder.verify(ninjaProperties).getBooleanWithDefault("jooq.executeLogging", true);
        inOrder.verify(ninjaProperties).getBooleanWithDefault("jooq.executeWithOptimisticLocking", true);
        inOrder.verify(ninjaProperties).getBooleanWithDefault("jooq.attachRecords", true);
        inOrder.verify(ninjaProperties).getWithDefault("jooq.sqlDialect", "DEFAULT");
    }
 
开发者ID:jschaf,项目名称:ninja-jooq,代码行数:32,代码来源:NinjaJooqLifecycleTest.java

示例3: TemplateEngineRythm

import ninja.utils.NinjaProperties; //导入依赖的package包/类
@Inject
public TemplateEngineRythm(Messages messages,
                           Lang lang,
                           Logger ninjaLogger,
                           NinjaExceptionHandler exceptionHandler,
                           RythmHelper rythmHelper,
                           TemplateEngineManager templateEngineManager,
                           NinjaProperties ninjaProperties,
                           RythmEngine engine) throws Exception {

    this.messages = messages;
    this.lang = lang;
    this.logger = ninjaLogger;
    this.exceptionHandler = exceptionHandler;
    this.rythmHelper = rythmHelper;
    this.engine = engine;
}
 
开发者ID:ninjaframework,项目名称:ninja-rythm,代码行数:18,代码来源:TemplateEngineRythm.java

示例4: TemplateEngineJade4J

import ninja.utils.NinjaProperties; //导入依赖的package包/类
@Inject
public TemplateEngineJade4J(Logger logger,
                            TemplateEngineHelper templateEngineHelper,
                            NinjaProperties ninjaProperties,
                            Jade4NinjaExceptionHandler exceptionHandler,
                            Messages messages,
                            Lang lang) {
    this.logger = logger;
    this.ninjaProperties = ninjaProperties;
    this.templateEngineHelper = templateEngineHelper;
    this.exceptionHandler = exceptionHandler;
    this.messages = messages;
    this.lang = lang;

    configureJade4J();
}
 
开发者ID:mysu,项目名称:jade4ninja,代码行数:17,代码来源:TemplateEngineJade4J.java

示例5: VertxInitializer

import ninja.utils.NinjaProperties; //导入依赖的package包/类
public VertxInitializer(NinjaProperties ninjaProperties) {
    options = new VertxOptions()
            .setClustered(ninjaProperties.getBooleanWithDefault(VERTX_IS_CLUSTERED, false))
            .setEventLoopPoolSize(ninjaProperties.getIntegerWithDefault(VERTX_EVENT_LOOP_SIZE,DEFAULT_EVENT_LOOP_POOL_SIZE))
            .setMaxEventLoopExecuteTime(Long.valueOf(ninjaProperties.getWithDefault(VERTX_MAX_EVENTLOOP_EXECUTE_TIME,"2000000000")))
            .setWorkerPoolSize(ninjaProperties.getIntegerWithDefault(VERTX_WORKER_POOL_SIZE, 20))
            .setMaxWorkerExecuteTime(Long.valueOf(ninjaProperties.getWithDefault(VERTX_MAX_WORKER_EXECITE_TIME,"60000000000")));


    if (ninjaProperties.getBooleanWithDefault(VERTX_IS_METRICS_ENABLED, false)) {
        options.setMetricsOptions(new MetricsOptions().setEnabled(true));
    }

    deploymentOptions = new DeploymentOptions().setInstances(ninjaProperties.getIntegerWithDefault(VERTX_INSTANCES, 1));

    if (ninjaProperties.getBooleanWithDefault(VERTX_IS_WORKER, true)) {
        deploymentOptions
                .setWorker(true)
                .setWorkerPoolName("ninja-vertx");
    }
    if (options.isClustered()) {
        CountDownLatch countDownLatch = new CountDownLatch(1);
        Vertx.clusteredVertx(options, res -> {
            if (res.succeeded()) {
                vertx = res.result();
                countDownLatch.countDown();
            } else {
                log.error(res.cause().getMessage(), res.cause());
            }
        });
        await(countDownLatch);
    } else {
        vertx = Vertx.vertx(options);
    }
}
 
开发者ID:kuangcao,项目名称:ninja-vertx-standalone,代码行数:36,代码来源:VertxInitializer.java

示例6: NinjaJooqLifecycle

import ninja.utils.NinjaProperties; //导入依赖的package包/类
@Inject
public NinjaJooqLifecycle(Logger logger,
                          NinjaProperties ninjaProperties) {

    this.logger = logger;
    this.ninjaProperties = ninjaProperties;
    
    startServer();
}
 
开发者ID:jschaf,项目名称:ninja-jooq,代码行数:10,代码来源:NinjaJooqLifecycle.java

示例7: testSchedule4

import ninja.utils.NinjaProperties; //导入依赖的package包/类
/**
 * Run every 5 seconds (configured in application.conf), guice-injected
 * {@link NinjaProperties} argument.
 * 
 * @param context
 */
@QuartzSchedule(cronSchedule = "0/2 * * * * ?", schedulerDelay = 4, jobDescription = "Test Schedule 4", jobName = "test4")
public void testSchedule4(NinjaProperties ninjaProperties) {
    Integer value = counter.updateValue(SCHEDULE_TEST_4);
    Application.LOG.info("\n\n\ntestSchedule4() updated value to {}. Available ninjaProperties: {}\n\n\n", value,
            ninjaProperties.getAllCurrentNinjaProperties().size());
}
 
开发者ID:FendlerConsulting,项目名称:ninja-quartz,代码行数:13,代码来源:TestSchedules.java

示例8: testSchedule5

import ninja.utils.NinjaProperties; //导入依赖的package包/类
/**
 * Run every 5 seconds (configured in application.conf), guice-injected
 * {@link NinjaProperties} argument.
 * 
 * @param context
 */
@QuartzSchedule(cronSchedule = "0/2 * * * * ?", schedulerDelay = 5, jobDescription = "Test Schedule 5", jobName = "test5")
public void testSchedule5(NinjaProperties ninjaProperties, JobExecutionContext context) {
    Integer value = counter.updateValue(SCHEDULE_TEST_5);
    Application.LOG.info(
            "\n\n\ntestSchedule5() updated value to {}. Context: {}, Available ninjaProperties: {}\n\n\n", value,
            context.hashCode(), ninjaProperties.getAllCurrentNinjaProperties().size());
}
 
开发者ID:FendlerConsulting,项目名称:ninja-quartz,代码行数:14,代码来源:TestSchedules.java

示例9: copyProperties

import ninja.utils.NinjaProperties; //导入依赖的package包/类
private void copyProperties(Properties properties , NinjaProperties ninjaProperties , String key , String subKey) {
    String s = ninjaProperties.get(key);
    if (s != null) {
        properties.put(key , s);
    }
    s = ninjaProperties.get(subKey);
    if (s != null) {
        properties.put(key , s);
    }
}
 
开发者ID:makotan,项目名称:ninja-mirage,代码行数:11,代码来源:NinjaMirageModule.java

示例10: MongoDB

import ninja.utils.NinjaProperties; //导入依赖的package包/类
@Inject
public MongoDB(NinjaProperties ninjaProperties) {
    this.ninjaProperties = ninjaProperties;

    if (this.ninjaProperties.getBooleanWithDefault(MONGODB_CONNECT_ON_STARTUP, true)) {
        this.connect();
    }

    // init morphia is only possible if connect on startup is true
    if (this.ninjaProperties.getBooleanWithDefault(MONGODB_CONNECT_ON_STARTUP, true)
            && this.ninjaProperties.getBooleanWithDefault(MORPHIA_INIT, true)) {
        this.initMorphia();
    }
}
 
开发者ID:bihe,项目名称:ninja-mongodb,代码行数:15,代码来源:MongoDB.java

示例11: MustacheFactoryProvider

import ninja.utils.NinjaProperties; //导入依赖的package包/类
@Inject
   public MustacheFactoryProvider(Logger logger,
    NinjaProperties ninjaProperties) {
this.logger = logger;
this.ninjaProperties = ninjaProperties;
initResourceRoots();
   }
 
开发者ID:kpacha,项目名称:ninja-mustache,代码行数:8,代码来源:MustacheFactoryProvider.java

示例12: MustacheTemplateEngine

import ninja.utils.NinjaProperties; //导入依赖的package包/类
@Inject
   public MustacheTemplateEngine(Messages messages, Lang lang,
    Logger ninjaLogger, NinjaExceptionHandler exceptionHandler,
    MustacheTemplateEngineHelper templateEngineHelper,
    TemplateEngineManager templateEngineManager,
    NinjaProperties ninjaProperties, MustacheFactory mustacheFactory)
    throws Exception {

this.messages = messages;
this.lang = lang;
this.logger = ninjaLogger;
this.templateEngineHelper = templateEngineHelper;
this.exceptionHandler = exceptionHandler;
this.mustacheFactory = mustacheFactory;
   }
 
开发者ID:kpacha,项目名称:ninja-mustache,代码行数:16,代码来源:MustacheTemplateEngine.java

示例13: RythmEngineProvider

import ninja.utils.NinjaProperties; //导入依赖的package包/类
@Inject
public RythmEngineProvider(Messages messages,
                           Logger logger,
                           TemplateEngineManager templateEngineManager,
                           NinjaProperties ninjaProperties) {
    this.messages = messages;
    this.logger = logger;
    this.templateEngineManager = templateEngineManager;
    this.ninjaProperties = ninjaProperties;
}
 
开发者ID:ninjaframework,项目名称:ninja-rythm,代码行数:11,代码来源:RythmEngineProvider.java

示例14: TemplateRythmConfiguration

import ninja.utils.NinjaProperties; //导入依赖的package包/类
@Inject
public TemplateRythmConfiguration(Messages messages,
                                  Logger ninjaLogger,
                                  TemplateEngineManager templateEngineManager,
                                  NinjaProperties ninjaProperties) {

    this.messages = messages;
    this.logger = ninjaLogger;
    this.ninjaProperties = ninjaProperties;

    init();
}
 
开发者ID:ninjaframework,项目名称:ninja-rythm,代码行数:13,代码来源:TemplateRythmConfiguration.java

示例15: getInstance

import ninja.utils.NinjaProperties; //导入依赖的package包/类
public synchronized static VertxInitializer getInstance(NinjaProperties ninjaProperties) {
    if (vertxInitializer == null) {
        vertxInitializer = new VertxInitializer(ninjaProperties);
    }
    return vertxInitializer;
}
 
开发者ID:kuangcao,项目名称:ninja-vertx-standalone,代码行数:7,代码来源:VertxInitializer.java


注:本文中的ninja.utils.NinjaProperties类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。