protected void prepareForFlush(){
  doneLock=new ReentrantLock();
  doneCondition=doneLock.newCondition();
  doneLock.lock();
}

protected void prepareForFlush ( ) { doneLock = new ReentrantLock ( ) ; doneCondition = doneLock . newCondition ( ) ; doneLock . lock ( ) ; }
internally used to indicate that the client thread will wait for this message to have been sent before continuing
