public static class NioEndpoint.ChannelInfo extends Object
ChannelInfo
Channel list class, used to avoid using a possibly large amount of objects with very little actual use.
Created on Apr 13, 2012 at 11:13:13 AMModifier and Type | Field and Description |
---|---|
protected NioChannel |
channel |
protected int |
flags |
static int |
READ |
static int |
RESUME |
protected long |
timeout |
static int |
WAKEUP |
static int |
WRITE |
Constructor and Description |
---|
ChannelInfo()
Create a new instance of
ChannelInfo |
ChannelInfo(NioChannel channel,
long timeout,
int flags)
Create a new instance of
ChannelInfo |
ChannelInfo(NioChannel channel,
long timeout,
TimeUnit unit,
int flags)
Create a new instance of
ChannelInfo |
Modifier and Type | Method and Description |
---|---|
static int |
merge(int flag1,
int flag2)
Merge the tow flags
|
boolean |
read() |
void |
read(boolean read)
Set the
read flag. |
void |
recycle()
Recycle this channel info for next use
|
boolean |
resume() |
void |
resume(boolean resume)
Set the
resume flag. |
boolean |
wakeup() |
void |
wakeup(boolean wakeup)
Set the
wakeup flag. |
boolean |
write() |
void |
write(boolean write)
Set the
write flag. |
public static final int READ
public static final int WRITE
public static final int RESUME
public static final int WAKEUP
protected NioChannel channel
protected long timeout
protected int flags
public ChannelInfo()
ChannelInfo
public ChannelInfo(NioChannel channel, long timeout, int flags)
ChannelInfo
channel
- the channeltimeout
- the channel timeout. The default time unit is
java.util.concurrent.TimeUnit.MILLISECONDS
flags
- public ChannelInfo(NioChannel channel, long timeout, TimeUnit unit, int flags)
ChannelInfo
channel
- timeout
- unit
- flags
- public void recycle()
public boolean read()
public void read(boolean read)
read
flag. If the parameter is true, the read
flag will have the value 1 else 0.read
- public boolean write()
public void write(boolean write)
write
flag. If the parameter is true, the write
flag will have the value 1 else 0.write
- public boolean resume()
public void resume(boolean resume)
resume
flag. If the parameter is true, the
resume flag will have the value 1 else 0.resume
- public boolean wakeup()
public void wakeup(boolean wakeup)
wakeup
flag. If the parameter is true, the
wakeup flag will have the value 1 else 0.wakeup
- public static int merge(int flag1, int flag2)
flag1
- flag2
- Copyright © 2018 JBoss by Red Hat. All rights reserved.