public abstract class AbstractAlarmChannel extends Object implements AlarmChannel
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
log |
| Constructor and Description |
|---|
AbstractAlarmChannel() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Runnable |
createSendTask(String msg,
String source)
Subclasses need to create and return a new Runnable in each call to this method.
|
int |
getMinResendInterval()
Returns the minimum amount of time that must elapse before a previously sent alarm message can be
sent again.
|
protected abstract boolean |
hasSource(String alarmSource)
This method is used to determine if a certain alarm channel has a special condition for the specified
alarmSource or not.
|
void |
send(String msg,
String source)
Sends an alarm message for the specified source.
|
void |
setAllowSynchronousSend(boolean flag)
Allow synchronous sending of alarms, if the thread pool for a channel rejects asynchronous
execution.
|
void |
setMinResendInterval(int millis)
Sets the minimum amount of time between equal messsages.
|
void |
shutdown()
Shuts down the thread pool and rejects any more incoming alarms.
|
public void setAllowSynchronousSend(boolean flag)
public void setMinResendInterval(int millis)
public int getMinResendInterval()
getMinResendInterval in interface AlarmChannelpublic void send(String msg, String source)
createSendTask(String, String) method, no alarm is sent, and no record is made of the
message's last time being sent.send in interface AlarmChannelmsg - The alarm message to be sent.source - The alarm source. A channel can send the alarm to different recipients depending on the source.
This parameter can be null, which means that it should be sent to the default recipients for the channel.public void shutdown()
shutdown in interface AlarmChannelprotected abstract Runnable createSendTask(String msg, String source)
msg - The message to be sent.source - The alarm source. A channel can have different recipient lists depending on the alarm source.protected abstract boolean hasSource(String alarmSource)