Class
Tree
          
PREV CLASS NEXT CLASS
SUMMARY: INNER | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD
 

com.newstep.solid.netio.tcp
Class TcpStreamAccessPoint
com.newstep.solid.netio.AccessPoint
  |
  +--com.newstep.solid.netio.tcp.TcpIpAccessPoint
       |
       +--com.newstep.solid.netio.tcp.TcpStreamAccessPoint
All Implemented Interfaces:
       AcceptListener, ConnectListener

public class TcpStreamAccessPoint      
Implements:
ConnectListener
AcceptListener
 
Links:
Generalization Generalization Link
to Class TcpIpAccessPoint
 
Implementation Implementation Link
to Interface ConnectListener
 
Implementation Implementation Link
to Interface AcceptListener
 
 

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
ServerChannel(TcpChannelEndpoint endpoint, ConnectionListener listener, Integer count)
void
Method Summary
protected void
getEndpoint(String text)
protected SelectorThread
public void
listen(ChannelEndpoint localEndpoint, ConnectionListener connectionListener, Integer numberOfConnections)
public void
onAccept(SelectableChannel channel)
public void
onConnect(SelectableChannel channel)
openChannel(ChannelEndpoint remoteEndpoint, CommChannelListener dataListener)
openChannel(ChannelEndpoint remoteEndpoint, Integer timeout)
openChannel(ChannelEndpoint remoteEndpoint, CommChannelStateListener connectionListener)
public void
Field Detail
acceptingChannels
private ConcurrentHashMap acceptingChannels
Multiplicity:
1
 

className
protected final static String className
Final.
Multiplicity:
1
Static.
 

listeningChannels
private ConcurrentHashMap listeningChannels
Multiplicity:
1
 

lock
private ReentrantLock lock
Multiplicity:
1
 

logger
protected static Logger logger
Multiplicity:
1
Static.
 

openChannels
private LinkedList openChannels
Multiplicity:
1
 

pendingConnections
private ConcurrentHashMap pendingConnections
Multiplicity:
1
 
Constructor Detail
TcpStreamAccessPoint
void TcpStreamAccessPoint (String name, ChannelAccessPointConfig capConfig)
 
Parameters:
name
capConfig
Stereotype:
create
 
Method Detail
closeChannel
protected void closeChannel (TcpStreamChannel channel)
 
Parameters:
channel
 

getEndpoint
public ChannelEndpoint getEndpoint (String text)
 
Throws:
IOException
 

getSelectorThread
protected SelectorThread getSelectorThread ()
 
Return:
this access point's selector thread
 

listen
public void listen (ChannelEndpoint localEndpoint, ConnectionListener connectionListener, Integer numberOfConnections)
 
Throws:
IOException
 

onAccept
public void onAccept (SelectableChannel channel)
 
 

onConnect
public void onConnect (SelectableChannel channel)
 
 

openChannel
public CommChannel openChannel (ChannelEndpoint remoteEndpoint, CommChannelListener dataListener)
 
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
 

openChannel
public CommChannel openChannel (ChannelEndpoint remoteEndpoint, Integer timeout)
 
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
 

openChannel
public CommChannel openChannel (ChannelEndpoint remoteEndpoint, CommChannelStateListener connectionListener)
 
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
 

stopListening
public void stopListening (ChannelEndpoint localEndpoint)
 
 

Class
Tree
          
PREV CLASS NEXT CLASS
SUMMARY: INNER | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD