Class MultiBackgroundInitializer.MultiBackgroundInitializerResults
- java.lang.Object
-
- org.apache.commons.lang3.concurrent.MultiBackgroundInitializer.MultiBackgroundInitializerResults
-
- Enclosing class:
- MultiBackgroundInitializer
public static class MultiBackgroundInitializer.MultiBackgroundInitializerResults extends java.lang.Object
A data class for storing the results of the background initialization performed byMultiBackgroundInitializer
. Objects of this inner class are returned byMultiBackgroundInitializer.initialize()
. They allow access to all result objects produced by theBackgroundInitializer
objects managed by the owning instance. It is also possible to retrieve status information about singleBackgroundInitializer
s, i.e. whether they completed normally or caused an exception.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConcurrentException
getException(java.lang.String name)
Returns theConcurrentException
object that was thrown by theBackgroundInitializer
with the given name.BackgroundInitializer<?>
getInitializer(java.lang.String name)
Returns theBackgroundInitializer
with the given name.java.lang.Object
getResultObject(java.lang.String name)
Returns the result object produced by theBackgroundInitializer
with the given name.java.util.Set<java.lang.String>
initializerNames()
Returns a set with the names of allBackgroundInitializer
objects managed by theMultiBackgroundInitializer
.boolean
isException(java.lang.String name)
Returns a flag whether theBackgroundInitializer
with the given name caused an exception.boolean
isSuccessful()
Returns a flag whether the whole initialization was successful.
-
-
-
Method Detail
-
getInitializer
public BackgroundInitializer<?> getInitializer(java.lang.String name)
Returns theBackgroundInitializer
with the given name. If the name cannot be resolved, an exception is thrown.- Parameters:
name
- the name of theBackgroundInitializer
- Returns:
- the
BackgroundInitializer
with this name - Throws:
java.util.NoSuchElementException
- if the name cannot be resolved
-
getResultObject
public java.lang.Object getResultObject(java.lang.String name)
Returns the result object produced by theBackgroundInitializer
with the given name. This is the object returned by the initializer'sinitialize()
method. If thisBackgroundInitializer
caused an exception, null is returned. If the name cannot be resolved, an exception is thrown.- Parameters:
name
- the name of theBackgroundInitializer
- Returns:
- the result object produced by this
BackgroundInitializer
- Throws:
java.util.NoSuchElementException
- if the name cannot be resolved
-
isException
public boolean isException(java.lang.String name)
Returns a flag whether theBackgroundInitializer
with the given name caused an exception.- Parameters:
name
- the name of theBackgroundInitializer
- Returns:
- a flag whether this initializer caused an exception
- Throws:
java.util.NoSuchElementException
- if the name cannot be resolved
-
getException
public ConcurrentException getException(java.lang.String name)
Returns theConcurrentException
object that was thrown by theBackgroundInitializer
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 theBackgroundInitializer
- Returns:
- the exception thrown by this initializer
- Throws:
java.util.NoSuchElementException
- if the name cannot be resolved
-
initializerNames
public java.util.Set<java.lang.String> initializerNames()
Returns a set with the names of allBackgroundInitializer
objects managed by theMultiBackgroundInitializer
.- Returns:
- an (unmodifiable) set with the names of the managed
BackgroundInitializer
objects
-
isSuccessful
public boolean isSuccessful()
Returns a flag 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
-
-