Klasse DelegableReentrantLock
java.lang.Object
org.eclipse.net4j.util.concurrent.NonFairReentrantLock
org.eclipse.net4j.util.concurrent.DelegableReentrantLock
- Alle implementierten Schnittstellen:
Serializable,Lock,IManagedContainerProvider,INotifier,IDeactivateable,ILifecycle
public class DelegableReentrantLock
extends NonFairReentrantLock
implements ILifecycle, IManagedContainerProvider
A reentrant lock that can be delegated to other threads as detected by
delegate detectors.
Delegate detectors can be registered programmatically or discovered in a managed container.
The plugin container is used by default.
This class implements ILifecycle and must be activated before use. As a consequence, it
also implements INotifier, but it does not send any events.
- Seit:
- 3.6
- Autor:
- Eike Stepper
- Siehe auch:
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenVon Schnittstelle geerbte verschachtelte Klassen/Schnittstellen org.eclipse.net4j.util.lifecycle.ILifecycle
ILifecycle.DeferrableActivationVon Schnittstelle geerbte verschachtelte Klassen/Schnittstellen org.eclipse.net4j.util.event.INotifier
INotifier.INotifier2 -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungConstructs a delegable reentrant lock that uses theplugin containerto discoverdelegate detectors.DelegableReentrantLock(boolean usePluginContainer) Constructs a delegable reentrant lock that uses theplugin containerto discoverdelegate detectorsif the given flag istrue.DelegableReentrantLock(IManagedContainer container) Constructs a delegable reentrant lock that uses the givenmanaged containerto discoverdelegate detectors. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungfinal voidactivate()final voidaddDelegateDetector(DelegableReentrantLock.DelegateDetector delegateDetector) final voidaddListener(IListener listener) Adds a listener to this notifier.final Exceptionfinal IManagedContainerfinal LifecycleStatefinal IListener[]Returns the listeners that are registered with this notifier.final booleanReturnstrueif one or more listeners are registered with this notifier,falseotherwise.final booleanisActive()protected booleanisDelegate(Thread thread, Thread owner) protected booleanfinal voidremoveDelegateDetector(DelegableReentrantLock.DelegateDetector delegateDetector) final voidremoveListener(IListener listener) Removes a listener from this notifier.Von Klasse geerbte Methoden org.eclipse.net4j.util.concurrent.NonFairReentrantLock
getHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreads, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isHeldByCurrentThread, isLocked, lock, lockInterruptibly, newCondition, toString, tryLock, tryLock, unlock
-
Konstruktordetails
-
DelegableReentrantLock
Constructs a delegable reentrant lock that uses the givenmanaged containerto discoverdelegate detectors. If the given container isnull, no container is used. -
DelegableReentrantLock
public DelegableReentrantLock(boolean usePluginContainer) Constructs a delegable reentrant lock that uses theplugin containerto discoverdelegate detectorsif the given flag istrue. Uses no container otherwise.- Seit:
- 3.29
-
DelegableReentrantLock
public DelegableReentrantLock()Constructs a delegable reentrant lock that uses theplugin containerto discoverdelegate detectors.
-
-
Methodendetails
-
addDelegateDetector
- Seit:
- 3.29
-
removeDelegateDetector
- Seit:
- 3.29
-
getContainer
- Angegeben von:
getContainerin SchnittstelleIManagedContainerProvider
-
activate
- Angegeben von:
activatein SchnittstelleILifecycle- Löst aus:
LifecycleException
-
deactivate
- Angegeben von:
deactivatein SchnittstelleIDeactivateable- Angegeben von:
deactivatein SchnittstelleILifecycle
-
getLifecycleState
- Angegeben von:
getLifecycleStatein SchnittstelleILifecycle
-
isActive
public final boolean isActive()- Angegeben von:
isActivein SchnittstelleILifecycle
-
addListener
Beschreibung aus Schnittstelle kopiert:INotifierAdds 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,
- Angegeben von:
addListenerin SchnittstelleINotifier
-
removeListener
Beschreibung aus Schnittstelle kopiert:INotifierRemoves a listener from this notifier.- Angegeben von:
removeListenerin SchnittstelleINotifier
-
getListeners
Beschreibung aus Schnittstelle kopiert:INotifierReturns the listeners that are registered with this notifier.Depending on the implementation duplicate listeners may be contained in the returned array.
- Angegeben von:
getListenersin SchnittstelleINotifier
-
hasListeners
public final boolean hasListeners()Beschreibung aus Schnittstelle kopiert:INotifierReturnstrueif one or more listeners are registered with this notifier,falseotherwise.- Angegeben von:
hasListenersin SchnittstelleINotifier
-
isOwner
- Setzt außer Kraft:
isOwnerin KlasseNonFairReentrantLock
-
isDelegate
-