public class LagomClientFactory extends Object implements Closeable
close()
method, when no longer needed.Modifier and Type | Method and Description |
---|---|
void |
close()
Close all resources associated with this client factory.
|
static LagomClientFactory |
create(String serviceName,
ClassLoader classLoader)
Create a client factory that uses the given service locator.
|
<T> T |
createClient(Class<T> clientInterface,
Collection<URI> serviceUris)
Create a Lagom service client that uses the given URIs.
|
<T> T |
createClient(Class<T> clientInterface,
ServiceLocator serviceLocator)
Create a Lagom service client for the given client interface using the given service locator.
|
<T> T |
createClient(Class<T> clientInterface,
URI serviceUri)
Create a Lagom service client that uses the given URI.
|
<T> T |
createDevClient(Class<T> clientInterface)
Create a Lagom service client that uses the Lagom dev mode service locator to locate the service.
|
<T> T |
createDevClient(Class<T> clientInterface,
URI serviceLocatorUri)
Create a Lagom service client that uses the Lagom dev mode service locator to locate the service.
|
public <T> T createClient(Class<T> clientInterface, ServiceLocator serviceLocator)
clientInterface
- The client interface for the service.serviceLocator
- The service locator.public <T> T createClient(Class<T> clientInterface, URI serviceUri)
clientInterface
- The client interface for the service.serviceUri
- The URI that the service lives at.public <T> T createClient(Class<T> clientInterface, Collection<URI> serviceUris)
clientInterface
- The client interface for the service.serviceUris
- The URIs that the service lives at. A copy of this collection will be used, so changes to the
collection after invoking this have no effect.public <T> T createDevClient(Class<T> clientInterface)
clientInterface
- The client interface for the service.public <T> T createDevClient(Class<T> clientInterface, URI serviceLocatorUri)
clientInterface
- The client interface for the service.serviceLocatorUri
- The URI of the Lagom dev mode service locator - usually http://localhost:8000.public void close()
close
in interface Closeable
close
in interface AutoCloseable
public static LagomClientFactory create(String serviceName, ClassLoader classLoader)
serviceName
- The name of this service that is going to be accessing the services created by this factory.classLoader
- The classloader.