Interface ClientFactory

All Superinterfaces:
AsyncCloseable, AutoCloseable, ListenableAsyncCloseable, Unwrappable
All Known Implementing Classes:
DecoratingClientFactory

public interface ClientFactory
extends Unwrappable, ListenableAsyncCloseable
Creates and manages clients.

Life cycle of the default ClientFactory

Clients or ClientBuilder uses the default ClientFactory returned by ofDefault(), unless you specified a ClientFactory explicitly. Calling AsyncCloseable.close() on the default ClientFactory will neither terminate its I/O threads nor release other related resources unlike other ClientFactory to protect itself from accidental premature termination.

Instead, when the current ClassLoader is the system class loader, a shutdown hook is registered so that they are released when the JVM exits.

If you are in a multi-classloader environment or you desire an early/explicit termination of the default ClientFactory, use closeDefault().