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

com.newstep.solid.comm.rtt
Class RttChannel
com.newstep.solid.comm.AbstractChannel
  |
  +--com.newstep.solid.comm.ProtocolElement
       |
       +--com.newstep.solid.comm.rtt.RttChannel
All Implemented Interfaces:
       Channel, ChannelListener, ChannelStatusListener, TimerListener

public class RttChannel      
The RttChannel is the RTT implementation of a channel. An Rtt channel can be
of a Server type or a Client type. When Server, it gets created when a
connection is accepted . When Client, it gets created at the client
application's request which has to supply the host it's connecting to and an
unigue client ID. The client application has to register a channel status
listener for this Rtt channel in order to get notified when the channel has
actually connected and it can be used for read/writes. In both cases the
application has to register a channel listener of this Rtt channel in order
to receive messages sent through the channel.
Implements:
ChannelStatusListener
TimerListener
 
Links:
Kernel Association Association Link
to Class RttChannelFactory
Associates type:
association
Client cardinality:
1..*
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Directed.
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
Custom properties
associates:
RttChannelFactory
 
Kernel Association Association Link
to Class RttTimer
Associates type:
aggregationByValue
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Supplier cardinality:
0..1
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
Custom properties
link:
aggregationByValue
 
Kernel Association Association Link
to Enumeration Type
Associates type:
association
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
 
Kernel Association Association Link
to Class ProtocolElement
Associates type:
association
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
private
 
Implementation Implementation Link
to Interface ChannelStatusListener
The RttChannel is the RTT implementation of a channel. An Rtt channel can be
of a Server type or a Client type. When Server, it gets created when a
connection is accepted . When Client, it gets created at the client
application's request which has to supply the host it's connecting to and an
unigue client ID. The client application has to register a channel status
listener for this Rtt channel in order to get notified when the channel has
actually connected and it can be used for read/writes. In both cases the
application has to register a channel listener of this Rtt channel in order
to receive messages sent through the channel.
 
Implementation Implementation Link
to Interface TimerListener
The RttChannel is the RTT implementation of a channel. An Rtt channel can be
of a Server type or a Client type. When Server, it gets created when a
connection is accepted . When Client, it gets created at the client
application's request which has to supply the host it's connecting to and an
unigue client ID. The client application has to register a channel status
listener for this Rtt channel in order to get notified when the channel has
actually connected and it can be used for read/writes. In both cases the
application has to register a channel listener of this Rtt channel in order
to receive messages sent through the channel.
 
Generalization Generalization Link
to Class ProtocolElement
The RttChannel is the RTT implementation of a channel. An Rtt channel can be
of a Server type or a Client type. When Server, it gets created when a
connection is accepted . When Client, it gets created at the client
application's request which has to supply the host it's connecting to and an
unigue client ID. The client application has to register a channel status
listener for this Rtt channel in order to get notified when the channel has
actually connected and it can be used for read/writes. In both cases the
application has to register a channel listener of this Rtt channel in order
to receive messages sent through the channel.
 
 

Nested Class Summary
public Static class
RttState
Field Summary
int
RttState
private String
private static String
private long
private boolean
private int
private RttState
public static int
private int
private Type
RttState
CLOSING
RttState
ERROR
RttState
EXTRA
RttState
IDENT
RttState
NONE
RttState
OPEN
RttState
REDUNDANT
private RttTimer
Constructor Summary
public void
RttChannel(Channel subChannel, ProtocolBuilder protocolFactory)
Method Summary
public void
public void
public void
public int
public RttState
public Address
public String
public int
public Address
public Type
public boolean
public void
public void
private void
private void
private void
private void
public void
setHostId(Integer hostId)
public void
setInternalState(RttState internalState)
public void
setName(String name)
public void
setPartnerId(Integer partnerID)
public void
public void
public void
public void
public String
public void
write(Message message)
Field Detail
channelName
private String channelName
Multiplicity:
1
 

className
private static String className
Multiplicity:
1
Static.
 

DELAY
private long DELAY
Multiplicity:
1
 

enabled
private boolean enabled
Multiplicity:
1
 

hostId
private int hostId
Multiplicity:
1
 

hostId
int hostId
 

internalState
RttState internalState
 

internalState
private RttState internalState
Multiplicity:
1
 

nextId
public static int nextId
Multiplicity:
1
Static.
 

partnerID
private int partnerID
Multiplicity:
1
 

protocolFactory
private ProtocolBuilder protocolFactory
Multiplicity:
1
Custom properties
associates:
RttChannelFactory
 

red
private ProtocolElement red
Multiplicity:
1
 

role
Type role
 

role
private Type role
Multiplicity:
1
 

timer
private RttTimer timer
Multiplicity:
1
 
Constructor Detail
RttChannel
public void RttChannel (Channel subChannel, ProtocolBuilder protocolFactory)
 
Constructor
Parameters:
subChannel
protocolFactory
Stereotype:
create
 
Method Detail
close
public void close ()
 
Channel Interface . Closes the channel
Throws:
ChannelException
 

disable
public void disable ()
 
Disables the RttChannel Sends a disable message to the server
 

enable
public void enable ()
 
Enables the RttChannel . Sends an enable message to the server
 

getHostId
public int getHostId ()
 
Returns the ID of this channel
Return:
int
 

getInternalState
public RttState getInternalState ()
 
 

getLocalAddress
public Address getLocalAddress ()
 
Return a Host
 

getName
public String getName ()
 
 

getPartnerId
public int getPartnerId ()
 
Returns the partner ID of this channel
Return:
TODO
 

getRedElement
public ProtocolElement getRedElement ()
 
Returns the redundant element of this channel. Used by the factory
Return:
ProtocolElement
 

getRemoteAddress
public Address getRemoteAddress ()
 
Return a Host
 

getRole
public Type getRole ()
 
 

isEnabled
public boolean isEnabled ()
 
Returns the enabled status of the channel
 

onMessage
public void onMessage (Message message)
 
ChannelListener Interface. Call back function for receiving a message.
 

open
public void open ()
 
Channel Interface. Opens the channel
Throws:
ChannelException
 

sendDisableMessage
private void sendDisableMessage ()
 
Sends the DISABLE message
 

sendEnableMessage
private void sendEnableMessage ()
 
Sends the ENABLE message.
 

sendExtraIdMessage
private void sendExtraIdMessage ()
 
This message is sent when the channel becomes REDUNDANT.
Throws:
ChannelException
 

sendFirstIdMessage
private void sendFirstIdMessage ()
 
Sends the ID_NEW message.
Throws:
ChannelException
 

setHostId
public void setHostId (Integer hostId)
 
Assigns the id of this channel. Has to be unique for one redundant
channel
Parameters:
hostId
 

setInternalState
public void setInternalState (RttState internalState)
 
 

setName
public void setName (String name)
 
 

setPartnerId
public void setPartnerId (Integer partnerID)
 
Assigns the partner ID of this channel
Parameters:
partnerID
 

setRedElement
public void setRedElement (ProtocolElement red)
 
Assigns the redundant element of this channel. Used by the factory
Parameters:
red
 

setRole
public void setRole (Type role)
 
 

statusChanged
public void statusChanged (Channel channel, ChannelState state)
 
ChannelStatusListener interface. Call back function for changes in status
 

timerExpired
public void timerExpired ()
 
TimerListener interface. The channel didn't connect on time; close the
channel and let the application decide what to do next
 

toString
public String toString ()
 
String representation of this channel
 

write
public void write (Message message)
 
Channel Interface. Writes a message on the channel. For a DATA messages
it only writes the message if the channel is enabled. Use isEnabled() to
ckeck for the enabled status
Throws:
ChannelException
 

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