source: trunk/seguranca/ExpressoCertMail/src/DataReader.java @ 1035

Revision 1035, 505 bytes checked in by rafaelraymundo, 15 years ago (diff)

Ticket #558 - Adicionada funcionalidade de assinatura e criptografia de e-mails.

Line 
1
2public class DataReader {
3
4        private boolean flag = false;
5        private String resultado;
6
7        public synchronized String getResultado(){
8                lock();
9                //notifyAll();
10                return this.resultado;
11        }
12
13        public synchronized void setResultado(String resultado){
14                //flag = true;
15                this.resultado = resultado;
16        }
17
18        public synchronized void unlock(){
19                flag = true;
20                notifyAll();
21        }
22
23        private synchronized void lock(){
24                while (!flag){
25                        try{
26                                wait();
27                        }
28                        catch (InterruptedException e){}
29                }
30                flag = false;
31        }
32
33}
Note: See TracBrowser for help on using the repository browser.