Prism.core
Class Port

java.lang.Object
  extended by Prism.core.Brick
      extended by Prism.core.Port
All Implemented Interfaces:
java.io.Serializable, IPort
Direct Known Subclasses:
ExtensiblePort

public class Port
extends Brick
implements IPort

Port represents locus of communication in Prism.

Version:
2.0
Author:
USC Soft. Arch. Group. Contact: Sam Malek malek@usc.edu
See Also:
Serialized Form

Field Summary
 
Fields inherited from class Prism.core.Brick
name, scaffold
 
Constructor Summary
Port(java.lang.String name, int pPortType)
          Port constructor.
 
Method Summary
 ExtensiblePort getExtensiblePort()
          In situations when the Port is actually more specialized and is an ExtensiblePort, this method returns the ExtensiblePort.
 IPort getMutualPort()
          This method returns the mutual port
 Brick getParentBrick()
          Returns the parent brick of this Port.
 int getPortType()
          Returns the type of port.
 void handle(Event e)
          Simple place holder method.
 void setExtensiblePort(ExtensiblePort pExtPort)
          Sets the reference of this port object to its ExtensiblePort(child).
 void setMutualPort(IPort pPort)
          Sets the mutual port for this port
 void setParentBrick(Brick pParentBrick)
          Sets the parent brick of this Port.
 
Methods inherited from class Prism.core.Brick
add, getStyle, start
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Port

public Port(java.lang.String name,
            int pPortType)
Port constructor.

Parameters:
pPortType - PortType which could either be Request or Reply.
pBrick - parent of this Port. Usually a Component/Connector.
Method Detail

handle

public void handle(Event e)
Simple place holder method. Doesn't do anything.

Specified by:
handle in class Brick
Parameters:
e - Event object to be handled

setMutualPort

public void setMutualPort(IPort pPort)
Sets the mutual port for this port

Specified by:
setMutualPort in interface IPort
Parameters:
pPort - Port to be added

getMutualPort

public IPort getMutualPort()
This method returns the mutual port

Specified by:
getMutualPort in interface IPort
Returns:
IPort the mutual port

getPortType

public int getPortType()
Returns the type of port. Request is equivalent to the notion of Top in C2. Reply is equivalent to the notion of Bottom in C2.

Specified by:
getPortType in interface IPort
Returns:
int port type

getParentBrick

public Brick getParentBrick()
Returns the parent brick of this Port.

Specified by:
getParentBrick in interface IPort
Returns:
Brick parent Brick

setParentBrick

public void setParentBrick(Brick pParentBrick)
Sets the parent brick of this Port.

Specified by:
setParentBrick in interface IPort

getExtensiblePort

public ExtensiblePort getExtensiblePort()
In situations when the Port is actually more specialized and is an ExtensiblePort, this method returns the ExtensiblePort.

Specified by:
getExtensiblePort in interface IPort
Returns:
ExtensiblePort child ExtensiblePort

setExtensiblePort

public void setExtensiblePort(ExtensiblePort pExtPort)
Sets the reference of this port object to its ExtensiblePort(child).

Specified by:
setExtensiblePort in interface IPort
Parameters:
pExtPort - child ExtensiblePort