|
TrueZIP Kernel 7.0-rc1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
C - The type of the cause exception.E - The type of the assembled exception.@NotThreadSafe public interface ExceptionBuilder<C extends Exception,E extends Exception>
An exception builder is an exception handler which assembles an exception
of the parameter type T from one or more exceptions of the parameter
type C.
This may be used in scenarios where a cooperative algorithm needs to
continue its task even if one or more exceptional conditions occur.
This interface would then allow to collect all cause exceptions during
the processing by calling warn(Exception) and later check out the
assembled exception by calling fail(Exception) or
check().
| Method Summary | |
|---|---|
void |
check()
Either returns or checks out and throws the result of the assembly in order to enable the assembly of another exception. |
E |
fail(C cause)
Adds the cause exception to the assembly and
checks out and returns
the result
in order to enable the assembly of another exception. |
void |
warn(C cause)
Adds the cause exception to the assembly and
either returns or checks out and throws
the result
in order to enable the assembly of another exception. |
| Method Detail |
|---|
@NonNull
E fail(@NonNull
C cause)
cause exception to the assembly and
checks out and returns
the result
in order to enable the assembly of another exception.
Called to handle an exceptional condition which does not allow the caller to proceed 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 be updated so that this instance can be reused to handle more exceptions!
fail in interface ExceptionHandler<C extends Exception,E extends Exception>cause - the exception to handle.
void warn(@NonNull
C cause)
throws E extends Exception
cause exception to the assembly and
either returns or checks out and throws
the result
in order to enable the assembly of another exception.
Called to handle an exceptional condition which
does
allow the caller to proceed its task.
The implementation may throw an exception of the parameter type
T or return from the call.
If the implementation maintains a state, it must be updated
so that this instance can be reused to handle more exceptions.
warn in interface ExceptionHandler<C extends Exception,E extends Exception>cause - the exception to handle - null is not permitted.
Exception - the assembled exception if the implementation wants
the caller to abort its task.
void check()
throws E extends Exception
Exception - the assembled exception if the implementation wants
the caller to abort its task.
|
TrueZIP Kernel 7.0-rc1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||