public final class PropertiesEndpointGroup extends DynamicEndpointGroup
| Modifier and Type | Method and Description |
|---|---|
static PropertiesEndpointGroupBuilder |
builder(ClassLoader classLoader,
String resourceName,
String endpointKeyPrefix)
Returns a new
PropertiesEndpointGroupBuilder created from the specified classpath resource. |
static PropertiesEndpointGroupBuilder |
builder(Path path,
String endpointKeyPrefix)
Returns a new
PropertiesEndpointGroupBuilder created from the file at the specified
Path. |
static PropertiesEndpointGroupBuilder |
builder(Properties properties,
String endpointKeyPrefix)
Returns a new
PropertiesEndpointGroupBuilder created from the specified Properties. |
protected void |
doCloseAsync(CompletableFuture<?> future)
Override this method to release the resources held by this
EndpointGroup and complete
the specified CompletableFuture. |
static PropertiesEndpointGroup |
of(ClassLoader classLoader,
String resourceName,
String endpointKeyPrefix)
Returns a new
PropertiesEndpointGroup created from the specified classpath resource. |
static PropertiesEndpointGroup |
of(ClassLoader classLoader,
String resourceName,
String endpointKeyPrefix,
int defaultPort)
Deprecated.
|
static PropertiesEndpointGroup |
of(Path path,
String endpointKeyPrefix)
Returns a new
PropertiesEndpointGroup created from the file at the specified Path. |
static PropertiesEndpointGroup |
of(Path path,
String endpointKeyPrefix,
int defaultPort)
Deprecated.
|
static PropertiesEndpointGroup |
of(Properties properties,
String endpointKeyPrefix)
Returns a new
PropertiesEndpointGroup created from the specified Properties. |
static PropertiesEndpointGroup |
of(Properties properties,
String endpointKeyPrefix,
int defaultPort)
Deprecated.
|
addEndpoint, close, closeAsync, endpoints, isClosed, isClosing, removeEndpoint, select, selectionStrategy, setEndpoints, whenClosed, whenReadyaddListener, notifyListeners, removeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddListener, awaitInitialEndpoints, awaitInitialEndpoints, empty, initialEndpointsFuture, of, of, of, of, orElse, removeListenerpublic static PropertiesEndpointGroup of(ClassLoader classLoader, String resourceName, String endpointKeyPrefix)
PropertiesEndpointGroup created from the specified classpath resource.
The value of each property whose name starts with endpointKeyPrefix will be parsed with
Endpoint.parse(String), and then loaded into the PropertiesEndpointGroup, e.g.
# endpointKeyPrefix = 'example.hosts.'
example.hosts.0=example1.com:36462
example.hosts.1=example2.com:36462
example.hosts.2=example3.com:36462
resourceName - the name of the resource where the list of Endpoints is loaded fromendpointKeyPrefix - the property name prefix@Deprecated public static PropertiesEndpointGroup of(ClassLoader classLoader, String resourceName, String endpointKeyPrefix, int defaultPort)
builder(ClassLoader, String, String)
and PropertiesEndpointGroupBuilder.defaultPort(int).PropertiesEndpointGroup created from the specified classpath resource.
The value of each property whose name starts with endpointKeyPrefix will be parsed with
Endpoint.parse(String), and then loaded into the PropertiesEndpointGroup, e.g.
# endpointKeyPrefix = 'example.hosts.'
example.hosts.0=example1.com:36462
example.hosts.1=example2.com:36462
example.hosts.2=example3.com:36462
resourceName - the name of the resource where the list of Endpoints is loaded fromendpointKeyPrefix - the property name prefixdefaultPort - the default port number to usepublic static PropertiesEndpointGroup of(Properties properties, String endpointKeyPrefix)
PropertiesEndpointGroup created from the specified Properties.
The value of each property whose name starts with endpointKeyPrefix will be parsed with
Endpoint.parse(String), and then loaded into the PropertiesEndpointGroup, e.g.
# endpointKeyPrefix = 'example.hosts.'
example.hosts.0=example1.com:36462
example.hosts.1=example2.com:36462
example.hosts.2=example3.com:36462
properties - the Properties where the list of Endpoints is loaded fromendpointKeyPrefix - the property name prefix@Deprecated public static PropertiesEndpointGroup of(Properties properties, String endpointKeyPrefix, int defaultPort)
builder(Properties, String)
and PropertiesEndpointGroupBuilder.defaultPort(int).PropertiesEndpointGroup created from the specified Properties.
The value of each property whose name starts with endpointKeyPrefix will be parsed with
Endpoint.parse(String), and then loaded into the PropertiesEndpointGroup, e.g.
# endpointKeyPrefix = 'example.hosts.'
example.hosts.0=example1.com:36462
example.hosts.1=example2.com:36462
example.hosts.2=example3.com:36462
properties - the Properties where the list of Endpoints is loaded fromendpointKeyPrefix - the property name prefixdefaultPort - the default port number to usepublic static PropertiesEndpointGroup of(Path path, String endpointKeyPrefix)
PropertiesEndpointGroup created from the file at the specified Path.
Any updates in the file will trigger a dynamic reload. The value of each property whose name starts
with endpointKeyPrefix will be parsed with Endpoint.parse(String), and then loaded
into the PropertiesEndpointGroup, e.g.
# endpointKeyPrefix = 'example.hosts.'
example.hosts.0=example1.com:36462
example.hosts.1=example2.com:36462
example.hosts.2=example3.com:36462
path - the path of the file where list of Endpoints is loaded fromendpointKeyPrefix - the property name prefix@Deprecated public static PropertiesEndpointGroup of(Path path, String endpointKeyPrefix, int defaultPort)
builder(Path, String)
and PropertiesEndpointGroupBuilder.defaultPort(int).PropertiesEndpointGroup created from the file at the specified Path.
Any updates in the file will trigger a dynamic reload. The value of each property whose name starts
with endpointKeyPrefix will be parsed with Endpoint.parse(String), and then loaded
into the PropertiesEndpointGroup, e.g.
# endpointKeyPrefix = 'example.hosts.'
example.hosts.0=example1.com:36462
example.hosts.1=example2.com:36462
example.hosts.2=example3.com:36462
path - the path of the file where list of Endpoints is loaded fromendpointKeyPrefix - the property name prefixdefaultPort - the default port number to usepublic static PropertiesEndpointGroupBuilder builder(ClassLoader classLoader, String resourceName, String endpointKeyPrefix)
PropertiesEndpointGroupBuilder created from the specified classpath resource.
The value of each property whose name starts with endpointKeyPrefix will be parsed with
Endpoint.parse(String), and then loaded into the PropertiesEndpointGroup, e.g.
# endpointKeyPrefix = 'example.hosts.'
example.hosts.0=example1.com:36462
example.hosts.1=example2.com:36462
example.hosts.2=example3.com:36462
resourceName - the name of the resource where the list of Endpoints is loaded fromendpointKeyPrefix - the property name prefixpublic static PropertiesEndpointGroupBuilder builder(Properties properties, String endpointKeyPrefix)
PropertiesEndpointGroupBuilder created from the specified Properties.
The value of each property whose name starts with endpointKeyPrefix will be parsed with
Endpoint.parse(String), and then loaded into the PropertiesEndpointGroup, e.g.
# endpointKeyPrefix = 'example.hosts.'
example.hosts.0=example1.com:36462
example.hosts.1=example2.com:36462
example.hosts.2=example3.com:36462
properties - the Properties where the list of Endpoints is loaded fromendpointKeyPrefix - the property name prefixpublic static PropertiesEndpointGroupBuilder builder(Path path, String endpointKeyPrefix)
PropertiesEndpointGroupBuilder created from the file at the specified
Path. Any updates in the file will trigger a dynamic reload. The value of each property
whose name starts with endpointKeyPrefix will be parsed with Endpoint.parse(String),
and then loaded into the PropertiesEndpointGroup, e.g.
# endpointKeyPrefix = 'example.hosts.'
example.hosts.0=example1.com:36462
example.hosts.1=example2.com:36462
example.hosts.2=example3.com:36462
path - the path of the file where list of Endpoints is loaded fromendpointKeyPrefix - the property name prefixprotected void doCloseAsync(CompletableFuture<?> future)
DynamicEndpointGroupEndpointGroup and complete
the specified CompletableFuture.doCloseAsync in class DynamicEndpointGroupCopyright © 2020 LeanCloud. All rights reserved.