dubbo源码分析4(spring配置文件解析机制)
我们知道dubbo一般也不会单独使用的吧,都会和spring一起使用,知道为什么吗?
因为dubbo是基于spring的扩展机制进行扩展的,所以首先我们要知道spring提供了一种什么扩展机制?
先看下图,基于spring的配置文件都会有如下所示这段东西,这是干啥的呢?

1.spring配置文件的文件头
首先我为了偷懒,要去找一个spring配置文件的网图,下图所示,这是一个很常见的spring配置文件,但是前面那一堆xmlns是什么东西啊,我擦(╯—﹏—)╯(┷━━━┷
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<tx:method name="find*" propagation="NOT_SUPPORTED" />
</tx:attributes>
</tx:advice>
<aop:config>
<aop:aspect id="***" ref="***"/>
<aop:pointcut id="***" expression="****" />
</aop:config>
</beans>


