001    /**
002     *  Licensed to the Apache Software Foundation (ASF) under one or more
003     *  contributor license agreements.  See the NOTICE file distributed with
004     *  this work for additional information regarding copyright ownership.
005     *  The ASF licenses this file to You under the Apache License, Version 2.0
006     *  (the "License"); you may not use this file except in compliance with
007     *  the License.  You may obtain a copy of the License at
008     *
009     *     http://www.apache.org/licenses/LICENSE-2.0
010     *
011     *  Unless required by applicable law or agreed to in writing, software
012     *  distributed under the License is distributed on an "AS IS" BASIS,
013     *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     *  See the License for the specific language governing permissions and
015     *  limitations under the License.
016     */
017    package org.apache.geronimo.management.geronimo;
018    
019    import java.net.UnknownHostException;
020    import java.net.InetSocketAddress;
021    
022    /**
023     * Base management interface for a network connector used to handle some
024     * protocol in order to talk to some part of the Geronimo server.
025     *
026     * @version $Rev: 476049 $ $Date: 2006-11-16 23:35:17 -0500 (Thu, 16 Nov 2006) $
027     */
028    public interface NetworkConnector {
029        /**
030         * Gets the network protocol that this connector handles.
031         */
032        String getProtocol();
033    
034        /**
035         * Gets the network port that this connector listens on.
036         */
037        int getPort();
038    
039        /**
040         * Sets the network port that this connector listens on.
041         */
042        void setPort(int port);
043    
044        /**
045         * Gets the hostname/IP that this connector listens on.
046         */
047        String getHost();
048    
049        /**
050         * Sets the hostname/IP that this connector listens on.  This is typically
051         * most useful for machines with multiple network cards, but can be used
052         * to limit a connector to only listen for connections from the local
053         * machine (127.0.0.1).  To listen on all available network interfaces,
054         * specify an address of 0.0.0.0.
055         */
056        void setHost(String host) throws UnknownHostException;
057    
058        /**
059         * Every connector must specify a property of type InetSocketAddress
060         * because we use that to identify the network services to print a list
061         * during startup.  However, this can be read-only since the host and port
062         * are set separately using setHost and setPort.
063         */
064        InetSocketAddress getListenAddress();
065    }