Class
Tree
          
SUMMARY: INNER | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD
 

com.newstep.solid.netio.packet
Class PacketChannelAccessPoint
com.newstep.solid.netio.AccessPoint
  |
  +--com.newstep.solid.netio.packet.PacketChannelAccessPoint

public class PacketChannelAccessPoint      
PacketChannelAccessPoint provides a means for creating and managing
PacketChannel instances.
 
Links:
Kernel Association Association Link
to Class SelectorThread
Associates type:
composition
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Directed.
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
Custom properties
link:
composition
 
Generalization Generalization Link
to Class AccessPoint
PacketChannelAccessPoint provides a means for creating and managing
PacketChannel instances.
 
 

Field Summary
private final static String
private final static Logger
private Collection
Constructor Summary
public void
Method Summary
protected void
close(PacketChannel packetChannel)
public void
getEndpoint(String text)
public void
listen(ChannelEndpoint localEndpoint, ConnectionListener connectionListener, Integer numberOfConnections)
openChannel(ChannelEndpoint remoteEndpoint, Integer timeout)
openChannel(ChannelEndpoint remoteEndpoint, CommChannelListener dataListener)
private void
startSelector(String name)
public void
protected void
Field Detail
CLASSNAME
private final static String CLASSNAME
Final.
Multiplicity:
1
Static.
 

logger
private final static Logger logger
Final.
Multiplicity:
1
Static.
 

packetChannels
private Collection packetChannels
Multiplicity:
1
Custom properties
associates:
com.newstep.netio.udp.PacketChannel
 

selectorThread
private SelectorThread selectorThread
Multiplicity:
1
 
Constructor Detail
PacketChannelAccessPoint
public void PacketChannelAccessPoint (String name)
 
creates new PacketChannelAccessPoint instance with the specified name and
starts the selector thread running
Parameters:
name the unique name for the access point
Stereotype:
create
 
Method Detail
close
protected void close (PacketChannel packetChannel)
 
closes the packet channel wrt the access point by removing it from the
packet channel collection
Parameters:
packetChannel the packet channel to close
 

finalize
public void finalize ()
 
finalizes the access point by stopping the selector thread
 

getEndpoint
public ChannelEndpoint getEndpoint (String text)
 
parses the text string and returns a valid Endpoint for the access
point type based on the parsed string. This allows clients to work in
independently from the endpoint types by manipulating input strings rather
than specific Endpoint types.
Custom properties
returns:
PacketChannelEndpoint instance based on the specified string value
 

listen
public void listen (ChannelEndpoint localEndpoint, ConnectionListener connectionListener, Integer numberOfConnections)
 
Creates a new PacketChannel instance, registers it with the selectorThread
and returns it immediately to the specified ConnectionListener for handling
Parameters:
localEndpoint the local endpoint on which to listen for new connections
connectionListener the new connection listener
numberOfConnections not used in the packet channel access point implementation
Throws:
IOException
 

openChannel
public CommChannel openChannel (ChannelEndpoint remoteEndpoint, Integer timeout)
 
Creates a PacketChannel instance connected to the specified remote
endpoint, waits the specified time before timeout on connection attempt
to the remote endpoint
Parameters:
remoteEndpoint the endpoint to which the returned channel is connected
timeout the duration to wait before timing-out the waiting to
connect to the specified remote endpoint
Throws:
IOException
 

openChannel
public CommChannel openChannel (ChannelEndpoint remoteEndpoint, CommChannelListener dataListener)
 
Creates a PacketChannel instance connected to the specified remote
endpoint, registers it with the selector and assigns the specified
CommChannelListener
Parameters:
remoteEndpoint the endpoint to which the returned channel is connected
dataListener the CommChannelListener to inform of new Packets
Throws:
IOException
 

openChannel
public CommChannel openChannel (ChannelEndpoint remoteEndpoint, CommChannelStateListener stateListener)
 
Creates a PacketChannel instance connected to the specified remote
endpoint, registers it with the selector and assigns the specified
CommChannelStateListener
Parameters:
remoteEndpoint the endpoint to which the returned channel is connected
stateListener the CommChannelListener to inform of new Packets
Throws:
IOException
 

startSelector
private void startSelector (String name)
 
Creates and starts the selector thread and waits for it to start up before
returning to the caller. In other words, it guarantees that the selector thread
is up and running after the execution of this method.
Parameters:
name the unique name of the access point used to construct a unique
thread name
 

stopListening
public void stopListening (ChannelEndpoint localEndpoint)
 
stops the listening packet channel -- nothing to do here since its not
waiting for more connections
Parameters:
localEndpoint the endpoint on which to cease listening for new
connections
 

stopSelector
protected void stopSelector ()
 
stops the access point selector thread
 

Class
Tree
          
SUMMARY: INNER | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD