Top Inners Fields Constructors Methods
org.glassfish.grizzly.nio.transport

public final Class TCPNIOServerConnection

extends TCPNIOConnection
Class Inheritance
Imports
java.io.IOException, java.net.SocketAddress, java.nio.channels.SelectionKey, .ServerSocketChannel, .SocketChannel, java.util.concurrent.ExecutionException, .Future, .TimeUnit, java.util.function.Supplier, java.util.logging.Level, .Logger, org.glassfish.grizzly.CloseReason, .Closeable, .CompletionHandler, .Connection, .EmptyCompletionHandler, .Grizzly, .GrizzlyFuture, .IOEvent, org.glassfish.grizzly.impl.FutureImpl, .SafeFutureImpl, org.glassfish.grizzly.nio.RegisterChannelResult, .SelectionKeyHandler, org.glassfish.grizzly.utils.CompletionHandlerAdapter, .Exceptions, .Holder

Author
oleksiys

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class

Field Summary

Modifier and TypeField and Description
private FutureImpl<Connection<L>>
private final Object
private final TCPNIOServerConnection.RegisterAcceptedChannelCompletionHandler
private static boolean
private static final Logger
Inherited from org.glassfish.grizzly.nio.transport.TCPNIOConnection:
localSocketAddressHolderpeerSocketAddressHolder

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public GrizzlyFuture<Connection<L>>

Returns:

Future
accept
()

Accept a Connection.

protected GrizzlyFuture<Connection<L>>

Returns:

Future
acceptAsync
()

Asynchronously accept a Connection

protected void
private void
configureAcceptedChannel(final SocketChannel acceptedChannel)

private TCPNIOConnection
createClientConnection(final SocketChannel acceptedChannel)

private SocketChannel
public int
getReadBufferSize()

Overrides org.glassfish.grizzly.nio.transport.TCPNIOConnection.getReadBufferSize.

Implements org.glassfish.grizzly.Connection.getReadBufferSize.

Get the default size of Buffers, which will be allocated for reading data from Connection.

public int
public boolean
public boolean
public void
public void
onAccept()

Method will be called by framework, when async accept will be ready

public void
private void
registerAcceptedChannel(final TCPNIOConnection acceptedConnection, final CompletionHandler<RegisterChannelResult> completionHandler, final int initialSelectionKeyInterest)

protected void
public void
setReadBufferSize(final int readBufferSize)

Overrides org.glassfish.grizzly.nio.transport.TCPNIOConnection.setReadBufferSize.

Implements org.glassfish.grizzly.Connection.setReadBufferSize.

Set the default size of Buffers, which will be allocated for reading data from Connection.

public void
setWriteBufferSize(final int writeBufferSize)

Overrides org.glassfish.grizzly.nio.transport.TCPNIOConnection.setWriteBufferSize.

Implements org.glassfish.grizzly.Connection.setWriteBufferSize.

Set the default size of Buffers, which will be allocated for writing data to Connection.

Inherited from org.glassfish.grizzly.nio.transport.TCPNIOConnection:
canWritecanWritecheckConnectFailedenableInitialOpReadgetLocalAddressgetPeerAddressnotifyCanWritenotifyCanWritenotifyReadyonConnectonReadonWritesetConnectResultHandlersetSelectionKeysetSelectorRunnerterminate0toString

Field Detail

acceptListenerback to summary
private FutureImpl<Connection<L>> acceptListener
acceptSyncback to summary
private final Object acceptSync
defaultCompletionHandlerback to summary
private final TCPNIOServerConnection.RegisterAcceptedChannelCompletionHandler defaultCompletionHandler
DISABLE_INTERRUPT_CLEARback to summary
private static boolean DISABLE_INTERRUPT_CLEAR
LOGGERback to summary
private static final Logger LOGGER

Hides org.glassfish.grizzly.nio.transport.TCPNIOConnection.LOGGER.

Constructor Detail

TCPNIOServerConnectionback to summary
public TCPNIOServerConnection(TCPNIOTransport transport, ServerSocketChannel serverSocketChannel)

Method Detail

acceptback to summary
public GrizzlyFuture<Connection<L>> accept() throws IOException

Accept a Connection. Could be used only in standalone mode. See Connection#configureStandalone(boolean).

Returns:GrizzlyFuture<Connection<L>>

Future

acceptAsyncback to summary
protected GrizzlyFuture<Connection<L>> acceptAsync() throws IOException

Asynchronously accept a Connection

Returns:GrizzlyFuture<Connection<L>>

Future

closeGracefully0back to summary
protected void closeGracefully0(final CompletionHandler<Closeable> completionHandler, final CloseReason closeReason)

Overrides org.glassfish.grizzly.nio.NIOConnection.closeGracefully0.

Annotations
@Override
configureAcceptedChannelback to summary
private void configureAcceptedChannel(final SocketChannel acceptedChannel) throws IOException
createClientConnectionback to summary
private TCPNIOConnection createClientConnection(final SocketChannel acceptedChannel)
doAcceptback to summary
private SocketChannel doAccept() throws IOException
getReadBufferSizeback to summary
public int getReadBufferSize()

Overrides org.glassfish.grizzly.nio.transport.TCPNIOConnection.getReadBufferSize.

Implements org.glassfish.grizzly.Connection.getReadBufferSize.

Doc from org.glassfish.grizzly.nio.transport.TCPNIOConnection.getReadBufferSize.

Get the default size of Buffers, which will be allocated for reading data from Connection. The value less or equal to zero will be ignored.

Annotations
@Override
getWriteBufferSizeback to summary
public int getWriteBufferSize()

Overrides org.glassfish.grizzly.nio.transport.TCPNIOConnection.getWriteBufferSize.

Implements org.glassfish.grizzly.Connection.getWriteBufferSize.

Doc from org.glassfish.grizzly.nio.transport.TCPNIOConnection.getWriteBufferSize.

Get the default size of Buffers, which will be allocated for writing data to Connection.

Annotations
@Override
isBlockingback to summary
public boolean isBlocking()

Overrides org.glassfish.grizzly.nio.NIOConnection.isBlocking.

Implements org.glassfish.grizzly.Connection.isBlocking.

Annotations
@Override
isStandaloneback to summary
public boolean isStandalone()

Overrides org.glassfish.grizzly.nio.NIOConnection.isStandalone.

Implements org.glassfish.grizzly.Connection.isStandalone.

Annotations
@Override
listenback to summary
public void listen() throws IOException
onAcceptback to summary
public void onAccept() throws IOException

Method will be called by framework, when async accept will be ready

preCloseback to summary
public void preClose()

Overrides org.glassfish.grizzly.nio.transport.TCPNIOConnection.preClose.

Annotations
@Override
registerAcceptedChannelback to summary
private void registerAcceptedChannel(final TCPNIOConnection acceptedConnection, final CompletionHandler<RegisterChannelResult> completionHandler, final int initialSelectionKeyInterest) throws IOException
resetPropertiesback to summary
protected void resetProperties()

Overrides org.glassfish.grizzly.nio.transport.TCPNIOConnection.resetProperties.

Annotations
@Override
@SuppressWarnings:unchecked
setReadBufferSizeback to summary
public void setReadBufferSize(final int readBufferSize)

Overrides org.glassfish.grizzly.nio.transport.TCPNIOConnection.setReadBufferSize.

Implements org.glassfish.grizzly.Connection.setReadBufferSize.

Doc from org.glassfish.grizzly.nio.transport.TCPNIOConnection.setReadBufferSize.

Set the default size of Buffers, which will be allocated for reading data from Connection. The value less or equal to zero will be ignored.

Annotations
@Override
setWriteBufferSizeback to summary
public void setWriteBufferSize(final int writeBufferSize)

Overrides org.glassfish.grizzly.nio.transport.TCPNIOConnection.setWriteBufferSize.

Implements org.glassfish.grizzly.Connection.setWriteBufferSize.

Doc from org.glassfish.grizzly.nio.transport.TCPNIOConnection.setWriteBufferSize.

Set the default size of Buffers, which will be allocated for writing data to Connection.

Annotations
@Override
org.glassfish.grizzly.nio.transport back to summary

protected final Class TCPNIOServerConnection.RegisterAcceptedChannelCompletionHandler

extends EmptyCompletionHandler<RegisterChannelResult>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final FutureImpl<Connection<L>>

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
Inherited from org.glassfish.grizzly.EmptyCompletionHandler:
cancelledfailedupdated

Field Detail

listenerback to summary
private final FutureImpl<Connection<L>> listener

Constructor Detail

RegisterAcceptedChannelCompletionHandlerback to summary
public RegisterAcceptedChannelCompletionHandler()
RegisterAcceptedChannelCompletionHandlerback to summary
public RegisterAcceptedChannelCompletionHandler(FutureImpl<Connection<L>> listener)

Method Detail

completedback to summary
public void completed(RegisterChannelResult result)

Overrides org.glassfish.grizzly.EmptyCompletionHandler.completed.

Implements org.glassfish.grizzly.CompletionHandler.completed.

Doc from org.glassfish.grizzly.EmptyCompletionHandler.completed.

The operation was completed.

Annotations
@Override