org.primordion.xholon.base
Class Interaction

java.lang.Object
  extended byorg.primordion.xholon.base.Xholon
      extended byorg.primordion.xholon.base.Interaction
All Implemented Interfaces:
IInteraction, IXholon

public class Interaction
extends Xholon
implements IInteraction

UML 2.0 Interaction.

Since:
0.2 (Created on Nov 24, 2005) 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
 
Fields inherited from class org.primordion.xholon.base.Xholon
DEFAULT_LEVEL, interaction, interactionsEnabled
 
Fields inherited from interface org.primordion.xholon.base.IInteraction
FORMAT_NONE, FORMAT_SDEDIT, FORMAT_SDEDIT_SOCKET, FORMAT_UML_GRAPH, MAX_DATA_LEN, MAX_LIFELINES_STORED, MAX_MESSAGES_STORED, 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
 
Constructor Summary
Interaction()
          Constructor.
 
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 class org.primordion.xholon.base.Xholon
act, appendChild, appendChild, appendChild, cleanup, configure, configure, createStructure, decVal, decVal, depth, draw, getChildNodes, getFirstChild, getFirstSibling, getId, getLastChild, getLastSibling, getName, getNeighbors, getNextId, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumSiblings, getParentNode, getPort, getPreviousSibling, getRoleName, getRootNode, getSiblings, getSizeMessageQ, 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, resetNextId, sendMessage, sendMessage, sendMessage, setAttributeVal, setFactory, setFirstChild, setId, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setPorts, setRoleName, setSizeMessageQ, setUid, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVariableValue, setXhc, swapNode, terminate, toString, treeSize, writeXml
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
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
 

Constructor Detail

Interaction

public Interaction()
Constructor.

Method Detail

setOutputFormat

public void setOutputFormat(int outputFormat)
Description copied from interface: IInteraction
Set the output format.

Specified by:
setOutputFormat in interface IInteraction
Parameters:
outputFormat - One of FORMAT_UML_GRAPH, FORMAT_SDEDIT, FORMAT_SDEDIT_SOCKET.

setSocketHost

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

Specified by:
setSocketHost in interface IInteraction
Parameters:
socketHost - A valid socket host (ex: localhost).

setSocketPort

public void setSocketPort(int socketPort)
Description copied from interface: IInteraction
Set the port for a socket connection, if using sdedit as a sequence diagram server.

Specified by:
setSocketPort in interface IInteraction
Parameters:
socketPort - A valid socket port (ex: 60001).

setShowStates

public void setShowStates(boolean showStates)
Description copied from interface: IInteraction
Set whether or not to show states on the sequence diagram.

Specified by:
setShowStates in interface IInteraction
Parameters:
showStates - true or false

getOutputFormat

public int getOutputFormat()
Description copied from interface: IInteraction
Get the output format.

Specified by:
getOutputFormat in interface IInteraction
Returns:
One of FORMAT_UML_GRAPH, FORMAT_SDEDIT, FORMAT_SDEDIT_SOCKET.

getSocketHost

public java.lang.String getSocketHost()
Description copied from interface: IInteraction
Get the host for a socket connection, if using sdedit as a sequence diagram server.

Specified by:
getSocketHost in interface IInteraction
Returns:
A socket host (ex: localhost).

getSocketPort

public int getSocketPort()
Description copied from interface: IInteraction
Get the port for a socket connection, if using sdedit as a sequence diagram server.

Specified by:
getSocketPort in interface IInteraction
Returns:
A socket port (ex: 60001).

getShowStates

public boolean getShowStates()
Description copied from interface: IInteraction
Get whether or not states will be shown on the sequence diagram.

Specified by:
getShowStates in interface IInteraction
Returns:
true or false

addMessage

public void addMessage(Message msg)
Description copied from interface: IInteraction
Add a message to the interaction.

Specified by:
addMessage in interface IInteraction
Parameters:
msg - The message.

addMessage

public void addMessage(int signal,
                       java.lang.Object data,
                       IXholon sender,
                       IXholon receiver,
                       int index)
Description copied from interface: IInteraction
Add a message to the interaction.

Specified by:
addMessage in interface IInteraction
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)
Description copied from interface: IInteraction
Add a state to the sequence diagram, but only if getShowStates() == true.

Specified by:
addState in interface IInteraction
Parameters:
state - A state within a state machine.

processReceivedMessage

public void processReceivedMessage(Message msg)
Description copied from interface: IInteraction
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 IInteraction
Overrides:
processReceivedMessage in class Xholon

createSequenceDiagram

public void createSequenceDiagram(java.lang.String modelName)
Description copied from interface: IInteraction
Create a sequence diagram from the interaction.

Specified by:
createSequenceDiagram in interface IInteraction
Parameters:
modelName - The name of this model.