X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=lib%2Fjetty%2Forg%2Feclipse%2Fjetty%2Fserver%2FNetworkConnector.java;fp=lib%2Fjetty%2Forg%2Feclipse%2Fjetty%2Fserver%2FNetworkConnector.java;h=58fdc9881c6380f92b4ca6c59f0e752fc6afb420;hp=0000000000000000000000000000000000000000;hb=73ef54a38e3930a1a789cdc6b5fa23cdd4c9d086;hpb=515007c7c1351045420669d65b59c08fa46850f2 diff --git a/lib/jetty/org/eclipse/jetty/server/NetworkConnector.java b/lib/jetty/org/eclipse/jetty/server/NetworkConnector.java new file mode 100644 index 00000000..58fdc988 --- /dev/null +++ b/lib/jetty/org/eclipse/jetty/server/NetworkConnector.java @@ -0,0 +1,72 @@ +// +// ======================================================================== +// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd. +// ------------------------------------------------------------------------ +// All rights reserved. This program and the accompanying materials +// are made available under the terms of the Eclipse Public License v1.0 +// and Apache License v2.0 which accompanies this distribution. +// +// The Eclipse Public License is available at +// http://www.eclipse.org/legal/epl-v10.html +// +// The Apache License v2.0 is available at +// http://www.opensource.org/licenses/apache2.0.php +// +// You may elect to redistribute this code under either of these licenses. +// ======================================================================== +// + +package org.eclipse.jetty.server; + +import java.io.Closeable; +import java.io.IOException; + +/** + *

A {@link Connector} for TCP/IP network connectors

+ */ +public interface NetworkConnector extends Connector, Closeable +{ + /** + *

Performs the activities needed to open the network communication + * (for example, to start accepting incoming network connections).

+ * + * @throws IOException if this connector cannot be opened + * @see #close() + */ + void open() throws IOException; + + /** + *

Performs the activities needed to close the network communication + * (for example, to stop accepting network connections).

+ * Once a connector has been closed, it cannot be opened again without first + * calling {@link #stop()} and it will not be active again until a subsequent call to {@link #start()} + */ + @Override + void close(); + + /* ------------------------------------------------------------ */ + /** + * A Connector may be opened and not started (to reserve a port) + * or closed and running (to allow graceful shutdown of existing connections) + * @return True if the connector is Open. + */ + boolean isOpen(); + + /** + * @return The hostname representing the interface to which + * this connector will bind, or null for all interfaces. + */ + String getHost(); + + /** + * @return The configured port for the connector or 0 if any available + * port may be used. + */ + int getPort(); + + /** + * @return The actual port the connector is listening on, or + * -1 if it has not been opened, or -2 if it has been closed. + */ + int getLocalPort(); +}