Ejemplo n.º 1
0
 @TritonMethod("lock.release")
 public boolean release(Channel channel, TritonMessage message, LockRelease release) {
   LockOwner owner = new LockOwner(channel, message.getCallId(), release.getOwnerId());
   manager.unlock(owner, release.getKey());
   return true;
 }
Ejemplo n.º 2
0
 @TritonMethod(value = "lock.acquire", async = true)
 public void acquire(Channel channel, TritonMessage message, LockAcquire acquire) {
   LockOwner owner = new LockOwner(channel, message.getCallId());
   manager.lock(owner, acquire.getKey(), acquire.getTimeout());
 }