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

com.newstep.solid.netio.slip
Class SlipChannel
com.newstep.solid.netio.AbstractCommChannel
  |
  +--com.newstep.solid.netio.AbstractMessageChannel
       |
       +--com.newstep.solid.netio.slip.SlipChannel
All Implemented Interfaces:
       CommChannel, CommChannelStateListener, MessageChannel, ProtocolListener

public class SlipChannel      
Simple Length Indicator Protocol (SLIP) implements a basic protocol in which
messages are sent as byte sequences prefixed with a header indicating the length
of the message. The length header may be encoded as:



The length indicator may optionally be followed by a configurable number of
blank padding bytes.


Clients of the SLIP protocol channel are not exposed to the header
information and receive/send only the payload information. The SlipChannel is
not aware of the payload contents. The contents are simply used as a sequence
of bytes.


SlipChannels are abstracted from their associated transport. That is the
underlying transport protocol may be assigned through configuration as long
as it adheres to the
com.newstep.solid.netio.StreamChannel constructs.


SlipChannels are based on the
com.newstep.solid.netio.MessageChannel construct and are
managed by and accessed through their associated SlipAccessPoint. The
SlipAccessPoint may be used both to listen for connections as server to
SlipChannels, and to create SlipChannels as a client and connect to a remote
end point.


As clients of their underlying transport channel the SlipChannel state
mimics that of its transport once it is assigned. Prior to assignment the
SlipChannel will remain in the CREATED state.

Implements:
ProtocolListener
CommChannelStateListener
 
Links:
Kernel Association Association Link
to Class SlipAccessPoint
The SLIP Channel access point associated with the channel instance
NOTE: the protocol element used by the SlipChannel is defined int the
com.newstep.solid.netio.AbstractMessageChannel
implementation
Associates type:
association
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
protected
 
Implementation Implementation Link
to Interface ProtocolListener
Simple Length Indicator Protocol (SLIP) implements a basic protocol in which
messages are sent as byte sequences prefixed with a header indicating the length
of the message. The length header may be encoded as:



The length indicator may optionally be followed by a configurable number of
blank padding bytes.


Clients of the SLIP protocol channel are not exposed to the header
information and receive/send only the payload information. The SlipChannel is
not aware of the payload contents. The contents are simply used as a sequence
of bytes.


SlipChannels are abstracted from their associated transport. That is the
underlying transport protocol may be assigned through configuration as long
as it adheres to the
com.newstep.solid.netio.StreamChannel constructs.


SlipChannels are based on the
com.newstep.solid.netio.MessageChannel construct and are
managed by and accessed through their associated SlipAccessPoint. The
SlipAccessPoint may be used both to listen for connections as server to
SlipChannels, and to create SlipChannels as a client and connect to a remote
end point.


As clients of their underlying transport channel the SlipChannel state
mimics that of its transport once it is assigned. Prior to assignment the
SlipChannel will remain in the CREATED state.

 
Implementation Implementation Link
to Interface CommChannelStateListener
Simple Length Indicator Protocol (SLIP) implements a basic protocol in which
messages are sent as byte sequences prefixed with a header indicating the length
of the message. The length header may be encoded as:



The length indicator may optionally be followed by a configurable number of
blank padding bytes.


Clients of the SLIP protocol channel are not exposed to the header
information and receive/send only the payload information. The SlipChannel is
not aware of the payload contents. The contents are simply used as a sequence
of bytes.


SlipChannels are abstracted from their associated transport. That is the
underlying transport protocol may be assigned through configuration as long
as it adheres to the
com.newstep.solid.netio.StreamChannel constructs.


SlipChannels are based on the
com.newstep.solid.netio.MessageChannel construct and are
managed by and accessed through their associated SlipAccessPoint. The
SlipAccessPoint may be used both to listen for connections as server to
SlipChannels, and to create SlipChannels as a client and connect to a remote
end point.


As clients of their underlying transport channel the SlipChannel state
mimics that of its transport once it is assigned. Prior to assignment the
SlipChannel will remain in the CREATED state.

 
Generalization Generalization Link
to Class AbstractMessageChannel
Simple Length Indicator Protocol (SLIP) implements a basic protocol in which
messages are sent as byte sequences prefixed with a header indicating the length
of the message. The length header may be encoded as:



The length indicator may optionally be followed by a configurable number of
blank padding bytes.


Clients of the SLIP protocol channel are not exposed to the header
information and receive/send only the payload information. The SlipChannel is
not aware of the payload contents. The contents are simply used as a sequence
of bytes.


SlipChannels are abstracted from their associated transport. That is the
underlying transport protocol may be assigned through configuration as long
as it adheres to the
com.newstep.solid.netio.StreamChannel constructs.


SlipChannels are based on the
com.newstep.solid.netio.MessageChannel construct and are
managed by and accessed through their associated SlipAccessPoint. The
SlipAccessPoint may be used both to listen for connections as server to
SlipChannels, and to create SlipChannels as a client and connect to a remote
end point.


As clients of their underlying transport channel the SlipChannel state
mimics that of its transport once it is assigned. Prior to assignment the
SlipChannel will remain in the CREATED state.

 
 

Field Summary
private final static String
private static Logger
protected SlipAccessPoint
Constructor Summary
void
SlipChannel(SlipAccessPoint slipAccessPoint)
Method Summary
public synchronized void
public void
void
public void
public String
public void
write(Byte payload)
Field Detail
className
private final static String className
Final.
Multiplicity:
1
Static.
 

logger
private static Logger logger
Multiplicity:
1
Static.
 

slipAccessPoint
protected SlipAccessPoint slipAccessPoint
The SLIP Channel access point associated with the channel instance
NOTE: the protocol element used by the SlipChannel is defined int the
com.newstep.solid.netio.AbstractMessageChannel
implementation
Multiplicity:
1
 
Constructor Detail
SlipChannel
void SlipChannel (SlipAccessPoint slipAccessPoint)
 
Initializes the slip channel and assigns its access point
Parameters:
slipAccessPoint The SlipAccessPoint that manages the channel
Stereotype:
create
 
Method Detail
close
public synchronized void close ()
 
Closes the SlipChannel and its associated transport streams
Synchronized.
 

getLocalEndpoint
public ChannelEndpoint getLocalEndpoint ()
 
Gets the local end point from the associated transport
Return:
The local end point from the associated transport
 

getRemoteEndpoint
public ChannelEndpoint getRemoteEndpoint ()
 
Gets the remote end point from the associated transport
Return:
The remote end point from the associated transport
 

messageReceived
public void messageReceived (ProtocolMessage message)
 
Handles messages from the protocol stack and propagates them to message
channel listener
Parameters:
message The protocol message to be propagated to the listener
 

setTransportChannel
void setTransportChannel (StreamChannel transportChannel)
 
Sets the transport channel on the framing element and assumes the channel
state of the transport
Parameters:
transportChannel The transport channel whos state is assumed
 

stateChanged
public void stateChanged (CommChannelState newState)
 
Listens to the transport connection state and follows its states exactly
Parameters:
newState The new state of the transport
 

toString
public String toString ()
 
Gets the stringified SlipChannel representation
Return:
The stringified SlipChannel representation
 

write
public void write (Byte payload)
 
Throws:
IOException
 

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