Package org.apache.ignite.configuration
Interface NamedConfigurationTree<T extends ConfigurationProperty<VIEWT>,VIEWT,CHANGET extends VIEWT>
- Type Parameters:
T- Type of the underlying configuration tree.VIEWT- Value type of the underlying node.CHANGET- Type of the object that changes underlying nodes values.
- All Superinterfaces:
ConfigurationProperty<NamedListView<VIEWT>>,ConfigurationTree<NamedListView<VIEWT>,NamedListChange<VIEWT, CHANGET>>
public interface NamedConfigurationTree<T extends ConfigurationProperty<VIEWT>,VIEWT,CHANGET extends VIEWT>
extends ConfigurationTree<NamedListView<VIEWT>,NamedListChange<VIEWT,CHANGET>>
Configuration tree representing arbitrary set of named underlying configuration tree of the same type.
-
Method Summary
Modifier and TypeMethodDescriptionany()Returns a placeholder that allows you to add listeners for changing configuration value of any element of the named list and any of its nested configurations.Returns a configuration tree for the purpose of reading configuration directly from the underlying storage.Get named configuration by name.Retrieves a named list element by its internal id.Returns all internal ids of the elements from the list.voidlistenElements(ConfigurationNamedListListener<VIEWT> listener) Add named-list-specific configuration values listener.voidRemoves named-list-specific configuration values listener.Methods inherited from interface org.apache.ignite.configuration.ConfigurationProperty
key, listen, stopListen, valueMethods inherited from interface org.apache.ignite.configuration.ConfigurationTree
change
-
Method Details
-
get
Get named configuration by name.- Parameters:
name- Name.
-
get
Retrieves a named list element by its internal id.- Parameters:
internalId- Internal id.- Returns:
- Named list element, associated with the passed internal id, or
nullif it doesn't exist.
-
internalIds
Returns all internal ids of the elements from the list. -
listenElements
Add named-list-specific configuration values listener.NOTE: If this method is called from another listener, then it is guaranteed to be called starting from the next configuration update only.
- Parameters:
listener- Listener.
-
stopListenElements
Removes named-list-specific configuration values listener.NOTE: Unpredictable behavior if the method is called inside other listeners.
- Parameters:
listener- Listener.
-
any
T any()Returns a placeholder that allows you to add listeners for changing configuration value of any element of the named list and any of its nested configurations.NOTE:
ConfigurationListenOnlyExceptionwill be thrown when trying to get/update the configuration values. -
directProxy
NamedConfigurationTree<T,VIEWT, directProxy()CHANGET> Description copied from interface:ConfigurationPropertyReturns a configuration tree for the purpose of reading configuration directly from the underlying storage. Actual reading is only happening while invokingConfigurationProperty.value(). It will either throwNoSuchElementException, unchecked runtime exception, or return the value.It is important to understand how it processes named list elements. Imagine having element named
awith internalIdaId.var namedListProxy = namedList.directProxy(); // Creates another proxy. var aElementProxy = namedListProxy.get("a"); // This operation performs actual reading. It'll throw an exception if element named "a" doesn't exist anymore. // It's been renamed or deleted. var aElement = aElementProxy.value(); // Creates another proxy. var aIdElementProxy = namedListProxy.get(aId); // This operation performs actual reading as previously stated. But, unlike the access by name, it won't throw an exception in // case of a rename. Only after deletion. var aIdElement = aIdElementProxy.value();Another important case is how already resolved named list elements are being proxied.
// Following code is in fact equivalent to a "namedList.directProxy().get(aId);" // Already resolved elements are always referenced to by their internal ids. This means that proxy will return a valid value // even after rename despite it looking like name "a" should be resolved once again. var aElementProxy = namedList.get("a").directProxy();- Specified by:
directProxyin interfaceConfigurationProperty<T extends ConfigurationProperty<VIEWT>>
-