Class UnixSocketConnector
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.server.AbstractConnector
org.eclipse.jetty.unixsocket.UnixSocketConnector
- All Implemented Interfaces:
org.eclipse.jetty.server.Connector, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.Graceful, org.eclipse.jetty.util.component.LifeCycle
@ManagedObject("Connector using UNIX Socket")
public class UnixSocketConnector
extends org.eclipse.jetty.server.AbstractConnector
A server-side connector for UNIX sockets.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Graceful
org.eclipse.jetty.util.component.Graceful.ShutdownNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate jnr.unixsocket.UnixServerSocketChannelprivate intprivate final org.eclipse.jetty.io.SelectorManagerprivate booleanprivate Stringprivate static final org.eclipse.jetty.util.log.Loggerstatic final intFields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY -
Constructor Summary
ConstructorsConstructorDescriptionUnixSocketConnector(org.eclipse.jetty.server.Server server) Constructs a UnixSocketConnector with the default configuration.UnixSocketConnector(org.eclipse.jetty.server.Server server, int selectors) Constructs a UnixSocketConnector with the given number of selectorsUnixSocketConnector(org.eclipse.jetty.server.Server server, int selectors, org.eclipse.jetty.server.ConnectionFactory... factories) Constructs a UnixSocketConnector with the given selectors and ConnectionFactories.UnixSocketConnector(org.eclipse.jetty.server.Server server, int selectors, org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory) Constructs a UnixSocketConnector with the given selectors and SslContextFactory.UnixSocketConnector(org.eclipse.jetty.server.Server server, Executor executor, org.eclipse.jetty.util.thread.Scheduler scheduler, org.eclipse.jetty.io.ByteBufferPool bufferPool, int selectors, org.eclipse.jetty.server.ConnectionFactory... factories) Constructs a UnixSocketConnector with the given parameters.UnixSocketConnector(org.eclipse.jetty.server.Server server, org.eclipse.jetty.server.ConnectionFactory... factories) Constructs a UnixSocketConnector with the given ConnectionFactories.UnixSocketConnector(org.eclipse.jetty.server.Server server, org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory) Constructs a UnixSocketConnector with the given SslContextFactory.UnixSocketConnector(org.eclipse.jetty.server.Server server, org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory, org.eclipse.jetty.server.ConnectionFactory... factories) Constructs a UnixSocketConnector with the given SslContextFactory and ConnectionFactories. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(int acceptorID) protected voidaccepted(jnr.unixsocket.UnixSocketChannel channel) voidclose()protected voiddoStart()protected voiddoStop()intbooleanorg.eclipse.jetty.io.SelectorManagerbooleanisOpen()protected UnixSocketEndPointnewEndPoint(SelectableChannel channel, org.eclipse.jetty.io.ManagedSelector selector, SelectionKey key) protected org.eclipse.jetty.io.SelectorManagernewSelectorManager(Executor executor, org.eclipse.jetty.util.thread.Scheduler scheduler, int selectors) voidopen()voidsetAcceptQueueSize(int acceptQueueSize) voidsetReuseAddress(boolean reuseAddress) voidsetUnixSocket(String filename) toString()Methods inherited from class org.eclipse.jetty.server.AbstractConnector
addConnectionFactory, addFirstConnectionFactory, addIfAbsentConnectionFactory, clearConnectionFactories, getAcceptorPriorityDelta, getAcceptors, getByteBufferPool, getConnectedEndPoints, getConnectionFactories, getConnectionFactory, getConnectionFactory, getDefaultConnectionFactory, getDefaultProtocol, getExecutor, getHttpChannelListeners, getIdleTimeout, getName, getProtocols, getScheduler, getServer, handleAcceptFailure, interruptAcceptors, isAccepting, isShutdown, join, join, onEndPointClosed, onEndPointOpened, removeConnectionFactory, setAccepting, setAcceptorPriorityDelta, setConnectionFactories, setDefaultProtocol, setIdleTimeout, setName, shutdownMethods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Container
addBean, addBean, addEventListener, getBean, getBeans, getBeans, getContainedBeans, isManaged, manage, removeBean, removeEventListener, unmanageMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dump, dump, dumpSelfMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpableMethods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
Field Details
-
MAX_UNIX_SOCKET_PATH_LENGTH
public static final int MAX_UNIX_SOCKET_PATH_LENGTH- See Also:
-
LOG
private static final org.eclipse.jetty.util.log.Logger LOG -
_manager
private final org.eclipse.jetty.io.SelectorManager _manager -
_unixSocket
-
_acceptChannel
private volatile jnr.unixsocket.UnixServerSocketChannel _acceptChannel -
_acceptQueueSize
private volatile int _acceptQueueSize -
_reuseAddress
private volatile boolean _reuseAddress
-
-
Constructor Details
-
UnixSocketConnector
public UnixSocketConnector(@Name("server") org.eclipse.jetty.server.Server server) Constructs a UnixSocketConnector with the default configuration.
- Parameters:
server- theServerthis connector will accept connections for.
-
UnixSocketConnector
public UnixSocketConnector(@Name("server") org.eclipse.jetty.server.Server server, @Name("selectors") int selectors) Constructs a UnixSocketConnector with the given number of selectors
- Parameters:
server- theServerthis connector will accept connections for.selectors- the number of selectors, or <=0 for a default value.
-
UnixSocketConnector
public UnixSocketConnector(@Name("server") org.eclipse.jetty.server.Server server, @Name("factories") org.eclipse.jetty.server.ConnectionFactory... factories) Constructs a UnixSocketConnector with the given ConnectionFactories.
- Parameters:
server- theServerthis connector will accept connections for.factories- zero or moreConnectionFactoryinstances used to create and configure connections.
-
UnixSocketConnector
public UnixSocketConnector(@Name("server") org.eclipse.jetty.server.Server server, @Name("selectors") int selectors, @Name("factories") org.eclipse.jetty.server.ConnectionFactory... factories) Constructs a UnixSocketConnector with the given selectors and ConnectionFactories.
- Parameters:
server- theServerthis connector will accept connections for.selectors- the number of selectors, or <=0 for a default value.factories- zero or moreConnectionFactoryinstances used to create and configure connections.
-
UnixSocketConnector
public UnixSocketConnector(@Name("server") org.eclipse.jetty.server.Server server, @Name("sslContextFactory") org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory) Constructs a UnixSocketConnector with the given SslContextFactory.
- Parameters:
server- theServerthis connector will accept connections for.sslContextFactory- when non null aSslConnectionFactoryprepended to the other ConnectionFactories
-
UnixSocketConnector
public UnixSocketConnector(@Name("server") org.eclipse.jetty.server.Server server, @Name("selectors") int selectors, @Name("sslContextFactory") org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory) Constructs a UnixSocketConnector with the given selectors and SslContextFactory.
.- Parameters:
server- theServerthis connector will accept connections for.selectors- the number of selectors, or <=0 for a default value.sslContextFactory- when non null aSslConnectionFactoryprepended to the other ConnectionFactories
-
UnixSocketConnector
public UnixSocketConnector(@Name("server") org.eclipse.jetty.server.Server server, @Name("sslContextFactory") org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory, @Name("factories") org.eclipse.jetty.server.ConnectionFactory... factories) Constructs a UnixSocketConnector with the given SslContextFactory and ConnectionFactories.
.- Parameters:
server- theServerthis connector will accept connections for.sslContextFactory- when non null aSslConnectionFactoryprepended to the other ConnectionFactoriesfactories- zero or moreConnectionFactoryinstances used to create and configure connections.
-
UnixSocketConnector
public UnixSocketConnector(@Name("server") org.eclipse.jetty.server.Server server, @Name("executor") Executor executor, @Name("scheduler") org.eclipse.jetty.util.thread.Scheduler scheduler, @Name("bufferPool") org.eclipse.jetty.io.ByteBufferPool bufferPool, @Name("selectors") int selectors, @Name("factories") org.eclipse.jetty.server.ConnectionFactory... factories) Constructs a UnixSocketConnector with the given parameters.
.- Parameters:
server- theServerthis connector will accept connections for.executor- the executor that runs tasks for handling requests, acceptors and selectors.scheduler- the scheduler used to schedule timed tasks.bufferPool- the ByteBufferPool used to allocate buffers.selectors- the number of selectors, or <=0 for a default value.factories- zero or moreConnectionFactoryinstances used to create and configure connections.
-
-
Method Details
-
getUnixSocket
-
setUnixSocket
-
newSelectorManager
protected org.eclipse.jetty.io.SelectorManager newSelectorManager(Executor executor, org.eclipse.jetty.util.thread.Scheduler scheduler, int selectors) -
doStart
-
doStop
-
isOpen
public boolean isOpen() -
open
- Throws:
IOException
-
close
public void close() -
accept
- Specified by:
acceptin classorg.eclipse.jetty.server.AbstractConnector- Throws:
IOException
-
accepted
- Throws:
IOException
-
getSelectorManager
public org.eclipse.jetty.io.SelectorManager getSelectorManager() -
getTransport
-
newEndPoint
protected UnixSocketEndPoint newEndPoint(SelectableChannel channel, org.eclipse.jetty.io.ManagedSelector selector, SelectionKey key) -
getAcceptQueueSize
@ManagedAttribute("Accept Queue size") public int getAcceptQueueSize()- Returns:
- the accept queue size
-
setAcceptQueueSize
public void setAcceptQueueSize(int acceptQueueSize) - Parameters:
acceptQueueSize- the accept queue size (also known as accept backlog)
-
getReuseAddress
@ManagedAttribute("Whether the server socket reuses addresses") public boolean getReuseAddress()- Returns:
- whether the server socket reuses addresses
- See Also:
-
setReuseAddress
public void setReuseAddress(boolean reuseAddress) - Parameters:
reuseAddress- whether the server socket reuses addresses- See Also:
-
toString
- Overrides:
toStringin classorg.eclipse.jetty.server.AbstractConnector
-