forked from fanruan/finekit
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
900 B
42 lines
900 B
6 years ago
|
package com.fanruan.api.io;
|
||
|
|
||
|
import com.fr.io.base.provider.RepositoryFactoryProvider;
|
||
|
import com.fr.io.context.ResourceModuleContext;
|
||
|
import org.jetbrains.annotations.NotNull;
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
* 资源仓库插件开发套件
|
||
|
*
|
||
|
* @author rinoux
|
||
|
* @version 10.0
|
||
|
* Created by rinoux on 2019/9/5
|
||
|
*/
|
||
|
public class ResourceModuleKit {
|
||
|
|
||
|
|
||
|
/**
|
||
|
* 添加一个资源仓库工厂
|
||
|
*
|
||
|
* @param factory 工厂
|
||
|
* @param <T> 工厂类型
|
||
|
*/
|
||
|
public static <T extends RepositoryFactoryProvider> void addFactory(@NotNull T factory) {
|
||
|
ResourceModuleContext.addFactory(factory);
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* 移除一个资源仓库工厂
|
||
|
*
|
||
|
* @param factory 工厂
|
||
|
* @param <T> 工厂类型
|
||
|
*/
|
||
|
public static <T extends RepositoryFactoryProvider> void removeFactory(@NotNull T factory) {
|
||
|
ResourceModuleContext.removeFactory(factory.getIdentity());
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
}
|