Java Doc for ListableBeanFactory.java in  » J2EE » spring-framework-2.0.6 » org » springframework » beans » factory » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » spring framework 2.0.6 » org.springframework.beans.factory 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.springframework.beans.factory.ListableBeanFactory

All known Subclasses:   org.springframework.beans.factory.support.StaticListableBeanFactory,
ListableBeanFactory
public interface ListableBeanFactory extends BeanFactory(Code)
Extension of the BeanFactory interface to be implemented by bean factories that can enumerate all their bean instances, rather than attempting bean lookup by name one by one as requested by clients. BeanFactory implementations that preload all their bean definitions (such as XML-based factories) may implement this interface.

If this is a HierarchicalBeanFactory , the return values will not take any BeanFactory hierarchy into account, but will relate only to the beans defined in the current factory. Use the BeanFactoryUtils helper class to consider beans in ancestor factories too.

The methods in this interface will just respect bean definitions of this factory. They will ignore any singleton beans that have been registered by other means like org.springframework.beans.factory.config.ConfigurableBeanFactory 's registerSingleton method, with the exception of getBeanNamesOfType and getBeansOfType which will check such manually registered singletons too. Of course, BeanFactory's getBean does allow transparent access to such special beans as well. However, in typical scenarios, all beans will be defined by external bean definitions anyway, so most applications don't need to worry about this differentation.

NOTE: With the exception of getBeanDefinitionCount and containsBeanDefinition, the methods in this interface are not designed for frequent invocation. Implementations may be slow.
author:
   Rod Johnson
author:
   Juergen Hoeller
since:
   16 April 2001
See Also:   HierarchicalBeanFactory
See Also:   BeanFactoryUtils





Method Summary
 booleancontainsBeanDefinition(String beanName)
     Check if this bean factory contains a bean definition with the given name.
 intgetBeanDefinitionCount()
     Return the number of beans defined in the factory.
 String[]getBeanDefinitionNames()
     Return the names of all beans defined in this factory.
 String[]getBeanNamesForType(Class type)
     Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans, which means that FactoryBeans will get initialized.

 String[]getBeanNamesForType(Class type, boolean includePrototypes, boolean allowEagerInit)
     Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set, which means that FactoryBeans will get initialized.

 MapgetBeansOfType(Class type)
     Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans, which means that FactoryBeans will get initialized.

 MapgetBeansOfType(Class type, boolean includePrototypes, boolean allowEagerInit)
     Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set, which means that FactoryBeans will get initialized.




Method Detail
containsBeanDefinition
boolean containsBeanDefinition(String beanName)(Code)
Check if this bean factory contains a bean definition with the given name.

Does not consider any hierarchy this factory may participate in, and ignores any singleton beans that have been registered by other means than bean definitions.
Parameters:
  beanName - the name of the bean to look for if this bean factory contains a bean definition with the given name
See Also:   ListableBeanFactory.containsBean




getBeanDefinitionCount
int getBeanDefinitionCount()(Code)
Return the number of beans defined in the factory.

Does not consider any hierarchy this factory may participate in, and ignores any singleton beans that have been registered by other means than bean definitions. the number of beans defined in the factory




getBeanDefinitionNames
String[] getBeanDefinitionNames()(Code)
Return the names of all beans defined in this factory.

Does not consider any hierarchy this factory may participate in, and ignores any singleton beans that have been registered by other means than bean definitions. the names of all beans defined in this factory,or an empty array if none defined




getBeanNamesForType
String[] getBeanNamesForType(Class type)(Code)
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type.

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' beanNamesForTypeIncludingAncestors to include beans in ancestor factories too.

Note: Does not ignore singleton beans that have been registered by other means than bean definitions.

This version of getBeanNamesForType matches all kinds of beans, be it singletons, prototypes, or FactoryBeans. In most implementations, the result will be the same as for getBeanNamesOfType(type, true, true).

Bean names returned by this method should always return bean names in the order of definition in the backend configuration, as far as possible.
Parameters:
  type - the class or interface to match, or null for all bean names the names of beans (or objects created by FactoryBeans) matchingthe given object type (including subclasses), or an empty array if none
See Also:   FactoryBean.getObjectType
See Also:   BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ListableBeanFactoryClass)




getBeanNamesForType
String[] getBeanNamesForType(Class type, boolean includePrototypes, boolean allowEagerInit)(Code)
Return the names of beans matching the given type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type. If "allowEagerInit" is not set, only raw FactoryBeans will be checked (which doesn't require initialization of each FactoryBean). $ *

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' beanNamesForTypeIncludingAncestors to include beans in ancestor factories too.

Note: Does not ignore singleton beans that have been registered by other means than bean definitions.

Bean names returned by this method should always return bean names in the order of definition in the backend configuration, as far as possible.
Parameters:
  type - the class or interface to match, or null for all bean names
Parameters:
  includePrototypes - whether to include prototype beans tooor just singletons (also applies to FactoryBeans)
Parameters:
  allowEagerInit - whether to initialize lazy-init singletons andobjects created by FactoryBeans (or by factory methods with a"factory-bean" reference) for the type check. Note that FactoryBeans need to beeagerly initialized to determine their type: So be aware that passing in "true"for this flag will initialize FactoryBeans and "factory-bean" references. the names of beans (or objects created by FactoryBeans) matchingthe given object type (including subclasses), or an empty array if none
See Also:   FactoryBean.getObjectType
See Also:   BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ListableBeanFactoryClassbooleanboolean)




getBeansOfType
Map getBeansOfType(Class type) throws BeansException(Code)
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type.

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' beansOfTypeIncludingAncestors to include beans in ancestor factories too.

Note: Does not ignore singleton beans that have been registered by other means than bean definitions.

This version of getBeansOfType matches all kinds of beans, be it singletons, prototypes, or FactoryBeans. In most implementations, the result will be the same as for getBeansOfType(type, true, true).

The Map returned by this method should always return bean names and corresponding bean instances in the order of definition in the backend configuration, as far as possible. This will usually mean that either JDK 1.4 or Commons Collections needs to be available.
Parameters:
  type - the class or interface to match, or null for all concrete beans a Map with the matching beans, containing the bean names askeys and the corresponding bean instances as values
throws:
  BeansException - if a bean could not be created
since:
   1.1.2
See Also:   FactoryBean.getObjectType
See Also:   BeanFactoryUtils.beansOfTypeIncludingAncestors(ListableBeanFactoryClass)




getBeansOfType
Map getBeansOfType(Class type, boolean includePrototypes, boolean allowEagerInit) throws BeansException(Code)
Return the bean instances that match the given object type (including subclasses), judging from either bean definitions or the value of getObjectType in the case of FactoryBeans.

NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.

Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set, which means that FactoryBeans will get initialized. If the object created by the FactoryBean doesn't match, the raw FactoryBean itself will be matched against the type. If "allowEagerInit" is not set, only raw FactoryBeans will be checked (which doesn't require initialization of each FactoryBean).

Does not consider any hierarchy this factory may participate in. Use BeanFactoryUtils' beansOfTypeIncludingAncestors to include beans in ancestor factories too.

Note: Does not ignore singleton beans that have been registered by other means than bean definitions.

The Map returned by this method should always return bean names and corresponding bean instances in the order of definition in the backend configuration, as far as possible. This will usually mean that either JDK 1.4 or Commons Collections needs to be available.
Parameters:
  type - the class or interface to match, or null for all concrete beans
Parameters:
  includePrototypes - whether to include prototype beans tooor just singletons (also applies to FactoryBeans)
Parameters:
  allowEagerInit - whether to initialize lazy-init singletons andobjects created by FactoryBeans (or by factory methods with a"factory-bean" reference) for the type check. Note that FactoryBeans need to beeagerly initialized to determine their type: So be aware that passing in "true"for this flag will initialize FactoryBeans and "factory-bean" references. a Map with the matching beans, containing the bean names askeys and the corresponding bean instances as values
throws:
  BeansException - if a bean could not be created
See Also:   FactoryBean.getObjectType
See Also:   BeanFactoryUtils.beansOfTypeIncludingAncestors(ListableBeanFactoryClassbooleanboolean)




www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.