public class ResourceModuleContext
extends java.lang.Object
Created by rinoux on 2017/11/3.
构造器和说明 |
---|
ResourceModuleContext() |
限定符和类型 | 方法和说明 |
---|---|
static void |
addFactory(RepositoryFactoryProvider factory)
添加工厂
此方法会RPC
|
static void |
addListener(RepositoryEventListener listener) |
static void |
apply(java.lang.String name,
RepositoryApplyPolicy policy)
启用仓库(可提供服务)
此方法会RPC
|
static boolean |
available() |
static void |
discard(java.lang.String name)
弃用仓库
此方法会RPC
|
static java.lang.String[] |
getAllInstalled() |
static ResourceModuleConfigProvider |
getConfig() |
static ResourceRepository |
getCurrentRepo()
当前使用的仓库
|
static RepositoryFactoryProvider |
getFactory(java.lang.String identity) |
static FactoryLoaderProvider |
getFactoryLoader() |
static InstalledComponent |
getInstalledComponent(java.lang.String repoName)
获取已安装的仓库组件
|
static java.util.Set<java.lang.String> |
getInstalledRepos()
所有安装仓库名称
|
static RepositoryInstallerProvider |
getInstaller() |
static RepositoryEventListener[] |
getListeners() |
static RepositoryManagerProvider |
getManager() |
static ResourceRepository |
getRealCurrentRepo()
获取实际的仓库(缓存的下层)
|
static ResourceRepository |
getRepoByName(java.lang.String name)
从可选仓库中查找指定名称的仓库
|
static <T extends RepositoryConfig> |
getRepoConfig(java.lang.String identity,
java.lang.String repoName)
获取已安装仓库的配置
|
static java.util.Set<java.lang.String> |
getServiceRepos()
获取
|
static InstalledComponent |
install(RepositoryProfile profile)
安装一个仓库(仅安装不可用)
此方法会RPC
|
static void |
removeFactory(java.lang.String identity)
删除工厂
此方法会RPC
|
static void |
removeListener(RepositoryEventListener listener) |
static void |
setRepositoryContext(RepositoryContextProvider context)
上下文建造器
|
static void |
uninstall(java.lang.String name)
卸载一个仓库
此方法会RPC
|
static <T extends RepositoryConfig> |
verifyRepoConfig(java.lang.String repoType,
T config)
验证仓库配置
|
public static void setRepositoryContext(RepositoryContextProvider context)
public static ResourceRepository getCurrentRepo()
public static ResourceRepository getRealCurrentRepo()
public static ResourceRepository getRepoByName(java.lang.String name)
name
- 仓库明晨public static java.util.Set<java.lang.String> getServiceRepos()
public static java.util.Set<java.lang.String> getInstalledRepos()
public static InstalledComponent getInstalledComponent(java.lang.String repoName)
repoName
- 仓库名称public static java.lang.String[] getAllInstalled()
public static InstalledComponent install(RepositoryProfile profile)
此方法会RPC
profile
- 仓库描述信息public static void uninstall(java.lang.String name)
此方法会RPC
name
- 仓库名称public static void apply(java.lang.String name, RepositoryApplyPolicy policy) throws RepositoryException
此方法会RPC
name
- 名称policy
- 启用策略RepositoryException
public static void discard(java.lang.String name) throws RepositoryException
此方法会RPC
name
- 仓库名称RepositoryException
public static void addFactory(RepositoryFactoryProvider factory)
此方法会RPC
factory
- public static void removeFactory(java.lang.String identity)
此方法会RPC
identity
- public static ResourceModuleConfigProvider getConfig()
public static RepositoryFactoryProvider getFactory(java.lang.String identity)
public static FactoryLoaderProvider getFactoryLoader()
public static RepositoryInstallerProvider getInstaller()
public static RepositoryManagerProvider getManager()
public static boolean available()
public static <T extends RepositoryConfig> boolean verifyRepoConfig(java.lang.String repoType, T config)
repoType
- 仓库类型config
- 配置public static <T extends RepositoryConfig> T getRepoConfig(java.lang.String identity, java.lang.String repoName)
identity
- 仓库类型repoName
- 仓库名称public static void addListener(RepositoryEventListener listener)
public static void removeListener(RepositoryEventListener listener)
public static RepositoryEventListener[] getListeners()