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

com.taobao.api.internal.toplink.channel.netty.NettyChannelSender Maven / Gradle / Ivy

The newest version!
package com.taobao.api.internal.toplink.channel.netty;

import java.net.SocketAddress;
import java.util.HashMap;
import java.util.Map;

import org.jboss.netty.channel.Channel;

import com.taobao.api.internal.toplink.channel.ChannelSender;

public abstract class NettyChannelSender implements ChannelSender {
	protected Channel channel;
	private Map context;

	public NettyChannelSender(Channel channel) {
		this.channel = channel;
		this.context = new HashMap();
	}
	
	public Channel getChannel() {
		return this.channel;
	}
	
	public SocketAddress getLocalAddress() {
		return this.channel.getLocalAddress();
	}
	
	public SocketAddress getRemoteAddress() {
		return this.channel.getRemoteAddress();
	}
	
	public Object getContext(Object key) {
		return this.context.get(key);
	}

	public void setContext(Object key, Object value) {
		this.context.put(key, value);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy