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

com.github.liuyehcf.framework.rpc.maple.netty.ChannelProxy Maven / Gradle / Ivy

There is a newer version: 1.0.2
Show newest version
package com.github.liuyehcf.framework.rpc.maple.netty;

import com.github.liuyehcf.framework.rpc.maple.register.ServiceInstance;
import io.netty.channel.Channel;
import lombok.Data;

/**
 * @author hechenfeng
 * @date 2019/3/25
 */
@Data
public class ChannelProxy {

    private volatile Channel channel;

    private volatile ServiceInstance serviceInstance;

    public void bind(final ServiceInstance serviceInstance, final Channel channel) {
        ResponseQueue.createChannelQueue(channel);
        this.serviceInstance = serviceInstance;
        this.channel = channel;
    }

    public Channel getChannel() {
        return channel;
    }

    public void close() {
        ResponseQueue.removeChannelQueue(channel);
        serviceInstance = null;
        channel = null;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy