@EJB
private CacheConsistencyManagerLocal cacheConsistencyManager;
@Override
public void onMessage(Message message) {
AbstractAlertConditionMessage conditionMessage = null;
try {
ObjectMessage objectMessage = (ObjectMessage) message;
conditionMessage = (AbstractAlertConditionMessage) objectMessage.getObject();
} catch (Throwable t) {
log.error("Error getting content of jms message", t);
return;
}
Integer definitionId = null;
try {
if (log.isDebugEnabled()) {
log.debug("Received message: " + conditionMessage);
}
int alertConditionId = conditionMessage.getAlertConditionId();
InventoryStatus status = alertConditionManager.getResourceStatusByConditionIdNewTx(alertConditionId);
if (status != InventoryStatus.COMMITTED) {
if (log.isDebugEnabled()) {
log.debug("Resource for AlertCondition[id=" + alertConditionId
+ "] is no longer COMMITTED, status was '" + status + "'; this message will be discarded");