class MailboxImpl.NotifyTask extends RetryTask
Modifier and Type | Field and Description |
---|---|
private Uuid |
regID
The Uuid of the associated registration
|
DAYS, HOURS, MINUTES, SECONDS
Constructor and Description |
---|
MailboxImpl.NotifyTask(TaskManager tm,
WakeupManager mgr,
Uuid regID)
Create an object to represent an event notification task.
|
Modifier and Type | Method and Description |
---|---|
private void |
deleteNextEvent(ServiceRegistration reg)
This utility function attempts to remove the event after
from the associated event registration's storage after
1) a successful delivery attempt
2) task has expired
3) the event type caused an earlier UnknownEventException
4) the event delivery resulted in an UnknownEventException
|
private boolean |
disableRegistration(Uuid regID,
RemoteEventListener l)
This utility function attempts to disable the given registration
because there was a problem with the provided listener.
|
private RemoteEvent |
getNextEvent(ServiceRegistration reg)
This utility function tries to obtain the next event for the
given registration.
|
boolean |
runAfter(List list,
int max)
Return
true if this task needs to runAfter any
of the tasks in the provided list and false
otherwise. |
boolean |
tryOnce()
Try to notify the target.
|
private Uuid regID
MailboxImpl.NotifyTask(TaskManager tm, WakeupManager mgr, Uuid regID)
private RemoteEvent getNextEvent(ServiceRegistration reg)
private void deleteNextEvent(ServiceRegistration reg)
private boolean disableRegistration(Uuid regID, RemoteEventListener l)
public boolean tryOnce()
true
if the
notification was successful. Return false
otherwise.
If we return false, this task will be rescheduled at some
point in the future.public boolean runAfter(List list, int max)
true
if this task needs to runAfter any
of the tasks in the provided list and false
otherwise. The notifier thread ensures that there should only
be one task per registration, so this method just returns
false.list
- the tasks to consider. A read-only List, with all
elements instanceof Task.max
- elements with index less than size should be consideredCopyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.