necesito un mapa segura hilo, tengo algo como esto: (i soy muy nuevo en java)hilo mapa seguro para java
public static class Manager
{
static
{
//something wrong here, doesn't compile
list = new java.util.Collections
.synchronizedMap(new Map<String, Client>());
}
static Map<String,Client> list;
public static void AddClient(Client client)
{
// thread safe add client to the list
}
public static void RemoveClient(Client client)
{
// thread safe remove client to the list
}
}
Nota, la estática mutables son un muy, muy, muy mala idea. –