// Path: src/main/java/com/baidu/unbiz/multiengine/exception/MultiEngineException.java
// public class MultiEngineException extends RuntimeException {
// 
//     /**
//      * serialVersionUID
//      */
//     private static final long serialVersionUID = 2396421433506179782L;
// 
//     /**
//      * Creates a new instance of CodecException.
//      */
//     public MultiEngineException() {
//         super();
//     }
// 
//     /**
//      * Creates a new instance of CodecException.
//      *
//      * @param arg0
//      * @param arg1
//      */
//     public MultiEngineException(String arg0, Throwable arg1) {
//         super(arg0, arg1);
//     }
// 
//     /**
//      * Creates a new instance of CodecException.
//      *
//      * @param arg0
//      */
//     public MultiEngineException(String arg0) {
//         super(arg0);
//     }
// 
//     /**
//      * Creates a new instance of CodecException.
//      *
//      * @param arg0
//      */
//     public MultiEngineException(Throwable arg0) {
//         super(arg0);
//     }
// 
// }


import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import com.baidu.unbiz.multiengine.exception.MultiEngineException;
package com.baidu.unbiz.multiengine.transport.client;



/**
 * 调用方异步发送消息时所持有的发送结果占位符实现，它实现如下接口：
 * <ul>
 * <li>SendFuture 被调用方使用</li>
 * </ul>
 *
 * @author wagnchongjie
 */
class SimpleSendFutrue implements SendFuture {
    private final CountDownLatch internalWaiter = new CountDownLatch(1);

    /**
     * 结果信息
     */
    private volatile Object result;

    private volatile boolean hasInit = false;

    @Override
    public <T> T get() {
        try {
            internalWaiter.await();
        } catch (InterruptedException e) {
// Path: src/main/java/com/baidu/unbiz/multiengine/exception/MultiEngineException.java
// public class MultiEngineException extends RuntimeException {
// 
//     /**
//      * serialVersionUID
//      */
//     private static final long serialVersionUID = 2396421433506179782L;
// 
//     /**
//      * Creates a new instance of CodecException.
//      */
//     public MultiEngineException() {
//         super();
//     }
// 
//     /**
//      * Creates a new instance of CodecException.
//      *
//      * @param arg0
//      * @param arg1
//      */
//     public MultiEngineException(String arg0, Throwable arg1) {
//         super(arg0, arg1);
//     }
// 
//     /**
//      * Creates a new instance of CodecException.
//      *
//      * @param arg0
//      */
//     public MultiEngineException(String arg0) {
//         super(arg0);
//     }
// 
//     /**
//      * Creates a new instance of CodecException.
//      *
//      * @param arg0
//      */
//     public MultiEngineException(Throwable arg0) {
//         super(arg0);
//     }
// 
// }


// Path: src/main/java/com/baidu/unbiz/multiengine/transport/client/SimpleSendFutrue.java
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import com.baidu.unbiz.multiengine.exception.MultiEngineException;

package com.baidu.unbiz.multiengine.transport.client;



/**
 * 调用方异步发送消息时所持有的发送结果占位符实现，它实现如下接口：
 * <ul>
 * <li>SendFuture 被调用方使用</li>
 * </ul>
 *
 * @author wagnchongjie
 */
class SimpleSendFutrue implements SendFuture {
    private final CountDownLatch internalWaiter = new CountDownLatch(1);

    /**
     * 结果信息
     */
    private volatile Object result;

    private volatile boolean hasInit = false;

    @Override
    public <T> T get() {
        try {
            internalWaiter.await();
        } catch (InterruptedException e) {
            throw new MultiEngineException(e);