Bug 164343 [DataBinding] Realm needs consistent Exception handling strategy
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/Realm.java
*     Brad Reynolds - bug 168153
 ******************************************************************************/
package org.eclipse.core.databinding.observable;
import java.util.LinkedList;
import org.eclipse.core.databinding.Binding;
/**
 * A realm defines a context from which objects implementing {@link IObservable}
 * must be accessed, and on which these objects will notify their listeners. To
 * bridge between observables from different realms, subclasses of
 * {@link Binding} can be used.
 * <p>
 * A block of code is said to be executing within a realm if calling
 * {@link #getDefault()} from that block returns true. Code reached by calling
 * methods from that block will execute within the same realm, with the
 * exception of methods on this class that can be used to execute code within a
 * specific realm. Clients can use {@link #syncExec(Runnable)},
 * {@link #asyncExec(Runnable)}, or {@link #exec(Runnable)} to execute a
 * runnable within this realm. Note that using {@link #syncExec(Runnable)} can
 * lead to deadlocks and should be avoided if the current thread holds any
 * locks.
 * </p>
 * <p>
 * It is instructive to think about possible implementations of Realm: It can be
 * based on executing on a designated thread such as a UI thread, or based on
 * holding a lock. In the former case, calling syncExec on a realm that is not
 * the current realm will execute the given runnable on a different thread (the
 * designated thread). In the latter case, calling syncExec may execute the
 * given runnable on the calling thread, but calling
 * {@link #asyncExec(Runnable)} will execute the given runnable on a different
 * thread. Therefore, no assumptions can be made about the thread that will