public class SpringLiteContext extends Object
The simplified version of the ROC framework, referring to the use of the spring-framework, implements a simple dependency injection and aspect-oriented programming for dynamic proxy implementations.
| 构造器和说明 |
|---|
SpringLiteContext() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
checkBeanOk(Object bean)
检查实例的状态,是否已完成组装,即所有的属性都已自动赋值
Check the status of the instance, and whether the assembly has been completed, that is, all properties are automatically assigned.
|
static Collection<Object> |
getAllBeanList() |
static <T> T |
getBean(Class<T> beanClass)
根据类型获取对象池中的对象
Gets the object in the object pool according to the type.
|
static <T> T |
getBean(Class<T> beanClass,
String specifiedBeanName)
根据类型获取对象池中的对象
Gets the object in the object pool according to the type.
|
static Object |
getBeanByClass(String clazzStr)
根据对象类型字符串获取该类型实例的名称
Gets the name of the type instance according to the object type.
|
static <T> List<T> |
getBeanList(Class<T> beanClass)
获取一个类型的所有实例
Gets all instances of a type.
|
static Annotation |
getFromArray(Annotation[] anns,
Class clazz)
从数组中获取指定的注解类型的实例
Gets an instance of the specified annotation type from the array.
|
static void |
init(net.sf.cglib.proxy.MethodInterceptor interceptor,
String... packName) |
static void |
init(String... packName)
使用默认的拦截器加载roc环境
Load the roc environment with the default interceptor.
|
static void |
init(String packName,
net.sf.cglib.proxy.MethodInterceptor interceptor)
根据传入的参数加载roc环境
Load the roc environment based on the incoming parameters.
|
static void |
putBean(Class clazz)
向上下文中加入一个托管对象,该对象是根据传入的类型,使用动态代理的方式实例化的
A managed object is added to the context, which is instantiated using a dynamic proxy based on the incoming type.
|
static void |
putBean(Class clazz,
boolean proxy) |
static void |
putBean(String beanName,
Object bean) |
static void |
removeBean(Class clazz)
从上下文中删除一个类型的所有实例,请谨慎调用
Delete all instances of a type from the context, please call carefully.
|
public static void init(String... packName)
packName - 扫描的根路径,The root package of the scan.public static void init(String packName, net.sf.cglib.proxy.MethodInterceptor interceptor)
packName - 扫描的根路径,The root package of the scan.interceptor - 方法拦截器,Method interceptorpublic static void init(net.sf.cglib.proxy.MethodInterceptor interceptor,
String... packName)
public static Object getBeanByClass(String clazzStr)
public static Annotation getFromArray(Annotation[] anns, Class clazz)
anns - 注解实例数组,Annotated instance arrayclazz - 目标注解类型,Target annotation typepublic static <T> T getBean(Class<T> beanClass)
T - 泛型beanClass - 对象类型public static void putBean(Class clazz) throws NulsException
clazz - 对象类型NulsExceptionpublic static void putBean(Class clazz, boolean proxy) throws NulsException
NulsExceptionpublic static void removeBean(Class clazz)
public static boolean checkBeanOk(Object bean)
bean - 对象实例public static <T> List<T> getBeanList(Class<T> beanClass)
T - 泛型beanClass - 类型public static Collection<Object> getAllBeanList()
Copyright © 2021. All rights reserved.