MotechEvent¶
-
public class
MotechEvent
implements Serializable¶ Motech Scheduled Event data carrier class. It contains a subject, to which listeners can subscribe and a payload in the form of a map of parameters. Instance of this class with event specific data will be sent by Motech Scheduler when a scheduled event is fired.
This class is immutable
Fields¶
Constructors¶
MotechEvent¶
MotechEvent¶
-
public
MotechEvent
(String subject, Map<String, Object> parameters)¶ Constructs a MotechEvent with the given subject and parameters.
Parameters: - subject – the subject of the event
- parameters – the map of additional parameters
Throws: - IllegalArgumentException – if the subject is null or contains
'*', '..'
Methods¶
getMessageRedeliveryCount¶
-
public int
getMessageRedeliveryCount
()¶ Returns the
motechEventRedeliveryCount
from the parameters. This is incremented by the event system if the delivery fails, so it is equal to the number of failed deliveries. Any exception from the handler is counted as failure in this context. It cannot be larger thanorg.motechproject.event.messaging.MotechEventConfig.messageMaxRedeliveryCount
Returns: the number of message redeliveries