I
- the type of the input exceptions.O
- the type of the assembled (output) exceptions.@NotThreadSafe public interface ExceptionBuilder<I extends Throwable,O extends Throwable> extends ExceptionHandler<I,O>
O
from one or more exceptions of the parameter
type I
.
This may be used in scenarios where a cooperative algorithm needs to
continue its task even if one or more input exceptions occur.
This interface would then allow to collect all cause exceptions during
the processing by calling warn(Throwable)
and later check out the
assembled exception by calling fail(Throwable)
or
check()
.Modifier and Type | Method and Description |
---|---|
void |
check()
Either returns or checks out and throws the result of the assembly in
order to enable the assembly of another output exception.
|
O |
fail(I input)
Adds
input to the assembly and checks out and returns the
result in order to enable the assembly of another exception. |
void |
warn(I input)
Adds
input to the assembly and either returns or checks out
and throws the result in order to enable the assembly of another output
exception. |
void check() throws O extends Throwable
O fail(I input)
input
to the assembly and checks out and returns the
result in order to enable the assembly of another exception.
Called to handle an exception which doesn't allow the caller to proceed with its task. The implementation must return an appropriate exception to be thrown by the cooperative algorithm. Finally, if the implementation maintains a state, it must get updated so that this instance can get reused to handle more exceptions!
void warn(I input) throws O extends Throwable
input
to the assembly and either returns or checks out
and throws the result in order to enable the assembly of another output
exception.
Called to handle an exception which may allow the caller to
proceed with its task.
The implementation may return from the call or throw an exception of the
parameter type O
.
If the implementation maintains a state, it must get updated
so that this instance can get reused to handle more exceptions.
Copyright © 2012–2016 Schlichtherle IT Services. All rights reserved.