81,091
社区成员
发帖
与我相关
我的任务
分享
[EHSS_INTER] 2013-04-15 09:10:02.210 [main] DEBUG [org.springframework.beans.factory.annotation.InjectionMetadata]
- Processing injected method of bean 'mobilePayHandlerImpl': AutowiredFieldElement for private com.talkweb.ehss.pay.mpay.dao.IMpayLogger com.talkweb.ehss.pay.mpay.service.impl.MobilePayHandlerImpl.mpayLogger
@Controller
public class MpayTaskDistribute extends HessianServlet implements IPerform{
@Autowired
private IMobilePayHandler handler;
private Logger logger = LoggerFactory.getLogger(MpayTaskDistribute.class);
@Service
public class MobilePayHandlerImpl implements IMobilePayHandler{
private Logger logger = LoggerFactory.getLogger(MobilePayHandlerImpl.class);
@Autowired
private IMpayLogger mpayLogger;
<?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:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd"
default-lazy-init="false">
<!-- MyBatis配置 -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<!-- 显式指定Mapper文件位置 -->
<property name="mapperLocations" value="classpath:/META-INF/mybatis/*Mapper.xml" />
</bean>
<!-- 扫描basePackage下所有以@MyBatisRepository标识的 接口-->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.talkweb.ehss" />
<property name="annotationClass"
value="com.talkweb.ehss.inter.MyBatisRepository" />
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"></property>
</bean>
<tx:advice id="serviceAdvice" transaction-manager="transactionManager">
<tx:attributes>
<!--当代理的service层中的方法抛出异常的时候才回滚,必须加rollback-for参数-->
<tx:method name="insert*" propagation="REQUIRED"
rollback-for="Throwable" />
<tx:method name="del*" propagation="REQUIRED" rollback-for="Throwable" />
<tx:method name="update*" propagation="REQUIRED"
rollback-for="Throwable" />
<!--除了上面标识的方法,其他方法全是只读方法-->
<tx:method name="*" read-only="true" />
</tx:attributes>
</tx:advice>
<!-- 使用annotation定义事务 -->
<tx:annotation-driven transaction-manager="transactionManager"
proxy-target-class="true" />
<!-- JSR303 Validator定义
<bean id="validator"
class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean" />
-->
<!-- production环境
<beans>
<context:property-placeholder
ignore-unresolvable="true" location="classpath*:META-INF/application.properties" />
-->
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
<property name="ignoreResourceNotFound" value="true" />
<property name="locations">
<list>
<value>classpath:META-INF/application.properties</value>
</list>
</property>
</bean>
<!-- 数据源配置, 使用DBCP数据库连接池 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<!-- Connection Info -->
<property name="driverClassName" value="${jdbc.driver}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<!-- Connection Pooling Info -->
<property name="maxActive" value="${dbcp.maxActive}" />
<property name="maxIdle" value="${dbcp.maxIdle}" />
<property name="defaultAutoCommit" value="false" />
<!-- 连接Idle一个小时后超时 -->
<property name="timeBetweenEvictionRunsMillis" value="3600000" />
<property name="minEvictableIdleTimeMillis" value="3600000" />
</bean>
<!-- 数据源配置,使用应用服务器的数据库连接池 -->
<!--
<jee:jndi-lookup id="dataSource"
jndi-name="java:comp/env/jdbc/ExampleDB" />
</beans>-->
<context:annotation-config/>
<context:component-scan base-package="com.talkweb.ehss"/>
<bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
</beans>
public interface IMobilePayHandler {
/**
* @Title: isMobilePayUser
* @Description: 检查是否开通手机支付
* @param dic :
* key : value
* mobileno:手机号码
* @return
* key : value
* ERR_NO : 0 是 1否
*/
public Dictionary isMobilePayUser(Dictionary dic);
@Controller
public class MpayTaskDistribute extends HessianServlet implements IPerform{
@Autowired
private IMobilePayHandler handler;
private Logger logger = LoggerFactory.getLogger(MpayTaskDistribute.class);
/* (non-Javadoc)
* @see com.talkweb.pm.framework.IPerform#perform(com.talkweb.pm.framework.Dictionary)
*/
public Dictionary perform(Dictionary dic) {
logger.info("this is the mpay task distribute:" + dic.getValueByName("FUN_ID") + " " +handler);
String fun_id = (String) dic.getValueByName("FUN_ID");
Dictionary returnDic = null;
if("VERIFY_MOBILE_PAY".equals(fun_id)){//是否开通手机支付
returnDic = handler.isMobilePayUser(dic);
}else if("TRUST_SMS_PAY".equals(fun_id)){//无密无协议支付
returnDic = handler.pay(dic);
}
return returnDic;
}
}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface MyBatisRepository {
}
用于
<!-- 扫描basePackage下所有以@MyBatisRepository标识的 接口-->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.talkweb.ehss" />
<property name="annotationClass"
value="com.talkweb.ehss.inter.MyBatisRepository" />
</bean>
@MyBatisRepository
public interface IMpayLogger {
/**
* @Title: logMapyRequestParam
* @Description: 手机支付请求参数 - logger
*/
public int logMpayRequestParam(PayLoggerBean param);
/**
* @Title: logMapyResponseParam
* @Description: 手机支付响应结果 - logger
*/
public int logMpayResponseParam(PayLoggerBean param);