Package org.cyclos.bootstrap
Class BeanHandlerImpl
- java.lang.Object
-
- org.cyclos.bootstrap.BeanHandlerImpl
-
- All Implemented Interfaces:
BeanHandler
@Component public class BeanHandlerImpl extends Object implements BeanHandler
Implementation forBeanHandler
-
-
Constructor Summary
Constructors Constructor Description BeanHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tautowire(Class<T> type)Instantiates a bean of the given type and autowire it's dependencies<T> Tautowire(Object object)Instantiates a bean with the given object and autowire it's dependencies<T> TautowireWithArgs(Class<T> type, Object... constructorArgs)Instantiates a bean of the given type using the given constructor arguments, and autowire it's dependencies<T extends CustomBean>
TcustomBean(Class<T> expectedType, String className)Creates a custom bean, that is, a bean whose interface is known, but the implementation class name is dynamicvoiddestroy()voiddestroy(Object bean)Destroys a bean.<T> TgetBean(Class<T> type)Returns a cacheable singleton bean by class, autowired with the context.<T extends CustomBean>
TgetBean(Class<T> expectedType, String className)Returns a cacheable singleton bean by classname, autowired with the context.<T> Tinstantiate(Class<T> type)Instantiates a bean of the given type<T> TinstantiateWithArgs(Class<T> type, Object... constructorArgs)Instantiates a bean of the given type with constructor arguments
-
-
-
Method Detail
-
autowire
public <T> T autowire(Class<T> type)
Description copied from interface:BeanHandlerInstantiates a bean of the given type and autowire it's dependencies- Specified by:
autowirein interfaceBeanHandler
-
autowire
public <T> T autowire(Object object)
Description copied from interface:BeanHandlerInstantiates a bean with the given object and autowire it's dependencies- Specified by:
autowirein interfaceBeanHandler
-
autowireWithArgs
public <T> T autowireWithArgs(Class<T> type, Object... constructorArgs)
Description copied from interface:BeanHandlerInstantiates a bean of the given type using the given constructor arguments, and autowire it's dependencies- Specified by:
autowireWithArgsin interfaceBeanHandler
-
customBean
public <T extends CustomBean> T customBean(Class<T> expectedType, String className)
Description copied from interface:BeanHandlerCreates a custom bean, that is, a bean whose interface is known, but the implementation class name is dynamic- Specified by:
customBeanin interfaceBeanHandler
-
destroy
@PreDestroy public void destroy()
-
destroy
public void destroy(Object bean)
Description copied from interface:BeanHandlerDestroys a bean. If it implementsDisposableBean, invoke it'sDisposableBean.destroy()method. Also invokes every zero-argument method annotated withPreDestroy.- Specified by:
destroyin interfaceBeanHandler
-
getBean
public <T> T getBean(Class<T> type)
Description copied from interface:BeanHandlerReturns a cacheable singleton bean by class, autowired with the context.- Specified by:
getBeanin interfaceBeanHandler
-
getBean
public <T extends CustomBean> T getBean(Class<T> expectedType, String className)
Description copied from interface:BeanHandlerReturns a cacheable singleton bean by classname, autowired with the context.- Specified by:
getBeanin interfaceBeanHandler
-
instantiate
public <T> T instantiate(Class<T> type)
Description copied from interface:BeanHandlerInstantiates a bean of the given type- Specified by:
instantiatein interfaceBeanHandler
-
instantiateWithArgs
public <T> T instantiateWithArgs(Class<T> type, Object... constructorArgs)
Description copied from interface:BeanHandlerInstantiates a bean of the given type with constructor arguments- Specified by:
instantiateWithArgsin interfaceBeanHandler
-
-