public class PetiteContainer extends PetiteBeans
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PETITE_CONTAINER_REF_NAME
Petite container reference name.
|
protected ScopedProxyManager |
scopedProxyManager |
annotationResolver, beanCollections, beans, beansAlt, externalsCache, paramManager, petiteConfig, petiteResolvers, providers, referencesResolver, scopes
Constructor and Description |
---|
PetiteContainer()
Creates new Petite container using
default configuration . |
PetiteContainer(PetiteConfig config)
Creates new Petite container using
provided configuration . |
Modifier and Type | Method and Description |
---|---|
void |
addBean(java.lang.String name,
java.lang.Object bean)
Adds object instance to the container as singleton bean using default
wiring mode and default init method flag.
|
void |
addBean(java.lang.String name,
java.lang.Object bean,
WiringMode wiringMode)
Adds object instance to the container as singleton bean.
|
void |
addSelf()
Adds self instance to the container so internal beans may fetch
container for further usage.
|
void |
addSelf(java.lang.String name)
Adds self instance to the container so internal beans may fetch
container for further usage.
|
<E> E |
createBean(java.lang.Class<E> type)
Creates and wires a bean within the container using default wiring mode and default init methods flag.
|
<E> E |
createBean(java.lang.Class<E> type,
WiringMode wiringMode)
Creates and wires a bean within the container and optionally invokes init methods.
|
PetiteRegistry |
createContainerRegistry()
Creates
PetiteRegistry helper tool for this container. |
protected java.lang.Object |
getBean(BeanReferences beanReferences)
Returns Petite bean instance named as one of the provided names.
|
<T> T |
getBean(java.lang.Class<T> type)
Returns Petite bean instance.
|
<T> T |
getBean(java.lang.String name)
Returns Petite bean instance.
|
java.lang.Object |
getBeanProperty(java.lang.String name)
Returns petite bean property value.
|
protected void |
initBeanDefinition(BeanDefinition def)
Resolves and initializes bean definition.
|
<T> T |
invokeMethod(java.lang.Object bean,
java.lang.reflect.Method method)
Invokes the method of some bean with the container, when its parameters requires to be injected into.
|
protected java.lang.Object |
invokeProvider(ProviderDefinition provider)
Invokes provider to get a bean.
|
protected java.lang.Object |
lookupMixingScopedBean(BeanDefinition def,
BeanReferences refNames) |
protected void |
registerBeanAndWireAndInjectParamsAndInvokeInitMethods(BeanData beanData)
Wires bean, injects parameters and invokes init methods.
|
void |
setBeanProperty(java.lang.String name,
java.lang.Object value)
Sets petite bean property.
|
void |
shutdown()
Shutdowns container.
|
void |
wire(java.lang.Object bean)
Wires provided bean with the container using default wiring mode.
|
void |
wire(java.lang.Object bean,
WiringMode wiringMode)
Wires provided bean with the container and optionally invokes init methods.
|
beanNames, beansCount, config, createBeandDefinitionForExternalBeans, createBeanDefinitionForRegistration, defineParameter, defineParameters, defineParameters, forEachBean, forEachBeanType, getParameter, isBeanNameRegistered, lookupBeanDefinition, lookupBeanDefinitions, lookupExistingBeanDefinition, paramManager, registerBean, registerPetiteBean, registerPetiteBean, registerPetiteBean, registerPetiteCtorInjectionPoint, registerPetiteDestroyMethods, registerPetiteInitMethods, registerPetiteMethodInjectionPoint, registerPetitePropertyInjectionPoint, registerPetiteProvider, registerPetiteProvider, registerPetiteSetInjectionPoint, registerScope, removeBean, removeBean, resolveBeanName, resolveBeanNamesForType, resolveScope, scopesCount, setExternalsCache
public static final java.lang.String PETITE_CONTAINER_REF_NAME
addSelf()
,
addSelf(String)
,
Constant Field Valuesprotected final ScopedProxyManager scopedProxyManager
public PetiteContainer()
default configuration
.public PetiteContainer(PetiteConfig config)
provided configuration
.protected java.lang.Object lookupMixingScopedBean(BeanDefinition def, BeanReferences refNames)
public <T> T getBean(java.lang.Class<T> type)
protected java.lang.Object getBean(BeanReferences beanReferences)
null
if bean is not found.public <T> T getBean(java.lang.String name)
createBean(Class)
protected void initBeanDefinition(BeanDefinition def)
protected void registerBeanAndWireAndInjectParamsAndInvokeInitMethods(BeanData beanData)
public void wire(java.lang.Object bean)
public void wire(java.lang.Object bean, WiringMode wiringMode)
public <T> T invokeMethod(java.lang.Object bean, java.lang.reflect.Method method)
public <E> E createBean(java.lang.Class<E> type)
public <E> E createBean(java.lang.Class<E> type, WiringMode wiringMode)
protected java.lang.Object invokeProvider(ProviderDefinition provider)
public void addBean(java.lang.String name, java.lang.Object bean)
public void addBean(java.lang.String name, java.lang.Object bean, WiringMode wiringMode)
public void addSelf(java.lang.String name)
public void addSelf()
public void setBeanProperty(java.lang.String name, java.lang.Object value)
public java.lang.Object getBeanProperty(java.lang.String name)
public PetiteRegistry createContainerRegistry()
PetiteRegistry
helper tool for this container.public void shutdown()
Copyright © 2003-present Jodd Team