Search in sources :

Example 1 with Prop

use of com.jfinal.kit.Prop in project xxl-job by xuxueli.

the class JFinalCoreConfig method initXxlJobExecutor.

private void initXxlJobExecutor() {
    // registry jobhandler
    XxlJobExecutor.registJobHandler("demoJobHandler", new DemoJobHandler());
    XxlJobExecutor.registJobHandler("shardingJobHandler", new ShardingJobHandler());
    // load executor prop
    Prop xxlJobProp = PropKit.use("xxl-job-executor.properties");
    // init executor
    xxlJobExecutor = new XxlJobExecutor();
    xxlJobExecutor.setAdminAddresses(xxlJobProp.get("xxl.job.admin.addresses"));
    xxlJobExecutor.setAppName(xxlJobProp.get("xxl.job.executor.appname"));
    xxlJobExecutor.setIp(xxlJobProp.get("xxl.job.executor.ip"));
    xxlJobExecutor.setPort(xxlJobProp.getInt("xxl.job.executor.port"));
    xxlJobExecutor.setAccessToken(xxlJobProp.get("xxl.job.accessToken"));
    xxlJobExecutor.setLogPath(xxlJobProp.get("xxl.job.executor.logpath"));
    xxlJobExecutor.setLogRetentionDays(xxlJobProp.getInt("xxl.job.executor.logretentiondays"));
    // start executor
    try {
        xxlJobExecutor.start();
    } catch (Exception e) {
        logger.error(e.getMessage(), e);
    }
}
Also used : ShardingJobHandler(com.xuxueli.executor.sample.jfinal.jobhandler.ShardingJobHandler) XxlJobExecutor(com.xxl.job.core.executor.XxlJobExecutor) DemoJobHandler(com.xuxueli.executor.sample.jfinal.jobhandler.DemoJobHandler) Prop(com.jfinal.kit.Prop)

Example 2 with Prop

use of com.jfinal.kit.Prop in project jfinal by jfinal.

the class Sqls method use.

private static Prop use(String fileName, String encoding) {
    Prop result = map.get(fileName);
    if (result == null) {
        result = new Prop(fileName, encoding);
        map.put(fileName, result);
        if (Sqls.prop == null)
            Sqls.prop = result;
    }
    return result;
}
Also used : Prop(com.jfinal.kit.Prop)

Example 3 with Prop

use of com.jfinal.kit.Prop in project my_curd by qinyou.

the class SysFileController method fileTypeData.

/**
 * 系统运输上传的文件类型,供combobox 使用
 */
public void fileTypeData() {
    Prop prop = PropKit.use("config.properties");
    String imageTypes = prop.get("imageType");
    String mediaTypes = prop.get("mediaType");
    String fileTypes = prop.get("fileType");
    String[] types = (imageTypes + "," + mediaTypes + "," + fileTypes).split(",");
    List<Map<String, String>> data = new ArrayList<Map<String, String>>();
    for (String type : types) {
        Map<String, String> dataItem = new HashMap<String, String>();
        dataItem.put("label", type);
        dataItem.put("value", type);
        data.add(dataItem);
    }
    renderJson(data);
}
Also used : Prop(com.jfinal.kit.Prop)

Aggregations

Prop (com.jfinal.kit.Prop)3 DemoJobHandler (com.xuxueli.executor.sample.jfinal.jobhandler.DemoJobHandler)1 ShardingJobHandler (com.xuxueli.executor.sample.jfinal.jobhandler.ShardingJobHandler)1 XxlJobExecutor (com.xxl.job.core.executor.XxlJobExecutor)1