Package org.ldaptive.transport.netty
Class ConnectionTransport
java.lang.Object
org.ldaptive.transport.netty.ConnectionTransport
- All Implemented Interfaces:
Transport
- Direct Known Subclasses:
ConnectionTransport.DualThread
,ConnectionTransport.SingleThread
,NioConnectionTransport
Creates netty connections using the best fit event loop group based on the operating system. See
Epoll.isAvailable()
and KQueue.isAvailable()
. The event loop
group is shutdown when the connection is closed.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
AConnectionTransport
configured with two underlying threads.static class
AConnectionTransport
configured with a single underlying thread. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.slf4j.Logger
Logger for this class.private int
Number of I/O threads.private int
Number of message threads. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new connection transport.ConnectionTransport
(int ioThreads) Creates a new connection transport.ConnectionTransport
(int ioThreads, int messageThreads) Creates a new connection transport. -
Method Summary
Modifier and TypeMethodDescriptionCreate a connection object.protected io.netty.channel.EventLoopGroup
createEventLoopGroup
(String name, int numThreads) Returns a new event loop group with the supplied name and number of threads.protected Class
<? extends io.netty.channel.Channel> Returns the socket channel type used with the event loop group.toString()
-
Field Details
-
logger
protected final org.slf4j.Logger loggerLogger for this class. -
numIoThreads
private int numIoThreadsNumber of I/O threads. -
numMessageThreads
private int numMessageThreadsNumber of message threads.
-
-
Constructor Details
-
ConnectionTransport
public ConnectionTransport()Creates a new connection transport. -
ConnectionTransport
public ConnectionTransport(int ioThreads) Creates a new connection transport.- Parameters:
ioThreads
- number of threads used for I/O in the event loop group
-
ConnectionTransport
public ConnectionTransport(int ioThreads, int messageThreads) Creates a new connection transport.- Parameters:
ioThreads
- number of threads used for I/O in the event loop groupmessageThreads
- number of threads for LDAP message handling in the event loop group
-
-
Method Details
-
getSocketChannelType
Returns the socket channel type used with the event loop group.- Returns:
- socket channel type
-
createEventLoopGroup
Returns a new event loop group with the supplied name and number of threads.- Parameters:
name
- of the event loop groupnumThreads
- number of worker threads- Returns:
- new event loop group
-
create
Description copied from interface:Transport
Create a connection object. Implementations should not open a TCP socket in this method. -
toString
-