Package org.jgroups.demos
Class LockServiceDemo
- java.lang.Object
-
- org.jgroups.demos.LockServiceDemo
-
- All Implemented Interfaces:
LockNotification
public class LockServiceDemo extends java.lang.Object implements LockNotification
Demos the LockService
-
-
Field Summary
Fields Modifier and Type Field Description protected JChannel
ch
protected LockService
lock_service
protected java.lang.String
name
protected java.lang.String
props
-
Constructor Summary
Constructors Constructor Description LockServiceDemo(java.lang.String props, java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
awaited(java.lang.String lock_name, Owner owner)
void
awaiting(java.lang.String lock_name, Owner owner)
protected static void
help()
void
lockCreated(java.lang.String lock_name)
void
lockDeleted(java.lang.String name)
void
locked(java.lang.String lock_name, Owner owner)
void
lockRevoked(java.lang.String lock_name, Owner current_owner)
protected void
loop()
static void
main(java.lang.String[] args)
protected static java.util.List<java.lang.String>
parseLockNames(java.lang.String line)
protected void
printLocks()
void
start()
void
start(JChannel ch)
void
unlocked(java.lang.String lock_name, Owner owner)
-
-
-
Field Detail
-
props
protected java.lang.String props
-
ch
protected JChannel ch
-
lock_service
protected LockService lock_service
-
name
protected java.lang.String name
-
-
Method Detail
-
start
public void start() throws java.lang.Exception
- Throws:
java.lang.Exception
-
start
public void start(JChannel ch) throws java.lang.Exception
- Throws:
java.lang.Exception
-
lockCreated
public void lockCreated(java.lang.String lock_name)
- Specified by:
lockCreated
in interfaceLockNotification
-
lockDeleted
public void lockDeleted(java.lang.String name)
- Specified by:
lockDeleted
in interfaceLockNotification
-
lockRevoked
public void lockRevoked(java.lang.String lock_name, Owner current_owner)
- Specified by:
lockRevoked
in interfaceLockNotification
-
locked
public void locked(java.lang.String lock_name, Owner owner)
- Specified by:
locked
in interfaceLockNotification
-
unlocked
public void unlocked(java.lang.String lock_name, Owner owner)
- Specified by:
unlocked
in interfaceLockNotification
-
awaiting
public void awaiting(java.lang.String lock_name, Owner owner)
- Specified by:
awaiting
in interfaceLockNotification
-
awaited
public void awaited(java.lang.String lock_name, Owner owner)
- Specified by:
awaited
in interfaceLockNotification
-
loop
protected void loop() throws java.lang.Exception
- Throws:
java.lang.Exception
-
parseLockNames
protected static java.util.List<java.lang.String> parseLockNames(java.lang.String line)
-
printLocks
protected void printLocks()
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
help
protected static void help()
-
-