當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。