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


Java ModuleManager类代码示例

本文整理汇总了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));
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:21,代码来源:RolesPermissionService.java

示例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);
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:20,代码来源:LockManager.java

示例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!");
    }
}
 
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:23,代码来源:ApiServer.java

示例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();
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:31,代码来源:MarkdownGenerator.java

示例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);
        }
    }
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:34,代码来源:ModuleDocs.java

示例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"));


}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:33,代码来源:MySQLDatabase.java

示例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;
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:7,代码来源:PluginCommands.java

示例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();
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:7,代码来源:Locker.java

示例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);
}
 
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:7,代码来源:Itemrepair.java

示例10: generateList

import org.cubeengine.libcube.ModuleManager; //导入依赖的package包/类
String generateList(Map<String, ModuleDocs> docs, Path modulePath, ModuleManager mm); 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:2,代码来源:Generator.java


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