Package org.eclipse.net4j.util.om.monitor

## Class NotifyingMonitor

- java.lang.Object
- - org.eclipse.net4j.util.om.monitor.AbstractMonitor
  - - org.eclipse.net4j.util.om.monitor.Monitor
    - - org.eclipse.net4j.util.om.monitor.NotifyingMonitor

- All Implemented Interfaces:
    `INotifier`, `OMMonitor`, `OMMonitorProgress`

      public class NotifyingMonitor
      extends Monitor
      implements INotifier

  Since:
    3.1
  Author:
    Eike Stepper

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `NotifyingMonitor.ProgressEvent` |

    - ### Nested classes/interfaces inherited from class org.eclipse.net4j.util.om.monitor.AbstractMonitor

      `AbstractMonitor.AsyncTimerTask`

    - ### Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier

      `INotifier.INotifier2`

    - ### Nested classes/interfaces inherited from interface org.eclipse.net4j.util.om.monitor.OMMonitor

      `OMMonitor.Async`

  - ### Field Summary

    - ### Fields inherited from class org.eclipse.net4j.util.om.monitor.Monitor

      `DEFAULT_ASYNC_SCHEDULE_PERIOD`

    - ### Fields inherited from interface org.eclipse.net4j.util.om.monitor.OMMonitor

      `DEFAULT_TIME_FACTOR, THOUSAND`

    - ### Fields inherited from interface org.eclipse.net4j.util.om.monitor.OMMonitorProgress

      `HUNDRED, ONE, TEN, ZERO`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `NotifyingMonitor()` |
    `NotifyingMonitor​(java.lang.String task)` |
    `NotifyingMonitor​(java.lang.String task, IListener[] listeners)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addListener​(IListener listener)` | Adds a listener to this notifier.
    `IListener[]` | `getListeners()` | Returns the listeners that are registered with this notifier.
    `java.lang.String` | `getTask()` |
    `boolean` | `hasListeners()` | Returns `true` if one or more listeners are registered with this notifier, `false` otherwise.
    `void` | `removeListener​(IListener listener)` | Removes a listener from this notifier.
    `void` | `worked​(double work)` |

    - ### Methods inherited from class org.eclipse.net4j.util.om.monitor.Monitor

      `cancel, cancel, checkCanceled, getAsyncSchedulePeriod, getTimer, isCanceled, scheduleAtFixedRate`

    - ### Methods inherited from class org.eclipse.net4j.util.om.monitor.AbstractMonitor

      `begin, begin, createAsyncTimerTask, createNestedMonitor, done, fork, fork, forkAsync, forkAsync, getTotalWork, getWork, getWorkPercent, hasBegun, percent, worked`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NotifyingMonitor

          public NotifyingMonitor()

    - #### NotifyingMonitor

          public NotifyingMonitor​(java.lang.String task)

    - #### NotifyingMonitor

          public NotifyingMonitor​(java.lang.String task,
                                  IListener[] listeners)

  - ### Method Detail

    - #### getTask

          public java.lang.String getTask()

    - #### hasListeners

          public boolean hasListeners()

      Description copied from interface: `INotifier`
      Returns `true` if one or more listeners are registered with this notifier, `false` otherwise.
      Specified by:
        `hasListeners` in interface `INotifier`

    - #### getListeners

          public IListener[] getListeners()

      Description copied from interface: `INotifier`
      Returns the listeners that are registered with this notifier.

      Depending on the implementation duplicate listeners may be contained in the returned array.

      Specified by:
        `getListeners` in interface `INotifier`

    - #### addListener

          public void addListener​(IListener listener)

      Description copied from interface: `INotifier`
      Adds a listener to this notifier.

      Depending on the implementation duplicate listeners may lead to duplicate event delivery or not. Implementors are encouraged to prevent events from being delivered more than once to the same listener,

      Specified by:
        `addListener` in interface `INotifier`

    - #### removeListener

          public void removeListener​(IListener listener)

      Description copied from interface: `INotifier`
      Removes a listener from this notifier.
      Specified by:
        `removeListener` in interface `INotifier`

    - #### worked

          public void worked​(double work)
                      throws MonitorCanceledException

      Specified by:
        `worked` in interface `OMMonitor`
      Overrides:
        `worked` in class `AbstractMonitor`
      Throws:
        `MonitorCanceledException`