Пример #1
0
 public synchronized void unfreeze(String host, int port) {
   InetSocketAddress addr = new InetSocketAddress(host, port);
   for (SubscribesConnectionEntry connectionEntry : clients.values()) {
     if (!connectionEntry.getClient().getAddr().equals(addr)) {
       continue;
     }
     connectionEntry.setFreezed(false);
     clientsEmpty.open();
     return;
   }
   throw new IllegalStateException("Can't find " + addr + " in slaves!");
 }
Пример #2
0
 public synchronized void add(SubscribesConnectionEntry entry) {
   clients.put(entry.getClient(), entry);
   if (!entry.isFreezed()) {
     clientsEmpty.open();
   }
 }