com.sun.jini.norm.event
Class EventType.SendTask

java.lang.Object
  extended by com.sun.jini.thread.RetryTask
      extended by com.sun.jini.norm.event.EventType.SendTask
All Implemented Interfaces:
TimeConstants, TaskManager.Task, Runnable
Enclosing class:
EventType

private class EventType.SendTask
extends RetryTask

Subclass of RetryTask used by EventType to send events.


Field Summary
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
 
Fields inherited from interface com.sun.jini.constants.TimeConstants
DAYS, HOURS, MINUTES, SECONDS
 
Constructor Summary
private EventType.SendTask(TaskManager taskManager, WakeupManager wakeupManager, EventFactory eventFactory, long seqNum)
          Simple constructor.
 
Method Summary
 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.
 
Methods inherited from class com.sun.jini.thread.RetryTask
attempt, cancel, cancelled, complete, reset, retryTime, run, startTime, waitFor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_TIME

private static final long MAX_TIME
Max time we are willing to let a send attempt to go on for

See Also:
Constant Field Values

eventFactory

private final EventFactory eventFactory
Factory used to create the RemoteEvent to be sent


seqNum

private final long seqNum
Sequence number the event should have


event

private RemoteEvent event
Cached event


eventForRegistrationNumber

private long eventForRegistrationNumber
Registration sequence number of the listener/handback pair event was built for

Constructor Detail

EventType.SendTask

private EventType.SendTask(TaskManager taskManager,
                           WakeupManager wakeupManager,
                           EventFactory eventFactory,
                           long seqNum)
Simple constructor.

Parameters:
taskManager - TaskManager this task is to be put into
eventFactory - EventFactory that will be used to create the event to be sent
seqNum - the sequence number of the event
Method Detail

tryOnce

public boolean tryOnce()
Description copied from class: RetryTask
Make a single attempt. Return true if the attempt was successful. If the attempt is not successful, the task will be scheduled for a future retry.

Specified by:
tryOnce in class RetryTask

runAfter

public boolean runAfter(List tasks,
                        int size)
Description copied from interface: TaskManager.Task
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()). Using List.get will be more efficient than List.iterator.

Parameters:
tasks - the tasks to consider. A read-only List, with all elements instanceof Task.
size - elements with index less than size should be considered


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.