001    // Copyright 2008 Waterken Inc. under the terms of the MIT X license
002    // found at http://www.opensource.org/licenses/mit-license.html
003    package org.ref_send.log;
004    
005    import org.ref_send.deserializer;
006    import org.ref_send.name;
007    
008    /**
009     * Logs a conditional message send.
010     * <p>
011     * This kind of event is produced for a send to a promise, such as happens for a
012     * {@linkplain org.ref_send.promise.Eventual#when when block}, or
013     * {@linkplain org.ref_send.promise.Eventual#cast eventual invocation}.
014     * The {@link #message} identifies the queued message, and the
015     * {@link #condition} identifies the promise the message is queued on.
016     * </p>
017     * @see Resolved
018     */
019    public class
020    SentIf extends Sent {
021        static private final long serialVersionUID = 1L;
022    
023        /**
024         * globally unique identifier for the condition
025         */
026        public final String condition;
027    
028        /**
029         * Constructs an instance.
030         * @param anchor    {@link #anchor}
031         * @param timestamp {@link #timestamp}
032         * @param trace     {@link #trace}
033         * @param message   {@link #message}
034         * @param condition {@link #condition}
035         */
036        public @deserializer
037        SentIf(@name("anchor") final Anchor anchor,
038               @name("timestamp") final Long timestamp,
039               @name("trace") final Trace trace,
040               @name("message") final String message,
041               @name("condition") final String condition) {
042            super(anchor, timestamp, trace, message);
043            this.condition = condition;
044        }
045    }