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
public class ConnectionTransport extends java.lang.Object implements Transport
Creates netty connections using the best fit event loop group based on the operating system. SeeEpoll.isAvailable()andKQueue.isAvailable(). The event loop group is shutdown when the connection is closed.- Author:
- Middleware Services
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConnectionTransport.DualThreadAConnectionTransportconfigured with two underlying threads.static classConnectionTransport.SingleThreadAConnectionTransportconfigured with a single underlying thread.
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.LoggerloggerLogger for this class.
-
Constructor Summary
Constructors Constructor Description ConnectionTransport()Creates a new connection transport.ConnectionTransport(int ioThreads)Creates a new connection transport.ConnectionTransport(int ioThreads, int messageThreads)Creates a new connection transport.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Connectioncreate(ConnectionConfig cc)Create a connection object.protected io.netty.channel.EventLoopGroupcreateEventLoopGroup(java.lang.String name, int numThreads)Returns a new event loop group with the supplied name and number of threads.protected java.lang.Class<? extends io.netty.channel.Channel>getSocketChannelType()Returns the socket channel type used with the event loop group.java.lang.StringtoString()
-
-
-
Constructor Detail
-
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 Detail
-
getSocketChannelType
protected java.lang.Class<? extends io.netty.channel.Channel> getSocketChannelType()
Returns the socket channel type used with the event loop group.- Returns:
- socket channel type
-
createEventLoopGroup
protected io.netty.channel.EventLoopGroup createEventLoopGroup(java.lang.String name, int numThreads)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
public Connection create(ConnectionConfig cc)
Description copied from interface:TransportCreate a connection object. Implementations should not open a TCP socket in this method.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-