1 30 31 package org.apache.commons.httpclient.server; 32 33 import java.util.HashSet ; 34 import java.util.Iterator ; 35 import java.util.Set ; 36 37 42 public class SimpleConnSet { 43 44 private Set connections = new HashSet (); 45 46 public SimpleConnSet() { 47 super(); 48 } 49 50 public synchronized void addConnection(final SimpleHttpServerConnection conn) { 51 this.connections.add(conn); 52 } 53 54 public synchronized void removeConnection(final SimpleHttpServerConnection conn) { 55 this.connections.remove(conn); 56 } 57 58 public synchronized void shutdown() { 59 for (Iterator i = connections.iterator(); i.hasNext();) { 60 SimpleHttpServerConnection conn = (SimpleHttpServerConnection) i.next(); 61 conn.close(); 62 } 63 } 64 65 } 66 | Popular Tags |