001package jmri.jmrix.loconet;
002
003/**
004 * LocoNetListener provides the call-back interface for notification when a new
005 * LocoNet message arrives from the layout.
006 * <p>
007 * Note that the LocoNetListener implementation cannot assume that messages will
008 * be returned in any particular thread. We may eventually revisit this, as
009 * returning messages in the Swing GUI thread would result in some
010 * simplification of client code. We've not done that yet because we're not sure
011 * that deadlocks can be avoided in that case.
012 *
013 * @author Bob Jacobsen Copyright (C) 2001
014 */
015public interface LocoNetListener extends java.util.EventListener {
016
017    /**
018     * Member function that will be invoked by a LocoNetInterface implementation
019     * to forward a LocoNet message from the layout.
020     *
021     * @param msg The received LocoNet message. Note that this same object may
022     *            be presented to multiple users. It should not be modified
023     *            here.
024     */
025    void message(LocoNetMessage msg);
026
027}