JanosVM v1.0 API

java.lang.isolate
Class IsolateMessageDispatcher

java.lang.Object
  |
  +--java.lang.isolate.IsolateMessageDispatcher
All Implemented Interfaces:
java.lang.Runnable

public final class IsolateMessageDispatcher
extends java.lang.Object
implements java.lang.Runnable

XXX Horrible polling implementation.


Inner Class Summary
static interface IsolateMessageDispatcher.Listener
           
 
Field Summary
private  boolean didDispatch
           
private  boolean done
           
private  java.util.HashMap linkToListenersMap
           
private  boolean started
           
 
Constructor Summary
IsolateMessageDispatcher()
           
 
Method Summary
 void add(Link link, IsolateMessageDispatcher.Listener listener)
           
private  void dispatchFailure(java.lang.Object[] listeners, Link link, java.lang.Throwable th)
          Invoke the given listener's receiveFailed.
private  void dispatchMessage(java.lang.Object[] listeners, Link link, IsolateMessage im)
          Invoke the given listener's messageReceived.
private  boolean processMessages()
          Do a pass through all the registered links, handling any that have something to do.
 void remove(Link link)
           
 void run()
           
 void shutdown()
           
private static void sleep(int millis)
          Weak sleep wrapper that doesn't throw exceptions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait, wait0
 

Field Detail

linkToListenersMap

private final java.util.HashMap linkToListenersMap

started

private boolean started

done

private boolean done

didDispatch

private boolean didDispatch
Constructor Detail

IsolateMessageDispatcher

public IsolateMessageDispatcher()
Method Detail

add

public void add(Link link,
                IsolateMessageDispatcher.Listener listener)

remove

public void remove(Link link)

dispatchFailure

private void dispatchFailure(java.lang.Object[] listeners,
                             Link link,
                             java.lang.Throwable th)
Invoke the given listener's receiveFailed.

dispatchMessage

private void dispatchMessage(java.lang.Object[] listeners,
                             Link link,
                             IsolateMessage im)
Invoke the given listener's messageReceived.

processMessages

private boolean processMessages()
Do a pass through all the registered links, handling any that have something to do. Return true if the dispatcher should shutdown, false if it should continue plugging away.

sleep

private static void sleep(int millis)
Weak sleep wrapper that doesn't throw exceptions.

run

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

shutdown

public void shutdown()

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