'Programming/Framework'에 해당되는 글 4건

  1. 2014.02.18 Akka
  2. 2013.04.26 antlr
  3. 2012.10.17 Transaction 설정 샘플
  4. 2012.10.17 Anyframe 의 JDBC 실행관련 설정

Akka

Akka 관련


http://javacan.tistory.com/entry/akka-1-start



'Programming > Framework' 카테고리의 다른 글

Akka  (0) 2014.02.18
antlr  (0) 2013.04.26
Transaction 설정 샘플  (0) 2012.10.17
Anyframe 의 JDBC 실행관련 설정  (0) 2012.10.17

antlr

개발용 툴 만들때 사용하면 좋을 듯한 parser generator



http://www.antlr.org/



What is ANTLR?

ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files. It's widely used to build languages, tools, and frameworks. From a grammar, ANTLR generates a parser that can build and walk parse trees.



'Programming > Framework' 카테고리의 다른 글

Akka  (0) 2014.02.18
antlr  (0) 2013.04.26
Transaction 설정 샘플  (0) 2012.10.17
Anyframe 의 JDBC 실행관련 설정  (0) 2012.10.17

Transaction 설정 샘플

Anyframe 의 트랜잭션 샘플


<?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" />


<!-- DataSource JDBC 설정  -->

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"

destroy-method="close">

<property name="initialSize" value="2"/>

<property name="maxActive"  value="5"/>

<property name="maxIdle" value="2"/>

<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>


<!-- DataSource JNDI 설정  -->

<!--

<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> 

    <property name="jndiName" value="#{contextProperties.jndiname}" />

    <property name="resourceRef" value="true"/>

</bean>

 -->


  <bean id="transactionManager"

class="org.springframework.jdbc.datasource.DataSourceTransactionManager">

<property name="dataSource" ref="dataSource" />

  </bean>


<!-- 일반 서비스의 트랜잭션  -->

  <tx:advice id="txAdvice" transaction-manager="transactionManager">

<tx:attributes>

<tx:method name="*" rollback-for="Exception" propagation="REQUIRED" />

</tx:attributes>

  </tx:advice>


<!-- 개별 트랜잭션을 별도로 분리하도록 한다.  -->

 <tx:advice id="txAdviceRequireNew" transaction-manager="transactionManager">

    <tx:attributes>

<tx:method name="*" rollback-for="Exception" propagation="REQUIRES_NEW" />

    </tx:attributes>

  </tx:advice>


<aop:config>

<!-- 일반 Service -->

 <aop:pointcut id="serviceTxPointCut" expression="execution(* com...impl.*ServiceImpl.*(..))" />

 <!--IDgen, logger  -->

<aop:pointcut id="requiredTxIdgenPointCut"

expression="execution(* com..impl.IdGenServiceBizImpl.*(..))" />

<aop:pointcut id="requiredTxUserLogPointCut"

expression="execution(* com.EventLogger.insertEventLog(..))" />


  <!-- Advisor: Transaction처리용  -->

  <aop:advisor advice-ref="txAdvice" pointcut-ref="serviceTxPointCut" />

  <aop:advisor advice-ref="txAdviceRequireNew" pointcut-ref="requiredTxIdgenPointCut" />

  <aop:advisor advice-ref="txAdviceRequireNew" pointcut-ref="requiredTxUserLogPointCut" />

</aop:config>

<!--    트랜잭션 정의             -->

</beans>


'Programming > Framework' 카테고리의 다른 글

Akka  (0) 2014.02.18
antlr  (0) 2013.04.26
Transaction 설정 샘플  (0) 2012.10.17
Anyframe 의 JDBC 실행관련 설정  (0) 2012.10.17

Anyframe 의 JDBC 실행관련 설정

Anyframe 의 JDBC 실행관련 설정


<beans xmlns="http://www.springframework.org/schema/beans"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">


<bean id="injectionPatternPostProcessor"

class="org.anyframe.jdbc.support.impl.DefaultInjectionPatternPostProcessor">

<!-- check sql comment pattern -->

<!-- check 1 = 1 pattern - ex. '1' = '1' , 1= 1, '1'='1' -->

<!--

<property name="warningPatterns">

<list>

<value>-{2,}</value>

<value>'?1'?\s*=\s*'?1'?</value>

</list>

</property>

-->

</bean>

 

  <bean id="completeQueryPostProcessor"

    class="org.anyframe.jdbc.support.ext.ThreadLocalCompleteQueryPostProcessor" />


 <bean id="jdbcAspect" class="org.anyframe.jdbc.support.aspect.JdbcAspect">

  <property name="injectionPatternPostProcessor" ref="injectionPatternPostProcessor" />

  <property name="completeQueryPostProcessor" ref="completeQueryPostProcessor" />

 </bean>


  <aop:config>

<aop:pointcut id="jdbcPointcut" expression="execution(* *..*DataSource.*(..))" />

<aop:advisor advice-ref="jdbcAspect" pointcut-ref="jdbcPointcut" />

  </aop:config>

</beans>



Anyframe 샘플....

http://dev.anyframejava.org/docs/anyframe/plugin/optional/jdbc-support/1.0.2/reference/html/ch04.html

public class ThreadLocalCompleteQueryPostProcessor extends DefaultCompleteQueryPostProcessor {

    @Override
    public void processCompleteQuery(String sql) {
        super.processCompleteQuery(sql);

        if ("Q".equals(SharedInfoHolder.getJobType())) {
            SharedInfoHolder.setExecutedQuery(sql);
            // throw new QueryLogException(sql);
        }
    }

}


'Programming > Framework' 카테고리의 다른 글

Akka  (0) 2014.02.18
antlr  (0) 2013.04.26
Transaction 설정 샘플  (0) 2012.10.17
Anyframe 의 JDBC 실행관련 설정  (0) 2012.10.17