001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one
003     * or more contributor license agreements.  See the NOTICE file
004     * distributed with this work for additional information
005     * regarding copyright ownership.  The ASF licenses this file
006     * to you under the Apache License, Version 2.0 (the
007     * "License"); you may not use this file except in compliance
008     * with the License.  You may obtain a copy of the License at
009     *
010     *  http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing,
013     * software distributed under the License is distributed on an
014     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015     * KIND, either express or implied.  See the License for the
016     * specific language governing permissions and limitations
017     * under the License.
018     */
019    
020    package org.apache.geronimo.gshell.whisper.transport;
021    
022    import java.io.Closeable;
023    import java.net.URI;
024    import java.util.EventListener;
025    
026    import org.apache.mina.common.IoAcceptor;
027    import org.apache.mina.common.IoHandler;
028    import org.apache.mina.common.ThreadModel;
029    
030    /**
031     * Provides the server-side protocol interface.
032     *
033     * @version $Rev: 579828 $ $Date: 2007-09-26 15:15:42 -0700 (Wed, 26 Sep 2007) $
034     */
035    public interface TransportServer<T extends IoAcceptor>
036        extends Closeable
037    {
038        URI getLocation();
039    
040        T getAcceptor();
041    
042        void close();
043    
044        //
045        // Listeners
046        //
047    
048        void addListener(Listener listener);
049    
050        void removeListener(Listener listener);
051    
052        interface Listener
053            extends EventListener
054        {
055            //
056            // TODO:
057            //
058        }
059    
060        //
061        // Configuration
062        //
063    
064        void setConfiguration(Configuration config);
065    
066        Configuration getConfiguration();
067    
068        interface Configuration
069        {
070            IoHandler getHandler();
071    
072            void setHandler(IoHandler hanlder);
073    
074            ThreadModel getThreadModel();
075    
076            void setThreadModel(ThreadModel threadModel);
077        }
078    }