本文整理汇总了Java中org.cubeengine.libcube.ModuleManager类的典型用法代码示例。如果您正苦于以下问题:Java ModuleManager类的具体用法?Java ModuleManager怎么用?Java ModuleManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ModuleManager类属于org.cubeengine.libcube包,在下文中一共展示了ModuleManager类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RolesPermissionService
import org.cubeengine.libcube.ModuleManager; //导入依赖的package包/类
@Inject
public RolesPermissionService(Roles module, FileManager fm, Reflector reflector, ModuleManager mm)
{
this.reflector = reflector;
this.modulePath = mm.getPathFor(Roles.class);
this.logger = mm.getLoggerFor(Roles.class);
this.config = fm.loadConfig(module, RolesConfig.class);
collections.put(SUBJECTS_DEFAULT, new FileBasedCollection(modulePath, this, reflector, SUBJECTS_DEFAULT, true));
collections.put(SUBJECTS_USER, new UserCollection(this));
collections.put(SUBJECTS_GROUP, new FileBasedCollection(modulePath, this, reflector, SUBJECTS_GROUP, true));
this.getLoadedCollections().values().stream()
.filter(c -> c instanceof FileBasedCollection)
.map(FileBasedCollection.class::cast)
.forEach(FileBasedCollection::reload);
collections.put(SUBJECTS_SYSTEM, new FileBasedCollection(modulePath,this, reflector, SUBJECTS_SYSTEM, true));
// TODO SUBJECTS_COMMAND_BLOCK
collections.put(SUBJECTS_ROLE_TEMPLATE, new FileBasedCollection(modulePath, this, reflector, SUBJECTS_ROLE_TEMPLATE, true));
}
示例2: LockManager
import org.cubeengine.libcube.ModuleManager; //导入依赖的package包/类
@Inject
public LockManager(Locker module, EventManager em, TaskManager tm, I18n i18n, ModuleManager mm)
{
this.tm = tm;
this.i18n = i18n;
logger = mm.getLoggerFor(Locker.class);
this.module = module;
try
{
messageDigest = MessageDigest.getInstance("SHA-1");
}
catch (NoSuchAlgorithmException e)
{
throw new RuntimeException("SHA-1 hash algorithm not available!");
}
this.commandListener = new CommandListener(module, this, i18n);
em.registerListener(Locker.class, this.commandListener);
em.registerListener(Locker.class, this);
}
示例3: ApiServer
import org.cubeengine.libcube.ModuleManager; //导入依赖的package包/类
@Inject
public ApiServer(LogFactory logFactory, FileManager fm, ModuleManager mm)
{
this.logger = mm.getLoggerFor(ApiServer.class);
this.moduleFolder = mm.getPathFor(ApiServer.class);
this.tf = mm.getThreadFactory(this.getClass());
this.log = logFactory.getLog(ApiServer.class, "WebAPI");
this.mm = mm;
this.log.addTarget(
new AsyncFileTarget.Builder(LoggingUtil.getLogFile(fm, "WebAPI").toPath(),
LoggingUtil.getFileFormat(true, true)
).setAppend(true).setCycler(LoggingUtil.getCycler()).setThreadFactory(tf).build());
// TODO this.log.addTarget(new LogProxyTarget(logFactory.getParent()));
try
{
this.bindAddress.set(InetAddress.getLocalHost());
}
catch (UnknownHostException ignored)
{
this.log.warn("Failed to get the localhost!");
}
}
示例4: generateList
import org.cubeengine.libcube.ModuleManager; //导入依赖的package包/类
@Override
public String generateList(Map<String, ModuleDocs> modules, Path modulePath, ModuleManager mm)
{
StringBuilder sb = new StringBuilder();
sb.append("# CubeEngine Documentation\n\n");
sb.append("## Modules\n\n");
ModuleDocs doc = modules.get("cubeengine-core");
sb.append(" - [").append("Core").append("](modules/").append(doc.getId()).append(".md)\n");
List<ModuleDocs> list = new ArrayList<>(modules.values());
list.sort((a, b) -> Boolean.compare(b.isOnOre(), a.isOnOre()));
for (ModuleDocs module : list)
{
if (module == doc)
{
continue;
}
sb.append(" - [").append(module.getModuleName()).append("](modules/").append(module.getId()).append(".md)");
if (module.isWIP())
{
sb.append(" - [WIP]");
}
sb.append("\n");
}
return sb.toString();
}
示例5: ModuleDocs
import org.cubeengine.libcube.ModuleManager; //导入依赖的package包/类
public ModuleDocs(PluginContainer plugin, Class module, Reflector reflector, PermissionManager pm, PermissionService ps, CommandManager cm, ModuleManager mm)
{
this.pc = plugin;
this.name = plugin.getName();
this.moduleName = mm.getModuleName(module).get();
this.id = plugin.getId();
this.moduleId = mm.getModuleID(module).get();
InputStream is = plugin.getClass().getResourceAsStream("/assets/cubeengine/"+ moduleId + "-info.yml");
if (is == null)
{
this.config = reflector.create(Info.class);
}
else
{
this.config = reflector.load(Info.class, new InputStreamReader(is));
}
this.basePermission = pm.getBasePermission(module);
for (PermissionDescription perm : ps.getDescriptions())
{
if (perm.getId().startsWith(basePermission.getId() + ".") || perm.getId().equals(basePermission.getId()))
{
this.permissions.add(perm);
}
}
for (CommandBase base : cm.getCommands())
{
if (base.getDescriptor().getOwner().equals(module))
{
this.commands.add(base);
}
}
}
示例6: MySQLDatabase
import org.cubeengine.libcube.ModuleManager; //导入依赖的package包/类
@Inject
public MySQLDatabase(Reflector reflector, ModuleManager mm, FileManager fm, LogFactory logFactory)
{
this.mm = mm;
this.mm.registerBinding(Database.class, this);
File pluginFolder = mm.getBasePath();
// Disable HikariPool Debug ConsoleSpam
((Logger)LogManager.getLogger(HikariPool.class)).setLevel(Level.INFO);
((Logger)LogManager.getLogger("com.zaxxer.hikari.pool.PoolBase")).setLevel(Level.INFO); // really? now pkg-private
((Logger)LogManager.getLogger(HikariConfig.class)).setLevel(Level.INFO);
// Setting up Logger...
this.logger = mm.getLoggerFor(Database.class);
AsyncFileTarget target =
new AsyncFileTarget.Builder(LoggingUtil.getLogFile(fm, "Database").toPath(),
LoggingUtil.getFileFormat(true, false)
).setAppend(true).setCycler(LoggingUtil.getCycler()).setThreadFactory(threadFactory).build();
target.setLevel(LogLevel.DEBUG);
logger.addTarget(target);
LogTarget parentTarget = logger.addDelegate(logFactory.getLog(LogFactory.class));
parentTarget.appendFilter(new PrefixFilter("[DB] "));
parentTarget.setLevel(LogLevel.INFO);
this.config = reflector.load(MySQLDatabaseConfiguration.class, new File(pluginFolder, "database.yml"));
}
示例7: PluginCommands
import org.cubeengine.libcube.ModuleManager; //导入依赖的package包/类
public PluginCommands(I18n i18n, PermissionManager pm, ModuleManager mm)
{
super(pm, VanillaPlus.class);
this.i18n = i18n;
this.mm = mm;
}
示例8: Locker
import org.cubeengine.libcube.ModuleManager; //导入依赖的package包/类
@Inject
public Locker(ModuleManager momu)
{
this.logger = momu.getLoggerFor(Locker.class);
this.plugin = momu.getPlugin(Locker.class).get();
}
示例9: Itemrepair
import org.cubeengine.libcube.ModuleManager; //导入依赖的package包/类
@Inject
public Itemrepair(Reflector reflector, ModuleManager mm)
{
this.logger = mm.getLoggerFor(Itemrepair.class);
reflector.getDefaultConverterManager().registerConverter(new BaseMaterialContainerConverter(), BaseMaterialContainer.class);
}
示例10: generateList
import org.cubeengine.libcube.ModuleManager; //导入依赖的package包/类
String generateList(Map<String, ModuleDocs> docs, Path modulePath, ModuleManager mm);