All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.netty.protocol.nrpc.RpcClientAop Maven / Gradle / Ivy

The newest version!
package com.github.netty.protocol.nrpc;

import io.netty.util.concurrent.FastThreadLocal;

import java.util.Map;
import java.util.function.Supplier;

/**
 * event aop
 *
 * @author wangzihao
 */
public interface RpcClientAop {

    FastThreadLocal> CONTEXT_LOCAL = new FastThreadLocal<>();

    default void onInitAfter(RpcClient rpcClient) {
    }

    default void onConnectAfter(RpcClient rpcClient) {
    }

    default void onDisconnectAfter(RpcClient rpcClient) {
    }

    default void onEncodeRequestBefore(RpcContext rpcContext, Map params) {
    }

    default void onTimeout(RpcContext rpcContext) {
    }

    default void onChunkAfter(RpcContext rpcContext, Supplier chunk, int chunkIndex, int chunkId, ChunkAck ack) {
    }

    default void onResponseAfter(RpcContext rpcContext) {
    }

    default void onStateUpdate(RpcContext rpcContext, State formState, State toState) {
    }
}