uka.karmi.rmi
Class GlobalSynchronization
java.lang.Object
uka.karmi.rmi.GlobalSynchronization
- public abstract class GlobalSynchronization
- extends java.lang.Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOCK_ROOT
public static final int LOCK_ROOT
- See Also:
- Constant Field Values
ROOT_LOCKED
public static final int ROOT_LOCKED
- See Also:
- Constant Field Values
LOCK_CHILDS
public static final int LOCK_CHILDS
- See Also:
- Constant Field Values
CHILDS_LOCKED
public static final int CHILDS_LOCKED
- See Also:
- Constant Field Values
SIBLINGS_LOCKED
public static final int SIBLINGS_LOCKED
- See Also:
- Constant Field Values
UNLOCK_PARENT
public static final int UNLOCK_PARENT
- See Also:
- Constant Field Values
SIBLINGS_UNLOCKED
public static final int SIBLINGS_UNLOCKED
- See Also:
- Constant Field Values
UNLOCK_CHILDS
public static final int UNLOCK_CHILDS
- See Also:
- Constant Field Values
CHILDS_UNLOCKED
public static final int CHILDS_UNLOCKED
- See Also:
- Constant Field Values
handler
protected CallHandler handler
tid
protected final long tid
GlobalSynchronization
public GlobalSynchronization(long tid)
getLocalLock
protected abstract java.lang.Object getLocalLock()
release
protected void release()
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
preLock
public void preLock()
throws java.io.IOException,
java.lang.ClassNotFoundException
Main entry point for an application thread when requesting a
global synchronization. The pattern to request a global
synchronization is the following:
preLock()
synchronized (this) {
postLock()
// code that requires global synchronization.
preUnlock()
}
postUnlock()
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
postLock
public void postLock()
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException- See Also:
preLock()
preUnlock
public void preUnlock()
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException- See Also:
preLock()
postUnlock
public void postUnlock()
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException- See Also:
preLock()
processLockRoot
public void processLockRoot(int childIdx)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
processLockChilds
public void processLockChilds()
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
isRoot
protected abstract boolean isRoot()
sendParent
protected abstract void sendParent(int code)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
receiveParent
protected abstract void receiveParent(int code)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
receiveParentNonBlocking
protected abstract void receiveParentNonBlocking(int code)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
sendChild
protected abstract void sendChild(int idx,
int code)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
receiveChildNonBlocking
protected abstract void receiveChildNonBlocking(int idx,
int code)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
sendAllChilds
protected abstract void sendAllChilds(int code)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
receiveAllChilds
protected abstract void receiveAllChilds(int code)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
sendOtherChilds
protected abstract void sendOtherChilds(int idx,
int code)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
receiveOtherChilds
protected abstract void receiveOtherChilds(int idx,
int code)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException