org.erights.e.elib.vat
Class PendingDelivery

java.lang.Object
  |
  +--org.erights.e.elib.vat.SendingContext
        |
        +--org.erights.e.elib.vat.PendingEvent
              |
              +--org.erights.e.elib.vat.PendingDelivery
All Implemented Interfaces:
EPrintable, Runnable

class PendingDelivery
extends PendingEvent

A PendingDelivery is a Runnable that will run() a single delivery event.

A PendingDelivery is a pair of a Message and the object to deliver it to.

NOTE! All the methods of this class trust their callers to 1) only provide interned strings as verb, and 2) not modify an args array after passing it in. Btw, all source code literal strings are automatically intern()ed.

Author:
Mark S. Miller

Field Summary
private  Object[] myArgs
           
private  boolean myNowFlag
           
private  Resolver myOptResolver
           
private  Object myReceiver
           
private  String myVerb
           
 
Fields inherited from class org.erights.e.elib.vat.SendingContext
 
Constructor Summary
  PendingDelivery(Vat vat, Object rec, boolean nowFlag, Message msg)
          Reify a pending delivery as sent by msg's sending context.
(package private) PendingDelivery(Vat vat, Object rec, Resolver optResolver, boolean nowFlag, String verb, Object[] args)
          Reify a pending delivery as sent by the current context.
 
Method Summary
 void __printOn(TextWriter out)
          Enabled:
 void innerRun()
          Actually do the delivery and report the outcome.
 void printContextOn(TextWriter out)
          Enabled:
 void report(String msg, Throwable problem)
          Trace at warning level that this event caused this problem.
 void run()
          Do now the event that this PendingEvent represents.
 
Methods inherited from class org.erights.e.elib.vat.SendingContext
report, toString, trace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myReceiver

private final Object myReceiver

myOptResolver

private final Resolver myOptResolver

myNowFlag

private final boolean myNowFlag

myVerb

private final String myVerb

myArgs

private final Object[] myArgs
Constructor Detail

PendingDelivery

PendingDelivery(Vat vat,
                Object rec,
                Resolver optResolver,
                boolean nowFlag,
                String verb,
                Object[] args)
Reify a pending delivery as sent by the current context.

Parameters:
vat - The Vat onto which this PendingEvent will be queued. Note that this may be different than Vat.getCurrentVat().

PendingDelivery

public PendingDelivery(Vat vat,
                       Object rec,
                       boolean nowFlag,
                       Message msg)
Reify a pending delivery as sent by msg's sending context.

Parameters:
vat - The Vat onto which this PendingEvent will be queued. Note that this may be different than Vat.getCurrentVat().
Method Detail

innerRun

public void innerRun()
Actually do the delivery and report the outcome.

Specified by:
innerRun in class PendingEvent

__printOn

public void __printOn(TextWriter out)
               throws IOException
Description copied from interface: EPrintable
Enabled:

IOException

run

public final void run()
Do now the event that this PendingEvent represents.

Does bookkeeping of debugging info around call to PendingEvent.innerRun(), including catching all thrown Exceptions that escape from innerRun() reporting them rather than propogating them.

Specified by:
run in interface Runnable
See Also:
java.lang.Thread#run()

report

public void report(String msg,
                   Throwable problem)
Trace at warning level that this event caused this problem.


printContextOn

public void printContextOn(TextWriter out)
                    throws IOException
Description copied from class: SendingContext
Enabled:

Overrides:
printContextOn in class SendingContext
IOException


comments?