org.eclipse.net4j.util.concurrent

## Class DelegableReentrantLock

- java.lang.Object
- - org.eclipse.net4j.util.concurrent.NonFairReentrantLock
  - - org.eclipse.net4j.util.concurrent.DelegableReentrantLock

- All Implemented Interfaces:
    java.io.Serializable, java.util.concurrent.locks.Lock, INotifier, IDeactivateable, ILifecycle

      public class DelegableReentrantLock
      extends NonFairReentrantLock
      implements ILifecycle

  Since:
    3.6
  Author:
    Eike Stepper
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `DelegableReentrantLock.DelegateDetector`

    - ### Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle

      `ILifecycle.DeferrableActivation`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DelegableReentrantLock()`
    `DelegableReentrantLock(IManagedContainer container)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `activate()`
    `void` | `addListener(IListener listener)` Adds a listener to this notifier.
    `java.lang.Exception` | `deactivate()`
    `IManagedContainer` | `getContainer()`
    `LifecycleState` | `getLifecycleState()`
    `IListener[]` | `getListeners()` Returns the listeners that are registered with this notifier.
    `boolean` | `hasListeners()` Returns `true` if one or more listeners are registered with this notifier, `false` otherwise.
    `boolean` | `isActive()`
    `protected boolean` | `isDelegate(java.lang.Thread thread, java.lang.Thread owner)`
    `protected boolean` | `isOwner(java.lang.Thread thread, java.lang.Thread owner)`
    `void` | `removeListener(IListener listener)` Removes a listener from this notifier.

    - ### Methods inherited from class org.eclipse.net4j.util.concurrent.NonFairReentrantLock

      `getHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreads, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isHeldByCurrentThread, isLocked, lock, lockInterruptibly, newCondition, toString, tryLock, tryLock, unlock`

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

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

- - ### Constructor Detail

    - #### DelegableReentrantLock

          public DelegableReentrantLock(IManagedContainer container)

    - #### DelegableReentrantLock

          public DelegableReentrantLock()

  - ### Method Detail

    - #### getContainer

          public final IManagedContainer getContainer()

    - #### activate

          public final void activate()
                              throws LifecycleException

      Specified by:
        `activate` in interface `ILifecycle`
      Throws:
        `LifecycleException`

    - #### deactivate

          public final java.lang.Exception deactivate()

      Specified by:
        `deactivate` in interface `IDeactivateable`
      Specified by:
        `deactivate` in interface `ILifecycle`

    - #### getLifecycleState

          public final LifecycleState getLifecycleState()

      Specified by:
        `getLifecycleState` in interface `ILifecycle`

    - #### isActive

          public final boolean isActive()

      Specified by:
        `isActive` in interface `ILifecycle`

    - #### addListener

          public final 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 final void removeListener(IListener listener)

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

    - #### getListeners

          public final 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`

    - #### hasListeners

          public final 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`

    - #### isOwner

          protected boolean isOwner(java.lang.Thread thread,
                                    java.lang.Thread owner)

      Overrides:
        `isOwner` in class `NonFairReentrantLock`

    - #### isDelegate

          protected boolean isDelegate(java.lang.Thread thread,
                                       java.lang.Thread owner)

Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html