public interface ApplicationContext
Modifier and Type | Method and Description |
---|---|
void |
add(Object object)
Adds an object instance with the fully qualified classname as name to the application context
|
void |
add(String name,
Object instance)
Adds an object instance with the specified name to the ApplicationContext.
|
<T> T |
find(Class<T> klass)
Looks for an object of the specified class.
|
<T> Collection<T> |
findAll(Class<T> klass)
Utility method to find all classes that implements or extends from the given class.
|
<T> T |
get(String name)
Returns the object of the specified type with the specified name.
|
BeanFactory |
getBeanFactory() |
boolean |
hasBean(String name)
Check if a object with the specified name is available in this ApplicationContext.
|
<T> T |
load(Class<T> klass)
Load the specified class with the context ClassLoader into this ApplicationContext.
|
<T> T |
load(Class<T> klass,
ClassLoader classLoader)
Load the specified class with the given ClassLoader into this ApplicationContext.
|
void |
shutdown()
Called to shutdown the application context, letting it perform shutdown like running
PreDestroy on beans. |
void add(String name, Object instance)
name
- the unique name of the objectinstance
- the object to add.void add(Object object)
ms
- <T> T get(String name)
name
- the name of the object to return<T> T find(Class<T> klass)
klass
- the class of the object to look for.<T> Collection<T> findAll(Class<T> klass)
klass
- the type to look forBeanFactory getBeanFactory()
boolean hasBean(String name)
name
- the name to look for.<T> T load(Class<T> klass, ClassLoader classLoader)
klass
- the class to load.classLoader
- the ClassLoader to use.<T> T load(Class<T> klass)
klass
- the class to load.void shutdown()
PreDestroy
on beans.Copyright © 2012 redlab.be. All Rights Reserved.