private void waitForCallback(final String uuid, final long timeout) throws TimeoutException {

		synchronized (lock) {

			this.message = null;
			this.hasTimeout = true;

			try {
				lock.wait(timeout);

			} catch (InterruptedException iex) {
				logger.warn("", iex);
			}

			// remove timed out callback
			if (this.hasTimeout) {

				peer.unregisterCallback(uuid);
				throw new TimeoutException();
			}
		}
	}
private void waitForCallback ( final String uuid , final long timeout ) throws TimeoutException { synchronized ( lock ) { this . message = null ; this . hasTimeout = true ; try { lock . wait ( timeout ) ; } catch ( InterruptedException iex ) { logger . warn ( "" , iex ) ; } if ( this . hasTimeout ) { peer . unregisterCallback ( uuid ) ; throw new TimeoutException ( ) ; } } }
----- private methods -----