/** * Releases the lock for state changes for the specified transition event. * @param transitionEvent */ protected final void unlockStateChange(ModuleEvent transitionEvent) { if (stateChangeLock.getHoldCount() == 0 || !stateTransitionEvents.contains(transitionEvent)) throw new IllegalMonitorStateException("Current thread does not hold the state change lock for: " + transitionEvent); //$NON-NLS-1$ stateTransitionEvents.remove(transitionEvent); stateChangeLock.unlock(); }
/** * Returns the thread that currently owns the state change lock for this module, or * <code>null</code> if not owned. * @return the owner, or <code>null</code> if not owned. */ public final Thread getStateChangeOwner() { return stateChangeLock.getOwner(); }
boolean stateLocked; if (timeout == 0) { stateChangeLock.lockInterruptibly(); stateLocked = true; } else { stateLocked = stateChangeLock.tryLock(timeLeft, TimeUnit.MILLISECONDS); stateChangeLock.unlock();
boolean invalid = false; try { boolean acquired = stateChangeLock.tryLock(revisions.getContainer().getModuleLockTimeout(), TimeUnit.SECONDS); Set<ModuleEvent> currentTransition = Collections.emptySet(); if (acquired) { currentTransition = EnumSet.copyOf(stateTransitionEvents); invalid = true; stateChangeLock.unlock(); } else { stateTransitionEvents.add(transitionEvent);
/** * Returns true if the current thread holds the state change lock for the specified transition event. * @param transitionEvent * @return true if the current thread holds the state change lock for the specified transition event. */ public final boolean holdsTransitionEventLock(ModuleEvent transitionEvent) { return stateChangeLock.getHoldCount() > 0 && stateTransitionEvents.contains(transitionEvent); }
boolean stateLocked; if (timeout == 0) { stateChangeLock.lockInterruptibly(); stateLocked = true; } else { stateLocked = stateChangeLock.tryLock(timeLeft, TimeUnit.MILLISECONDS); stateChangeLock.unlock();
boolean invalid = false; try { boolean acquired = stateChangeLock.tryLock(revisions.getContainer().getModuleLockTimeout(), TimeUnit.SECONDS); Set<ModuleEvent> currentTransition = Collections.emptySet(); if (acquired) { currentTransition = EnumSet.copyOf(stateTransitionEvents); invalid = true; stateChangeLock.unlock(); } else { stateTransitionEvents.add(transitionEvent);
/** * Returns true if the current thread holds the state change lock for the specified transition event. * @param transitionEvent * @return true if the current thread holds the state change lock for the specified transition event. */ public final boolean holdsTransitionEventLock(ModuleEvent transitionEvent) { return stateChangeLock.getHoldCount() > 0 && stateTransitionEvents.contains(transitionEvent); }
boolean stateLocked; if (timeout == 0) { stateChangeLock.lockInterruptibly(); stateLocked = true; } else { stateLocked = stateChangeLock.tryLock(timeLeft, TimeUnit.MILLISECONDS); stateChangeLock.unlock();
boolean invalid = false; try { boolean acquired = stateChangeLock.tryLock(revisions.getContainer().getModuleLockTimeout(), TimeUnit.SECONDS); Set<ModuleEvent> currentTransition = Collections.emptySet(); if (acquired) { currentTransition = EnumSet.copyOf(stateTransitionEvents); invalid = true; stateChangeLock.unlock(); } else { stateTransitionEvents.add(transitionEvent);
/** * Releases the lock for state changes for the specified transition event. * @param transitionEvent */ protected final void unlockStateChange(ModuleEvent transitionEvent) { if (stateChangeLock.getHoldCount() == 0 || !stateTransitionEvents.contains(transitionEvent)) throw new IllegalMonitorStateException("Current thread does not hold the state change lock for: " + transitionEvent); //$NON-NLS-1$ stateTransitionEvents.remove(transitionEvent); stateChangeLock.unlock(); }
/** * Returns true if the current thread holds the state change lock for the specified transition event. * @param transitionEvent * @return true if the current thread holds the state change lock for the specified transition event. */ public final boolean holdsTransitionEventLock(ModuleEvent transitionEvent) { return stateChangeLock.getHoldCount() > 0 && stateTransitionEvents.contains(transitionEvent); }
/** * Returns the thread that currently owns the state change lock for this module, or * <code>null</code> if not owned. * @return the owner, or <code>null</code> if not owned. */ public final Thread getStateChangeOwner() { return stateChangeLock.getOwner(); }
try { if (timeout == 0) { stateChangeLock.lockInterruptibly(); stateLocked = true; } else { stateLocked = stateChangeLock.tryLock(timeLeft, TimeUnit.MILLISECONDS); stateChangeLock.unlock();
/** * Releases the lock for state changes for the specified transition event. * @param transitionEvent */ protected final void unlockStateChange(ModuleEvent transitionEvent) { if (stateChangeLock.getHoldCount() == 0 || !stateTransitionEvents.contains(transitionEvent)) throw new IllegalMonitorStateException("Current thread does not hold the state change lock for: " + transitionEvent); //$NON-NLS-1$ stateTransitionEvents.remove(transitionEvent); stateChangeLock.unlock(); }
/** * Returns true if the current thread holds the state change lock for the specified transition event. * @param transitionEvent * @return true if the current thread holds the state change lock for the specified transition event. */ public final boolean holdsTransitionEventLock(ModuleEvent transitionEvent) { return stateChangeLock.getHoldCount() > 0 && stateTransitionEvents.contains(transitionEvent); }
/** * Returns the thread that currently owns the state change lock for this module, or * <code>null</code> if not owned. * @return the owner, or <code>null</code> if not owned. */ public final Thread getStateChangeOwner() { return stateChangeLock.getOwner(); }
try { if (timeout == 0) { stateChangeLock.lockInterruptibly(); stateLocked = true; } else { stateLocked = stateChangeLock.tryLock(timeLeft, TimeUnit.MILLISECONDS); stateChangeLock.unlock();