public class NioEndpoint.EventPoller extends Object implements Runnable
EventPoller
Created on Mar 26, 2012 at 12:51:53 PMModifier and Type | Field and Description |
---|---|
protected ConcurrentHashMap<Long,NioEndpoint.ChannelInfo> |
channelList |
protected long |
lastMaintain
Last run of maintain.
|
protected ConcurrentLinkedQueue<NioEndpoint.ChannelInfo> |
recycledChannelList |
Constructor and Description |
---|
EventPoller(int size)
Create a new instance of
EventPoller |
Modifier and Type | Method and Description |
---|---|
boolean |
add(NioChannel channel,
long timeout,
int flag)
Add the channel to the list of channels
|
void |
destroy()
Destroy the event poller
|
void |
init()
Initialize the event poller
|
void |
maintain()
Check timeouts and raise timeout event
|
protected boolean |
offer(NioEndpoint.ChannelInfo info)
Recycle the the
NioEndpoint.ChannelInfo |
protected NioEndpoint.ChannelInfo |
poll() |
protected boolean |
remove(long id)
Remove the channel having the specified id
|
boolean |
remove(NioChannel channel) |
boolean |
remove(NioEndpoint.ChannelInfo info) |
void |
run() |
protected long lastMaintain
protected ConcurrentHashMap<Long,NioEndpoint.ChannelInfo> channelList
protected ConcurrentLinkedQueue<NioEndpoint.ChannelInfo> recycledChannelList
public EventPoller(int size)
EventPoller
size
- public void maintain()
protected boolean remove(long id)
id
- public boolean remove(NioChannel channel)
channel
- public boolean remove(NioEndpoint.ChannelInfo info)
info
- public void init()
public void destroy()
protected NioEndpoint.ChannelInfo poll()
protected boolean offer(NioEndpoint.ChannelInfo info)
NioEndpoint.ChannelInfo
info
- public boolean add(NioChannel channel, long timeout, int flag)
channel
- timeout
- flag
- Copyright © 2014 JBoss by Red Hat. All rights reserved.