public class MessageMgrBuilder extends Object
MessageMgr object with all settings.| Modifier and Type | Field and Description |
|---|---|
protected Object |
appID
The identifier (or name) of the application using the message manager.
|
protected IsErrorSetFT |
buildErrors
Errors of the builder.
|
protected boolean |
doCollectMessages
Flag to define the behavior for message collection.
|
protected Map<E_MessageType,MessageTypeHandler> |
messageHandlers
Maps of message handlers for message types.
|
| Constructor and Description |
|---|
MessageMgrBuilder(Object appID)
Creates a new builder with given application identifier (name).
|
| Modifier and Type | Method and Description |
|---|---|
MessageMgr |
build()
Builds a
MessageMgr. |
MessageMgrBuilder |
enableMessageCollection()
Enables collection of messages for the manager.
|
IsErrorSetFT |
getBuildErrors()
Returns errors the builder collected.
|
MessageMgrBuilder |
setHandler(E_MessageType type)
Activate a message type and sets a type handler with max count set to 100.
|
MessageMgrBuilder |
setHandler(E_MessageType type,
int maxCount)
Activate a message type and sets a type handler with max count.
|
MessageMgrBuilder |
setHandler(E_MessageType type,
int maxCount,
Logger logger)
Activate a message type and sets a type handler with max count using specific logger.
|
MessageMgrBuilder |
setHandler(E_MessageType type,
Logger logger)
Activate a message type and sets a type handler with max count set to 100 using specific logger.
|
protected final IsErrorSetFT buildErrors
protected final Map<E_MessageType,MessageTypeHandler> messageHandlers
protected boolean doCollectMessages
protected final Object appID
public MessageMgrBuilder(Object appID)
appID - identifier (or name) of the application using the managerIllegalArgumentException - if application identifier was null or its toString() is blankpublic IsErrorSetFT getBuildErrors()
public MessageMgrBuilder setHandler(E_MessageType type)
type - message type to be activated, nothing will be set if nullpublic MessageMgrBuilder setHandler(E_MessageType type, int maxCount)
type - message type to be activated, nothing will be set if nullmaxCount - max count for the handler, -1 to ignore or greater than 0 to be usedpublic MessageMgrBuilder setHandler(E_MessageType type, Logger logger)
type - message type to be activated, nothing will be set if nulllogger - the logger to be used for the handler, if null the message will be added to the local listpublic MessageMgrBuilder setHandler(E_MessageType type, int maxCount, Logger logger)
type - message type to be activated, nothing will be set if nullmaxCount - max count for the handler, -1 to ignore or greater than 0 to be usedlogger - the logger to be used for the handler, if null the message will be added to the local listpublic MessageMgrBuilder enableMessageCollection()
public MessageMgr build()
MessageMgr.Copyright © 2010–2017. All rights reserved.