@Target(value=TYPE) @Retention(value=RUNTIME) @Documented @Import(value=com.holonplatform.spring.internal.context.BeanFactoryScopeRegistrar.class) public @interface EnableBeanContext
Contextscope using Spring application context (or in exact terms, using the application context
BeanFactory) to provide context resource instances as Spring beans.
When a context resource is requested (using
Context.resource(String, Class)), the scope strategy to provide a
matching Spring bean is defined as follow:
trueand a Spring bean of the required type, ignoring the name, is present and only one candidate is available, this instance is returned.
The Spring BeanFactory behaviour is preserved during beans lookup, so, for example, Spring beans scopes strategy is
applied, just like bean retrieval using
BeanFactory.getBean(String, Class) and similar methods.
|Modifier and Type||Fields and Description|
Property which can be used to configure the
|Modifier and Type||Optional Element and Description|
Whether to lookup context resource bean candidates by type, ignoring bean name, when default lookup by name and type fails.
public static final String LOOKUP_BY_TYPE_PROPERTY_NAME
public abstract boolean lookupByType
trueto lookup context resource bean candidates by type ignoring bean name and context resource key match
Copyright © 2019 The Holon Platform. All rights reserved.