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


org.springframework.context.ConfigurableApplicationContext

All known Subclasses:   org.springframework.context.support.AbstractApplicationContext,
ConfigurableApplicationContext
public interface ConfigurableApplicationContext extends ApplicationContext,Lifecycle(Code)
SPI interface to be implemented by most if not all application contexts. Provides facilities to configure an application context in addition to the application context client methods in the org.springframework.context.ApplicationContext interface.

Configuration and lifecycle methods are encapsulated here to avoid making them obvious to ApplicationContext client code. The present methods should only be used by startup and shutdown code.
author:
   Juergen Hoeller
since:
   03.11.2003





Method Summary
 voidaddApplicationListener(ApplicationListener listener)
     Add a new ApplicationListener that will be notified on context events such as context refresh and context shutdown.

Note that any ApplicationListener registered here will be applied on refresh of this context.

 voidaddBeanFactoryPostProcessor(BeanFactoryPostProcessor beanFactoryPostProcessor)
     Add a new BeanFactoryPostProcessor that will get applied to the internal bean factory of this application context on refresh, before any of the bean definitions get evaluated.
 voidclose()
     Close this application context, releasing all resources and locks that the implementation might hold.
 ConfigurableListableBeanFactorygetBeanFactory()
     Return the internal bean factory of this application context. Can be used to access specific functionality of the underlying factory.

Note: Do not use this to post-process the bean factory; singletons will already have been instantiated before.

 booleanisActive()
     Determine whether this application context is active, that is, whether it has been refreshed at least once and has not been closed yet.
 voidrefresh()
     Load or refresh the persistent representation of the configuration, which might an XML file, properties file, or relational database schema.

As this is a startup method, it should destroy already created singletons if it fails, to avoid dangling resources.

 voidregisterShutdownHook()
     Register a shutdown hook with the JVM runtime, closing this context on JVM shutdown unless it has already been closed at that time.

This method can be called multiple times.

 voidsetParent(ApplicationContext parent)
     Set the parent of this application context.



Method Detail
addApplicationListener
void addApplicationListener(ApplicationListener listener)(Code)
Add a new ApplicationListener that will be notified on context events such as context refresh and context shutdown.

Note that any ApplicationListener registered here will be applied on refresh of this context. If a listener is added after the initial refresh, it will be applied on next refresh of the context.
Parameters:
  listener - the ApplicationListener to register
See Also:   org.springframework.context.event.ContextRefreshedEvent
See Also:   org.springframework.context.event.ContextClosedEvent




addBeanFactoryPostProcessor
void addBeanFactoryPostProcessor(BeanFactoryPostProcessor beanFactoryPostProcessor)(Code)
Add a new BeanFactoryPostProcessor that will get applied to the internal bean factory of this application context on refresh, before any of the bean definitions get evaluated. To be invoked during context configuration.
Parameters:
  beanFactoryPostProcessor - the factory processor to register



close
void close()(Code)
Close this application context, releasing all resources and locks that the implementation might hold. This includes destroying all cached singleton beans.

Note: Does not invoke close on a parent context; parent contexts have their own, independent lifecycle.

This method can be called multiple times without side effects: Subsequent close calls on an already closed context will be ignored.




getBeanFactory
ConfigurableListableBeanFactory getBeanFactory() throws IllegalStateException(Code)
Return the internal bean factory of this application context. Can be used to access specific functionality of the underlying factory.

Note: Do not use this to post-process the bean factory; singletons will already have been instantiated before. Use a BeanFactoryPostProcessor to intercept the BeanFactory setup process before beans get touched.

Generally, this internal factory will only be accessible while the context is active, that is, inbetween ConfigurableApplicationContext.refresh() and ConfigurableApplicationContext.close() . The ConfigurableApplicationContext.isActive() flag can be used to check whether the context is in an appropriate state. the underlying bean factory
throws:
  IllegalStateException - if the context does not hold an internalbean factory (usually if ConfigurableApplicationContext.refresh() hasn't been called yet orif ConfigurableApplicationContext.close() has already been called)
See Also:   ConfigurableApplicationContext.isActive()
See Also:   ConfigurableApplicationContext.refresh()
See Also:   ConfigurableApplicationContext.close()
See Also:   ConfigurableApplicationContext.addBeanFactoryPostProcessor




isActive
boolean isActive()(Code)
Determine whether this application context is active, that is, whether it has been refreshed at least once and has not been closed yet. whether the context is still active
See Also:   ConfigurableApplicationContext.refresh()
See Also:   ConfigurableApplicationContext.close()
See Also:   ConfigurableApplicationContext.getBeanFactory()



refresh
void refresh() throws BeansException, IllegalStateException(Code)
Load or refresh the persistent representation of the configuration, which might an XML file, properties file, or relational database schema.

As this is a startup method, it should destroy already created singletons if it fails, to avoid dangling resources. In other words, after invocation of that method, either all or no singletons at all should be instantiated.
throws:
  BeansException - if the bean factory could not be initialized
throws:
  IllegalStateException - if already initialized and multiple refreshattempts are not supported




registerShutdownHook
void registerShutdownHook()(Code)
Register a shutdown hook with the JVM runtime, closing this context on JVM shutdown unless it has already been closed at that time.

This method can be called multiple times. Only one shutdown hook (at max) will be registered for each context instance.
See Also:   java.lang.Runtime.addShutdownHook
See Also:   ConfigurableApplicationContext.close()




setParent
void setParent(ApplicationContext parent)(Code)
Set the parent of this application context.

Note that the parent shouldn't be changed: It should only be set outside a constructor if it isn't available when an object of this class is created, for example in case of WebApplicationContext setup.
Parameters:
  parent - the parent context
See Also:   org.springframework.web.context.ConfigurableWebApplicationContext




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