core startup
1 |
synchronized (this.startupShutdownMonitor) { |
The IOC Container
Introduction
The AplicationContext
is a sub-class of BeanFactory
, it adds easier intregration of spring’s AOP features, message resource manage(internationnal), event publication, application-layer specific contexts.
Bean definitions are represented as BeanDefinition
objects, which contain (among other information) the following metadata:
- A package-qualified class name: typically the actual implementation *class *of the bean being defined.
- Bean behavioral configuration elements, which state how the bean should behave in the container (scope, lifecycle callbacks, and so forth).
- References to other beans that are needed for the bean to do its work; these references are also called collaborators or dependencies.
- Other configuration settings to set in the newly created object, for example, the number of connections to use in a bean that manages a connection pool, or the size limit of the pool.
Data access with JDBC
JDBC core control class
JdbcTemplate
- creation and release of resources
- basic tasks work-flow of JDBC, such as statement creation and execution
- execute SQL query and update statement and precudure calls, iterate over ‘ResultSet ‘and extract returned parameter values
- catch JDBC exception
- threadsafe once configured
Core config
- ApplicationListener
ORM Data Access
JPA
- Three ways to set up
EntityManagerFactory
:LocalEntityManagerFactoryBean
:- suitable for simple deployment enviroment, and the application only use jpa for data access.
近期评论