001    /**
002     * Copyright (C) 2010-2011, FuseSource Corp.  All rights reserved.
003     *
004     *     http://fusesource.com
005     *
006     * The software in this package is published under the terms of the
007     * CDDL license a copy of which has been included with this distribution
008     * in the license.txt file.
009     */
010    package org.fusesource.hawtdispatch.transport;
011    
012    import java.io.IOException;
013    
014    
015    /**
016     * An asynchronous listener of commands
017     *
018     */
019    public interface TransportListener {
020        
021        /**
022         * called to process a command
023         * @param command
024         */
025        void onTransportCommand(Object command);
026    
027        /**
028         * transport can now accept more commands for transmission. 
029         */
030        void onRefill();
031    
032        /**
033         * An unrecoverable exception has occured on the transport
034         * @param error
035         */
036        void onTransportFailure(IOException error);
037        
038        /**
039         * The transport has been connected.
040         */
041        public void onTransportConnected();
042    
043        /**
044         * The transport has been disconnected.
045         *
046         * @param reconnecting is true if the transport is attempting
047         *                     to reconnect.
048         */
049        public void onTransportDisconnected(boolean reconnecting);
050    
051    }