|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||
java.lang.Objectorg.jboss.netty.channel.AbstractChannel
public abstract class AbstractChannel

Channel的脚架实现.
| 字段摘要 |
|---|
| 从接口 org.jboss.netty.channel.Channel 继承的字段 |
|---|
OP_NONE, OP_READ, OP_READ_WRITE, OP_WRITE |
| 方法摘要 | |
|---|---|
ChannelFuture |
bind(java.net.SocketAddress localAddress)
异步绑定该通道到指定的本地地址. |
ChannelFuture |
close()
异步关闭通道.如果该通道已经绑定或连接,则会先断开连接和取消绑定.一旦该通道被关闭,将不能再次打开.在一个关闭的通道调用该方法不会有任何效果. |
int |
compareTo(Channel o)
比较两个通道的ID. |
ChannelFuture |
connect(java.net.SocketAddress remoteAddress)
异步连接该通道到指定的远程地址. |
ChannelFuture |
disconnect()
异步从当前远程地址断开连接. |
boolean |
equals(java.lang.Object o)
只有当指定的对象与该对象相同时返回true(如: this == o). |
ChannelFuture |
getCloseFuture()
返回一个当通道被关闭会接收通知的 ChannelFuture. |
ChannelFactory |
getFactory()
返回创建该通道的 ChannelFactory. |
java.lang.Integer |
getId()
返回该通道唯一的整型ID. |
int |
getInterestOps()
返回该通道当前的 interestOps. |
Channel |
getParent()
返回该通道的父通道. |
ChannelPipeline |
getPipeline()
返回连接该通道用来处理 ChannelEvent事件的ChannelPipeline. |
int |
hashCode()
返回该通道的哈希标识 . |
boolean |
isOpen()
只有当该通道是打开的才返回 true. |
boolean |
isReadable()
只有当I/O线程可以从该通道读取消息时才返回true.该方法是以下代码的快捷方式: return (getInterestOps() & OP_READ) ! |
boolean |
isWritable()
只有当I/O线程可以执行请求立即写操作时才返回true.当该方法返回false时任何写操作都会被排队直到I/O线程准备处理队列的写请求为止. |
ChannelFuture |
setInterestOps(int interestOps)
异步改变该通道的 interestOps. |
ChannelFuture |
setReadable(boolean readable)
异步挂起或恢复I/O线程的读操作.该方法是以下代码的快捷方式: int interestOps = getInterestOps(); if (readable) { setInterestOps(interestOps | OP_READ); } else { setInterestOps(interestOps & ˜OP_READ); } |
java.lang.String |
toString()
返回该缓冲的字符串形式.为了更简单标识,返回的字符串包含了该缓冲的 ID, 本地地址,和 远程地址. |
ChannelFuture |
unbind()
异步取消与当前本地地址的绑定. |
ChannelFuture |
write(java.lang.Object message)
异步返送消息到该通道.如果该通道是使用无连接传输创建的(如. |
ChannelFuture |
write(java.lang.Object message,
java.net.SocketAddress remoteAddress)
异步发送消息到该通道.它有一个附加的参数允许用户使用指定的远程地址代替当前远程地址来发送消息. |
| 从类 java.lang.Object 继承的方法 |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| 从接口 org.jboss.netty.channel.Channel 继承的方法 |
|---|
getConfig, getLocalAddress, getRemoteAddress, isBound, isConnected |
| 方法详细信息 |
|---|
public final java.lang.Integer getId()
Channel 复制的描述
Channel 中的 getIdpublic Channel getParent()
Channel 复制的描述
Channel 中的 getParentnull.public ChannelFactory getFactory()
Channel 复制的描述ChannelFactory.
Channel 中的 getFactorypublic ChannelPipeline getPipeline()
Channel 复制的描述ChannelEvent事件的ChannelPipeline.
Channel 中的 getPipelinepublic final int hashCode()
java.lang.Object 中的 hashCodepublic final boolean equals(java.lang.Object o)
this == o).
java.lang.Object 中的 equalspublic final int compareTo(Channel o)
java.lang.Comparable<Channel> 中的 compareTopublic boolean isOpen()
Channel 复制的描述true.
Channel 中的 isOpenpublic ChannelFuture bind(java.net.SocketAddress localAddress)
Channel 复制的描述
Channel 中的 bindlocalAddress - 绑定地址
ChannelFuturepublic ChannelFuture unbind()
Channel 复制的描述
Channel 中的 unbindChannelFuturepublic ChannelFuture close()
Channel 复制的描述
Channel 中的 closeChannelFuturepublic ChannelFuture getCloseFuture()
Channel 复制的描述ChannelFuture. 该方法总是返回相同的future实例.
Channel 中的 getCloseFuturepublic ChannelFuture connect(java.net.SocketAddress remoteAddress)
Channel 复制的描述
Channel 中的 connectremoteAddress - 连接的远程地址
ChannelFuturepublic ChannelFuture disconnect()
Channel 复制的描述
Channel 中的 disconnectChannelFuturepublic int getInterestOps()
Channel 复制的描述interestOps.
Channel 中的 getInterestOpsChannel.OP_NONE, Channel.OP_READ, Channel.OP_WRITE, 或
Channel.OP_READ_WRITEpublic ChannelFuture setInterestOps(int interestOps)
Channel 复制的描述interestOps.
Channel 中的 setInterestOpsinterestOps - 新的interestOps
interestOps改变成功或失败时能接收到通知的ChannelFuturepublic boolean isReadable()
Channel 复制的描述return (getInterestOps() & OP_READ) != 0;
Channel 中的 isReadablepublic boolean isWritable()
Channel 复制的描述return (getInterestOps() & OP_WRITE) == 0;
Channel 中的 isWritablepublic ChannelFuture setReadable(boolean readable)
Channel 复制的描述
int interestOps = getInterestOps();
if (readable) {
setInterestOps(interestOps | OP_READ);
} else {
setInterestOps(interestOps & ˜OP_READ);
}
Channel 中的 setReadablereadable - true则为恢复读操作,false为挂起读操作
interestOps改变成功或失败时能接收到通知的ChannelFuturepublic ChannelFuture write(java.lang.Object message)
Channel 复制的描述DatagramChannel)并且还没有连接, 你必须使用
Channel.write(Object, SocketAddress)代替.否则,写请求会抛出
NotYetConnectedException并且'exceptionCaught'事件会被触发.
Channel 中的 writemessage - 要写的消息
ChannelFuture
public ChannelFuture write(java.lang.Object message,
java.net.SocketAddress remoteAddress)
Channel 复制的描述DatagramChannel)创建且还没有连接,你必须指定一个非空的地址.否则,写请求会抛出
NotYetConnectedException并且'exceptionCaught'事件会被触发.
Channel 中的 writemessage - 要写的消息remoteAddress - 消息要发送的远程地址.如果为null,则和方法Channel.write(Object)相同.
ChannelFuturepublic java.lang.String toString()
java.lang.Object 中的 toString
|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||