org.bukkit.Server.configureDbConfig()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中org.bukkit.Server.configureDbConfig()方法的一些代码示例,展示了Server.configureDbConfig()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Server.configureDbConfig()方法的具体详情如下:
包路径:org.bukkit.Server
类名称:Server
方法名:configureDbConfig

Server.configureDbConfig介绍

[英]Populates a given ServerConfig with values attributes to this server.
[中]使用此服务器的值属性填充给定的ServerConfig。

代码示例

代码示例来源:origin: Bukkit/Bukkit

/**
 * @see Server#configureDbConfig(ServerConfig config)
 */
public static void configureDbConfig(ServerConfig config) {
  server.configureDbConfig(config);
}

代码示例来源:origin: Bukkit/Bukkit

final void init(PluginLoader loader, Server server, PluginDescriptionFile description, File dataFolder, File file, ClassLoader classLoader) {
  this.loader = loader;
  this.server = server;
  this.file = file;
  this.description = description;
  this.dataFolder = dataFolder;
  this.classLoader = classLoader;
  this.configFile = new File(dataFolder, "config.yml");
  this.logger = new PluginLogger(this);
  if (description.isDatabaseEnabled()) {
    ServerConfig db = new ServerConfig();
    db.setDefaultServer(false);
    db.setRegister(false);
    db.setClasses(getDatabaseClasses());
    db.setName(description.getName());
    server.configureDbConfig(db);
    DataSourceConfig ds = db.getDataSourceConfig();
    ds.setUrl(replaceDatabaseString(ds.getUrl()));
    dataFolder.mkdirs();
    ClassLoader previous = Thread.currentThread().getContextClassLoader();
    Thread.currentThread().setContextClassLoader(classLoader);
    ebean = EbeanServerFactory.create(db);
    Thread.currentThread().setContextClassLoader(previous);
  }
}

代码示例来源:origin: SpigotMC/Spigot-API

/**
 * @see Server#configureDbConfig(ServerConfig config)
 */
public static void configureDbConfig(ServerConfig config) {
  server.configureDbConfig(config);
}

代码示例来源:origin: SpigotMC/Spigot-API

final void init(PluginLoader loader, Server server, PluginDescriptionFile description, File dataFolder, File file, ClassLoader classLoader) {
  this.loader = loader;
  this.server = server;
  this.file = file;
  this.description = description;
  this.dataFolder = dataFolder;
  this.classLoader = classLoader;
  this.configFile = new File(dataFolder, "config.yml");
  this.logger = new PluginLogger(this);
  if (description.isDatabaseEnabled()) {
    ServerConfig db = new ServerConfig();
    db.setDefaultServer(false);
    db.setRegister(false);
    db.setClasses(getDatabaseClasses());
    db.setName(description.getName());
    server.configureDbConfig(db);
    DataSourceConfig ds = db.getDataSourceConfig();
    ds.setUrl(replaceDatabaseString(ds.getUrl()));
    dataFolder.mkdirs();
    ClassLoader previous = Thread.currentThread().getContextClassLoader();
    Thread.currentThread().setContextClassLoader(classLoader);
    ebean = EbeanServerFactory.create(db);
    Thread.currentThread().setContextClassLoader(previous);
  }
}

相关文章

Server类方法