SourceForge.net Logo

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

Field Summary
 
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
 
Fields inherited from interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
AUTOWIRE_AUTODETECT, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR
 
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.
 
Methods inherited from interface de.mindmatters.faces.spring.factory.ConfigurableBeanFactory
addInstantiationProcessor
 
Methods inherited from interface org.springframework.beans.factory.config.ConfigurableListableBeanFactory
getBeanDefinition, ignoreDependencyInterface, ignoreDependencyType, preInstantiateSingletons
 
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType
 
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getType, isSingleton
 
Methods inherited from interface org.springframework.beans.factory.config.AutowireCapableBeanFactory
applyBeanPostProcessorsAfterInitialization, applyBeanPostProcessorsBeforeInitialization, applyBeanPropertyValues, autowire, autowireBeanProperties
 
Methods inherited from interface org.springframework.beans.factory.config.ConfigurableBeanFactory
addBeanPostProcessor, containsSingleton, destroySingletons, getBeanPostProcessorCount, registerAlias, registerCustomEditor, registerSingleton, setParentBeanFactory
 
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
getParentBeanFactory
 

Method Detail

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 names
scope - 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 beans
scope - the scope to match, or null for all scopes
createBeanIfNecessary - 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

SourceForge.net Logo

Copyright © 2002 mindmatters GmbH & Co. KG