Module org.glassfish.grizzly
Package org.glassfish.grizzly.nio
Class RoundRobinConnectionDistributor
java.lang.Object
org.glassfish.grizzly.nio.AbstractNIOConnectionDistributor
org.glassfish.grizzly.nio.RoundRobinConnectionDistributor
- All Implemented Interfaces:
NIOChannelDistributor
RoundRobin NIOConnectionDistributor implementation, which allocates one SelectorRunner for OP_ACCEPT events and other
event will be assign to a next SelectorRunner from the array.
- Author:
- Alexey Stashok
-
Field Summary
Fields inherited from class org.glassfish.grizzly.nio.AbstractNIOConnectionDistributor
transport -
Constructor Summary
ConstructorsConstructorDescriptionRoundRobinConnectionDistributor(NIOTransport transport) RoundRobinConnectionDistributor(NIOTransport transport, boolean useDedicatedAcceptor) RoundRobinConnectionDistributor(NIOTransport transport, boolean useDedicatedAcceptor, boolean isServerOnly) Constructs RoundRobinConnectionDistributor with the given configuration. -
Method Summary
Modifier and TypeMethodDescriptionvoidregisterChannel(SelectableChannel channel, int interestOps, Object attachment) voidregisterChannelAsync(SelectableChannel channel, int interestOps, Object attachment, CompletionHandler<RegisterChannelResult> completionHandler) voidregisterServiceChannelAsync(SelectableChannel channel, int interestOps, Object attachment, CompletionHandler<RegisterChannelResult> completionHandler) Methods inherited from class org.glassfish.grizzly.nio.AbstractNIOConnectionDistributor
getTransportSelectorRunners, registerChannel, registerChannel, registerChannelAsync, registerChannelAsync, registerChannelAsync
-
Constructor Details
-
RoundRobinConnectionDistributor
-
RoundRobinConnectionDistributor
-
RoundRobinConnectionDistributor
public RoundRobinConnectionDistributor(NIOTransport transport, boolean useDedicatedAcceptor, boolean isServerOnly) Constructs RoundRobinConnectionDistributor with the given configuration.- Parameters:
transport-useDedicatedAcceptor- depending on this flag serverConnections, responsible for accepting client connections, will or will not use dedicatedSelectorRunnerisServerOnly- true means thisNIOChannelDistributorwill be used by aTransport, which operates as a server only(the Transport will never initiate a client-sideConnection). In this case we're able to use optimized (thread unsafe) distribution algorithm.
-
-
Method Details
-
registerChannel
public void registerChannel(SelectableChannel channel, int interestOps, Object attachment) throws IOException - Throws:
IOException
-
registerChannelAsync
public void registerChannelAsync(SelectableChannel channel, int interestOps, Object attachment, CompletionHandler<RegisterChannelResult> completionHandler) -
registerServiceChannelAsync
public void registerServiceChannelAsync(SelectableChannel channel, int interestOps, Object attachment, CompletionHandler<RegisterChannelResult> completionHandler)
-