com.newstep.solid.netio.tcp
|
Class TcpStreamAccessPoint
|
|
|
+--com.newstep.solid.netio.tcp.TcpStreamAccessPoint
public class TcpStreamAccessPoint
Implements:
ConnectListener
AcceptListener
Links:
Generalization Generalization Link
Implementation Implementation Link
Implementation Implementation Link
| Field Summary |
private ConcurrentHashMap |
|
protected final static String |
|
private ConcurrentHashMap |
|
private ReentrantLock |
|
protected static Logger |
|
private LinkedList |
|
private ConcurrentHashMap |
|
ServerSocketChannel |
channel |
|
connectionListener |
int |
counter |
|
localEndpoint |
| Constructor Summary |
void |
|
void |
|
| Method Summary |
protected void |
|
|
|
|
|
public void |
|
public void |
|
public void |
|
|
|
|
|
|
|
public void |
|
private ConcurrentHashMap acceptingChannels
Multiplicity:
1
protected final static String className
Final.
Multiplicity:
1
Static.
private ConcurrentHashMap listeningChannels
Multiplicity:
1
private ReentrantLock lock
Multiplicity:
1
protected static Logger logger
Multiplicity:
1
Static.
private LinkedList openChannels
Multiplicity:
1
private ConcurrentHashMap pendingConnections
Multiplicity:
1
Parameters:
name
capConfig
Stereotype:
create
Parameters:
channel
Throws:
IOException
Return:
this access point's selector thread
Throws:
IOException
public void onAccept (SelectableChannel channel)
public void onConnect (SelectableChannel channel)
Syncrhonously opens and connects a tcp channel to the remote endpoint
Parameters:
remoteEndpoint
endpoint to connect to
dataListener
listener to be notified on incomming data
Return:
newly opened and connected tcp channel
Throws:
IOException
Syncrhonously opens and connects a tcp channel to the remote endpoint
Parameters:
remoteEndpoint
endpoint to connect to
timeout
milliseconds to wait for the channel to get connected
Return:
newly opened and connected tcp channel
Throws:
IOException
Asyncrhonously opens a tcp channel and notifies connection listener upon establishing the
connection to the remote endpoint. registerStreamListener must be invoked on the channel upon
connection in order to be notified of incomming data.
Parameters:
remoteEndpoint
endpoint to connect to
connectionListener
listener to be notified on connection
Return:
newly opened tcp channel
Throws:
IOException