Class PropertiesEndpointGroup
java.lang.Object
com.linecorp.armeria.common.util.AbstractListenable<List<Endpoint>>
com.linecorp.armeria.client.endpoint.DynamicEndpointGroup
com.linecorp.armeria.client.endpoint.PropertiesEndpointGroup
- All Implemented Interfaces:
EndpointGroup
,EndpointSelector
,AsyncCloseable
,Listenable<List<Endpoint>>
,ListenableAsyncCloseable
,AutoCloseable
-
Method Summary
Modifier and TypeMethodDescriptionbuilder
(ClassLoader classLoader, String resourceName, String endpointKeyPrefix) Returns a newPropertiesEndpointGroupBuilder
created from the specified classpath resource.Returns a newPropertiesEndpointGroupBuilder
created from the file at the specifiedPath
.builder
(Properties properties, String endpointKeyPrefix) Returns a newPropertiesEndpointGroupBuilder
created from the specifiedProperties
.protected void
doCloseAsync
(CompletableFuture<?> future) Override this method to release the resources held by thisEndpointGroup
and complete the specifiedCompletableFuture
.static PropertiesEndpointGroup
of
(ClassLoader classLoader, String resourceName, String endpointKeyPrefix) Returns a newPropertiesEndpointGroup
created from the specified classpath resource.static PropertiesEndpointGroup
Returns a newPropertiesEndpointGroup
created from the file at the specifiedPath
.static PropertiesEndpointGroup
of
(Properties properties, String endpointKeyPrefix) Returns a newPropertiesEndpointGroup
created from the specifiedProperties
.toString()
Methods inherited from class com.linecorp.armeria.client.endpoint.DynamicEndpointGroup
addEndpoint, allowsEmptyEndpoints, builder, close, closeAsync, endpoints, isClosed, isClosing, latestValue, removeEndpoint, select, select, selectionStrategy, selectionTimeoutMillis, selectNow, setEndpoints, toString, whenClosed, whenReady
Methods inherited from class com.linecorp.armeria.common.util.AbstractListenable
addListener, addListener, notifyListeners, removeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.linecorp.armeria.client.endpoint.EndpointGroup
addListener, addListener, orElse, removeListener
-
Method Details
-
of
public static PropertiesEndpointGroup of(ClassLoader classLoader, String resourceName, String endpointKeyPrefix) Returns a newPropertiesEndpointGroup
created from the specified classpath resource. The value of each property whose name starts withendpointKeyPrefix
will be parsed withEndpoint.parse(String)
, and then loaded into thePropertiesEndpointGroup
, e.g.# endpointKeyPrefix = 'example.hosts.' example.hosts.0=example1.com:36462 example.hosts.1=example2.com:36462 example.hosts.2=example3.com:36462
- Parameters:
resourceName
- the name of the resource where the list ofEndpoint
s is loaded fromendpointKeyPrefix
- the property name prefix
-
of
Returns a newPropertiesEndpointGroup
created from the specifiedProperties
. The value of each property whose name starts withendpointKeyPrefix
will be parsed withEndpoint.parse(String)
, and then loaded into thePropertiesEndpointGroup
, e.g.# endpointKeyPrefix = 'example.hosts.' example.hosts.0=example1.com:36462 example.hosts.1=example2.com:36462 example.hosts.2=example3.com:36462
- Parameters:
properties
- theProperties
where the list ofEndpoint
s is loaded fromendpointKeyPrefix
- the property name prefix
-
of
Returns a newPropertiesEndpointGroup
created from the file at the specifiedPath
. Any updates in the file will trigger a dynamic reload. The value of each property whose name starts withendpointKeyPrefix
will be parsed withEndpoint.parse(String)
, and then loaded into thePropertiesEndpointGroup
, e.g.# endpointKeyPrefix = 'example.hosts.' example.hosts.0=example1.com:36462 example.hosts.1=example2.com:36462 example.hosts.2=example3.com:36462
- Parameters:
path
- the path of the file where list ofEndpoint
s is loaded fromendpointKeyPrefix
- the property name prefix
-
builder
public static PropertiesEndpointGroupBuilder builder(ClassLoader classLoader, String resourceName, String endpointKeyPrefix) Returns a newPropertiesEndpointGroupBuilder
created from the specified classpath resource. The value of each property whose name starts withendpointKeyPrefix
will be parsed withEndpoint.parse(String)
, and then loaded into thePropertiesEndpointGroup
, e.g.# endpointKeyPrefix = 'example.hosts.' example.hosts.0=example1.com:36462 example.hosts.1=example2.com:36462 example.hosts.2=example3.com:36462
- Parameters:
resourceName
- the name of the resource where the list ofEndpoint
s is loaded fromendpointKeyPrefix
- the property name prefix
-
builder
public static PropertiesEndpointGroupBuilder builder(Properties properties, String endpointKeyPrefix) Returns a newPropertiesEndpointGroupBuilder
created from the specifiedProperties
. The value of each property whose name starts withendpointKeyPrefix
will be parsed withEndpoint.parse(String)
, and then loaded into thePropertiesEndpointGroup
, e.g.# endpointKeyPrefix = 'example.hosts.' example.hosts.0=example1.com:36462 example.hosts.1=example2.com:36462 example.hosts.2=example3.com:36462
- Parameters:
properties
- theProperties
where the list ofEndpoint
s is loaded fromendpointKeyPrefix
- the property name prefix
-
builder
Returns a newPropertiesEndpointGroupBuilder
created from the file at the specifiedPath
. Any updates in the file will trigger a dynamic reload. The value of each property whose name starts withendpointKeyPrefix
will be parsed withEndpoint.parse(String)
, and then loaded into thePropertiesEndpointGroup
, e.g.# endpointKeyPrefix = 'example.hosts.' example.hosts.0=example1.com:36462 example.hosts.1=example2.com:36462 example.hosts.2=example3.com:36462
- Parameters:
path
- the path of the file where list ofEndpoint
s is loaded fromendpointKeyPrefix
- the property name prefix
-
doCloseAsync
Description copied from class:DynamicEndpointGroup
Override this method to release the resources held by thisEndpointGroup
and complete the specifiedCompletableFuture
.- Overrides:
doCloseAsync
in classDynamicEndpointGroup
-
toString
- Overrides:
toString
in classDynamicEndpointGroup
-