@ManagedObject(value="Connector using UNIX Socket") public class UnixSocketConnector extends AbstractConnector
A server-side connector for UNIX sockets.
| Modifier and Type | Class and Description |
|---|---|
protected class |
UnixSocketConnector.UnixSocketConnectorManager |
AbstractLifeCycle.AbstractLifeCycleListenerLifeCycle.ListenerContainer.InheritedListener, Container.ListenerGraceful.Shutdown| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_UNIX_SOCKET_PATH_LENGTH |
| Constructor and Description |
|---|
UnixSocketConnector(Server server)
Constructs a UnixSocketConnector with the default configuration.
|
UnixSocketConnector(Server server,
ConnectionFactory... factories)
Constructs a UnixSocketConnector with the given ConnectionFactories.
|
UnixSocketConnector(Server server,
java.util.concurrent.Executor executor,
Scheduler scheduler,
ByteBufferPool bufferPool,
int selectors,
ConnectionFactory... factories)
Constructs a UnixSocketConnector with the given parameters.
|
UnixSocketConnector(Server server,
int selectors)
Constructs a UnixSocketConnector with the given number of selectors
|
UnixSocketConnector(Server server,
int selectors,
ConnectionFactory... factories)
Constructs a UnixSocketConnector with the given selectors and ConnectionFactories.
|
UnixSocketConnector(Server server,
int selectors,
SslContextFactory sslContextFactory)
Constructs a UnixSocketConnector with the given selectors and SslContextFactory.
|
UnixSocketConnector(Server server,
SslContextFactory sslContextFactory)
Constructs a UnixSocketConnector with the given SslContextFactory.
|
UnixSocketConnector(Server server,
SslContextFactory sslContextFactory,
ConnectionFactory... factories)
Constructs a UnixSocketConnector with the given SslContextFactory and ConnectionFactories.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(int acceptorID) |
protected void |
accepted(jnr.unixsocket.UnixSocketChannel channel) |
void |
close() |
protected void |
doStart()
Starts the managed lifecycle beans in the order they were added.
|
protected void |
doStop()
Stops the managed lifecycle beans in the reverse order they were added.
|
int |
getAcceptQueueSize() |
boolean |
getReuseAddress() |
SelectorManager |
getSelectorManager() |
java.lang.Object |
getTransport() |
java.lang.String |
getUnixSocket() |
boolean |
isOpen() |
protected UnixSocketEndPoint |
newEndPoint(java.nio.channels.SelectableChannel channel,
ManagedSelector selector,
java.nio.channels.SelectionKey key) |
protected SelectorManager |
newSelectorManager(java.util.concurrent.Executor executor,
Scheduler scheduler,
int selectors) |
void |
open() |
void |
setAcceptQueueSize(int acceptQueueSize) |
void |
setReuseAddress(boolean reuseAddress) |
void |
setUnixSocket(java.lang.String filename) |
java.lang.String |
toString() |
addConnectionFactory, addFirstConnectionFactory, addIfAbsentConnectionFactory, clearConnectionFactories, getAcceptorPriorityDelta, getAcceptors, getByteBufferPool, getConnectedEndPoints, getConnectionFactories, getConnectionFactory, getConnectionFactory, getDefaultConnectionFactory, getDefaultProtocol, getExecutor, getIdleTimeout, getName, getProtocols, getScheduler, getServer, handleAcceptFailure, interruptAcceptors, isAccepting, isShutdown, join, join, onEndPointClosed, onEndPointOpened, removeConnectionFactory, setAccepting, setAcceptorPriorityDelta, setConnectionFactories, setDefaultProtocol, setIdleTimeout, setName, shutdownaddBean, 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, updateBeansaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, start, stop, stopaddBean, addBean, addEventListener, getBean, getBeans, getBeans, getContainedBeans, isManaged, manage, removeBean, removeEventListener, unmanagedump, dump, dump, dumpObject, dumpObjects, dumpSelfpublic static final int MAX_UNIX_SOCKET_PATH_LENGTH
public UnixSocketConnector(@Name(value="server") Server server)
Constructs a UnixSocketConnector with the default configuration.
server - the Server this connector will accept connections for.public UnixSocketConnector(@Name(value="server") Server server, @Name(value="selectors") int selectors)
Constructs a UnixSocketConnector with the given number of selectors
server - the Server this connector will accept connections for.selectors - the number of selectors, or <=0 for a default value.public UnixSocketConnector(@Name(value="server") Server server, @Name(value="factories") ConnectionFactory... factories)
Constructs a UnixSocketConnector with the given ConnectionFactories.
server - the Server this connector will accept connections for.factories - zero or more ConnectionFactory instances used to create and configure connections.public UnixSocketConnector(@Name(value="server") Server server, @Name(value="selectors") int selectors, @Name(value="factories") ConnectionFactory... factories)
Constructs a UnixSocketConnector with the given selectors and ConnectionFactories.
server - the Server this connector will accept connections for.selectors - the number of selectors, or <=0 for a default value.factories - zero or more ConnectionFactory instances used to create and configure connections.public UnixSocketConnector(@Name(value="server") Server server, @Name(value="sslContextFactory") SslContextFactory sslContextFactory)
Constructs a UnixSocketConnector with the given SslContextFactory.
server - the Server this connector will accept connections for.sslContextFactory - when non null a SslConnectionFactory prepended to the other ConnectionFactoriespublic UnixSocketConnector(@Name(value="server") Server server, @Name(value="selectors") int selectors, @Name(value="sslContextFactory") SslContextFactory sslContextFactory)
Constructs a UnixSocketConnector with the given selectors and SslContextFactory.
.server - the Server this connector will accept connections for.sslContextFactory - when non null a SslConnectionFactory prepended to the other ConnectionFactoriesselectors - the number of selectors, or <=0 for a default value.public UnixSocketConnector(@Name(value="server") Server server, @Name(value="sslContextFactory") SslContextFactory sslContextFactory, @Name(value="factories") ConnectionFactory... factories)
Constructs a UnixSocketConnector with the given SslContextFactory and ConnectionFactories.
.server - the Server this connector will accept connections for.sslContextFactory - when non null a SslConnectionFactory prepended to the other ConnectionFactoriesfactories - zero or more ConnectionFactory instances used to create and configure connections.public UnixSocketConnector(@Name(value="server") Server server, @Name(value="executor") java.util.concurrent.Executor executor, @Name(value="scheduler") Scheduler scheduler, @Name(value="bufferPool") ByteBufferPool bufferPool, @Name(value="selectors") int selectors, @Name(value="factories") ConnectionFactory... factories)
Constructs a UnixSocketConnector with the given parameters.
.server - the Server this 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 more ConnectionFactory instances used to create and configure connections.@ManagedAttribute(value="The UNIX socket file name") public java.lang.String getUnixSocket()
public void setUnixSocket(java.lang.String filename)
protected SelectorManager newSelectorManager(java.util.concurrent.Executor executor, Scheduler scheduler, int selectors)
protected void doStart()
throws java.lang.Exception
ContainerLifeCycledoStart in class AbstractConnectorjava.lang.Exceptionprotected void doStop()
throws java.lang.Exception
ContainerLifeCycledoStop in class AbstractConnectorjava.lang.Exceptionpublic boolean isOpen()
public void open()
throws java.io.IOException
java.io.IOExceptionpublic void close()
public void accept(int acceptorID)
throws java.io.IOException
accept in class AbstractConnectorjava.io.IOExceptionprotected void accepted(jnr.unixsocket.UnixSocketChannel channel)
throws java.io.IOException
java.io.IOExceptionpublic SelectorManager getSelectorManager()
public java.lang.Object getTransport()
protected UnixSocketEndPoint newEndPoint(java.nio.channels.SelectableChannel channel, ManagedSelector selector, java.nio.channels.SelectionKey key)
@ManagedAttribute(value="Accept Queue size") public int getAcceptQueueSize()
public void setAcceptQueueSize(int acceptQueueSize)
acceptQueueSize - the accept queue size (also known as accept backlog)@ManagedAttribute(value="Whether the server socket reuses addresses") public boolean getReuseAddress()
ServerSocket.getReuseAddress()public void setReuseAddress(boolean reuseAddress)
reuseAddress - whether the server socket reuses addressesServerSocket.setReuseAddress(boolean)public java.lang.String toString()
toString in class AbstractConnectorCopyright © 1995–2022 Webtide. All rights reserved.