public class WarningService extends AbstractResinSubSystem
Modifier and Type | Field and Description |
---|---|
static int |
START_PRIORITY |
START_PRIORITY_CACHE_SERVICE, START_PRIORITY_CLASSLOADER, START_PRIORITY_CLUSTER_SERVICE, START_PRIORITY_DATABASE_SYSTEM, START_PRIORITY_DEFAULT, START_PRIORITY_ENV_SYSTEM, START_PRIORITY_NETWORK_CLUSTER, STOP_PRIORITY_CLASSLOADER
Constructor and Description |
---|
WarningService() |
Modifier and Type | Method and Description |
---|---|
void |
addHandler(WarningHandler handler)
Add a warning event handler.
|
void |
addPriorityHandler(WarningHandler handler)
Add a warning event handler.
|
static WarningService |
createAndAddService() |
static WarningService |
getCurrent() |
int |
getStartPriority()
Returns the start priority of the service, used to determine which
services to start first.
|
static void |
sendCurrentWarning(java.lang.Object source,
java.lang.String msg)
Sends a warning to the current service.
|
static void |
sendCurrentWarning(java.lang.Object source,
java.lang.Throwable e)
Sends a warning to the current service.
|
void |
sendWarning(java.lang.Object source,
java.lang.String msg)
Send a warning message to any registered handlers.
|
void |
sendWarning(java.lang.Object source,
java.lang.Throwable e)
Send a warning message to any registered handlers.
|
destroy, getStopPriority, isActive, preCreate, start, stop, toString
public static final int START_PRIORITY
public static WarningService createAndAddService()
public static WarningService getCurrent()
public void sendWarning(java.lang.Object source, java.lang.String msg)
source
- source of the message, usually youmsg
- test to print or send as an alertisHighPriority
- set true to send to high priority warning handlerspublic void sendWarning(java.lang.Object source, java.lang.Throwable e)
source
- source of the message, usually youmsg
- test to print or send as an alertisHighPriority
- set true to send to high priority warning handlerspublic static void sendCurrentWarning(java.lang.Object source, java.lang.String msg)
public static void sendCurrentWarning(java.lang.Object source, java.lang.Throwable e)
public void addHandler(WarningHandler handler)
handler
- an object that implements WarningHandlerisHighPriority
- high priority handlers only get high priority warnings.public void addPriorityHandler(WarningHandler handler)
handler
- an object that implements WarningHandlerisHighPriority
- high priority handlers only get high priority warnings.public int getStartPriority()
ResinSubSystem
getStartPriority
in interface ResinSubSystem
getStartPriority
in class AbstractResinSubSystem