com.sun.jini.outrigger
Class Notifier

java.lang.Object
  extended by com.sun.jini.outrigger.Notifier
All Implemented Interfaces:
TimeConstants

 class Notifier
extends Object
implements TimeConstants

The notifier thread. This thread is responsible for notifying objects for which interest has been registered. It operates in transient space as much as possible. Pending notifications will be lost when the server goes down, but registrations of interest survive across server crashes for persistent servers.

Author:
Sun Microsystems, Inc.
See Also:
JavaSpace.notify(net.jini.core.entry.Entry, net.jini.core.transaction.Transaction, net.jini.core.event.RemoteEventListener, long, java.rmi.MarshalledObject), OutriggerServerImpl.notify(com.sun.jini.outrigger.EntryRep, net.jini.core.transaction.Transaction, net.jini.core.event.RemoteEventListener, long, java.rmi.MarshalledObject)

Nested Class Summary
private  class Notifier.NotifyTask
          A task that represent a notification of matching a particular template under a given transaction.
 
Field Summary
private static long[] delays
           
private static Logger logger
          Logger for logging event related information
private static int MAX_ATTEMPTS
           
private static long MAX_TIME
           
private  TaskManager pending
          pending notifications tasks
private  ProxyPreparer recoveredListenerPreparer
          Proxy preparer to use on recovered listeners
private  JavaSpace source
          The object to use for the source when creating events.
private  WakeupManager wakeupMgr
          wakeup manager for NotifyTask
 
Fields inherited from interface com.sun.jini.constants.TimeConstants
DAYS, HOURS, MINUTES, SECONDS
 
Constructor Summary
Notifier(JavaSpace source, ProxyPreparer recoveredListenerPreparer, Configuration config)
          Create a notifier connected to the given space.
 
Method Summary
(package private)  void enqueueDelivery(EventSender sender)
          Queue up an event for delivery.
(package private)  void terminate()
          Terminate the notifier, shutting down any threads it has running.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

private final JavaSpace source
The object to use for the source when creating events.


recoveredListenerPreparer

private final ProxyPreparer recoveredListenerPreparer
Proxy preparer to use on recovered listeners


wakeupMgr

private final WakeupManager wakeupMgr
wakeup manager for NotifyTask


pending

private final TaskManager pending
pending notifications tasks


MAX_ATTEMPTS

private static final int MAX_ATTEMPTS
See Also:
Constant Field Values

logger

private static final Logger logger
Logger for logging event related information


MAX_TIME

private static final long MAX_TIME
See Also:
Constant Field Values

delays

private static final long[] delays
Constructor Detail

Notifier

Notifier(JavaSpace source,
         ProxyPreparer recoveredListenerPreparer,
         Configuration config)
   throws ConfigurationException
Create a notifier connected to the given space.

Parameters:
source - the value to use for the source in remote event objects.
recoveredListenerPreparer - ProxyPreparer to apply to recovered listeners.
config - a source of configuration data.a
Throws:
ConfigurationException - if there is a problem with the passed configuration.
NullPointerException - if source or config arguments are null.
Method Detail

terminate

void terminate()
Terminate the notifier, shutting down any threads it has running. This method can assume that the constructor completed.


enqueueDelivery

void enqueueDelivery(EventSender sender)
Queue up an event for delivery.

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


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