--- projects/cms/source/server/uk/org/iscream/cms/server/filtermanager/HostListener.java 2001/05/29 17:02:35 1.9 +++ projects/cms/source/server/uk/org/iscream/cms/server/filtermanager/HostListener.java 2002/03/20 12:56:37 1.10 @@ -15,7 +15,7 @@ import java.io.*; * of the HostInit class, which handles further communication. * * @author $Author: tdb $ - * @version $Id: HostListener.java,v 1.9 2001/05/29 17:02:35 tdb Exp $ + * @version $Id: HostListener.java,v 1.10 2002/03/20 12:56:37 tdb Exp $ */ class HostListener extends Thread { @@ -24,7 +24,7 @@ class HostListener extends Thread { /** * The current CVS revision of this class */ - public final String REVISION = "$Revision: 1.9 $"; + public final String REVISION = "$Revision: 1.10 $"; //---STATIC METHODS--- @@ -52,6 +52,16 @@ class HostListener extends Thread { * and then passing them off to other processes to deal with. */ public void run(){ + // get our ACL from the configuration + ACL acl = null; + try { + String stringACL = ConfigurationProxy.getInstance().getProperty("FilterManager", "FilterManager.ACL"); + acl = new ACL(stringACL); + } + catch(PropertyNotFoundException e) { + _logger.write(toString(), Logger.WARNING, "No ACL found for FilterManager: " + e); + } + ServerSocket listenSocket=null; // We use this boolean so we can break out of the while loop if we want boolean run = true; @@ -59,7 +69,13 @@ class HostListener extends Thread { // Work out the port we want int listenPort = Integer.parseInt(ConfigurationProxy.getInstance().getProperty("FilterManager", "FilterManager.listenPort")); // Setup the ServerSocket so that clients can connect - listenSocket = new ServerSocket(listenPort); + // use an ACLServerSocket if we have an ACL + if(acl != null) { + listenSocket = new ACLServerSocket(acl, listenPort); + } + else { + listenSocket = new ServerSocket(listenPort); + } _logger.write(toString(), Logger.SYSMSG, "Server listening on " +InetAddress.getLocalHost().getHostName() +"/"+InetAddress.getLocalHost().getHostAddress()