public class SpringContext extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static org.springframework.context.ApplicationContext |
context |
| 构造器和说明 |
|---|
SpringContext() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
getBean(Class<T> clazz)
not thread safe
|
static <T> T |
getBean(String className)
this method not thread safe
|
static <T> T |
getBean(String className,
ClassLoader classLoader)
this method not thread safe
|
static Object |
getBeanByName(String beanName) |
static void |
lock() |
static int |
lockTimes() |
static void |
unlock() |
static int |
unLockTimes() |
public static <T> T getBean(Class<T> clazz) throws Exception
clazz - Exceptionpublic static <T> T getBean(String className) throws Exception
T - target Class TypeclassName - className pattern classFullName[:beanId]Exceptionpublic static <T> T getBean(String className, ClassLoader classLoader) throws Exception
T - target Class TypeclassName - className pattern classFullName[:beanId]classLoader - target classLoaderExceptionpublic static void unlock()
public static void lock()
public static int lockTimes()
public static int unLockTimes()
Copyright © 2022. All rights reserved.