01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.geronimo.management.geronimo;
17:
18: import java.net.UnknownHostException;
19: import java.net.InetSocketAddress;
20:
21: /**
22: * Base management interface for a network connector used to handle some
23: * protocol in order to talk to some part of the Geronimo server.
24: *
25: * @version $Rev: 476049 $ $Date: 2006-11-16 20:35:17 -0800 (Thu, 16 Nov 2006) $
26: */
27: public interface NetworkConnector {
28: /**
29: * Gets the network protocol that this connector handles.
30: */
31: String getProtocol();
32:
33: /**
34: * Gets the network port that this connector listens on.
35: */
36: int getPort();
37:
38: /**
39: * Sets the network port that this connector listens on.
40: */
41: void setPort(int port);
42:
43: /**
44: * Gets the hostname/IP that this connector listens on.
45: */
46: String getHost();
47:
48: /**
49: * Sets the hostname/IP that this connector listens on. This is typically
50: * most useful for machines with multiple network cards, but can be used
51: * to limit a connector to only listen for connections from the local
52: * machine (127.0.0.1). To listen on all available network interfaces,
53: * specify an address of 0.0.0.0.
54: */
55: void setHost(String host) throws UnknownHostException;
56:
57: /**
58: * Every connector must specify a property of type InetSocketAddress
59: * because we use that to identify the network services to print a list
60: * during startup. However, this can be read-only since the host and port
61: * are set separately using setHost and setPort.
62: */
63: InetSocketAddress getListenAddress();
64: }
|