com.sun.jini.outrigger
Class Notifier.NotifyTask

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

private class Notifier.NotifyTask
extends RetryTask

A task that represent a notification of matching a particular template under a given transaction.


Field Summary
private  EventSender sender
          Who and what to send a event to.
 
Fields inherited from interface com.sun.jini.constants.TimeConstants
DAYS, HOURS, MINUTES, SECONDS
 
Constructor Summary
Notifier.NotifyTask(EventSender sender)
          Create an object to represent this list of chits needing notification.
 
Method Summary
private  void logFailure(String exceptionDescription, Level level, boolean terminal, Throwable t)
          Log a failed delivery attempt
 boolean runAfter(List list, int max)
          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()
          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

sender

private final EventSender sender
Who and what to send a event to.

Constructor Detail

Notifier.NotifyTask

Notifier.NotifyTask(EventSender sender)
Create an object to represent this list of chits needing notification.

Parameters:
sender - An object that on request will attempt to deliver its event to the associated listener.
Throws:
NullPointerException - if sender is null
Method Detail

tryOnce

public boolean tryOnce()
Try to notify the target. Return true if the notification was successful.

We know that we are the only one dealing with the given chit because runAfter makes sure of it.

Specified by:
tryOnce in class RetryTask

runAfter

public boolean runAfter(List list,
                        int max)
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:
list - the tasks to consider. A read-only List, with all elements instanceof Task.
max - elements with index less than size should be considered

logFailure

private void logFailure(String exceptionDescription,
                        Level level,
                        boolean terminal,
                        Throwable t)
Log a failed delivery attempt



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