Java Doc for ApplicationContextManager.java in  » Testing » unitils » org » unitils » spring » util » 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 » Testing » unitils » org.unitils.spring.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.unitils.spring.util.ApplicationContextManager

ApplicationContextManager
public class ApplicationContextManager extends AnnotatedInstanceManager (Code)
A class for managing and creating Spring application contexts.

todo javadoc
author:
   Tim Ducheyne
author:
   Filip Neven



Field Summary
protected  ApplicationContextFactoryapplicationContextFactory
    
protected  List<Class<? extends BeanPostProcessor>>beanPostProcessorTypes
     List of registered BeanPostProcessor types.
protected  Map<ApplicationContext, Map<Class<? extends BeanPostProcessor>, BeanPostProcessor>>beanPostProcessors
    

Constructor Summary
public  ApplicationContextManager(ApplicationContextFactory applicationContextFactory)
     Creates a new instance, using the given ApplicationContextFactory .

Method Summary
public  voidaddBeanPostProcessorType(Class<? extends BeanPostProcessor> beanPostProcessorType)
    
protected  ApplicationContextcreateInstanceForValues(List<String> locations)
     Creates a new application context for the given locations.
protected  List<String>getAnnotationValues(SpringApplicationContext annotation)
     Gets the locations that are specified for the given SpringApplicationContext annotation.
public  ApplicationContextgetApplicationContext(Object testObject)
     Gets the application context for the given test as described in the class javadoc.
public  TgetBeanPostProcessor(ApplicationContext applicationContext, Class<T> beanPostProcessorType)
    
public  booleanhasApplicationContext(Object testObject)
     Checks whether the given test object has an application context linked to it.
public  voidinvalidateApplicationContext(Class... classes)
     Forces the reloading of the application context the next time that it is requested.
protected  voidregisterBeanPostProcessor(ConfigurableApplicationContext applicationContext, Class<? extends BeanPostProcessor> beanPostProcessorType, BeanPostProcessor beanPostProcessor)
    

Field Detail
applicationContextFactory
protected ApplicationContextFactory applicationContextFactory(Code)
Factory for creating ApplicationContexts



beanPostProcessorTypes
protected List<Class<? extends BeanPostProcessor>> beanPostProcessorTypes(Code)
List of registered BeanPostProcessor types. For each ApplicationContext that is created, a BeanPostProcessor of each of these types is associated with the ApplicationContext



beanPostProcessors
protected Map<ApplicationContext, Map<Class<? extends BeanPostProcessor>, BeanPostProcessor>> beanPostProcessors(Code)




Constructor Detail
ApplicationContextManager
public ApplicationContextManager(ApplicationContextFactory applicationContextFactory)(Code)
Creates a new instance, using the given ApplicationContextFactory . The given list of BeanPostProcessors will be registered on all ApplicationContexts that are created.
Parameters:
  applicationContextFactory - The factory for creating ApplicationContexts, not null.




Method Detail
addBeanPostProcessorType
public void addBeanPostProcessorType(Class<? extends BeanPostProcessor> beanPostProcessorType)(Code)



createInstanceForValues
protected ApplicationContext createInstanceForValues(List<String> locations)(Code)
Creates a new application context for the given locations. The application context factory is used to create the instance. After creating the context, this will also register all BeanPostProcessors and refresh the context.

Note: for this to work, the application context may not have been refreshed in the factory. By registering the bean post processors before the refresh, we can intercept bean creation and bean wiring. This is no longer possible if the context is already refreshed.
Parameters:
  locations - The locations where to find configuration files, not null the context, not null




getAnnotationValues
protected List<String> getAnnotationValues(SpringApplicationContext annotation)(Code)
Gets the locations that are specified for the given SpringApplicationContext annotation. An array with 1 empty string should be considered to be empty and null should be returned.
Parameters:
  annotation - The annotation, not null The locations, null if no values were specified



getApplicationContext
public ApplicationContext getApplicationContext(Object testObject)(Code)
Gets the application context for the given test as described in the class javadoc. A UnitilsException will be thrown if no context could be retrieved or created.
Parameters:
  testObject - The test instance, not null The application context, not null



getBeanPostProcessor
public T getBeanPostProcessor(ApplicationContext applicationContext, Class<T> beanPostProcessorType)(Code)



hasApplicationContext
public boolean hasApplicationContext(Object testObject)(Code)
Checks whether the given test object has an application context linked to it. If true is returned, ApplicationContextManager.getApplicationContext will return an application context, If false is returned, it will raise an exception.
Parameters:
  testObject - The test instance, not null True if an application context is linked



invalidateApplicationContext
public void invalidateApplicationContext(Class... classes)(Code)
Forces the reloading of the application context the next time that it is requested. If classes are given only contexts that are linked to those classes will be reset. If no classes are given, all cached contexts will be reset.
Parameters:
  classes - The classes for which to reset the contexts



registerBeanPostProcessor
protected void registerBeanPostProcessor(ConfigurableApplicationContext applicationContext, Class<? extends BeanPostProcessor> beanPostProcessorType, BeanPostProcessor beanPostProcessor)(Code)



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