initialize().
ConcurrentInitializer implementations.
| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | AbstractConcurrentInitializer.
The type of results supplied by this builder. I extends AbstractConcurrentInitializerThe type of the object managed by the initializer class. T, The type of builder. B extends AbstractConcurrentInitializer.The exception type thrown by E extends Exception>initialize().Builds a new instance for subclasses. |
| Modifier and Type | Field and Description |
|---|---|
| private final FailableConsumer | |
| private final FailableSupplier | initializer
Initializer supplier called by |
| Access | Constructor and Description |
|---|---|
| public | |
| pack-priv | AbstractConcurrentInitializer(final FailableSupplier<? extends T, ? extends Exception>
the initializer supplier called by initializer, final FailableConsumer<? super T, ? extends Exception> initialize().the closer consumer called by closer)close().Constructs a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| protected abstract E | Returns: a new exception with the actual type of E, that wraps e.The actual exception that was thrown. e)Gets an Exception with a type of E as defined by a concrete subclass of this class. |
| protected T | Returns: the managed data object.Creates and initializes the object managed by this |
| protected abstract boolean | Returns: true if all initialization is complete, otherwise false.Tests whether initialization has been completed. |
| closer | back to summary |
|---|---|
| private final FailableConsumer<? super T, ? extends Exception> closer Closer consumer called by | |
| initializer | back to summary |
|---|---|
| private final FailableSupplier<? extends T, ? extends Exception> initializer Initializer supplier called by | |
| AbstractConcurrentInitializer | back to summary |
|---|---|
| public AbstractConcurrentInitializer() Constructs a new instance. | |
| AbstractConcurrentInitializer | back to summary |
|---|---|
| pack-priv AbstractConcurrentInitializer(final FailableSupplier<? extends T, ? extends Exception> initializer, final FailableConsumer<? super T, ? extends Exception> closer) Constructs a new instance.
| |
| close | back to summary |
|---|---|
| public void close() throws ConcurrentException Calls the closer with the manager object.
| |
| getTypedException | back to summary |
|---|---|
| protected abstract E getTypedException(Exception e) Gets an Exception with a type of E as defined by a concrete subclass of this class.
| |
| initialize | back to summary |
|---|---|
| protected T initialize() throws E Creates and initializes the object managed by this Subclasses and clients that do not provide an initializer are expected to implement this method.
| |
| isInitialized | back to summary |
|---|---|
| protected abstract boolean isInitialized() Tests whether initialization has been completed. If initialization threw an exception this will return false, but it will return true if a subsequent call to initialize completes successfully. If the implementation of ConcurrentInitializer can initialize multiple objects, this will only return true if all objects have been initialized.
| |
initialize().
| Modifier and Type | Field and Description |
|---|---|
| private FailableConsumer | |
| private FailableSupplier | initializer
Initializer supplier called by |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public FailableConsumer | |
| public FailableSupplier | Returns: the initializer supplier called byinitialize().Gets the initializer supplier called by |
| public B | Returns: this instance.the consumer called by closer)close().Sets the closer consumer called by |
| public B | Returns: this instance.the supplier called by initializer)initialize().Sets the initializer supplier called by |
| closer | back to summary |
|---|---|
| private FailableConsumer<T, ? extends Exception> closer Closer consumer called by | |
| initializer | back to summary |
|---|---|
| private FailableSupplier<T, ? extends Exception> initializer Initializer supplier called by | |
| AbstractBuilder | back to summary |
|---|---|
| public AbstractBuilder() Constructs a new instance. | |
| getCloser | back to summary |
|---|---|
| public FailableConsumer Gets the closer consumer called by
| |
| getInitializer | back to summary |
|---|---|
| public FailableSupplier Gets the initializer supplier called by
| |
| setCloser | back to summary |
|---|---|
| public B setCloser(final FailableConsumer<T, ? extends Exception> closer) Sets the closer consumer called by
| |
| setInitializer | back to summary |
|---|---|
| public B setInitializer(final FailableSupplier<T, ? extends Exception> initializer) Sets the initializer supplier called by
| |