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

com.newstep.solid.netio.slip
Class SlipAccessPoint
com.newstep.solid.netio.AccessPoint
  |
  +--com.newstep.solid.netio.slip.SlipAccessPoint
Direct Known Subclasses:
       SlipTransConnListenerTest.TestSlipAccessPoint, TestSlipAccessPoint

public class SlipAccessPoint      
The access point for Simple Length Indicated Protocol (SLIP).
The SlipAccessPoint manages access to SlipChannel instances for both client
and server SlipChannel usage. In order to provide a Slip server, the
SlipAccessPoint.listen(...) must be invoked with an associated
ConnectionListener such that the access point knows the proper handler for
newly created SlipChannels. In addition, the access point must receive the
localEndpoint infomation indicating how it should manifest itself as a
listening server.


Client implementations may access SlipChannels via the openChannel(...)
methods. These methods provide both blocking and non-blocking channel
openning mechanisms.

NOTE: when openChannel be sure that the returned
SlipChannel is assigned both a com.newstep.solid.netio.MessageListener
and a com.newstep.solid.netio.CommChannelStateListener.
These may be assigned by the openChannel(...) function. Please check the
docs for further details.


In order to maintain the transport protocol abstraction, the SlipAccessPoint
leverages the underlying transport protocol access point whose factory class
MUST be defined in the SlipAccessPointConfig.


In order to avoid exposing the newConnection(...) function to its
clients, the SlipAccessPoint leverages the SlipTranConnListener to handle
new connections from the transport layer. This encapsulation also helps to
associate the channel with the local endpoint on which it was connected.

 
Links:
Kernel Association Association Link
to Class AccessPoint
The access point for the associated transport channels
Associates type:
association
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
protected
 
Kernel Association Association Link
to Class SlipAccessPointConfig
Associates type:
association
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
 
Generalization Generalization Link
to Class AccessPoint
The access point for Simple Length Indicated Protocol (SLIP).
The SlipAccessPoint manages access to SlipChannel instances for both client
and server SlipChannel usage. In order to provide a Slip server, the
SlipAccessPoint.listen(...) must be invoked with an associated
ConnectionListener such that the access point knows the proper handler for
newly created SlipChannels. In addition, the access point must receive the
localEndpoint infomation indicating how it should manifest itself as a
listening server.


Client implementations may access SlipChannels via the openChannel(...)
methods. These methods provide both blocking and non-blocking channel
openning mechanisms.

NOTE: when openChannel be sure that the returned
SlipChannel is assigned both a com.newstep.solid.netio.MessageListener
and a com.newstep.solid.netio.CommChannelStateListener.
These may be assigned by the openChannel(...) function. Please check the
docs for further details.


In order to maintain the transport protocol abstraction, the SlipAccessPoint
leverages the underlying transport protocol access point whose factory class
MUST be defined in the SlipAccessPointConfig.


In order to avoid exposing the newConnection(...) function to its
clients, the SlipAccessPoint leverages the SlipTranConnListener to handle
new connections from the transport layer. This encapsulation also helps to
associate the channel with the local endpoint on which it was connected.

 
 

Field Summary
String
protected Collection
protected ReentrantLock
protected final static String
protected static Logger
private String
protected HashMap
protected AccessPoint
Constructor Summary
protected void
Method Summary
protected void
addChannel(SlipChannel slipChannel)
protected void
getEndpoint(String text)
public String
public void
listen(ChannelEndpoint localEndpoint, ConnectionListener connectionListener, Integer numberOfConnections)
openChannel(ChannelEndpoint remoteEndpoint, CommChannelListener dataListener)
openChannel(ChannelEndpoint remoteEndpoint, Integer timeout)
openChannel(ChannelEndpoint remoteEndpoint, CommChannelStateListener channelStateListener)
public void
Field Detail
channels
protected Collection channels
The collection of active SlipChannels
Multiplicity:
1
 

channelsLock
protected ReentrantLock channelsLock
A concurrecy lock for channels Collection access
Multiplicity:
1
 

className
protected final static String className
The fully qualified SlipAccessPoint class name used for logging
Final.
Multiplicity:
1
Static.
 

logger
protected static Logger logger
The access point logger
Multiplicity:
1
Static.
 

name
String name
 

name
private String name
Multiplicity:
1
 

slipAccessPointConfig
private SlipAccessPointConfig slipAccessPointConfig
Multiplicity:
1
 

transConnListeners
protected HashMap transConnListeners
A collection of transport connection listeners mapped by
their associated end points
Multiplicity:
1
 

transportAccessPoint
protected AccessPoint transportAccessPoint
The access point for the associated transport channels
Multiplicity:
1
 
Constructor Detail
SlipAccessPoint
protected void SlipAccessPoint (String name, ChannelAccessPointConfig config)
 
Creates a new slip access point with the specified name and configuration
Parameters:
name The name for the new SlipAccessPoint
config The configuration of the new SlipAccessPoint
Stereotype:
create
 
Method Detail
addChannel
protected void addChannel (SlipChannel slipChannel)
 
Adds the specified channel to the channels collection
Parameters:
slipChannel The channel to be added to the access point
 

closeChannel
protected void closeChannel (SlipChannel slipChannel)
 
Notifies the access point of the channel closure
Parameters:
slipChannel The closed channel
 

getConfiguration
SlipAccessPointConfig getConfiguration ()
 
Return:
The access point config
 

getEndpoint
public ChannelEndpoint getEndpoint (String text)
 
Destringifies an endpoint reference
Parameters:
text A stringified endpoint descriptor
Return:
A ChannelEndpoint based on the stringified parameter
Throws:
IOException
 

getName
public String getName ()
 
Gets the name of the slip access point.
Return:
The name of the slip access point
 

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

openChannel
public CommChannel openChannel (ChannelEndpoint remoteEndpoint, CommChannelListener dataListener)
 
Opens a client SlipChannel instance to the specified end point
Parameters:
remoteEndpoint The remote endpoint to connect the channel

NOTE: for SlipChannels the remote end point type must match the
underlying transport type used by the channel.
dataListener The listener entity for the new channel

NOTE: for SlipChannels the listener MUST be a MessageListener

Return:
An open SlipChannel in the CONNECTED state
Throws:
IOException
 

openChannel
public CommChannel openChannel (ChannelEndpoint remoteEndpoint, Integer timeout)
 
Blocking call to get an open channel does not assign the channel listener.
This must be done on the returned CommChannel in the same thread as the return
Parameters:
remoteEndpoint the remote end point


NOTE: for SlipChannels the remote end point type must match the
underlying transport type used by the channel.
timeout The duration in seconds after which the access point should
timeout if no channel has been openned

Return:
An open comm channel/slip channel in the CONNECTED state
Throws:
IOException
 

openChannel
public CommChannel openChannel (ChannelEndpoint remoteEndpoint, CommChannelStateListener channelStateListener)
 
Opens a SlipChannel asynchronously with the specified state listener
assigned to receive the channel status updates.
Parameters:
remoteEndpoint The remote endpoint


NOTE: for SlipChannels the remote end point type must match the
underlying transport type used by the channel.
channelStateListener The entity to be assigned as the new
channel's state listener during the asynchronous channel opening

Throws:
IOException
 

stopListening
public void stopListening (ChannelEndpoint localEndpoint)
 
Stops the access point from listening on the specified local end point
Parameters:
localEndpoint The local end point on which to stop listening
 

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