01: /**
02: * MaskingThread.java
03: * @author ss133690
04: * @version 0.1
05: */package com.sun.portal.cli.cert;
06:
07: import java.io.*;
08: import com.sun.portal.log.common.PortalLogger;
09:
10: class MaskingThread extends Thread {
11: private boolean stop = false;
12: private int index;
13: private String prompt;
14:
15: public MaskingThread(String prompt) {
16: this .prompt = prompt;
17: }
18:
19: public void run() {
20: while (!stop) {
21: try {
22: this .sleep(1);
23: } catch (InterruptedException iex) {
24: }
25: if (!stop) {
26: System.out.print("\r" + prompt + " \r" + prompt);
27: }
28: System.out.flush();
29: }
30: }
31:
32: public void stopMasking() {
33: this .stop = true;
34: }
35: }
|