All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class uhr.core.msg.ConnectionStd

java.lang.Object
   |
   +----uhr.core.msg.ConnectionStd

public class ConnectionStd
extends Object
implements Connection
This class describes a single connection between parts in a cell and the cell's MessageRouter. It is used to connect and disconnect connections, as well as describe existing connections. It is immutable.


Constructor Index

 o ConnectionStd()
A no-arg constructor for internal use and future serialization.

Method Index

 o convertTypeToConstant(String)
Returns the connection constant given its String representation.
 o createDirectConnection(String, String, String, MessageSender, MessageReceiver)
Creates a direct connection.
 o createReceiverConnection(String, int, String, MessageReceiver)
Creates a receiver connection.
 o createSenderConnection(String, int, String, MessageSender)
Creates a sender connection.
 o getConnectionType()
Returns the connection type.
 o getConnectionTypeString()
Returns the String for the connection type constant.
 o getMessageName()
Returns the message name.
 o getMessageReceiver()
Returns the receiver or null if a sender connection.
 o getMessageSender()
Returns the sender or null if a receiver connection.
 o getReceiverName()
Returns the receiver name or null if a sender connection.
 o getSenderName()
Returns the sender name or null if a receiver connection.
 o isDirectConnection()
Determines whether this is a direct connection.
 o isReceiverConnection()
Determines whether this is a receiver connection.
 o isSenderConnection()
Determines whether this is a sender connection.

Constructors

 o ConnectionStd
 public ConnectionStd()
A no-arg constructor for internal use and future serialization.

Methods

 o createSenderConnection
 public Connection createSenderConnection(String messageName,
                                          int connectionType,
                                          String senderName,
                                          MessageSender sender)
Creates a sender connection. Senders send message signals.

Parameters:
messageName - the name of the signal to connect.
connectionType - the type of connection, which must be SIGNAL_OUT, SIGNAL_IN or SERVICE_NEED.
senderName - the name of the sender part.
sender - the sender in the connection.
 o createReceiverConnection
 public Connection createReceiverConnection(String messageName,
                                            int connectionType,
                                            String receiverName,
                                            MessageReceiver receiver)
Creates a receiver connection. Receivers have interests in particular messages.

Parameters:
messageName - the name of the interest to connect.
connectionType - the type of connection, which must be INTEREST_OUT, INTEREST_IN or SERVICE_SUPPLIER.
receiverName - the name of the receiver part.
receiver - the receiver in the connection.
 o createDirectConnection
 public Connection createDirectConnection(String messageName,
                                          String senderName,
                                          String receiverName,
                                          MessageSender sender,
                                          MessageReceiver receiver)
Creates a direct connection. Messages with this messageName will go directly as possible from the sender to receiver.

Parameters:
messageName - the name of the interest to connect.
senderName - the name of the sender part.
receiverName - the name of the receiver part.
sender - the sender in the connection.
receiver - the receiver in the connection.
 o isSenderConnection
 public boolean isSenderConnection()
Determines whether this is a sender connection.

Returns:
true is this is a sender connection, false if not.
 o isReceiverConnection
 public boolean isReceiverConnection()
Determines whether this is a receiver connection.

Returns:
true is this is a receiver connection, false if not.
 o isDirectConnection
 public boolean isDirectConnection()
Determines whether this is a direct connection.

Returns:
true is this is a direct connection, false if not.
 o getMessageName
 public String getMessageName()
Returns the message name.

Returns:
the the message name.
 o getConnectionType
 public int getConnectionType()
Returns the connection type.

Returns:
the connection type.
 o getConnectionTypeString
 public String getConnectionTypeString()
Returns the String for the connection type constant. For example if the type is Connection.DIRECT then "DIRECT" is returned.

Returns:
the String for the connection type constant.
 o convertTypeToConstant
 public int convertTypeToConstant(String connectionType)
Returns the connection constant given its String representation. For example if given "DIRECT" then Connection.DIRECT is returned.

Returns:
the connection constant for the String.
 o getSenderName
 public String getSenderName()
Returns the sender name or null if a receiver connection.

Returns:
the sender name or null if a receiver connection.
 o getReceiverName
 public String getReceiverName()
Returns the receiver name or null if a sender connection.

Returns:
the receiver name or null if a sender connection.
 o getMessageSender
 public MessageSender getMessageSender()
Returns the sender or null if a receiver connection.

Returns:
the sender or null if a receiver connection.
 o getMessageReceiver
 public MessageReceiver getMessageReceiver()
Returns the receiver or null if a sender connection.

Returns:
the receiver or null if a sender connection.

All Packages  Class Hierarchy  This Package  Previous  Next  Index