@Override
            public void operationComplete(final IoFuture future) {
                try {
                    listener.operationComplete(new Future() {
                        @Override
                        public boolean isSuccess() {
                            if (ioFuture instanceof WriteFuture) {
                                return ((WriteFuture) future).isWritten();
                            } else if (ioFuture instanceof ConnectFuture) {
                                return ((ConnectFuture) future).isConnected();
                            } else if (ioFuture instanceof CloseFuture) {
                                return ((CloseFuture) ioFuture).isClosed();
                            }
                            return future.isDone();
                        }

                        @Override
                        public Throwable cause() {
                            return null;
                        }
                    });
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
@author Robert HG (254963746@qq.com) on 11/4/15.
lts-core/src/main/java/com/github/ltsopensource/remoting/mina/MinaChannelHandler.java