public String poll(long timeout) throws InterruptedException {
  lastTimeMillis=System.currentTimeMillis();
  String result="<delta/>";
synchronized (this) {
    if (buffer.length() == 0) {
      wait(timeout);
    }
    if (buffer.length() > 0) {
      result="<delta>" + buffer.toString() + "</delta>";
      buffer=new StringBuffer();
    }
    notify();
  }
  return result;
}

public String poll ( long timeout ) throws InterruptedException { lastTimeMillis = System . currentTimeMillis ( ) ; String result = "<delta/>" ; synchronized ( this ) { if ( buffer . length ( ) == 0 ) { wait ( timeout ) ; } if ( buffer . length ( ) > 0 ) { result = "<delta>" + buffer . toString ( ) + "</delta>" ; buffer = new StringBuffer ( ) ; } notify ( ) ; } return result ; }
returns the changes received by other sessions for the shared diagram . the method returns an empty xml node if no change was received within the given timeout .
