\r
// Look for a realm - that may have been configured earlier. \r
// If the realm is added after context - it'll set itself.\r
+ // TODO: what is the use case for this ? \r
if( realm == null && mserver != null ) {\r
ObjectName realmName=null;\r
try {\r
applicationLifecycleListenersObjects = new Object[0];\r
\r
if(log.isDebugEnabled())\r
- log.debug("resetContext " + oname + " " + mserver);\r
+ log.debug("resetContext " + oname);\r
}\r
\r
/**\r
host.setAutoDeploy(false);\r
Registry.getRegistry(null, null)\r
.registerComponent(host, parentName, null);\r
- mserver.invoke(parentName, "init", new Object[] {}, new String[] {} );\r
+ // We could do it the hard way...\r
+ //mserver.invoke(parentName, "init", new Object[] {}, new String[] {} );\r
+ // or same thing easier:\r
+ host.init();\r
}\r
\r
// Add the main configuration listener\r
LifecycleListener config = null;\r
try {\r
- Object configClassname = null;\r
- try {\r
- configClassname = mserver.getAttribute(parentName, "configClass");\r
- } catch (AttributeNotFoundException e) {\r
- // Ignore, it's normal a host may not have this optional attribute\r
- }\r
- if (configClassname != null) {\r
- Class clazz = Class.forName(String.valueOf(configClassname));\r
+ String configClassName = ((Host)getParent()).getConfigClass();\r
+ if (configClassName != null) {\r
+ Class clazz = Class.forName(configClassName);\r
config = (LifecycleListener) clazz.newInstance();\r
} else {\r
config = new ContextConfig();\r
log.debug("AddChild " + parentName + " " + this);\r
}\r
try {\r
- mserver.invoke(parentName, "addChild", new Object[] { this },\r
- new String[] {"org.apache.catalina.Container"});\r
+ ((Host)getParent()).addChild(this);\r
} catch (Exception e) {\r
destroy();\r
throw e;\r