Patch from Tobi Schäfer to pass Jetty XML configuration file to Helma server.
This commit is contained in:
parent
2fc811ccc0
commit
9f2238c019
2 changed files with 45 additions and 27 deletions
|
@ -77,6 +77,9 @@ public class Server implements Runnable {
|
|||
InetAddrPort websrvPort = null;
|
||||
InetAddrPort ajp13Port = null;
|
||||
|
||||
// Jetty configuration file
|
||||
File configFile = null;
|
||||
|
||||
// map of server-wide database sources
|
||||
Hashtable dbSources;
|
||||
|
||||
|
@ -105,6 +108,7 @@ public class Server implements Runnable {
|
|||
websrvPort = config.getWebsrvPort();
|
||||
ajp13Port = config.getAjp13Port();
|
||||
hopHome = config.getHomeDir();
|
||||
configFile = config.getConfigFile();
|
||||
|
||||
// create system properties
|
||||
sysProps = new ResourceProperties();
|
||||
|
@ -260,6 +264,8 @@ public class Server implements Runnable {
|
|||
} catch (Exception portx) {
|
||||
throw new Exception("Error parsing AJP1.3 server port property: " + portx);
|
||||
}
|
||||
} else if (args[i].equals("-c") && ((i + 1) < args.length)) {
|
||||
config.setConfigFile(new File(args[++i]));
|
||||
} else if (args[i].equals("-i") && ((i + 1) < args.length)) {
|
||||
// eat away the -i parameter which is meant for helma.main.launcher.Main
|
||||
i++;
|
||||
|
@ -326,6 +332,7 @@ public class Server implements Runnable {
|
|||
System.out.println("Possible options:");
|
||||
System.out.println(" -h dir Specify hop home directory");
|
||||
System.out.println(" -f file Specify server.properties file");
|
||||
System.out.println(" -c jetty.xml Specify Jetty XML configuration file");
|
||||
System.out.println(" -w [ip:]port Specify embedded web server address/port");
|
||||
System.out.println(" -x [ip:]port Specify XML-RPC address/port");
|
||||
System.out.println(" -jk [ip:]port Specify AJP13 address/port");
|
||||
|
@ -560,9 +567,10 @@ public class Server implements Runnable {
|
|||
*/
|
||||
public void run() {
|
||||
try {
|
||||
if ((websrvPort != null) || (ajp13Port != null)) {
|
||||
if (configFile != null && configFile.exists()) {
|
||||
http = new org.mortbay.jetty.Server(configFile.toURI().toURL());
|
||||
} else if ((websrvPort != null) || (ajp13Port != null)) {
|
||||
http = new HttpServer();
|
||||
}
|
||||
|
||||
// start embedded web server if port is specified
|
||||
if (websrvPort != null) {
|
||||
|
@ -594,6 +602,7 @@ public class Server implements Runnable {
|
|||
ajp13.setRemoteServers(jkallowarr);
|
||||
logger.info("Starting AJP13-Listener on port " + (ajp13Port));
|
||||
}
|
||||
}
|
||||
|
||||
if (xmlrpcPort != null) {
|
||||
String xmlparser = sysProps.getProperty("xmlparser");
|
||||
|
|
|
@ -31,6 +31,7 @@ public class ServerConfig {
|
|||
private InetAddrPort ajp13Port = null;
|
||||
private File propFile = null;
|
||||
private File homeDir = null;
|
||||
private File configFile = null;
|
||||
|
||||
public boolean hasPropFile() {
|
||||
return (propFile != null);
|
||||
|
@ -103,4 +104,12 @@ public class ServerConfig {
|
|||
public void setHomeDir(File homeDir) {
|
||||
this.homeDir = homeDir == null ? null : homeDir.getAbsoluteFile();
|
||||
}
|
||||
|
||||
public File getConfigFile() {
|
||||
return configFile;
|
||||
}
|
||||
|
||||
public void setConfigFile(File configFile) {
|
||||
this.configFile = configFile == null ? null : configFile.getAbsoluteFile();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue