public class LagomClientFactory
extends Object
implements java.io.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,
java.util.Collection<java.net.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,
java.net.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,
java.net.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, java.net.URI serviceUri)
clientInterface
- The client interface for the service.serviceUri
- The URI that the service lives at.public <T> T createClient(Class<T> clientInterface, java.util.Collection<java.net.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, java.net.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 java.io.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.