LockService is the main class for to use for distributed locking functionality. LockService needs access to a
and interacts with a locking protocol (e.g.
) via events.
When no locking protocol is seen on the channel's stack, LockService will throw an exception at startup. An example
of using LockService is:
JChannel ch=new JChannel("/home/bela/locking.xml); // locking.xml needs to have a locking protocol towards the top
LockService lock_service=new LockService(ch);
// do something with the lock acquired
The exact semantics of this lock implemantation are defined in
Note that, contrary to the semantics of
, unlock() can be called multiple
times; after a lock has been released, future calls to unlock() have no effect.