org.apache.ode.utils

## Class WatchDog.DefaultObserver<A>

- java.lang.Object
- - org.apache.ode.utils.WatchDog.DefaultObserver<A>

- All Implemented Interfaces:
    WatchDog.Observer<A>
  Direct Known Subclasses:
    DeploymentPoller.DDWatchDogObserver
  Enclosing class:
    WatchDog<T,C extends WatchDog.Observer>

      public static class WatchDog.DefaultObserver<A>
      extends java.lang.Object
      implements WatchDog.Observer<A>

  A default implementation of #ChangeHandler. Delete and Update will both invoke the #init method which satifies most use cases. So subclasses may simply override the #init method to fit their own needs.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.concurrent.locks.ReadWriteLock` | `lock`
    `protected A` | `object`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WatchDog.DefaultObserver()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `A` | `get()`
    `java.util.concurrent.locks.Lock` | `getLock()`
    `void` | `init()` empty implementation
    `boolean` | `isInitialized()`
    `void` | `onDelete()` delegate to #init
    `void` | `onUpdate()` delegate to #init
    `void` | `reset()`

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

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

- - ### Field Detail

    - #### lock

          protected final java.util.concurrent.locks.ReadWriteLock lock

    - #### object

          protected A object

  - ### Constructor Detail

    - #### WatchDog.DefaultObserver

          public WatchDog.DefaultObserver()

  - ### Method Detail

    - #### isInitialized

          public boolean isInitialized()

      Specified by:
        `isInitialized` in interface `WatchDog.Observer<A>`
      Returns:
        true if the wrapped if not null

    - #### init

          public void init()

      empty implementation
      Specified by:
        `init` in interface `WatchDog.Observer<A>`

    - #### reset

          public void reset()

      Specified by:
        `reset` in interface `WatchDog.Observer<A>`

    - #### onDelete

          public void onDelete()

      delegate to #init
      Specified by:
        `onDelete` in interface `WatchDog.Observer<A>`

    - #### onUpdate

          public void onUpdate()

      delegate to #init
      Specified by:
        `onUpdate` in interface `WatchDog.Observer<A>`

    - #### getLock

          public java.util.concurrent.locks.Lock getLock()

      Specified by:
        `getLock` in interface `WatchDog.Observer<A>`

    - #### get

          public A get()

      Specified by:
        `get` in interface `WatchDog.Observer<A>`