org.multiverse.utils
Class Listeners

java.lang.Object
  extended by org.multiverse.utils.Listeners

public final class Listeners
extends java.lang.Object

A immutable single-linked list for storing listener-latches.

Structure is thread-safe and designed to be used in a CAS-loop.

Author:
Peter Veentjer.

Constructor Summary
Listeners(Latch listener, Listeners next)
           
 
Method Summary
 Latch getListener()
          Returns the listener Latch stored in this ListenerNode.
 Listeners getNext()
          Gets the next ListenerNode or null if this ListerNode is the end of the line.
 void openAll()
          Opens all listeners.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Listeners

public Listeners(Latch listener,
                 Listeners next)
Method Detail

getListener

public Latch getListener()
Returns the listener Latch stored in this ListenerNode.

Returns:
the listener Latch.

getNext

public Listeners getNext()
Gets the next ListenerNode or null if this ListerNode is the end of the line.

Returns:
the next ListenerNode

openAll

public void openAll()
Opens all listeners. Method is not recursive but iterative.



Copyright © 2008-2010 Multiverse. All Rights Reserved.