Prism.core
Class Connector

java.lang.Object
  extended by Prism.core.Brick
      extended by Prism.core.Connector
All Implemented Interfaces:
java.io.Serializable, IConnector
Direct Known Subclasses:
ExtensibleConnector

public class Connector
extends Brick
implements IConnector

A connector provides interaction and mediation services to attached components. The connector is connected to a set of components on both sides (a set may be empty). Connectors use the provided AbstractHandler to distribute event among connected Bricks.

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
 
Fields inherited from interface Prism.core.IConnector
INITIAL_SIZE_OF_BRICK_QUEUE
 
Constructor Summary
Connector(java.lang.String name)
          Constructor for connector that defines a simple connector with the given name.
Connector(java.lang.String name, int pStyle)
           
 
Method Summary
 void addConnPort(IPort port)
          Adds a port to this connector.
 java.util.Vector getConnPorts()
          This method returns a list of all available ports in this connector.
 void handle(Event e)
          This method distributes the incoming event to connected Bricks.
 void removeConnPort(IPort port)
          Removes a port from this component.
 
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

Connector

public Connector(java.lang.String name)
Constructor for connector that defines a simple connector with the given name.

Parameters:
name - String name of the connector

Connector

public Connector(java.lang.String name,
                 int pStyle)
Method Detail

handle

public void handle(Event e)
This method distributes the incoming event to connected Bricks. Distribution policy depends on the type of IHandler that is installed.

Specified by:
handle in interface IConnector
Specified by:
handle in class Brick
Parameters:
e - Incoming Event

addConnPort

public void addConnPort(IPort port)
Adds a port to this connector.

Specified by:
addConnPort in interface IConnector
Parameters:
port - Port to be added.

removeConnPort

public void removeConnPort(IPort port)
Removes a port from this component.

Specified by:
removeConnPort in interface IConnector
Parameters:
port - Port to be removed.

getConnPorts

public java.util.Vector getConnPorts()
This method returns a list of all available ports in this connector.

Specified by:
getConnPorts in interface IConnector
Returns:
DynamicArray List of available ports