<p>Essentially what I want is a BlockingQueue of size=1. I have a "listener" thread that simply waits, blocking until an object is put into the queue, and then retrieves it--and a "producer" thread that actually puts the object into the queue.</p>

<p>I can implement this with some synchronized blocks and a BlockingQueue implementation, but that seems like overkill. Is there a better, simpler way to do what I want?</p>

<p>Example interface:</p>

<pre><code>public interface Wait&lt;T&gt; {
  /**
   * If "put" has never been called on this object, then this method will
   * block and wait until it has. Once "put" has been called with some T, this
   * method will return that T immediately.
   */
  public T get() throws InterruptedException;

  /**
   * @param object The object to return to callers of get(). If called more
   * than once, will throw an {@link IllegalStateException}.
   */
  public void put(T object);
}
</code></pre>

Use reflection to get the values of all the properties from the class then write them as attributes on to an XmlNode
```
```
PropertyInfo[] properties = control.GetType().GetProperties();
foreach (PropertyInfo property in properties)
{
  object o = property.GetValue(control, null);
  // write value of o.ToString() out as an attribute on a XmlNode
  // where attribute name is property.Name
}
```
```