|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object it.sauronsoftware.junique.JUnique
public class JUnique
Point-of-entry of the JUnique library.
Constructor Summary | |
---|---|
JUnique()
|
Method Summary | |
---|---|
static void |
acquireLock(java.lang.String id)
This method tries to acquire a lock in the user-space for a given ID. |
static void |
acquireLock(java.lang.String id,
MessageHandler messageHandler)
This method tries to acquire a lock in the user-space for a given ID. |
static void |
releaseLock(java.lang.String id)
It releases a previously acquired lock on an ID. |
static java.lang.String |
sendMessage(java.lang.String id,
java.lang.String message)
It sends a message to the JVM process that has previously locked the given ID. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JUnique()
Method Detail |
---|
public static void acquireLock(java.lang.String id) throws AlreadyLockedException
id
- The lock ID.
AlreadyLockedException
- If the lock cannot be acquired, since it has been already
taken in the user-space.public static void acquireLock(java.lang.String id, MessageHandler messageHandler) throws AlreadyLockedException
id
- The lock ID.messageHandler
- An optional message handler that will be used after the lock
has be acquired to handle incoming messages on the lock
channel.
AlreadyLockedException
- If the lock cannot be acquired, since it has been already
taken in the user-space.public static void releaseLock(java.lang.String id)
id
- The lock ID.public static java.lang.String sendMessage(java.lang.String id, java.lang.String message)
id
- The lock ID.message
- The message.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |