public class AllInOneClientFactory extends AbstractClientFactory
ClientFactory
which combines all known official ClientFactory
implementations.
It currently combines the following ClientFactory
s:
DEFAULT
Constructor and Description |
---|
AllInOneClientFactory()
Creates a new instance with the default
SessionOptions . |
AllInOneClientFactory(boolean useDaemonThreads)
Creates a new instance with the default
SessionOptions . |
AllInOneClientFactory(SessionOptions options)
Creates a new instance with the specified
SessionOptions . |
AllInOneClientFactory(SessionOptions options,
boolean useDaemonThreads)
Creates a new instance with the specified
SessionOptions . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes all clients managed by this factory and shuts down the
EventLoopGroup
created implicitly by this factory. |
io.netty.channel.EventLoopGroup |
eventLoopGroup()
Returns the
EventLoopGroup being used by this ClientFactory . |
java.util.function.Supplier<io.netty.channel.EventLoop> |
eventLoopSupplier()
|
<T> T |
newClient(java.net.URI uri,
java.lang.Class<T> clientType,
ClientOptions options)
Creates a new client that connects to the specified
URI using the default
ClientFactory . |
SessionOptions |
options()
Returns the session-layer options of the connections created by this
ClientFactory . |
java.util.Set<Scheme> |
supportedSchemes()
Returns the
Scheme s supported by this ClientFactory . |
newClient, newClient, newClient, newEndpoint, validateScheme
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
closeDefault
public AllInOneClientFactory()
SessionOptions
.public AllInOneClientFactory(boolean useDaemonThreads)
SessionOptions
.useDaemonThreads
- whether to create I/O event loop threads as daemon threadspublic AllInOneClientFactory(SessionOptions options)
SessionOptions
.public AllInOneClientFactory(SessionOptions options, boolean useDaemonThreads)
SessionOptions
.useDaemonThreads
- whether to create I/O event loop threads as daemon threadspublic java.util.Set<Scheme> supportedSchemes()
ClientFactory
Scheme
s supported by this ClientFactory
.public SessionOptions options()
ClientFactory
ClientFactory
.public io.netty.channel.EventLoopGroup eventLoopGroup()
ClientFactory
EventLoopGroup
being used by this ClientFactory
. Can be used to, e.g.,
schedule a periodic task without creating a separate event loop. Use ClientFactory.eventLoopSupplier()
instead if what you need is an EventLoop
rather than an EventLoopGroup
.public java.util.function.Supplier<io.netty.channel.EventLoop> eventLoopSupplier()
ClientFactory
public <T> T newClient(java.net.URI uri, java.lang.Class<T> clientType, ClientOptions options)
ClientFactory
URI
using the default
ClientFactory
.uri
- the URI of the server endpointclientType
- the type of the new clientoptions
- the ClientOptions
public void close()
ClientFactory
EventLoopGroup
created implicitly by this factory.