<?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:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<!-- Druid数据源配置并管理 -->
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
<property name="driverClassName" value="${db_driverClassName}"/>
<property name="url" value="${db_url}" />
<property name="username" value="${db_user}" />
<property name="password" value="${db_passwd}" />
<property name="dbType" value="oracle" />
<!-- 配置初始化大小、最小、最大 -->
<property name="initialSize" value="10" />
<property name="minIdle" value="10" />
<property name="maxActive" value="100" />
<!-- 获取连接等待超时时间 -->
<property name="maxWait" value="60000" />
<!-- 配置间隔多久进行空闲回收,单位是毫秒 -->
<property name="timeBetweenEvictionRunsMillis" value="60000" />
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
<property name="minEvictableIdleTimeMillis" value="300000" />
<property name="validationQuery" value="SELECT 'x'" />
<property name="testWhileIdle" value="true" />
<property name="testOnBorrow" value="false" />
<property name="testOnReturn" value="false" />
<!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
<property name="poolPreparedStatements" value="true" />
<property name="maxPoolPreparedStatementPerConnectionSize" value="20" />
</bean>
<!-- Dao -->
<bean id="jdbcDaoImpl" class="com.npnets.dao.impl.JdbcDaoImpl">
<property name="jdbcTemplate" ref="jdbcTemp"/>
</bean>
<bean id="agentDao" class="com.npnets.dao.impl.AgentDaoImpl">
<property name="jdbcDao" ref="jdbcDaoImpl" />
</bean>
<bean id="web800Dao" class="com.npnets.dao.impl.Web800DaoImpl">
<property name="jdbcDao" ref="jdbcDaoImpl"/>
</bean>
<!-- 业务层 -->
<bean id="web800Manager" class="com.npnets.service.impl.Web800ManagerImpl">
<property name="jdbcDao" ref="jdbcDaoImpl" />
<property name="agentDao" ref="agentDao" />
<property name="web800Dao" ref="web800Dao" />
</bean>
<!-- 接口层 -->
<bean id="agentService" class="com.npnets.interfaces.impl.AgentServiceImpl">
<property name="web800Manager" ref="web800Manager" />
</bean>
<bean id="web800Service" class="com.npnets.interfaces.impl.Web800ServiceImpl">
<property name="web800Manager" ref="web800Manager"/>
</bean>
<!-- 系统信息 -->
<bean id="systemConfig" class="com.npnets.tools.SystemConfig">
<property name="agentIp" value="${agent_ip}" />
<property name="agentPort" value="${agent_port}" />
<property name="web800Ip" value="${web800_ip}" />
<property name="web800Port" value="${web800_port}" />
<property name="listenerPort" value="${listener_Port}" />
<property name="accphonenumber" value="${accphonenumber}" />
</bean>
<!-- 读取数据库配置文件/WEB-INF/classes/ -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:jdbc.properties"/>
</bean>