[doc] Added comments on a brain overloading method.
Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
parent
14007f4d9a
commit
da107f0a40
@ -206,10 +206,18 @@ public final class ConnectingConsoleInput implements ConsoleInput {
|
|||||||
return doPrompt(message, timeout, tic);
|
return doPrompt(message, timeout, tic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Actually do the prompting
|
||||||
|
*
|
||||||
|
* @param message the prompt message
|
||||||
|
* @param timeout the time to wait for an answer
|
||||||
|
* @param tic the moment the wait started
|
||||||
|
* @return the message provided through the prompting
|
||||||
|
* @throws IOException if an IO error occurred while prompting. */
|
||||||
private String doPrompt(final String message, final long timeout, final long tic)
|
private String doPrompt(final String message, final long timeout, final long tic)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
do {
|
do {
|
||||||
if (!checkPrompt()) {
|
if (!checkPrompt()) {
|
||||||
|
// We are not prompting... lets stop here.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
getConnection(getTimeoutLeft(tic, timeout));
|
getConnection(getTimeoutLeft(tic, timeout));
|
||||||
@ -220,10 +228,13 @@ public final class ConnectingConsoleInput implements ConsoleInput {
|
|||||||
actualConnected = connected;
|
actualConnected = connected;
|
||||||
}
|
}
|
||||||
if (!connect) {
|
if (!connect) {
|
||||||
|
// There is no provide of input... So lets start again, until we actually
|
||||||
|
// DO get a provider of input.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
final String res = actualPrompt(message, timeout, tic, actualConnected);
|
final String res = actualPrompt(message, timeout, tic, actualConnected);
|
||||||
|
// We got something from the prompting
|
||||||
synchronized (promptLock) {
|
synchronized (promptLock) {
|
||||||
if (prompting) {
|
if (prompting) {
|
||||||
prompting = false;
|
prompting = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user