Prism.framework
Class ArchitectureAdapter

java.lang.Object
  |
  +--Prism.framework.Brick
        |
        +--Prism.framework.Architecture
              |
              +--Prism.framework.ArchitectureAdapter
All Implemented Interfaces:
IArchitecture, IComponent, IConnector, IPeerConnector, ScaffoldConstants

public class ArchitectureAdapter
extends Architecture

Architecture is an abstract class and needs to be sub classed to be instantiated. ArchitectureAdapter is a stub around the base architecture implementation. It can be used where no additional behavior is required

Version:
0.1
Author:
Nikunj Mehta

Fields inherited from class Prism.framework.Brick
bottomId, myId, name, scaffold, sideId, topId
 
Fields inherited from interface Prism.framework.ScaffoldConstants
DISPATCH, MONITOR, SCHEDULER
 
Constructor Summary
ArchitectureAdapter(java.lang.String name)
          ArchitectureAdapter is constructed simply with a name.
 
Method Summary
 void addToBottom(Brick bottom)
          Connect the component to the lBottom of this connector
 void addToSide(Brick side)
          Connect the brick to the side of this connector
 void addToTop(Brick top)
          Connect the component to the lTop of this connector
 java.lang.Object getBottom()
          Get the connector at the bottom
 java.lang.Object getSide()
          Get the connector at the side
 java.lang.Object getTop()
          Get the connector at the top
 boolean hasBottom()
          Find out if the brick has connected bricks at its bottom
 boolean hasSide()
          Find out if the brick has connected bricks at its side
 boolean hasTop()
          Find out if the brick has connected bricks at its top
 void removeFromBottom(Brick bottom)
          Remove the component from the lBottom of this connector
 void removeFromSide(Brick side)
          Remove the brick from the side of this connector
 void removeFromTop(Brick top)
          Remove the component from the lTop of this connector
 void send(Notification n)
          This method sends the Notification n down the C2 architecture that this component is a part of.
 void send(Peer p)
          This method sends the peer message p on the side of the C2 architecture that this component is a part of.
 void send(Request r)
          This method sends the request r up the C2 architecture that this component is a part of.
 void setBottom(IConnector conn)
          Set the connector at the bottom
 void setSide(IPeerConnector conn)
          Set the connector at the side
 void setTop(IConnector conn)
          Set the connector at the top
 
Methods inherited from class Prism.framework.Architecture
add, getBrickByInstanceName, getComponents, getReference, handle, peerUnweld, peerWeld, remove, start, toString, unweld, weld
 
Methods inherited from class Prism.framework.Brick
add, fireEvent, getBottomId, getSideId, getTopId, setBottomId, setName, setNameAfterTheFact, setScaffold, setSideId, setTopId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArchitectureAdapter

public ArchitectureAdapter(java.lang.String name)
ArchitectureAdapter is constructed simply with a name.
Parameters:
name - String name of the architecture.
Method Detail

hasTop

public boolean hasTop()
Find out if the brick has connected bricks at its top
Returns:
boolean whether there are connectors at the top

hasBottom

public boolean hasBottom()
Find out if the brick has connected bricks at its bottom
Returns:
boolean whether there are connectors at the bottom

hasSide

public boolean hasSide()
Find out if the brick has connected bricks at its side
Returns:
boolean whether there are connectors at the side

getTop

public java.lang.Object getTop()
Get the connector at the top
Returns:
Object the top connector

getBottom

public java.lang.Object getBottom()
Get the connector at the bottom
Returns:
Object the bottom connector

getSide

public java.lang.Object getSide()
Get the connector at the side
Returns:
Object the side connector

setTop

public void setTop(IConnector conn)
Set the connector at the top
Parameters:
conn - IConnector the top connector

setBottom

public void setBottom(IConnector conn)
Set the connector at the bottom
Parameters:
conn - IConnector the bottom connector

setSide

public void setSide(IPeerConnector conn)
Set the connector at the side
Parameters:
conn - IPeerConnector the side connector

addToTop

public void addToTop(Brick top)
Description copied from interface: IConnector
Connect the component to the lTop of this connector
Following copied from interface: Prism.framework.IConnector
Parameters:
t - Brick to be added to the lTop

addToBottom

public void addToBottom(Brick bottom)
Description copied from interface: IConnector
Connect the component to the lBottom of this connector
Following copied from interface: Prism.framework.IConnector
Parameters:
b - Brick to be added to the lBottom

addToSide

public void addToSide(Brick side)
Description copied from interface: IPeerConnector
Connect the brick to the side of this connector
Following copied from interface: Prism.framework.IPeerConnector
Parameters:
t - Brick to be added to the side

removeFromTop

public void removeFromTop(Brick top)
Description copied from interface: IConnector
Remove the component from the lTop of this connector
Following copied from interface: Prism.framework.IConnector
Parameters:
t - Brick to be added to the lTop

removeFromBottom

public void removeFromBottom(Brick bottom)
Description copied from interface: IConnector
Remove the component from the lBottom of this connector
Following copied from interface: Prism.framework.IConnector
Parameters:
b - Brick to be added to the lBottom

removeFromSide

public void removeFromSide(Brick side)
Description copied from interface: IPeerConnector
Remove the brick from the side of this connector
Following copied from interface: Prism.framework.IPeerConnector
Parameters:
b - Brick to be added to the side

send

public void send(Request r)
Description copied from interface: IComponent
This method sends the request r up the C2 architecture that this component is a part of.
Following copied from interface: Prism.framework.IComponent
Parameters:
r - a Request to be sent to the connector above.

send

public void send(Notification n)
Description copied from interface: IComponent
This method sends the Notification n down the C2 architecture that this component is a part of.
Following copied from interface: Prism.framework.IComponent
Parameters:
n - a Notification object to be sent to the connector below.

send

public void send(Peer p)
Description copied from interface: IComponent
This method sends the peer message p on the side of the C2 architecture that this component is a part of.
Following copied from interface: Prism.framework.IComponent
Parameters:
p - a Peer message to be sent to the connector on the side.