private class EventType.SendTask extends RetryTask
RetryTask
used by EventType
to send events.Modifier and Type | Field and Description |
---|---|
private RemoteEvent |
event
Cached event
|
private EventFactory |
eventFactory
Factory used to create the
RemoteEvent to be sent |
private long |
eventForRegistrationNumber
Registration sequence number of the listener/handback pair
event was built for
|
private static long |
MAX_TIME
Max time we are willing to let a send attempt to go on for
|
private long |
seqNum
Sequence number the event should have
|
DAYS, HOURS, MINUTES, SECONDS
Modifier | Constructor and Description |
---|---|
private |
EventType.SendTask(TaskManager taskManager,
WakeupManager wakeupManager,
EventFactory eventFactory,
long seqNum)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
runAfter(List tasks,
int size)
Return true if this task must be run after at least one task
in the given task list with an index less than size (size may be
less then tasks.size()).
|
boolean |
tryOnce()
Make a single attempt.
|
private static final long MAX_TIME
private final EventFactory eventFactory
RemoteEvent
to be sentprivate final long seqNum
private RemoteEvent event
private long eventForRegistrationNumber
private EventType.SendTask(TaskManager taskManager, WakeupManager wakeupManager, EventFactory eventFactory, long seqNum)
taskManager
- TaskManager
this task is to be
put intoeventFactory
- EventFactory
that will be used
to create the event to be sentseqNum
- the sequence number of the eventpublic boolean tryOnce()
RetryTask
true
if the attempt
was successful. If the attempt is not successful, the task
will be scheduled for a future retry.public boolean runAfter(List tasks, int size)
TaskManager.Task
tasks
- the tasks to consider. A read-only List, with all
elements instanceof Task.size
- 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.