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 newPropertiesEndpointGroupBuildercreated from the specified classpath resource.Returns a newPropertiesEndpointGroupBuildercreated from the file at the specifiedPath.builder(Properties properties, String endpointKeyPrefix) Returns a newPropertiesEndpointGroupBuildercreated from the specifiedProperties.protected voiddoCloseAsync(CompletableFuture<?> future) Override this method to release the resources held by thisEndpointGroupand complete the specifiedCompletableFuture.static PropertiesEndpointGroupof(ClassLoader classLoader, String resourceName, String endpointKeyPrefix) Returns a newPropertiesEndpointGroupcreated from the specified classpath resource.static PropertiesEndpointGroupReturns a newPropertiesEndpointGroupcreated from the file at the specifiedPath.static PropertiesEndpointGroupof(Properties properties, String endpointKeyPrefix) Returns a newPropertiesEndpointGroupcreated 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, toStringSelector, whenClosed, whenReadyMethods inherited from class com.linecorp.armeria.common.util.AbstractListenable
addListener, addListener, notifyListeners, removeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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 newPropertiesEndpointGroupcreated from the specified classpath resource. The value of each property whose name starts withendpointKeyPrefixwill 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 ofEndpoints is loaded fromendpointKeyPrefix- the property name prefix
-
of
Returns a newPropertiesEndpointGroupcreated from the specifiedProperties. The value of each property whose name starts withendpointKeyPrefixwill 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- thePropertieswhere the list ofEndpoints is loaded fromendpointKeyPrefix- the property name prefix
-
of
Returns a newPropertiesEndpointGroupcreated from the file at the specifiedPath. Any updates in the file will trigger a dynamic reload. The value of each property whose name starts withendpointKeyPrefixwill 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 ofEndpoints is loaded fromendpointKeyPrefix- the property name prefix
-
builder
public static PropertiesEndpointGroupBuilder builder(ClassLoader classLoader, String resourceName, String endpointKeyPrefix) Returns a newPropertiesEndpointGroupBuildercreated from the specified classpath resource. The value of each property whose name starts withendpointKeyPrefixwill 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 ofEndpoints is loaded fromendpointKeyPrefix- the property name prefix
-
builder
public static PropertiesEndpointGroupBuilder builder(Properties properties, String endpointKeyPrefix) Returns a newPropertiesEndpointGroupBuildercreated from the specifiedProperties. The value of each property whose name starts withendpointKeyPrefixwill 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- thePropertieswhere the list ofEndpoints is loaded fromendpointKeyPrefix- the property name prefix
-
builder
Returns a newPropertiesEndpointGroupBuildercreated from the file at the specifiedPath. Any updates in the file will trigger a dynamic reload. The value of each property whose name starts withendpointKeyPrefixwill 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 ofEndpoints is loaded fromendpointKeyPrefix- the property name prefix
-
doCloseAsync
Description copied from class:DynamicEndpointGroupOverride this method to release the resources held by thisEndpointGroupand complete the specifiedCompletableFuture.- Overrides:
doCloseAsyncin classDynamicEndpointGroup
-
toString
- Overrides:
toStringin classDynamicEndpointGroup
-