Connection implementation for Java NIO Connections.
| Modifier and Type | Class and Description |
|---|---|
| private static class | NIOConnection.
Map, which contains |
| Modifier and Type | Field and Description |
|---|---|
| private volatile TaskQueue | |
| private final TaskQueue | |
| protected final AttributeHolder | |
| protected volatile SelectableChannel | |
| private volatile GrizzlyFuture | |
| private final List | |
| private volatile CloseReason | |
| private static final AtomicReferenceFieldUpdater | |
| private volatile Object | |
| protected static final AtomicReferenceFieldUpdater | connectCloseSemaphoreUpdater
Semaphore responsible for connect/close notification |
| private static final AtomicLong | |
| private final long | |
| protected volatile boolean | |
| private final AtomicBoolean | isCloseScheduled
closeTypeFlag, "null" value means the connection is open. |
| private boolean | isInitialReadRequired
Is initial OP_READ enabling required for the connection |
| protected volatile boolean | |
| private static final Logger | |
| private static final short | |
| protected volatile int | |
| protected final DefaultMonitoringConfig | monitoringConfig
Connection probes |
| protected static final Object | |
| protected static final Object | |
| protected volatile Processor | |
| protected volatile ProcessorSelector | |
| private final NIOConnection. | processorStateStorage
Storage contains states of different Processors this Connection is associated with. |
| private final SelectorHandler. | |
| protected volatile long | |
| protected volatile SelectionKey | |
| protected volatile SelectorRunner | |
| protected final NIOTransport | |
| private static final boolean | |
| private final SelectorHandler. | |
| protected volatile long | |
| protected short |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addCloseListener(final CloseListener<T extends Closeable, C extends ICloseType> closeListener)
Implements org. Add the |
| public void | addCloseListener(Connection.
Implements org.
References Deprecated
Connection.CloseListener is deprecated or references (maybe indirectly) at least one deprecated element.
Add the |
| public void | assertOpen()
Implements org. Checks if this Connection is open and ready to be used. |
| public void | |
| protected final void | |
| public GrizzlyFuture | |
| public void | close(final CompletionHandler<Closeable> completionHandler)
Implements org.
Deprecated
please use
close() with the following
GrizzlyFuture#addCompletionHandler(org. call
Gracefully close the |
| public GrizzlyFuture | |
| protected void | |
| public final void | closeSilently()
Implements org. Gracefully close the |
| public void | closeWithReason(final IOException reason)
Implements org. Gracefully closes the Connection and provides the reason description. |
| public void | configureBlocking(boolean isBlocking)
Implements org. Sets the |
| public synchronized void | configureStandalone(boolean isStandalone)
Implements org.
|
| public void | |
| public final void | |
| protected void | |
| protected void | |
| public final void | |
| public void | executeInEventThread(final IOEvent event, final Runnable runnable)
Implements org. Executes the |
| public TaskQueue | |
| public TaskQueue | |
| public AttributeHolder | getAttributes()
Implements org. Get associated |
| public SelectableChannel | |
| public CloseReason | getCloseReason()
Implements org. Returns |
| public long | getId()
Implements org. Returns id of this instance, unique in the context of the JVM and the implementation class. |
| public int | getMaxAsyncWriteQueueSize()
Implements org. Get the max size (in bytes) of asynchronous write queue associated with connection. |
| public MemoryManager | |
| public final MonitoringConfig | getMonitoringConfig()
Implements org. Return the object associated |
| public Processor | getProcessor()
Implements org. Gets the default |
| public ProcessorSelector | getProcessorSelector()
Implements org. Gets the default |
| public long | getReadTimeout(TimeUnit timeUnit)
Implements org. Returns the current value for the blocking read timeout converted to the provided |
| public SelectionKey | |
| public SelectorRunner | |
| public Transport | getTransport()
Implements org. Get the |
| public long | getWriteTimeout(TimeUnit timeUnit)
Implements org. Returns the current value for the blocking write timeout converted to the provided |
| private void | invokeCloseListener(final CloseListener<T extends Closeable, C extends ICloseType> closeListener, final CloseType closeType)
References Deprecated
CloseType is deprecated or references (maybe indirectly) at least one deprecated element.
|
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| private void | |
| public void | notifyConnectionError(Throwable error)
Implements org. Method gets invoked, when error occur during the Connection lifecycle. |
| protected static void | notifyIOEventDisabled(NIOConnection
the Connection event occurred on. connection, IOEvent the ioEvent)IOEvent.Notify registered |
| protected static void | notifyIOEventEnabled(NIOConnection
the Connection event occurred on. connection, IOEvent the ioEvent)IOEvent.Notify registered |
| protected static void | notifyIOEventReady(NIOConnection
the Connection event occurred on. connection, IOEvent the ioEvent)IOEvent.Notify registered |
| protected static void | notifyProbesAccept(final NIOConnection
the server Connection, which accepted the client connection. serverConnection, final NIOConnection the client Connection. clientConnection)Notify registered |
| protected static void | notifyProbesBind(NIOConnection
the Connection event occurred on. connection)Notify registered |
| protected static void | notifyProbesClose(NIOConnection
the Connection event occurred on. connection)Notify registered |
| protected static void | notifyProbesConnect(NIOConnection
the Connection event occurred on. connection)Notify registered |
| protected static void | notifyProbesError(NIOConnection
the Connection event occurred on. connection, Throwable error)Notify registered |
| protected static void | notifyProbesRead(NIOConnection connection, Buffer data, int size)
Notify registered |
| protected static void | notifyProbesWrite(NIOConnection connection, Buffer data, long size)
Notify registered |
| public Processor | obtainProcessor(IOEvent ioEvent)
Implements org. Gets the |
| public <E> E | obtainProcessorState(final Processor<E extends Context> processor, final Supplier<E> factory)
Implements org. Returns the |
| pack-priv final void | |
| protected void | |
| public <M> GrizzlyFuture | |
| public <M> void | read(final CompletionHandler<ReadResult<M, SocketAddress>> completionHandler)
Implements org.
|
| public boolean | removeCloseListener(final CloseListener<T extends Closeable, C extends ICloseType> closeListener)
Implements org. Remove the |
| public boolean | removeCloseListener(Connection.
Implements org.
References Deprecated
Connection.CloseListener is deprecated or references (maybe indirectly) at least one deprecated element.
Remove the |
| protected void | |
| public void | setMaxAsyncWriteQueueSize(int maxAsyncWriteQueueSize)
Implements org. Set the max size (in bytes) of asynchronous write queue associated with connection. |
| pack-priv void | setMonitoringProbes(final ConnectionProbe[] monitoringProbes)
Set the monitoringProbes array directly. |
| public void | setProcessor(Processor<E extends Context> preferableProcessor)
Implements org. Sets the default |
| public void | setProcessorSelector(final ProcessorSelector preferableProcessorSelector)
Implements org. Sets the default |
| public void | setReadTimeout(long timeout, TimeUnit timeUnit)
Implements org. Specifies the timeout for the blocking reads. |
| protected void | |
| protected void | |
| public void | setWriteTimeout(long timeout, TimeUnit timeUnit)
Implements org. Specifies the timeout for the blocking writes. |
| public void | |
| public GrizzlyFuture | |
| protected void | |
| public void | terminateSilently()
Implements org. Close the |
| public void | terminateWithReason(final IOException reason)
Implements org. Closes the Connection and provides the reason description. |
| public <M> GrizzlyFuture | |
| public <M> void | write(final M message, final CompletionHandler<WriteResult<M, SocketAddress>> completionHandler)
Implements org. Method writes the buffer. |
| public <M> void | write(final M message, CompletionHandler<WriteResult<M, SocketAddress>> completionHandler, PushBackHandler pushbackHandler)
Implements org.
Deprecated
Method writes the buffer. |
| public <M> void | write(final SocketAddress dstAddress, final M message, final CompletionHandler<WriteResult<M, SocketAddress>> completionHandler)
Implements org. Method writes the buffer to the specific address. |
| public <M> void | write(final SocketAddress dstAddress, final M message, final CompletionHandler<WriteResult<M, SocketAddress>> completionHandler, final PushBackHandler pushbackHandler)
Implements org.
Deprecated
Method writes the buffer to the specific address. |