Trull

edu.luc.cs.trull
Class ActionComponent

java.lang.Object
  extended by edu.luc.cs.trull.EmptyComponent
      extended by edu.luc.cs.trull.TerminatingComponent
          extended by edu.luc.cs.trull.ActionComponent
All Implemented Interfaces:
Component, PropertyChangeSource, Startable, Suspendable, Terminating, java.beans.PropertyChangeListener, java.util.EventListener
Direct Known Subclasses:
Done

public class ActionComponent
extends TerminatingComponent

An adapter for using a simple PropertyChangeListener as a Trull component. When started, this component invokes the listener method and then terminates.

See Also:
PropertyChangeListener

Field Summary
private  java.beans.PropertyChangeListener action
          The action of this component.
private static org.apache.log4j.Logger logger
           
 
Constructor Summary
ActionComponent()
          Creates an ActionComponent component with a null listener.
ActionComponent(java.beans.PropertyChangeListener action)
          Creates an ActionComponent component with the given listener as its action.
 
Method Summary
 java.beans.PropertyChangeListener getAction()
          Gets the action of this component.
 void setAction(java.beans.PropertyChangeListener action)
          Sets the action of this component to the given listener.
 void start(java.beans.PropertyChangeEvent incoming)
          Starts this startable component.
 void stop()
          Stops this startable component.
 
Methods inherited from class edu.luc.cs.trull.TerminatingComponent
fireTermination, getParent, getTermEvent, scheduleTermination, setTerminationListener
 
Methods inherited from class edu.luc.cs.trull.EmptyComponent
addPropertyChangeListener, getPropertyChangeListeners, getTerminationListener, propertyChange, removePropertyChangeListener, resume, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

action

private java.beans.PropertyChangeListener action
The action of this component.


logger

private static final org.apache.log4j.Logger logger
Constructor Detail

ActionComponent

public ActionComponent()
Creates an ActionComponent component with a null listener.


ActionComponent

public ActionComponent(java.beans.PropertyChangeListener action)
Creates an ActionComponent component with the given listener as its action.

Parameters:
action - the listener to be used as the action. May be null.
Method Detail

getAction

public java.beans.PropertyChangeListener getAction()
Gets the action of this component.

Returns:
the listener used as the action.

setAction

public void setAction(java.beans.PropertyChangeListener action)
Sets the action of this component to the given listener.

Parameters:
action - the listener to be used as the action. May be null.

start

public void start(java.beans.PropertyChangeEvent incoming)
Description copied from interface: Startable
Starts this startable component.

Specified by:
start in interface Startable
Overrides:
start in class EmptyComponent
Parameters:
incoming - the event that triggered the invocation of this method. May be null.

stop

public void stop()
Description copied from interface: Startable
Stops this startable component.

Specified by:
stop in interface Startable
Overrides:
stop in class EmptyComponent

Trull

http://www.cs.luc.edu/trull/