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


org.springframework.context.support.AbstractApplicationContext
   org.springframework.context.support.AbstractRefreshableApplicationContext
      org.springframework.context.support.AbstractXmlApplicationContext
         org.springframework.context.support.ClassPathXmlApplicationContext

ClassPathXmlApplicationContext
public class ClassPathXmlApplicationContext extends AbstractXmlApplicationContext (Code)
Standalone XML application context, taking the context definition files from the class path, interpreting plain paths as class path resource names that include the package path (e.g. "mypackage/myresource.txt"). Useful for test harnesses as well as for application contexts embedded within JARs.

The config location defaults can be overridden via ClassPathXmlApplicationContext.getConfigLocations , Config locations can either denote concrete files like "/myfiles/context.xml" or Ant-style patterns like "/myfiles/*-context.xml" (see the org.springframework.util.AntPathMatcher javadoc for pattern details).

Note: In case of multiple config locations, later bean definitions will override ones defined in earlier loaded files. This can be leveraged to deliberately override certain bean definitions via an extra XML file.

This is a simple, one-stop shop convenience ApplicationContext. Consider using the GenericApplicationContext class in combination with an org.springframework.beans.factory.xml.XmlBeanDefinitionReader for more flexible context setup.
author:
   Rod Johnson
author:
   Juergen Hoeller
See Also:   ClassPathXmlApplicationContext.getResource
See Also:   ClassPathXmlApplicationContext.getResourceByPath
See Also:   GenericApplicationContext




Constructor Summary
public  ClassPathXmlApplicationContext(String configLocation)
     Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML file and automatically refreshing the context.
public  ClassPathXmlApplicationContext(String[] configLocations)
     Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML files and automatically refreshing the context.
public  ClassPathXmlApplicationContext(String[] configLocations, ApplicationContext parent)
     Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files and automatically refreshing the context.
public  ClassPathXmlApplicationContext(String[] configLocations, boolean refresh)
     Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML files.
public  ClassPathXmlApplicationContext(String[] configLocations, boolean refresh, ApplicationContext parent)
     Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files.
public  ClassPathXmlApplicationContext(String path, Class clazz)
     Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML file and automatically refreshing the context.

This is a convenience method to load class path resources relative to a given Class.

public  ClassPathXmlApplicationContext(String[] paths, Class clazz)
     Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML files and automatically refreshing the context.
public  ClassPathXmlApplicationContext(String[] paths, Class clazz, ApplicationContext parent)
     Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files and automatically refreshing the context.

Method Summary
protected  String[]getConfigLocations()
    
protected  Resource[]getConfigResources()
    


Constructor Detail
ClassPathXmlApplicationContext
public ClassPathXmlApplicationContext(String configLocation) throws BeansException(Code)
Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML file and automatically refreshing the context.
Parameters:
  configLocation - resource location
throws:
  BeansException - if context creation failed



ClassPathXmlApplicationContext
public ClassPathXmlApplicationContext(String[] configLocations) throws BeansException(Code)
Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML files and automatically refreshing the context.
Parameters:
  configLocations - array of resource locations
throws:
  BeansException - if context creation failed



ClassPathXmlApplicationContext
public ClassPathXmlApplicationContext(String[] configLocations, ApplicationContext parent) throws BeansException(Code)
Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files and automatically refreshing the context.
Parameters:
  configLocations - array of resource locations
Parameters:
  parent - the parent context
throws:
  BeansException - if context creation failed



ClassPathXmlApplicationContext
public ClassPathXmlApplicationContext(String[] configLocations, boolean refresh) throws BeansException(Code)
Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML files.
Parameters:
  configLocations - array of resource locations
Parameters:
  refresh - whether to automatically refresh the context,loading all bean definitions and creating all singletons.Alternatively, call refresh manually after further configuring the context.
throws:
  BeansException - if context creation failed
See Also:   ClassPathXmlApplicationContext.refresh()



ClassPathXmlApplicationContext
public ClassPathXmlApplicationContext(String[] configLocations, boolean refresh, ApplicationContext parent) throws BeansException(Code)
Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files.
Parameters:
  configLocations - array of resource locations
Parameters:
  refresh - whether to automatically refresh the context,loading all bean definitions and creating all singletons.Alternatively, call refresh manually after further configuring the context.
Parameters:
  parent - the parent context
throws:
  BeansException - if context creation failed
See Also:   ClassPathXmlApplicationContext.refresh()



ClassPathXmlApplicationContext
public ClassPathXmlApplicationContext(String path, Class clazz) throws BeansException(Code)
Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML file and automatically refreshing the context.

This is a convenience method to load class path resources relative to a given Class. For full flexibility, consider using a GenericApplicationContext with an XmlBeanDefinitionReader and a ClassPathResource argument.
Parameters:
  path - relative (or absolute) path within the class path
Parameters:
  clazz - the class to load resources with (basis for the given paths)
throws:
  BeansException - if context creation failed
See Also:   org.springframework.core.io.ClassPathResource.ClassPathResource(StringClass)
See Also:   org.springframework.context.support.GenericApplicationContext
See Also:   org.springframework.beans.factory.xml.XmlBeanDefinitionReader




ClassPathXmlApplicationContext
public ClassPathXmlApplicationContext(String[] paths, Class clazz) throws BeansException(Code)
Create a new ClassPathXmlApplicationContext, loading the definitions from the given XML files and automatically refreshing the context.
Parameters:
  paths - array of relative (or absolute) paths within the class path
Parameters:
  clazz - the class to load resources with (basis for the given paths)
throws:
  BeansException - if context creation failed
See Also:   org.springframework.core.io.ClassPathResource.ClassPathResource(StringClass)
See Also:   org.springframework.context.support.GenericApplicationContext
See Also:   org.springframework.beans.factory.xml.XmlBeanDefinitionReader



ClassPathXmlApplicationContext
public ClassPathXmlApplicationContext(String[] paths, Class clazz, ApplicationContext parent) throws BeansException(Code)
Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files and automatically refreshing the context.
Parameters:
  paths - array of relative (or absolute) paths within the class path
Parameters:
  clazz - the class to load resources with (basis for the given paths)
Parameters:
  parent - the parent context
throws:
  BeansException - if context creation failed
See Also:   org.springframework.core.io.ClassPathResource.ClassPathResource(StringClass)
See Also:   org.springframework.context.support.GenericApplicationContext
See Also:   org.springframework.beans.factory.xml.XmlBeanDefinitionReader




Method Detail
getConfigLocations
protected String[] getConfigLocations()(Code)



getConfigResources
protected Resource[] getConfigResources()(Code)



Methods inherited from org.springframework.context.support.AbstractXmlApplicationContext
protected String[] getConfigLocations()(Code)(Java Doc)
protected Resource[] getConfigResources()(Code)(Java Doc)
protected void initBeanDefinitionReader(XmlBeanDefinitionReader beanDefinitionReader)(Code)(Java Doc)
protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) throws IOException(Code)(Java Doc)
protected void loadBeanDefinitions(XmlBeanDefinitionReader reader) throws BeansException, IOException(Code)(Java Doc)

Methods inherited from org.springframework.context.support.AbstractRefreshableApplicationContext
final protected void closeBeanFactory()(Code)(Java Doc)
protected DefaultListableBeanFactory createBeanFactory()(Code)(Java Doc)
protected void customizeBeanFactory(DefaultListableBeanFactory beanFactory)(Code)(Java Doc)
final public ConfigurableListableBeanFactory getBeanFactory()(Code)(Java Doc)
abstract protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) throws IOException, BeansException(Code)(Java Doc)
final protected void refreshBeanFactory() throws BeansException(Code)(Java Doc)

Fields inherited from org.springframework.context.support.AbstractApplicationContext
final public static String APPLICATION_EVENT_MULTICASTER_BEAN_NAME(Code)(Java Doc)
final public static String MESSAGE_SOURCE_BEAN_NAME(Code)(Java Doc)
final protected Log logger(Code)(Java Doc)

Methods inherited from org.springframework.context.support.AbstractApplicationContext
public void addApplicationListener(ApplicationListener listener)(Code)(Java Doc)
public void addBeanFactoryPostProcessor(BeanFactoryPostProcessor beanFactoryPostProcessor)(Code)(Java Doc)
protected void addListener(ApplicationListener listener)(Code)(Java Doc)
public void close()(Code)(Java Doc)
abstract protected void closeBeanFactory()(Code)(Java Doc)
public boolean containsBean(String name)(Code)(Java Doc)
public boolean containsBeanDefinition(String name)(Code)(Java Doc)
public boolean containsLocalBean(String name)(Code)(Java Doc)
public void destroy()(Code)(Java Doc)
protected void destroyBeans()(Code)(Java Doc)
protected void doClose()(Code)(Java Doc)
public String[] getAliases(String name)(Code)(Java Doc)
public List getApplicationListeners()(Code)(Java Doc)
public AutowireCapableBeanFactory getAutowireCapableBeanFactory() throws IllegalStateException(Code)(Java Doc)
public Object getBean(String name) throws BeansException(Code)(Java Doc)
public Object getBean(String name, Class requiredType) throws BeansException(Code)(Java Doc)
public int getBeanDefinitionCount()(Code)(Java Doc)
public String[] getBeanDefinitionNames()(Code)(Java Doc)
abstract public ConfigurableListableBeanFactory getBeanFactory() throws IllegalStateException(Code)(Java Doc)
public List getBeanFactoryPostProcessors()(Code)(Java Doc)
public String[] getBeanNamesForType(Class type)(Code)(Java Doc)
public String[] getBeanNamesForType(Class type, boolean includePrototypes, boolean allowEagerInit)(Code)(Java Doc)
public Map getBeansOfType(Class type) throws BeansException(Code)(Java Doc)
public Map getBeansOfType(Class type, boolean includePrototypes, boolean allowEagerInit) throws BeansException(Code)(Java Doc)
public String getDisplayName()(Code)(Java Doc)
protected BeanFactory getInternalParentBeanFactory()(Code)(Java Doc)
protected MessageSource getInternalParentMessageSource()(Code)(Java Doc)
protected Collection getLifecycleBeans()(Code)(Java Doc)
public String getMessage(String code, Object args, String defaultMessage, Locale locale)(Code)(Java Doc)
public String getMessage(String code, Object args, Locale locale) throws NoSuchMessageException(Code)(Java Doc)
public String getMessage(MessageSourceResolvable resolvable, Locale locale) throws NoSuchMessageException(Code)(Java Doc)
public ApplicationContext getParent()(Code)(Java Doc)
public BeanFactory getParentBeanFactory()(Code)(Java Doc)
protected ResourcePatternResolver getResourcePatternResolver()(Code)(Java Doc)
public Resource[] getResources(String locationPattern) throws IOException(Code)(Java Doc)
public long getStartupDate()(Code)(Java Doc)
public Class getType(String name) throws NoSuchBeanDefinitionException(Code)(Java Doc)
protected void initApplicationEventMulticaster()(Code)(Java Doc)
protected void initMessageSource()(Code)(Java Doc)
protected void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory)(Code)(Java Doc)
public boolean isActive()(Code)(Java Doc)
public boolean isPrototype(String name) throws NoSuchBeanDefinitionException(Code)(Java Doc)
public boolean isRunning()(Code)(Java Doc)
public boolean isSingleton(String name) throws NoSuchBeanDefinitionException(Code)(Java Doc)
public boolean isTypeMatch(String name, Class targetType) throws NoSuchBeanDefinitionException(Code)(Java Doc)
protected ConfigurableListableBeanFactory obtainFreshBeanFactory()(Code)(Java Doc)
protected void onClose()(Code)(Java Doc)
protected void onRefresh() throws BeansException(Code)(Java Doc)
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)(Code)(Java Doc)
protected void prepareBeanFactory(ConfigurableListableBeanFactory beanFactory)(Code)(Java Doc)
protected void prepareRefresh()(Code)(Java Doc)
public void publishEvent(ApplicationEvent event)(Code)(Java Doc)
public void refresh() throws BeansException, IllegalStateException(Code)(Java Doc)
abstract protected void refreshBeanFactory() throws BeansException, IllegalStateException(Code)(Java Doc)
protected void registerBeanPostProcessors(ConfigurableListableBeanFactory beanFactory)(Code)(Java Doc)
protected void registerListeners()(Code)(Java Doc)
public void registerShutdownHook()(Code)(Java Doc)
public void setDisplayName(String displayName)(Code)(Java Doc)
public void setParent(ApplicationContext parent)(Code)(Java Doc)
public void start()(Code)(Java Doc)
public void stop()(Code)(Java Doc)
public String toString()(Code)(Java Doc)

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