Top Description Fields Constructors Methods
org.eclipse.jetty.server

public abstract Class AbstractNetworkConnector

extends AbstractConnector
implements NetworkConnector
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.server.NetworkConnector, java.io.Closeable, java.lang.AutoCloseable, org.eclipse.jetty.server.Connector, org.eclipse.jetty.util.component.Graceful, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.LifeCycle
Known Direct Subclasses
org.eclipse.jetty.server.ServerConnector
Annotations
@ManagedObject:AbstractNetworkConnector
Imports
java.io.IOException, java.util.concurrent.CompletableFuture, .Executor, org.eclipse.jetty.io.ByteBufferPool, org.eclipse.jetty.util.annotation.ManagedAttribute, .ManagedObject, org.eclipse.jetty.util.thread.Scheduler

An abstract Network Connector.

Extends the AbstractConnector support for the NetworkConnector interface.

Field Summary

Modifier and TypeField and Description
private volatile String
private volatile int
Inherited from org.eclipse.jetty.server.AbstractConnector:
LOG

Constructor Summary

AccessConstructor and Description
public
AbstractNetworkConnector(Server server, Executor executor, Scheduler scheduler, ByteBufferPool bufferPool, int acceptors, ConnectionFactory... factories)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements org.eclipse.jetty.server.NetworkConnector.close.

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

protected void
doStart()

Overrides org.eclipse.jetty.server.AbstractConnector.doStart.

Starts the managed lifecycle beans in the order they were added.
protected void
doStop()

Overrides org.eclipse.jetty.server.AbstractConnector.doStop.

Stops the managed lifecycle beans in the reverse order they were added.
public String
public int
public int
protected boolean
public void
open()

Implements org.eclipse.jetty.server.NetworkConnector.open.

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

public void
public void
setPort(int port)

public CompletableFuture<Void>
public String
toString()

Overrides org.eclipse.jetty.server.AbstractConnector.toString.

Returns a string representation of the object.
Inherited from org.eclipse.jetty.server.AbstractConnector:
acceptaddConnectionFactoryaddFirstConnectionFactoryaddIfAbsentConnectionFactoryclearConnectionFactoriesgetAcceptorPriorityDeltagetAcceptorsgetByteBufferPoolgetConnectedEndPointsgetConnectionFactoriesgetConnectionFactorygetConnectionFactorygetDefaultConnectionFactorygetDefaultProtocolgetExecutorgetIdleTimeoutgetNamegetProtocolsgetSchedulergetServergetShutdownIdleTimeoutinterruptAcceptorsisAcceptingisShutdownjoinjoinonEndPointClosedonEndPointOpenedremoveConnectionFactorysetAcceptingsetAcceptorPriorityDeltasetConnectionFactoriessetDefaultProtocolsetIdleTimeoutsetNamesetShutdownIdleTimeout

Field Detail

_hostback to summary
private volatile String _host
_portback to summary
private volatile int _port

Constructor Detail

AbstractNetworkConnectorback to summary
public AbstractNetworkConnector(Server server, Executor executor, Scheduler scheduler, ByteBufferPool bufferPool, int acceptors, ConnectionFactory... factories)

Method Detail

closeback to summary
public void close()

Implements org.eclipse.jetty.server.NetworkConnector.close.

Doc from org.eclipse.jetty.server.NetworkConnector.close.

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 stop() and it will not be active again until a subsequent call to start()
Annotations
@Override
doStartback to summary
protected void doStart() throws Exception

Overrides org.eclipse.jetty.server.AbstractConnector.doStart.

Doc from org.eclipse.jetty.util.component.ContainerLifeCycle.doStart.

Starts the managed lifecycle beans in the order they were added.

Annotations
@Override
Exceptions
Exception:

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

If there was a problem starting. Will cause a transition to FAILED state

doStopback to summary
protected void doStop() throws Exception

Overrides org.eclipse.jetty.server.AbstractConnector.doStop.

Doc from org.eclipse.jetty.util.component.ContainerLifeCycle.doStop.

Stops the managed lifecycle beans in the reverse order they were added.

Annotations
@Override
Exceptions
Exception:

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

If there was a problem stopping. Will cause a transition to FAILED state

getHostback to summary
public String getHost()

Implements org.eclipse.jetty.server.NetworkConnector.getHost.

Returns:String

Doc from org.eclipse.jetty.server.NetworkConnector.getHost.

The hostname representing the interface to which this connector will bind, or null for all interfaces.

Annotations
@Override
@ManagedAttribute:The network interface this connector binds to as an IP address or a hostname. If null or 0.0.0.0, then bind to all interfaces.
getLocalPortback to summary
public int getLocalPort()

Implements org.eclipse.jetty.server.NetworkConnector.getLocalPort.

Returns:int

Doc from org.eclipse.jetty.server.NetworkConnector.getLocalPort.

The actual port the connector is listening on, or -1 if it has not been opened, or -2 if it has been closed.

Annotations
@Override
getPortback to summary
public int getPort()

Implements org.eclipse.jetty.server.NetworkConnector.getPort.

Returns:int

Doc from org.eclipse.jetty.server.NetworkConnector.getPort.

The configured port for the connector or 0 if any available port may be used.

Annotations
@Override
@ManagedAttribute:Port this connector listens on. If set the 0 a random port is assigned which may be obtained with getLocalPort()
handleAcceptFailureback to summary
protected boolean handleAcceptFailure(Throwable ex)

Overrides org.eclipse.jetty.server.AbstractConnector.handleAcceptFailure.

Annotations
@Override
openback to summary
public void open() throws IOException

Implements org.eclipse.jetty.server.NetworkConnector.open.

Doc from org.eclipse.jetty.server.NetworkConnector.open.

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

Annotations
@Override
Exceptions
IOException:
if this connector cannot be opened
setHostback to summary
public void setHost(String host)
setPortback to summary
public void setPort(int port)
shutdownback to summary
public CompletableFuture<Void> shutdown()

Overrides org.eclipse.jetty.server.AbstractConnector.shutdown.

Implements org.eclipse.jetty.util.component.Graceful.shutdown.

Doc from org.eclipse.jetty.util.component.Graceful.shutdown.

Shutdown the component. When this method returns, the component should not accept any new load.

Returns:CompletableFuture<Void>

A future that is completed once all load on the component is completed

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.eclipse.jetty.server.AbstractConnector.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override