zoukankan      html  css  js  c++  java
  • 随想 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);
                }
            };
        }
    }
  • 相关阅读:
    格式控制符
    sort快速排序法
    堆积排序
    oracle常用命令
    C#中int和System.Int32理解总结
    IIS 7.5中的配置
    WPF循序渐进:XAML入门 .
    怎样找到excel两列之间同行相同的数据
    pl/sql functions and cbo costing
    Oracle 学习纲要
  • 原文地址:https://www.cnblogs.com/iiiDragon/p/9458517.html
Copyright © 2011-2022 走看看