|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IMessageHandler
Handle messages, logging and/or aborting as appropriate.
Implementations define which messages are logged and whether
the handler aborts the process.
For messages that are costly to construct, clients may query
isIgnoring(IMessage.Kind)
to avoid construction if the message will be ignored.
Clients passing messages to an IMessageHandler should not
interfere with aborts by catching AbortException unless
otherwise required by their logic or the message handler.
Field Summary | |
---|---|
static IMessageHandler |
SYSTEM_ERR
print all to System.err and throw AbortException on failure or abort messages |
static IMessageHandler |
SYSTEM_OUT
print all to System.out but do not throw AbortException on failure or abort messages |
static IMessageHandler |
THROW
Throw exceptions for anything with ERROR or greater severity |
Method Summary | |
---|---|
void |
dontIgnore(IMessage.Kind kind)
Allow fine grained configuration after initialization. |
boolean |
handleMessage(IMessage message)
Handle message, by reporting and/or throwing an AbortException. |
void |
ignore(IMessage.Kind kind)
Allow fine grained configuration after initialization. |
boolean |
isIgnoring(IMessage.Kind kind)
Signal clients whether this will ignore messages of a given type. |
Field Detail |
---|
static final IMessageHandler SYSTEM_ERR
static final IMessageHandler SYSTEM_OUT
static final IMessageHandler THROW
Method Detail |
---|
boolean handleMessage(IMessage message) throws AbortException
message
- the IMessage to handle - never null
java.lang.IllegalArgumentException
- if message is null
AbortException
- depending on handler logic.boolean isIgnoring(IMessage.Kind kind)
void dontIgnore(IMessage.Kind kind)
kind
- void ignore(IMessage.Kind kind)
kind
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |