• 随想 20180811


    Distributor Software Desgin:

    Netty RPC (Reactor Model) -->  Proxy or Reflection --> Busisness Logic 

    1. Configuration

    2. BuildFactory --> Context or Env

    3. BuildFactory --> Serialize & Deserialize Instance with Poxy or Reflection ( Class.forName().newInstance())

    4. ThreadPool Generation

    5. Dispatcher Generation

    5.1 Register itself to master or zookeeper / Master-Slave / NameServer

    5.2 Register Handler 

    5.3 Create receiver to save msg

    5.4 Create ThreadPool to handle msg from receiver

    5.5 Memory Allocation/Persistent, Syn/Ack

    6. Netty Server Start

    7. Future --> ListenerFuture<?>, ChannelFuture<?>, FutureTask<?>

    public class JavassistProxyFactory extends AbstractProxyFactory {    
        @SuppressWarnings("unchecked")
        public <T> T getProxy(Invoker<T> invoker, Class<?>[] interfaces) {
            return (T) Proxy.getProxy(interfaces).newInstance(
                       new InvokerInvocationHandler(invoker)
                    );
        }
    
        public <T> Invoker<T> getInvoker(T proxy, Class<T> type, URL url) {
            final Wrapper wrapper = Wrapper.getWrapper(
                          proxy.getClass().getName().indexOf('$') < 0 ? 
                          proxy.getClass() : type);
            return new AbstractProxyInvoker<T>(proxy, type, url) {
                @Override
                protected Object doInvoke(T proxy, String methodName, 
                                          Class<?>[] parameterTypes, 
                                          Object[] arguments) throws Throwable {
                    return wrapper.invokeMethod(proxy, methodName, parameterTypes, arguments);
                }
            };
        }
    }
  • 相关阅读:
    Qt全局坐标和相对坐标
    坐标系统
    qt坐标系统见解
    Qt中QGraphics类坐标映射关系详解
    对QT多线程以及事件投递的理解
    Qt中mouseMoveEvent无效
    递归、尾递归
    末日重生
    201314
    归并排序
  • 原文地址:https://www.cnblogs.com/iiiDragon/p/9458517.html
Copyright © 2020-2023  润新知