This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.dangnh.xmlconfig.annotation.*; | |
/** | |
* | |
* @author DangNH | |
*/ | |
@Source("file:./config/RMQConfig.xml") | |
public interface RmqConnectionConfig{ | |
@Key("rmq-config.connection.host") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.dangnh.xmlconfig.annotation.*; | |
/** | |
* | |
* @author DangNH | |
*/ | |
@Source("file:./config/RMQConfig.xml") /*URI đến file config*/ | |
public interface RmqExchangeDeclareConfig{ | |
@Key("rmq-config.consumer.exchange-declare") | |
@DefaultValue("tms-topic") /*giá trị mặc định*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.elcom.ifccore.config.RmqExchangeDeclareConfig; | |
import org.dangnh.xmlconfig.ConfigFactory; | |
/** | |
* | |
* @author DangNH | |
*/ | |
public class TestConfig { | |
public static void main(String[] args) { | |
RmqExchangeDeclareConfig config = ConfigFactory.create(RmqExchangeDeclareConfig.class); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.reflect.Method; | |
import org.dangnh.xmlconfig.Converter.Converter; | |
/** | |
* | |
* @author DangNH | |
*/ | |
public class CustomCvt implements Converter{ | |
@Override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.dangnh.xmlconfig.annotation.*; | |
/** | |
* | |
* @author DangNH | |
*/ | |
@Source("file:./config/RMQConfig.xml") | |
public interface RmqConsumerConfig { | |
@CustomConverter(CustomCvt.class) | |
@Key("rmq-config.consumer.pool-size") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestMsgListener implements MsgHandler { | |
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(TestMsgListener.class); | |
@Override | |
public void OnRecvMsg(MessageProtocol.Message msg) { | |
System.out.println("asdasdda"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashSet; | |
import java.util.Set; | |
/** | |
* Created by dangg on 5/19/2016. | |
*/ | |
class HashSetOrderingTest { | |
public static void main(String args[]) { | |
Set<String> hset = new HashSet<String>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> | |
<!-- ===================================================================== --> | |
<!-- Log4j Configuration --> | |
<!-- ===================================================================== --> | |
<!-- | |
| For more configuration infromation and examples see the Jakarta Log4j | |
| owebsite: http://jakarta.apache.org/log4j | |
--> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.LinkedList; | |
import java.util.Queue; | |
/** | |
* | |
* @author 404NotFound | |
*/ | |
public class MyQueue<E> { | |
private final Object sync = new Object(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rx.Observable; | |
import rx.observables.ConnectableObservable; | |
import rx.subjects.BehaviorSubject; | |
import java.util.concurrent.TimeUnit; | |
/** | |
* Created by dangg on 6/13/2016. | |
*/ | |
public class MainTest { |