Prism.core
Class Architecture

java.lang.Object
  extended by Prism.core.Brick
      extended by Prism.core.Architecture
All Implemented Interfaces:
java.io.Serializable, IArchitecture
Direct Known Subclasses:
ExtensibleArchitecture

public class Architecture
extends Brick
implements IArchitecture

Base class for the Prism Architecture. This class is a Brick by itself that can be a part of another Prism Brick. It is responsible for keeping state of the components and connectors that are currently part of this Prism architecture.

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.IArchitecture
INITIAL_SIZE_OF_BRICK_ARRAY
 
Constructor Summary
Architecture(java.lang.String str)
          This constructor sets the name of this architecture to str.
 
Method Summary
 void add(Brick b)
          This method will add a brick instance b to the architecture.
 Brick getBrickByInstanceName(java.lang.String instName)
           
 java.util.Vector getBricks()
          Returns a list of Bricks in this architecture.
 void handle(Event e)
          This method will define the action to be taken by this architecture when it recieves an event from another Brick attached to it.
 void remove(Brick b)
          This method removes a brick from the architecture and thereby preventing it from receiving anymore messages from this architecture.
 void start()
          This method must be called to start the architecture.
 void unweld(IPort p1, IPort p2)
          This method disconnects two ports.
 void weld(IPort p1, IPort p2)
          This is a generic method for connecting two Ports.
 
Methods inherited from class Prism.core.Brick
add, getStyle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Architecture

public Architecture(java.lang.String str)
This constructor sets the name of this architecture to str.

Parameters:
str - The name of this architecture. It cannot be a null value
Method Detail

start

public void start()
This method must be called to start the architecture. This method will in turn call the start() method of each Brick in the architecture.

Overrides:
start in class Brick

handle

public void handle(Event e)
This method will define the action to be taken by this architecture when it recieves an event from another Brick attached to it.

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

add

public void add(Brick b)
This method will add a brick instance b to the architecture.

Specified by:
add in interface IArchitecture
Parameters:
b - A brick object to be added

remove

public void remove(Brick b)
This method removes a brick from the architecture and thereby preventing it from receiving anymore messages from this architecture. If it is not found to be a part of this architecture then the method does nothing and returns.

Specified by:
remove in interface IArchitecture
Parameters:
b - A brick object to be removed from the architecture.

weld

public void weld(IPort p1,
                 IPort p2)
This is a generic method for connecting two Ports. It is assumed that the two ports have already been assigned to another parent Brick (component/connector) object.

Specified by:
weld in interface IArchitecture
Parameters:
p1 - First Port
p2 - second Port

unweld

public void unweld(IPort p1,
                   IPort p2)
This method disconnects two ports.

Specified by:
unweld in interface IArchitecture
Parameters:
p1 - First Port
p2 - Second Port

getBrickByInstanceName

public Brick getBrickByInstanceName(java.lang.String instName)
Specified by:
getBrickByInstanceName in interface IArchitecture

getBricks

public java.util.Vector getBricks()
Description copied from interface: IArchitecture
Returns a list of Bricks in this architecture.

Specified by:
getBricks in interface IArchitecture
Returns:
DyanmicArray list of Bricks