MultiBackgroundInitializer.MultiBackgroundInitializerResults

public static class org.apache.commons.lang3.concurrent.MultiBackgroundInitializer.MultiBackgroundInitializerResults[source]

A data class for storing the results of the background initialization performed by MultiBackgroundInitializer. Objects of this inner class are returned by MultiBackgroundInitializer#initialize(). They allow access to all result objects produced by the BackgroundInitializer objects managed by the owning instance. It is also possible to retrieve status information about single BackgroundInitializers, i.e. whether they completed normally or caused an exception.

Methods

getException(String)

Gets the ConcurrentException object that was thrown by the BackgroundInitializer with the given name.

getInitializer(String)

Gets the BackgroundInitializer with the given name.

getResultObject(String)

Gets the result object produced by the BackgroundInitializer with the given name.

initializerNames()

Returns a set with the names of all BackgroundInitializer objects managed by the MultiBackgroundInitializer.

isException(String)

Tests whether the BackgroundInitializer with the given name caused an exception.

isSuccessful()

Tests whether the whole initialization was successful.

public ConcurrentException getException(String name)[source]

Gets the ConcurrentException object that was thrown by the BackgroundInitializer with the given name. If this initializer did not throw an exception, the return value is null. If the name cannot be resolved, an exception is thrown.

Parameters:

name – The name of the BackgroundInitializer.

Returns:

The exception thrown by this initializer.

Throws:

java.util.NoSuchElementException – Thrown if the name cannot be resolved.

public BackgroundInitializer<?> getInitializer(String name)[source]

Gets the BackgroundInitializer with the given name. If the name cannot be resolved, an exception is thrown.

Parameters:

name – The name of the BackgroundInitializer.

Returns:

The BackgroundInitializer with this name.

Throws:

java.util.NoSuchElementException – Thrown if the name cannot be resolved.

public Object getResultObject(String name)[source]

Gets the result object produced by the BackgroundInitializer with the given name. This is the object returned by the initializer’s initialize() method. If this BackgroundInitializer caused an exception, null is returned. If the name cannot be resolved, an exception is thrown.

Parameters:

name – The name of the BackgroundInitializer.

Returns:

The result object produced by this BackgroundInitializer.

Throws:

java.util.NoSuchElementException – Thrown if the name cannot be resolved.

public Set<String> initializerNames()[source]

Returns a set with the names of all BackgroundInitializer objects managed by the MultiBackgroundInitializer.

Returns:

An (unmodifiable) set with the names of the managed BackgroundInitializer objects.

public boolean isException(String name)[source]

Tests whether the BackgroundInitializer with the given name caused an exception.

Parameters:

name – The name of the BackgroundInitializer.

Returns:

A flag whether this initializer caused an exception.

Throws:

java.util.NoSuchElementException – Thrown if the name cannot be resolved.

public boolean isSuccessful()[source]

Tests whether the whole initialization was successful. This is the case if no child initializer has thrown an exception.

Returns:

A flag whether the initialization was successful.