JanosVM v1.0 API

edu.utah.janosvm.kit.comm.amiga
Class SignalDispatcher

java.lang.Object
  |
  +--edu.utah.janosvm.kit.comm.amiga.SignalDispatcher
All Implemented Interfaces:
java.lang.Runnable

public class SignalDispatcher
extends java.lang.Object
implements java.lang.Runnable

A SignalDispatcher provides some basic infrastructure for dispatching signals received by a SignalSet.


Field Summary
private  boolean active
          Flag indicating whether the run method is currently running or not.
private  List handlers
          The list of objects that can handle certain signals.
static int SIG_EXIT
          Reserved signal used to cause the dispatcher to exit the run() method.
private static int SIG_NEW_MASK
          Reserved signal used to indicate that there was a change in the signal mask.
private  SignalSet ss
          The SignalSet to handle signals for.
private static TeamLocal TEAM_DISPATCHER
           
private  long waitMask
          The set of signals to wait for.
 
Constructor Summary
SignalDispatcher()
          Construct an empty SignalDispatcher.
 
Method Summary
 void addHandler(SignalHandler sh)
          Add a SignalHandler to this dispatcher.
 void exit()
          Send the SIG_EXIT signal to the dispatcher so that it will exit the handler loop.
 SignalSet getSignalSet()
           
static SignalDispatcher getTeamDispatcher()
           
 boolean isActive()
           
 void remHandler(SignalHandler sh)
          Remove a SignalHandler from the dispatcher.
 void run()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait, wait0
 

Field Detail

TEAM_DISPATCHER

private static final TeamLocal TEAM_DISPATCHER

SIG_EXIT

public static final int SIG_EXIT
Reserved signal used to cause the dispatcher to exit the run() method.

SIG_NEW_MASK

private static final int SIG_NEW_MASK
Reserved signal used to indicate that there was a change in the signal mask.

ss

private final SignalSet ss
The SignalSet to handle signals for.

handlers

private final List handlers
The list of objects that can handle certain signals.

waitMask

private long waitMask
The set of signals to wait for.

active

private boolean active
Flag indicating whether the run method is currently running or not.
Constructor Detail

SignalDispatcher

public SignalDispatcher()
Construct an empty SignalDispatcher.
Method Detail

getSignalSet

public SignalSet getSignalSet()
Returns:
The SignalSet that this dispatcher listens on.

addHandler

public void addHandler(SignalHandler sh)
Add a SignalHandler to this dispatcher.
Parameters:
sh - An initialized SignalHandler that will handle a given signal.

remHandler

public void remHandler(SignalHandler sh)
Remove a SignalHandler from the dispatcher.
Parameters:
sh - The SignalHandler to remove.

isActive

public boolean isActive()
Returns:
True if the run() method is running, false otherwise.

run

public void run()
Specified by:
run in interface java.lang.Runnable

exit

public void exit()
Send the SIG_EXIT signal to the dispatcher so that it will exit the handler loop.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getTeamDispatcher

public static final SignalDispatcher getTeamDispatcher()
Returns:
The SignalDispatcher for this team.

JanosVM v1.0 API

This documentation is Copyright (C) 2000-2003 The University of Utah. All Rights Reserved. See the documentation license for distribution terms and restrictions.
Documentation, software, and mailing lists for the JanosVM can be found at the Janos Project web page: http://www.cs.utah.edu/flux/janos/
Generated on Feb 13, 2003