Pessoal, algu�m poderia me ajudar a entender essa
classe ?
Obrigado
Kleber Rodrigo de Carvalho
import java.sql.*;
import java.util.*;
import java.io.*;
class DBPool implements java.io.Serializable{
/**
* Fields containing sensitive data should not be
serialized;
* doing so exposes their values to any party with
access to the serialization stream.
* There are several methods for preventing a field
from being serialized:
* Declare the field as private transient.
*/
private transient Stack cola = null;
public DBPool(){
LogFile.log("creando el DB pool",4);
cola = new Stack();
}
public synchronized Connection popDBConnection(){
Connection conn = null;
/**
* Faz enquanto a pilha est� vazia
*/
while(cola.isEmpty()){
try{
wait();
}
catch(InterruptedException i){
}
}
/**
* Remove o objeto do top desta pilha e
retorna este objeto para esta fun��o.
* Faz um casting deste objeto para conn
*/
conn = (Connection )cola.pop();
return conn;
}
/**
* @param r : Nome da conex�o
*/
public synchronized void
pushDBConnection(Connection r){
/**
* push(Object item)
* Impulsiona um item para o topo desta pilha
*/
cola.push(r);
this.notifyAll();
}
}
__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/
------------------------------ LISTA SOUJAVA ----------------------------
http://www.soujava.org.br - Sociedade de Usu�rios Java da Sucesu-SP
d�vidas mais comuns: http://www.soujava.org.br/faq.htm
regras da lista: http://www.soujava.org.br/regras.htm
historico: http://www.mail-archive.com/java-list%40soujava.org.br
para sair da lista: envie email para [EMAIL PROTECTED]
-------------------------------------------------------------------------