public class GaussBeanFactory extends Object implements org.springframework.context.ApplicationContextAware
getBean(java.lang.Class<T>) method coz it gives you the
singleton by default if context is from Spring frameworkApplicationContext,
ApplicationContextAware| Constructor and Description |
|---|
GaussBeanFactory() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
copyObject(T source) |
static <T> T |
create(Class<T> clazz) |
static <T> T |
create(Class<T> clazz,
Consumer<T> action) |
static <T> T |
create(Class<T> clazz,
Object... args)
use declared constructor to instantiate an object
|
static <T> T |
create(Constructor<T> ctor,
Object... args)
use specific constructor to create an object
|
static <T> T |
getBean(Class<T> clazz)
Get an instance of the object that client acquires through application context.
|
static Object |
getBean(String name)
Get an instance of the object that client acquires through application context.
|
static boolean |
isReady() |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
This method is inherited from Spring-aware component and leave here for client to replace the context
container if client wishes to change context implementation by its own.
|
public static <T> T getBean(Class<T> clazz) throws GaussFactoryException
create(java.lang.Class<T>)
instead if you are in unknown situation.clazz - class type the objectGaussFactoryExceptionpublic static Object getBean(String name)
create(java.lang.Class<T>)
instead if you are in unknown situation.name - name of the objectpublic static <T> T create(Class<T> clazz)
public static <T> T create(Class<T> clazz, Object... args)
T - the type of objectclazz - the class type of objectargs - constructor parameterspublic static <T> T create(Constructor<T> ctor, Object... args)
T - the type of objectctor - the specific constructor of objectargs - constructor parameterspublic static <T> T copyObject(T source)
public static boolean isReady()
public void setApplicationContext(@NonNull
org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareapplicationContext - bean containerorg.springframework.beans.BeansException - see ApplicationContextExceptionCopyright © 2022. All rights reserved.