All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cybermkd.plugin.MongoRestyPlugin Maven / Gradle / Ivy

There is a newer version: 1.0.8.2
Show newest version
package com.cybermkd.plugin;

import cn.dreampie.common.Plugin;
import com.cybermkd.kit.MongoKit;
import com.mongodb.MongoClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 创建人:T-baby
 * 创建日期: 16/4/17
 * 文件描述:MongoDB for Resty 插件
 */

public class MongoRestyPlugin extends MongoPlugin implements Plugin {


    final Logger logger = LoggerFactory.getLogger(MongoRestyPlugin.class);

    private MongoClient client;

    @Override
    public boolean start() {
        client = getMongoClient();
        MongoKit.INSTANCE.init(client, getDatabase());
        return true;
    }

    @Override
    public boolean stop() {
        if (client != null) {
            client.close();
        }
        return true;
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy