forked from fanruan/finekit
41 lines
900 B
41 lines
900 B
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()); |
|
} |
|
|
|
|
|
|
|
}
|
|
|