Changeset 9833 for helma/helma/branches/jetty6
- Timestamp:
- 06/17/09 14:28:52 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
helma/helma/branches/jetty6/src/helma/main/JettyServer.java
r9578 r9833 22 22 import org.mortbay.jetty.bio.SocketConnector; 23 23 import org.mortbay.jetty.nio.SelectChannelConnector; 24 import org.mortbay.xml.XmlConfiguration; 24 25 25 import java.util.StringTokenizer;26 26 import java.net.URL; 27 27 import java.net.InetSocketAddress; … … 46 46 47 47 private JettyServer(URL url) throws IOException { 48 // TODO: this is wrong. url is supposed to be the url of a jetty config file. 49 http = new org.mortbay.jetty.Server(url.getPort()); 50 openListeners(); 48 http = new org.mortbay.jetty.Server(); 49 50 try { 51 XmlConfiguration config = new XmlConfiguration(url); 52 config.configure(http); 53 54 openListeners(); 55 } catch (IOException e) { 56 throw e; 57 } catch (Exception e) { 58 throw new RuntimeException("Jetty configuration problem: " + e); 59 } 51 60 } 52 61 … … 75 84 http.addConnector(ajp13); 76 85 77 String jkallow = server.sysProps.getProperty("allowAJP13"); 78 79 // by default the AJP13-connection just accepts requests from 127.0.0.1 80 if (jkallow == null) { 81 jkallow = "127.0.0.1"; 86 // jetty6 does not support protection of AJP13 connections anymore 87 if (server.sysProps.containsKey("allowAJP13")) { 88 String message = "allowAJP13 property is no longer supported. " + 89 "Please remove it from your config and use a firewall " + 90 "to protect the AJP13 port"; 91 server.getLogger().error(message); 92 throw new RuntimeException(message); 82 93 } 83 94 84 StringTokenizer st = new StringTokenizer(jkallow, " ,;");85 String[] jkallowarr = new String[st.countTokens()];86 int cnt = 0;87 88 while (st.hasMoreTokens()) {89 jkallowarr[cnt] = st.nextToken();90 cnt++;91 }92 93 // TODO:94 //ajp13.setRemoteServers(jkallowarr);95 95 server.getLogger().info("Starting AJP13-Listener on port " + (ajpPort)); 96 96 } … … 101 101 return http; 102 102 } 103 /* TODO:104 public HttpContext getContext(String contextPath) {105 return http.getContext(contextPath);106 }107 108 public HttpContext addContext(String contextPath) {109 return http.addContext(contextPath);110 }111 */112 103 113 104 public void start() throws Exception {