class Acceptor {

  ResourcePool getSocketSet(final ConnectionType connectionType)
    throws ShutdownException {

    synchronized (m_socketSets) {
      if (m_isShutdown) {
        throw new ShutdownException("Acceptor has been shut down");
      }

      final ResourcePool original = m_socketSets.get(connectionType);

      if (original != null) {
        return original;
      }
      else {
        final ResourcePool newSocketSet = new ResourcePoolImplementation();

        newSocketSet.addListener(
          new ResourcePool.Listener() {
            public void resourceAdded(ResourcePool.Resource resource) {
              final ConnectionIdentity connection =
                ((SocketWrapper)resource).getConnectionIdentity();

              getListeners(connectionType).apply(
                new ListenerSupport.Informer<Listener>() {
                  public void inform(Listener l) {
                    l.connectionAccepted(connectionType, connection);
                  }
                });
            }

            public void resourceClosed(ResourcePool.Resource resource) {
              final ConnectionIdentity connection =
                ((SocketWrapper)resource).getConnectionIdentity();

              getListeners(connectionType).apply(
                new ListenerSupport.Informer<Listener>() {
                  public void inform(Listener l) {
                    l.connectionClosed(connectionType, connection);
                  }
                });
            }
          });

        m_socketSets.put(connectionType, newSocketSet);
        return newSocketSet;
      }
    }
  }

  public  Acceptor(String addressString,
                  int port,
                  int numberOfThreads,
                  TimeAuthority timeAuthority);

}