*/
protected Digester createStartDigester()
{
long t1 = System.currentTimeMillis();
// Initialize the digester
Digester digester = new WillowDigester();
if (debug > 0)
{
digester.setDebug(debug);
}
digester.setValidating(false);
digester.setClassLoader(StandardServer.class.getClassLoader());
// Configure the actions we will be using
digester.addObjectCreate("Server", "org.huihoo.willow.core.StandardServer", "className");
digester.addSetProperties("Server");
digester.addSetNext("Server", "setServer", "org.huihoo.willow.Server");
digester.addObjectCreate("Server/Listener", null, // MUST be specified in the element
"className");
digester.addSetProperties("Server/Listener");
digester.addSetNext(
"Server/Listener",
"addLifecycleListener",
"org.huihoo.willow.LifecycleListener");
digester.addObjectCreate(
"Server/Service",
"org.huihoo.willow.core.StandardService",
"className");
digester.addSetProperties("Server/Service");
digester.addSetNext("Server/Service", "addService", "org.huihoo.willow.Service");
digester.addObjectCreate("Server/Service/Listener", null, // MUST be specified in the element
"className");
digester.addSetProperties("Server/Service/Listener");
digester.addSetNext(
"Server/Service/Listener",
"addLifecycleListener",
"org.huihoo.willow.LifecycleListener");
digester.addObjectCreate(
"Server/Service/NamingServer",
"org.huihoo.willow.core.StandardNamingServer",
"className");
digester.addRule("Server/Service/NamingServer", new SetAllPropertiesRule());
digester.addSetNext(
"Server/Service/NamingServer",
"setNamingServer",
"org.huihoo.willow.NamingServer");
// Add RuleSets for nested elements
digester.addRuleSet(new EngineRuleSet("Server/Service/"));
digester.addRuleSet(new ContextRuleSet("Server/Service/Engine/"));
// When the 'engine' is found, set the parentClassLoader.
digester.addRule(
"Server/Service/Engine",
new SetParentClassLoaderRule(digester, parentClassLoader));
long t2 = System.currentTimeMillis();
log.debug("Digester for server.xml created " + (t2 - t1));