org.primordion.xholon.base
Interface IInteraction

All Superinterfaces:
IXholon
All Known Implementing Classes:
Interaction

public interface IInteraction
extends IXholon

UML 2.0 Interaction.

Since:
0.6 (Created on April 16, 2007) TODO lifeline has been converted from a Set to a Vector (Dec. 4, 2006). It now inefficiently has to call Vector.contains() to prevent duplicate entries in lifeline. It should probably make use of Hashtable.
Author:
Ken Webb

Field Summary
static int FORMAT_NONE
           
static int FORMAT_SDEDIT
           
static int FORMAT_SDEDIT_SOCKET
           
static int FORMAT_UML_GRAPH
           
static int MAX_DATA_LEN
           
static int MAX_LIFELINES_STORED
           
static int MAX_MESSAGES_STORED
           
static int MAX_NAME_LEN
           
 
Fields inherited from interface org.primordion.xholon.base.IXholon
DEFAULT_SIZE_MSG_Q, NINCLUDE_PSC, NINCLUDE_PSx, NINCLUDE_PxC, NINCLUDE_Pxx, NINCLUDE_xSC, NINCLUDE_xSx, NINCLUDE_xxC, NINCLUDE_xxx
 
Method Summary
 void addMessage(int signal, java.lang.Object data, IXholon sender, IXholon receiver, int index)
          Add a message to the interaction.
 void addMessage(Message msg)
          Add a message to the interaction.
 void addState(IStateMachineEntity state)
          Add a state to the sequence diagram, but only if getShowStates() == true.
 void createSequenceDiagram(java.lang.String modelName)
          Create a sequence diagram from the interaction.
 int getOutputFormat()
          Get the output format.
 boolean getShowStates()
          Get whether or not states will be shown on the sequence diagram.
 java.lang.String getSocketHost()
          Get the host for a socket connection, if using sdedit as a sequence diagram server.
 int getSocketPort()
          Get the port for a socket connection, if using sdedit as a sequence diagram server.
 void processReceivedMessage(Message msg)
          Process a message that was previously sent from one Xholon instance (the sender) and added to the Interaction, and has now been received by another Xholon instance (the receiver).
 void setOutputFormat(int outputFormat)
          Set the output format.
 void setShowStates(boolean showStates)
          Set whether or not to show states on the sequence diagram.
 void setSocketHost(java.lang.String socketHost)
          Set the host for a socket connection, if using sdedit as a sequence diagram server.
 void setSocketPort(int socketPort)
          Set the port for a socket connection, if using sdedit as a sequence diagram server.
 
Methods inherited from interface org.primordion.xholon.base.IXholon
act, appendChild, appendChild, appendChild, cleanup, configure, configure, createStructure, decVal, decVal, depth, draw, getChildNodes, getFirstChild, getFirstSibling, getId, getLastChild, getLastSibling, getName, getNeighbors, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumSiblings, getParentNode, getPort, getPreviousSibling, getRoleName, getRootNode, getSiblings, getUid, getVal_boolean, getVal_byte, getVal_char, getVal_double, getVal_float, getVal_int, getVal_long, getVal_Object, getVal_short, getVal_String, getVal, getXhc, getXhcId, getXhcName, getXhType, handleNodeSelection, hasAncestor, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, height, incVal, incVal, initialize, initStatics, inOrderPrint, insertAfter, insertBefore, insertFirstChild, isActiveObject, isBound, isContainer, isExternal, isInternal, isLeaf, isPassiveObject, isRootNode, performActivity, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postAct, postConfigure, postOrderPrint, postReconfigure, preAct, preConfigure, preOrderPrint, preReconfigure, print, println, processMessageQ, reconfigure, remove, removeChild, sendMessage, sendMessage, sendMessage, setAttributeVal, setFirstChild, setId, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setPorts, setRoleName, setUid, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVariableValue, setXhc, swapNode, terminate, treeSize, writeXml
 

Field Detail

MAX_MESSAGES_STORED

public static final int MAX_MESSAGES_STORED
See Also:
Constant Field Values

MAX_LIFELINES_STORED

public static final int MAX_LIFELINES_STORED
See Also:
Constant Field Values

MAX_NAME_LEN

public static final int MAX_NAME_LEN
See Also:
Constant Field Values

MAX_DATA_LEN

public static final int MAX_DATA_LEN
See Also:
Constant Field Values

FORMAT_NONE

public static final int FORMAT_NONE
See Also:
Constant Field Values

FORMAT_UML_GRAPH

public static final int FORMAT_UML_GRAPH
See Also:
Constant Field Values

FORMAT_SDEDIT

public static final int FORMAT_SDEDIT
See Also:
Constant Field Values

FORMAT_SDEDIT_SOCKET

public static final int FORMAT_SDEDIT_SOCKET
See Also:
Constant Field Values
Method Detail

setOutputFormat

public void setOutputFormat(int outputFormat)
Set the output format.

Parameters:
outputFormat - One of FORMAT_UML_GRAPH, FORMAT_SDEDIT, FORMAT_SDEDIT_SOCKET.

setSocketHost

public void setSocketHost(java.lang.String socketHost)
Set the host for a socket connection, if using sdedit as a sequence diagram server.

Parameters:
socketHost - A valid socket host (ex: localhost).

setSocketPort

public void setSocketPort(int socketPort)
Set the port for a socket connection, if using sdedit as a sequence diagram server.

Parameters:
socketPort - A valid socket port (ex: 60001).

setShowStates

public void setShowStates(boolean showStates)
Set whether or not to show states on the sequence diagram.

Parameters:
showStates - true or false

getOutputFormat

public int getOutputFormat()
Get the output format.

Returns:
One of FORMAT_UML_GRAPH, FORMAT_SDEDIT, FORMAT_SDEDIT_SOCKET.

getSocketHost

public java.lang.String getSocketHost()
Get the host for a socket connection, if using sdedit as a sequence diagram server.

Returns:
A socket host (ex: localhost).

getSocketPort

public int getSocketPort()
Get the port for a socket connection, if using sdedit as a sequence diagram server.

Returns:
A socket port (ex: 60001).

getShowStates

public boolean getShowStates()
Get whether or not states will be shown on the sequence diagram.

Returns:
true or false

addMessage

public void addMessage(Message msg)
Add a message to the interaction.

Parameters:
msg - The message.

addMessage

public void addMessage(int signal,
                       java.lang.Object data,
                       IXholon sender,
                       IXholon receiver,
                       int index)
Add a message to the interaction.

Parameters:
signal - A signal that identifies the type of message.
data - Optional data carried by the message.
sender - The sender of the message.
receiver - The intended receiver of the message.
index - A port replication index.

addState

public void addState(IStateMachineEntity state)
Add a state to the sequence diagram, but only if getShowStates() == true.

Parameters:
state - A state within a state machine.

processReceivedMessage

public void processReceivedMessage(Message msg)
Process a message that was previously sent from one Xholon instance (the sender) and added to the Interaction, and has now been received by another Xholon instance (the receiver).

Specified by:
processReceivedMessage in interface IXholon
Parameters:
msg - The message that was received.
See Also:
IXholon.processReceivedMessage(org.primordion.xholon.base.Message)

createSequenceDiagram

public void createSequenceDiagram(java.lang.String modelName)
Create a sequence diagram from the interaction.

Parameters:
modelName - The name of this model.