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


org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor

All known Subclasses:   org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator,  org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor,
InstantiationAwareBeanPostProcessor
public interface InstantiationAwareBeanPostProcessor extends BeanPostProcessor(Code)
Subinterface of BeanPostProcessor that adds a before-instantiation callback, and a callback after instantiation but before explicit properties are set or autowiring occurs.

Typically used to suppress default instantiation for specific target beans, for example to create proxies with special TargetSources (pooling targets, lazily initializing targets, etc), or to implement additional injection strategies such as field injection.

NOTE: This interface is a special purpose interface, mainly for internal use within the framework. It is recommended to implement the plain BeanPostProcessor interface as far as possible, or to derive from InstantiationAwareBeanPostProcessorAdapter in order to be shielded from extensions to this interface.
author:
   Juergen Hoeller
author:
   Rod Johnson
since:
   1.2
See Also:   org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.setCustomTargetSourceCreators
See Also:   org.springframework.aop.framework.autoproxy.target.LazyInitTargetSourceCreator





Method Summary
 booleanpostProcessAfterInstantiation(Object bean, String beanName)
     Perform operations after the bean has been instantiated, via a constructor or factory method, but before Spring property population (from explicit properties or autowiring) occurs.
Parameters:
  bean - the bean instance created, but whose properties have not yet been set
Parameters:
  beanName - the name of the bean true if properties should be set on the bean; falseif property population should be skipped.
 ObjectpostProcessBeforeInstantiation(Class beanClass, String beanName)
     Apply this BeanPostProcessor before the target bean gets instantiated. The returned bean object may be a proxy to use instead of the target bean, effectively suppressing default instantiation of the target bean.

If a non-null object is returned by this method, the bean creation process will be short-circuited.

 PropertyValuespostProcessPropertyValues(PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName)
     Post-process the given property values before the factory applies them to the given bean.



Method Detail
postProcessAfterInstantiation
boolean postProcessAfterInstantiation(Object bean, String beanName) throws BeansException(Code)
Perform operations after the bean has been instantiated, via a constructor or factory method, but before Spring property population (from explicit properties or autowiring) occurs.
Parameters:
  bean - the bean instance created, but whose properties have not yet been set
Parameters:
  beanName - the name of the bean true if properties should be set on the bean; falseif property population should be skipped. Normal implementations should return true.Returning false will also prevent any subsequent InstantiationAwareBeanPostProcessorinstances being invoked on this bean instance.
throws:
  org.springframework.beans.BeansException - in case of errors



postProcessBeforeInstantiation
Object postProcessBeforeInstantiation(Class beanClass, String beanName) throws BeansException(Code)
Apply this BeanPostProcessor before the target bean gets instantiated. The returned bean object may be a proxy to use instead of the target bean, effectively suppressing default instantiation of the target bean.

If a non-null object is returned by this method, the bean creation process will be short-circuited. The only further processing applied is the InstantiationAwareBeanPostProcessor.postProcessAfterInitialization callback from the configured BeanPostProcessor BeanPostProcessors .

This callback will only be applied to bean definitions with a bean class. In particular, it will not be applied to beans with a "factory-method".

Post-processors may implement the extended SmartInstantiationAwareBeanPostProcessor interface in order to predict the type of the bean object that they are going to return here.
Parameters:
  beanClass - the class of the bean to be instantiated
Parameters:
  beanName - the name of the bean the bean object to expose instead of a default instance of the target bean,or null to proceed with default instantiation
throws:
  org.springframework.beans.BeansException - in case of errors
See Also:   org.springframework.beans.factory.support.AbstractBeanDefinition.hasBeanClass
See Also:   org.springframework.beans.factory.support.AbstractBeanDefinition.getFactoryMethodName




postProcessPropertyValues
PropertyValues postProcessPropertyValues(PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName) throws BeansException(Code)
Post-process the given property values before the factory applies them to the given bean. Allows for checking whether all dependencies have been satisfied, for example based on a "Required" annotation on bean property setters.

Also allows for replacing the property values to apply, typically through creating a new MutablePropertyValues instance based on the original PropertyValues, adding or removing specific values.
Parameters:
  pvs - the property values that the factory is about to apply (never null)
Parameters:
  pds - the relevant property descriptors for the target bean (with ignoreddependency types - which the factory handles specifically - already filtered out)
Parameters:
  bean - the bean instance created, but whose properties have not yet been set
Parameters:
  beanName - the name of the bean the actual property values to apply to to the given bean(can be the passed-in PropertyValues instance), or nullto skip property population
throws:
  org.springframework.beans.BeansException - in case of errors
See Also:   org.springframework.beans.MutablePropertyValues




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