Java Doc for ConfigurableBeanFactory.java in  » J2EE » spring-framework-2.5 » org » springframework » beans » factory » config » 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.5 » org.springframework.beans.factory.config 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.springframework.beans.factory.config.ConfigurableBeanFactory

ConfigurableBeanFactory
public interface ConfigurableBeanFactory extends HierarchicalBeanFactory,SingletonBeanRegistry(Code)
Configuration interface to be implemented by most bean factories. Provides facilities to configure a bean factory, in addition to the bean factory client methods in the org.springframework.beans.factory.BeanFactory interface.

This bean factory interface is not meant to be used in normal application code: Stick to org.springframework.beans.factory.BeanFactory or org.springframework.beans.factory.ListableBeanFactory for typical needs. This extended interface is just meant to allow for framework-internal plug'n'play and for special access to bean factory configuration methods.
author:
   Juergen Hoeller
since:
   03.11.2003
See Also:   org.springframework.beans.factory.BeanFactory
See Also:   org.springframework.beans.factory.ListableBeanFactory
See Also:   ConfigurableListableBeanFactory



Field Summary
 StringSCOPE_PROTOTYPE
     Scope identifier for the standard prototype scope: "prototype".
 StringSCOPE_SINGLETON
     Scope identifier for the standard singleton scope: "singleton".


Method Summary
 voidaddBeanPostProcessor(BeanPostProcessor beanPostProcessor)
     Add a new BeanPostProcessor that will get applied to beans created by this factory.
 voidaddPropertyEditorRegistrar(PropertyEditorRegistrar registrar)
     Add a PropertyEditorRegistrar to be applied to all bean creation processes.

Such a registrar creates new PropertyEditor instances and registers them on the given registry, fresh for each bean creation attempt.

 voidcopyConfigurationFrom(ConfigurableBeanFactory otherFactory)
     Copy all relevant configuration from the given other factory.
 voiddestroyBean(String beanName, Object beanInstance)
     Destroy the given bean instance (usually a prototype instance obtained from this factory) according to its bean definition.
 voiddestroyScopedBean(String beanName)
     Destroy the specified scoped bean in the current target scope, if any.
 voiddestroySingletons()
     Destroy all singleton beans in this factory, including inner beans that have been registered as disposable.
 ClassLoadergetBeanClassLoader()
     Return this factory's class loader for loading bean classes.
 intgetBeanPostProcessorCount()
     Return the current number of registered BeanPostProcessors, if any.
 String[]getDependenciesForBean(String beanName)
     Return the names of all beans that the specified bean depends on, if any.
 String[]getDependentBeans(String beanName)
     Return the names of all beans which depend on the specified bean, if any.
 BeanDefinitiongetMergedBeanDefinition(String beanName)
     Return a merged BeanDefinition for the given bean name, merging a child bean definition with its parent if necessary.
 ScopegetRegisteredScope(String scopeName)
     Return the Scope implementation for the given scope name, if any.
 String[]getRegisteredScopeNames()
     Return the names of all currently registered scopes.
 ClassLoadergetTempClassLoader()
     Return the temporary ClassLoader to use for type matching purposes, if any.
 TypeConvertergetTypeConverter()
     Obtain a type converter as used by this BeanFactory.
 booleanisCacheBeanMetadata()
     Return whether to cache bean metadata such as given bean definitions (in merged fashion) and resolved bean classes.
 booleanisCurrentlyInCreation(String beanName)
     Determine whether the specified bean is currently in creation.
 booleanisFactoryBean(String name)
     Determine whether the bean with the given name is a FactoryBean.
 voidregisterAlias(String beanName, String alias)
     Given a bean name, create an alias.
 voidregisterCustomEditor(Class requiredType, PropertyEditor propertyEditor)
     Register the given custom property editor for all properties of the given type.
 voidregisterDependentBean(String beanName, String dependentBeanName)
     Register a dependent bean for the given bean, to be destroyed before the given bean is destroyed.
 voidregisterScope(String scopeName, Scope scope)
     Register the given scope, backed by the given Scope implementation.
 voidresolveAliases(StringValueResolver valueResolver)
     Resolve all alias target names and aliases registered in this factory, applying the given StringValueResolver to them.
 voidsetBeanClassLoader(ClassLoader beanClassLoader)
     Set the class loader to use for loading bean classes. Default is the thread context class loader.

Note that this class loader will only apply to bean definitions that do not carry a resolved bean class yet.

 voidsetCacheBeanMetadata(boolean cacheBeanMetadata)
     Set whether to cache bean metadata such as given bean definitions (in merged fashion) and resolved bean classes.
 voidsetParentBeanFactory(BeanFactory parentBeanFactory)
     Set the parent of this bean factory.
 voidsetTempClassLoader(ClassLoader tempClassLoader)
     Specify a temporary ClassLoader to use for type matching purposes. Default is none, simply using the standard bean ClassLoader.

A temporary ClassLoader is usually just specified if load-time weaving is involved, to make sure that actual bean classes are loaded as lazily as possible.

 voidsetTypeConverter(TypeConverter typeConverter)
     Set a custom type converter that this BeanFactory should use for converting bean property values, constructor argument values, etc.

Field Detail
SCOPE_PROTOTYPE
String SCOPE_PROTOTYPE(Code)
Scope identifier for the standard prototype scope: "prototype". Custom scopes can be added via registerScope.
See Also:   ConfigurableBeanFactory.registerScope



SCOPE_SINGLETON
String SCOPE_SINGLETON(Code)
Scope identifier for the standard singleton scope: "singleton". Custom scopes can be added via registerScope.
See Also:   ConfigurableBeanFactory.registerScope





Method Detail
addBeanPostProcessor
void addBeanPostProcessor(BeanPostProcessor beanPostProcessor)(Code)
Add a new BeanPostProcessor that will get applied to beans created by this factory. To be invoked during factory configuration.
Parameters:
  beanPostProcessor - the bean processor to register



addPropertyEditorRegistrar
void addPropertyEditorRegistrar(PropertyEditorRegistrar registrar)(Code)
Add a PropertyEditorRegistrar to be applied to all bean creation processes.

Such a registrar creates new PropertyEditor instances and registers them on the given registry, fresh for each bean creation attempt. This avoids the need for synchronization on custom editors; hence, it is generally preferable to use this method instead of ConfigurableBeanFactory.registerCustomEditor .
Parameters:
  registrar - the PropertyEditorRegistrar to register




copyConfigurationFrom
void copyConfigurationFrom(ConfigurableBeanFactory otherFactory)(Code)
Copy all relevant configuration from the given other factory.

Should include all standard configuration settings as well as BeanPostProcessors, Scopes, and factory-specific internal settings. Should not include any metadata of actual bean definitions, such as BeanDefinition objects and bean name aliases.
Parameters:
  otherFactory - the other BeanFactory to copy from




destroyBean
void destroyBean(String beanName, Object beanInstance)(Code)
Destroy the given bean instance (usually a prototype instance obtained from this factory) according to its bean definition.

Any exception that arises during destruction should be caught and logged instead of propagated to the caller of this method.
Parameters:
  beanName - the name of the bean definition
Parameters:
  beanInstance - the bean instance to destroy




destroyScopedBean
void destroyScopedBean(String beanName)(Code)
Destroy the specified scoped bean in the current target scope, if any.

Any exception that arises during destruction should be caught and logged instead of propagated to the caller of this method.
Parameters:
  beanName - the name of the scoped bean




destroySingletons
void destroySingletons()(Code)
Destroy all singleton beans in this factory, including inner beans that have been registered as disposable. To be called on shutdown of a factory.

Any exception that arises during destruction should be caught and logged instead of propagated to the caller of this method.




getBeanClassLoader
ClassLoader getBeanClassLoader()(Code)
Return this factory's class loader for loading bean classes.



getBeanPostProcessorCount
int getBeanPostProcessorCount()(Code)
Return the current number of registered BeanPostProcessors, if any.



getDependenciesForBean
String[] getDependenciesForBean(String beanName)(Code)
Return the names of all beans that the specified bean depends on, if any.
Parameters:
  beanName - the name of the bean the array of names of beans which the bean depends on,or an empty array if none



getDependentBeans
String[] getDependentBeans(String beanName)(Code)
Return the names of all beans which depend on the specified bean, if any.
Parameters:
  beanName - the name of the bean the array of dependent bean names, or an empty array if none



getMergedBeanDefinition
BeanDefinition getMergedBeanDefinition(String beanName) throws NoSuchBeanDefinitionException(Code)
Return a merged BeanDefinition for the given bean name, merging a child bean definition with its parent if necessary. Considers bean definitions in ancestor factories as well.
Parameters:
  beanName - the name of the bean to retrieve the merged definition for a (potentially merged) BeanDefinition for the given bean
throws:
  NoSuchBeanDefinitionException - if there is no bean definition with the given name



getRegisteredScope
Scope getRegisteredScope(String scopeName)(Code)
Return the Scope implementation for the given scope name, if any.

This will only return explicitly registered scopes. Built-in scopes such as "singleton" and "prototype" won't be exposed.
Parameters:
  scopeName - the name of the scope the registered Scope implementation, or null if none
See Also:   ConfigurableBeanFactory.registerScope




getRegisteredScopeNames
String[] getRegisteredScopeNames()(Code)
Return the names of all currently registered scopes.

This will only return the names of explicitly registered scopes. Built-in scopes such as "singleton" and "prototype" won't be exposed. the array of scope names, or an empty array if none
See Also:   ConfigurableBeanFactory.registerScope




getTempClassLoader
ClassLoader getTempClassLoader()(Code)
Return the temporary ClassLoader to use for type matching purposes, if any.



getTypeConverter
TypeConverter getTypeConverter()(Code)
Obtain a type converter as used by this BeanFactory. This may be a fresh instance for each call, since TypeConverters are usually not thread-safe.

If the default PropertyEditor mechanism is active, the returned TypeConverter will be aware of all custom editors that have been registered.




isCacheBeanMetadata
boolean isCacheBeanMetadata()(Code)
Return whether to cache bean metadata such as given bean definitions (in merged fashion) and resolved bean classes.



isCurrentlyInCreation
boolean isCurrentlyInCreation(String beanName)(Code)
Determine whether the specified bean is currently in creation.
Parameters:
  beanName - the name of the bean whether the bean is currently in creation



isFactoryBean
boolean isFactoryBean(String name) throws NoSuchBeanDefinitionException(Code)
Determine whether the bean with the given name is a FactoryBean.
Parameters:
  name - the name of the bean to check whether the bean is a FactoryBean(false means the bean exists but is not a FactoryBean)
throws:
  NoSuchBeanDefinitionException - if there is no bean with the given name



registerAlias
void registerAlias(String beanName, String alias) throws BeanDefinitionStoreException(Code)
Given a bean name, create an alias. We typically use this method to support names that are illegal within XML ids (used for bean names).

Typically invoked during factory configuration, but can also be used for runtime registration of aliases. Therefore, a factory implementation should synchronize alias access.
Parameters:
  beanName - the canonical name of the target bean
Parameters:
  alias - the alias to be registered for the bean
throws:
  BeanDefinitionStoreException - if the alias is already in use




registerCustomEditor
void registerCustomEditor(Class requiredType, PropertyEditor propertyEditor)(Code)
Register the given custom property editor for all properties of the given type. To be invoked during factory configuration.

Note that this method will register a shared custom editor instance; access to that instance will be synchronized for thread-safety. It is generally prefable to use ConfigurableBeanFactory.addPropertyEditorRegistrar instead of this method, to avoid for the need for synchronization on custom editors.
Parameters:
  requiredType - type of the property
Parameters:
  propertyEditor - editor to registerConfigurableBeanFactory.addPropertyEditorRegistrar




registerDependentBean
void registerDependentBean(String beanName, String dependentBeanName)(Code)
Register a dependent bean for the given bean, to be destroyed before the given bean is destroyed.
Parameters:
  beanName - the name of the bean
Parameters:
  dependentBeanName - the name of the dependent bean



registerScope
void registerScope(String scopeName, Scope scope)(Code)
Register the given scope, backed by the given Scope implementation.
Parameters:
  scopeName - the scope identifier
Parameters:
  scope - the backing Scope implementation



resolveAliases
void resolveAliases(StringValueResolver valueResolver)(Code)
Resolve all alias target names and aliases registered in this factory, applying the given StringValueResolver to them.

The value resolver may for example resolve placeholders in target bean names and even in alias names.
Parameters:
  valueResolver - the StringValueResolver to apply




setBeanClassLoader
void setBeanClassLoader(ClassLoader beanClassLoader)(Code)
Set the class loader to use for loading bean classes. Default is the thread context class loader.

Note that this class loader will only apply to bean definitions that do not carry a resolved bean class yet. This is the case as of Spring 2.0 by default: Bean definitions only carry bean class names, to be resolved once the factory processes the bean definition.
Parameters:
  beanClassLoader - the class loader to use,or null to suggest the default class loader




setCacheBeanMetadata
void setCacheBeanMetadata(boolean cacheBeanMetadata)(Code)
Set whether to cache bean metadata such as given bean definitions (in merged fashion) and resolved bean classes. Default is on.

Turn this flag off to enable hot-refreshing of bean definition objects and in particular bean classes. If this flag is off, any creation of a bean instance will re-query the bean class loader for newly resolved classes.




setParentBeanFactory
void setParentBeanFactory(BeanFactory parentBeanFactory) throws IllegalStateException(Code)
Set the parent of this bean factory.

Note that the parent cannot be changed: It should only be set outside a constructor if it isn't available at the time of factory instantiation.
Parameters:
  parentBeanFactory - the parent BeanFactory
throws:
  IllegalStateException - if this factory is already associated witha parent BeanFactory
See Also:   ConfigurableBeanFactory.getParentBeanFactory()




setTempClassLoader
void setTempClassLoader(ClassLoader tempClassLoader)(Code)
Specify a temporary ClassLoader to use for type matching purposes. Default is none, simply using the standard bean ClassLoader.

A temporary ClassLoader is usually just specified if load-time weaving is involved, to make sure that actual bean classes are loaded as lazily as possible. The temporary loader is then removed once the BeanFactory completes its bootstrap phase.




setTypeConverter
void setTypeConverter(TypeConverter typeConverter)(Code)
Set a custom type converter that this BeanFactory should use for converting bean property values, constructor argument values, etc.

This will override the default PropertyEditor mechanism and hence make any custom editors or custom editor registrars irrelevant.
See Also:   ConfigurableBeanFactory.addPropertyEditorRegistrar
See Also:   ConfigurableBeanFactory.registerCustomEditor




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