de.mindmatters.faces.spring.factory.context
Interface ManagedBeanFactory
- All Superinterfaces:
- AutowireCapableBeanFactory, BeanFactory, ConfigurableBeanFactory, ConfigurableBeanFactory, ConfigurableListableBeanFactory, HierarchicalBeanFactory, ListableBeanFactory
- All Known Implementing Classes:
- AbstractManagedBeanFactory
- public interface ManagedBeanFactory
- extends ConfigurableBeanFactory
Creates and caches (corresponding to the faces specific scope definitions)
managed beans declared in a faces configuration file. Implementations should
create non-managed beans in the way described in the Spring docs. Scoping
should be done for all scoped beans (see
ScopedBeanDefinition
)
with the help of the configured
ScopedBeanStorage
(see
setScopedBeanStorage(ScopedBeanStorage)
).
Furthermore this class provides convenience methods for retrieving bean names
and bean types by type and scope. For further information see
getBeansOfType(Class, String, boolean)
and
ListableBeanFactory.getBeanNamesForType(Class, boolean, boolean)
respectively.
- Author:
- Andreas Kuhrwahl
Method Summary |
java.lang.String[] |
getBeanNamesForType(java.lang.Class type,
java.lang.String scope)
Returns the names of beans matching the given type (including subclasses)
and given scope. |
java.util.Map |
getBeansOfType(java.lang.Class type,
java.lang.String scope,
boolean createBeanIfNecessary)
Returns the bean instances that match the given object type (including
subclasses) and given scope. |
void |
setScopedBeanStorage(ScopedBeanStorage scopedBeanStorage)
Sets the appropriate storage to use. |
getBeanNamesForType
public java.lang.String[] getBeanNamesForType(java.lang.Class type,
java.lang.String scope)
- Returns the names of beans matching the given type (including subclasses)
and given scope.
- Parameters:
type
- the class or interface to match, or null
for
all bean namesscope
- the scope to match, or null
for all scopes
- Returns:
- the names of beans matching the given object type (including
subclasses) and given scope, or an empty array if none
getBeansOfType
public java.util.Map getBeansOfType(java.lang.Class type,
java.lang.String scope,
boolean createBeanIfNecessary)
- Returns the bean instances that match the given object type (including
subclasses) and given scope. If the requested beans are not created yet
they will be created if
createBeanIfNecessary
is
true
.
- Parameters:
type
- the class or interface to match, or null
for
all concrete beansscope
- the scope to match, or null
for all scopescreateBeanIfNecessary
- whether to create beans not created yet and return them, or
not
- Returns:
- a Map with the matching beans, containing the bean names as keys
and the corresponding bean instances as values
- Throws:
BeansException
- if a bean could not be created
setScopedBeanStorage
public void setScopedBeanStorage(ScopedBeanStorage scopedBeanStorage)
- Sets the appropriate storage to use.
- Parameters:
scopedBeanStorage
- The scopedBeanStorage to set.- See Also:
ScopedBeanStorage
Copyright © 2002 mindmatters GmbH & Co. KG