Key - the type of key used for client lookupClient - the type of client stored in the grouppublic interface ClientGroup<Key,Client extends ListenableAsyncCloseable>
extends ListenableAsyncCloseable
| Modifier and Type | Method and Description |
|---|---|
static <Key,Client extends ListenableAsyncCloseable> |
from(Function<Key,Client> factory)
|
Client |
get(Key key)
Return the
Client identified by the provided key or create a new one when none exists. |
Client get(Key key)
Client identified by the provided key or create a new one when none exists.key - the key identifying the client to return or create, this key may contain attributes about the
requested client in order to create new instanceskey, either by looking up an existing or creating a new
instance if non-existentstatic <Key,Client extends ListenableAsyncCloseable> ClientGroup<Key,Client> from(Function<Key,Client> factory)
Key - the type of key used for client lookup and creationClient - the type of client stored in the groupfactory - Function will be called every time get(Object) is called with a non-existent
Key.ClientGroup based on a @{code factory} of clients of type Client.