本文整理了Java中org.jboss.netty.channel.Channel.getAttachment()
方法的一些代码示例,展示了Channel.getAttachment()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Channel.getAttachment()
方法的具体详情如下:
包路径:org.jboss.netty.channel.Channel
类名称:Channel
方法名:getAttachment
[英]Retrieves an object which is #setAttachment(Object) to this Channel.
[中]检索此通道的#setAttachment(对象)对象。
代码示例来源:origin: com.ning/async-http-client
public static Object getAttribute(Channel channel) {
return channel.getAttachment();
}
代码示例来源:origin: org.apache.camel/camel-netty
/**
* To get the {@link NettyCamelState} from the given channel.
*/
public NettyCamelState getState(Channel channel) {
return (NettyCamelState) channel.getAttachment();
}
代码示例来源:origin: org.asynchttpclient/async-http-client-netty3-provider
public static Object getAttribute(Channel channel) {
return channel.getAttachment();
}
代码示例来源:origin: io.gatling/async-http-client
public static Object getAttribute(Channel channel) {
return channel.getAttachment();
}
代码示例来源:origin: org.asynchttpclient/async-http-client-netty3
public static Object getAttribute(Channel channel) {
return channel.getAttachment();
}
代码示例来源:origin: io.libraft/libraft-agent
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) {
Object attachment = e.getChannel().getAttachment();
Throwable channelException = e.getCause();
if (channelException instanceof ConnectException) {
LOGGER.warn("{}: closing channel to {}: {}", self, attachment, channelException.getMessage());
} else {
LOGGER.warn("{}: caught exception - closing channel to {}", self, attachment, channelException);
}
e.getChannel().close();
}
}
代码示例来源:origin: k3po/k3po
ChannelAddress transportCandidate = (ChannelAddress) ctx.getChannel().getParent().getAttachment();
ChannelAddress candidate = new ChannelAddress(tlsLocation, transportCandidate);
代码示例来源:origin: k3po/k3po
ChannelAddress transportCandidate = (ChannelAddress) ctx.getChannel().getParent().getAttachment();
ChannelAddress candidate = new ChannelAddress(httpLocation, transportCandidate);
内容来源于网络,如有侵权,请联系作者删除!