Class c2.framework.ComponentThread
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class c2.framework.ComponentThread

java.lang.Object
   |
   +----c2.framework.Brick
           |
           +----c2.framework.Component
                   |
                   +----c2.framework.ComponentThread

public class ComponentThread
extends Component
implements Runnable
A component that runs in its own thread of control.

See the Component class for details on components.

See Also:
Component

Variable Index

 o sem
 o t

Constructor Index

 o ComponentThread()
 o ComponentThread(String, Class)

Method Index

 o create(String, Class)
Initializes the component.
 o finish()
Immediately stops the execution of the component or connector (even if it has outstanding messages to process).
 o finished()
Returns true if the component or connector is idle (ie that it is not processing any messages).
 o newMessage(Port)
This method is invoked when the component receives a new request or notification.
 o run()
The run method is called when the thread is created.
 o start()
Start the component or connector running.

Variables

 o t
  protected Thread t
 o sem
  protected Semaphor sem

Constructors

 o ComponentThread
  public ComponentThread()
 o ComponentThread
  public ComponentThread(String name,
                         Class portClass)

Methods

 o create
  public void create(String name,
                     Class portClass)
Initializes the component.
Overrides:
create in class Component
 o newMessage
  protected void newMessage(Port p)
This method is invoked when the component receives a new request or notification.
Overrides:
newMessage in class Component
 o start
  public void start()
Start the component or connector running.
Overrides:
start in class Brick
 o finish
  public void finish()
Immediately stops the execution of the component or connector (even if it has outstanding messages to process).
Overrides:
finish in class Brick
 o finished
  public boolean finished()
Returns true if the component or connector is idle (ie that it is not processing any messages).
Overrides:
finished in class Brick
 o run
  public void run()
The run method is called when the thread is created. It waits (on a semaphor) for requests and notifications to arrive, and calls the appropriate handle() method to process them.

All Packages  Class Hierarchy  This Package  Previous  Next  Index