OpenNMS API 1.2.3

org.opennms.netmgt.utils
Class BarrierSignaler

java.lang.Object
  extended byorg.opennms.netmgt.utils.BarrierSignaler
All Implemented Interfaces:
Signaler

public final class BarrierSignaler
extends java.lang.Object
implements Signaler

The Signaler interface was designed to get around the problem of not being able to extend the functionality of the Object.notify and Object.notifyAll methods. In some instances is would be nice to alter the default behavior slightly, the signaler interface allows this to occur.

An object that implements the Signaler interface is used just like a typical object. But instead of using notify and notifyAll, the methods signal and signalAll should be used in their place.

Author:
Weave , Sowmya , OpenNMS

Field Summary
private  int m_barrier
          The barrier where the signal starts occuring on each call.
private  int m_counter
          The count of signal calls.
 
Constructor Summary
BarrierSignaler(int barrier)
          Constructs a new barrier signaler.
 
Method Summary
 void signal()
           Provides the functionality of the notify method, but may be overridden by the implementor to provide additional functionality.
 void signalAll()
           Provides the functionality of the notifyAll method, but may be overridden by the implementor to provide additional functionality.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_barrier

private int m_barrier
The barrier where the signal starts occuring on each call.


m_counter

private int m_counter
The count of signal calls. This latches at the barrier and does not increment further.

Constructor Detail

BarrierSignaler

public BarrierSignaler(int barrier)
Constructs a new barrier signaler.

Parameters:
barrier - The barrier for notification to start.
Method Detail

signal

public void signal()

Provides the functionality of the notify method, but may be overridden by the implementor to provide additional functionality.

Specified by:
signal in interface Signaler
See Also:
Object.notify()

signalAll

public void signalAll()

Provides the functionality of the notifyAll method, but may be overridden by the implementor to provide additional functionality.

Specified by:
signalAll in interface Signaler
See Also:
Object.notifyAll()

OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.