Skip to content

Instantly share code, notes, and snippets.

@circlee
circlee / TransactionEventListeners component
Created July 5, 2017 06:33
TransactionEventListeners component
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;
import org.springframework.transaction.event.TransactionPhase;
import org.springframework.transaction.event.TransactionalEventListener;
import com.test.listener.abstracts.EventAfterCommit;
import com.test.listener.abstracts.EventAfterCompletion;
import com.test.listener.abstracts.EventAfterRollback;
import com.test.listener.abstracts.EventBeforeCommit;
import com.test.listener.abstracts.EventMultiCast;
@circlee
circlee / EventAfterCommit
Created July 5, 2017 06:35
EventAfterCommit
package com.test.listener.abstracts;
public abstract class EventAfterCommit extends Event{
}
@circlee
circlee / Event abstract class
Created July 5, 2017 06:36
Event interface
public abstract class Event {
public abstract void callback();
}
@circlee
circlee / transaction eventlister test
Created July 5, 2017 06:44
transaction eventlister test
import javax.inject.Inject;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.test.listener.abstracts.EventAfterCommit;
@circlee
circlee / jenkinsFile
Created July 10, 2017 09:33
jenkinsFile
//CORE_TAG, ADMIN_TAG, MEMO 등 빌드 파라미터 정의
properties([parameters([string(defaultValue: '', description: '', name: 'CORE_TAG'), string(defaultValue: '', description: '', name: 'ADMIN_TAG'), string(defaultValue: '', description: '', name: 'MEMO')]), pipelineTriggers([])])
//GIT Tag 생성을 위한 메소드 정의
def GitTagging(String tagName, String commitId){
sh("git config --global user.email '${env.GIT_USERNAME}'")
sh("git config --global user.name '${env.GIT_USERNAME}'")
sh("git config credential.helper '!echo password=\$GIT_PASSWORD; echo'")
sh("git tag " + tagName+" " + commitId )
sh("git push origin "+ tagName)
@circlee
circlee / heroku getting started Main.java
Created July 12, 2017 12:02
heroku getting started Main.java
import ratpack.exec.Blocking;
import ratpack.server.BaseDir;
import ratpack.server.RatpackServer;
import ratpack.groovy.template.TextTemplateModule;
import ratpack.guice.Guice;
import static ratpack.groovy.Groovy.groovyTemplate;
import java.util.*;
import java.sql.*;
public class SingletonTest_1 {
static {
System.out.println("SingletonTest_1 class load");
}
private static SingletonTest_1 instance= null;
public class SingletonTest_2 {
static {
System.out.println("SingletonTest_2 class load");
}
private static SingletonTest_2 instance= null;
public class SingletonTest_3 {
static {
System.out.println("SingletonTest_3 class load");
}
private static SingletonTest_3 instance= null;
public class SingletonTest_4 {
static {
System.out.println("SingletonTest_3 class load");
}
private SingletonTest_4(){
System.out.println("SingletonTest_3 class new instance");