Package org.uberfire.client.mvp
Class LockManagerImpl
- java.lang.Object
-
- org.uberfire.client.mvp.LockManagerImpl
-
- All Implemented Interfaces:
LockManager
@Dependent public class LockManagerImpl extends Object implements LockManager
Default implementation ofLockManagerusing theVFSLockServiceProxyfor lock management.
-
-
Constructor Summary
Constructors Constructor Description LockManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacquireLock()Attempts to acquire a lock where the consuming code knows a lock needs to be acquired.voidacquireLockOnDemand()Registers DOM handlers to detect changes onLockTarget.getWidget()and, if required (seeLockDemandDetector), automatically tries to acquire a lock.com.google.gwt.user.client.EventListeneracquireLockOnDemand(com.google.gwt.dom.client.Element element)protected voidfireChangeTitleEvent()protected voidfireUpdatedLockStatusEvent()protected org.uberfire.backend.vfs.impl.LockInfogetLockInfo()org.uberfire.client.mvp.LockTargetgetLockTarget()voidinit(org.uberfire.client.mvp.LockTarget lockTarget)Retrieves the latest lock information for the provided target and fires events to update the corresponding UI.voidonFocus()Notifies this lock manager that the lock target's widget got focus to initialize widget-specific state i.e. to publish JavaScript methods for lock management which can be used by non-native editors (i.e editors that are rendered on the server).voidreleaseLock()Releases the previously acquired lock.
-
-
-
Method Detail
-
init
public void init(org.uberfire.client.mvp.LockTarget lockTarget)
Description copied from interface:LockManagerRetrieves the latest lock information for the provided target and fires events to update the corresponding UI.- Specified by:
initin interfaceLockManager- Parameters:
lockTarget- theLockTargetproviding information about what to lock.
-
onFocus
public void onFocus()
Description copied from interface:LockManagerNotifies this lock manager that the lock target's widget got focus to initialize widget-specific state i.e. to publish JavaScript methods for lock management which can be used by non-native editors (i.e editors that are rendered on the server). The lock manager must be initialized before calling this method (seeLockManager.init(LockTarget)).- Specified by:
onFocusin interfaceLockManager
-
acquireLockOnDemand
public void acquireLockOnDemand()
Description copied from interface:LockManagerRegisters DOM handlers to detect changes onLockTarget.getWidget()and, if required (seeLockDemandDetector), automatically tries to acquire a lock. If the target is already locked by another user and the lock can't be acquired, the user will be notified and the lock target's reload runnable will be executed. Errors in the execution of this method are propagated to the global RPC/MessageBus error handler. The lock manager must be initialized before calling this method (seeLockManager.init(LockTarget)).- Specified by:
acquireLockOnDemandin interfaceLockManager
-
acquireLockOnDemand
public com.google.gwt.user.client.EventListener acquireLockOnDemand(com.google.gwt.dom.client.Element element)
-
acquireLock
public void acquireLock()
Description copied from interface:LockManagerAttempts to acquire a lock where the consuming code knows a lock needs to be acquired. If the target is already locked by another user and the lock cannot be acquired, the user will be notified and the lock target's reload runnable will be executed. Attempts to acquire a lock will always cause anChangeTitleWidgetEventto be fired. Errors in the execution of this method are propagated to the global RPC/MessageBus error handler. The lock manager must be initialized before calling this method (seeLockManager.init(LockTarget)).- Specified by:
acquireLockin interfaceLockManager
-
releaseLock
public void releaseLock()
Description copied from interface:LockManagerReleases the previously acquired lock. Errors in the execution of this method are propagated to the global RPC/MessageBus error handler.- Specified by:
releaseLockin interfaceLockManager
-
getLockTarget
public org.uberfire.client.mvp.LockTarget getLockTarget()
-
getLockInfo
protected org.uberfire.backend.vfs.impl.LockInfo getLockInfo()
-
fireChangeTitleEvent
protected void fireChangeTitleEvent()
-
fireUpdatedLockStatusEvent
protected void fireUpdatedLockStatusEvent()
-
-