com.sun.jini.mercury
Class MailboxImpl.NotifyTask

java.lang.Object
  extended by com.sun.jini.thread.RetryTask
      extended by com.sun.jini.mercury.MailboxImpl.NotifyTask
All Implemented Interfaces:
TimeConstants, TaskManager.Task, Runnable
Enclosing class:
MailboxImpl

 class MailboxImpl.NotifyTask
extends RetryTask

A task that represents an event notification task for a particular registration. A NotifyTask will be returned to the task pool after one of the following has occured (which ever comes first):


Field Summary
private  Uuid regID
          The Uuid of the associated registration
 
Fields inherited from interface com.sun.jini.constants.TimeConstants
DAYS, HOURS, MINUTES, SECONDS
 
Constructor Summary
MailboxImpl.NotifyTask(TaskManager tm, WakeupManager mgr, Uuid regID)
          Create an object to represent an event notification task.
 
Method Summary
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.
 
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

regID

private Uuid regID
The Uuid of the associated registration

Constructor Detail

MailboxImpl.NotifyTask

MailboxImpl.NotifyTask(TaskManager tm,
                       WakeupManager mgr,
                       Uuid regID)
Create an object to represent an event notification task.

Method Detail

getNextEvent

private RemoteEvent getNextEvent(ServiceRegistration reg)
This utility function tries to obtain the next event for the given registration. If it finds one, the event is returned. Otherwise null is returned.


deleteNextEvent

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


disableRegistration

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.


tryOnce

public boolean tryOnce()
Try to notify the target. Return true if the notification was successful. Return false otherwise. If we return false, this task will be rescheduled at some point in the future.

Specified by:
tryOnce in class RetryTask

runAfter

public 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. The notifier thread ensures that there should only be one task per registration, so this method just returns false.

Parameters:
list - the tasks to consider. A read-only List, with all elements instanceof Task.
max - 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.