버전 4 (anonymous에 의해 수정됨, 13 년전) |
---|
=== anyframe
--context-annotaion.xml
<?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" 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"> <!--AOP(Aspect Oriented Programming)--> <aop:aspectj-autoproxy /> <!--Bean Definition--> <context:component-scan base-package="com.everland" use-default-filters="false"> <context:include-filter type="annotation" expression="org.springframework.stereotype.Service" /> <context:include-filter type="annotation" expression="org.springframework.stereotype.Repository" /> </context:component-scan> </beans>
--context-transaction.xml
<?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:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"> <util:properties id="contextProperties" location="classpath:context.properties"/> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="#{contextProperties.driver}"/> <property name="url" value="#{contextProperties.url}"/> <property name="username" value="#{contextProperties.username}"/> <property name="password" value="#{contextProperties.password}"/> </bean> <bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource"/> </bean> <tx:annotation-driven transaction-manager="txManager" /> <tx:advice id="txAdvice" transaction-manager="txManager"> <tx:attributes> <tx:method name="*" rollback-for="Exception" propagation="REQUIRED"/> </tx:attributes> </tx:advice> <aop:config> <aop:pointcut id="mipServiceRequiredTx" expression="execution(* *..MiPService.*(..))"/> <aop:pointcut id="dynamicHibernateRequiredTx" expression="execution(* *..*DynamicHibernateService.*(..))"/> <aop:pointcut id="jobRequiredTx" expression="execution(* *..job..*Job.execute(..))"/> <aop:pointcut id="flexRequiredTx" expression="execution(* *..FlexService.*(..))"/> <aop:advisor advice-ref="txAdvice" order="2" pointcut-ref="flexRequiredTx" /> <aop:advisor advice-ref="txAdvice" order="2" pointcut-ref="mipServiceRequiredTx" /> <aop:advisor advice-ref="txAdvice" order="2" pointcut-ref="dynamicHibernateRequiredTx" /> <aop:advisor advice-ref="txAdvice" order="2" pointcut-ref="jobRequiredTx" /> </aop:config> </beans>
--doremi
--root-context.xml
<?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:util="http://www.springframework.org/schema/util" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:arid="http://chrisrichardson.net/schema/arid" xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd 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://chrisrichardson.net/schema/arid http://chrisrichardson.net/schema/arid.xsd"> <!-- aop 관련 --> <!-- Advice 클래스를 빈으로 등록 --> <bean id="performanceTraceAdvice" class="com.everland.ws.doremi.common.log.ProfilingAdvice" /> <!-- Aspect 설정: Advice를 어떤 Pointcut에 적용할 지 설정 --> <aop:config> <aop:aspect id="traceAspect1" ref="performanceTraceAdvice"> <aop:pointcut id="publicMethod" expression="execution(public * com.everland.ws.*.doremi.*.*.*(..))" /> <aop:around pointcut-ref="publicMethod" method="trace" /> </aop:aspect> </aop:config> <!-- db 관련 끝 --> <util:properties id="db" location="classpath:db.properties"/> <beans:bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <beans:property name="driverClassName" value="#{db['db.driverClassName']}" /> <beans:property name="url" value="#{db['db.url']}" /> <beans:property name="username" value="#{db['db.username']}" /> <beans:property name="password" value="#{db['db.password']}" /> </beans:bean> <!-- jdbc setting --> <beans:bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"> <beans:property name="dataSource" ref="dataSource"/> </beans:bean> <beans:bean id="simplejdbcTemplate" class="org.springframework.jdbc.core.simple.SimpleJdbcTemplate"> <beans:constructor-arg ref="dataSource"/> </beans:bean> <!-- ibatis setting --> <beans:bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> <beans:property name="dataSource" ref="dataSource"/> <beans:property name="configLocation" value="WEB-INF/sqlMap/sqlMapConfig.xml"/> </beans:bean> <beans:bean id="sqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate"> <beans:property name="sqlMapClient" ref="sqlMapClient"/> </beans:bean> <!-- db 관련 끝 --> <arid:define-beans package="com.everland.ws.sd.doremi.service" /> <arid:define-beans package="com.everland.ws.mm.doremi.service" /> <context:annotation-config /> <context:component-scan base-package="com.everland" /> </beans:beans>