You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2006/06/20 22:43:37 UTC

svn commit: r415794 - /tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardContext.java

Author: costin
Date: Tue Jun 20 13:43:37 2006
New Revision: 415794

URL: http://svn.apache.org/viewvc?rev=415794&view=rev
Log:
Direct calls instead of introspection via JMX

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardContext.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardContext.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardContext.java?rev=415794&r1=415793&r2=415794&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardContext.java Tue Jun 20 13:43:37 2006
@@ -4056,6 +4056,7 @@
 
         // Look for a realm - that may have been configured earlier. 
         // If the realm is added after context - it'll set itself.
+        // TODO: what is the use case for this ? 
         if( realm == null && mserver != null ) {
             ObjectName realmName=null;
             try {
@@ -4546,7 +4547,7 @@
         applicationLifecycleListenersObjects = new Object[0];
         
         if(log.isDebugEnabled())
-            log.debug("resetContext " + oname + " " + mserver);
+            log.debug("resetContext " + oname);
     }
 
     /**
@@ -5183,20 +5184,18 @@
                 host.setAutoDeploy(false);
                 Registry.getRegistry(null, null)
                     .registerComponent(host, parentName, null);
-                mserver.invoke(parentName, "init", new Object[] {}, new String[] {} );
+                // We could do it the hard way...
+                //mserver.invoke(parentName, "init", new Object[] {}, new String[] {} );
+                // or same thing easier:
+                host.init();
             }
             
             // Add the main configuration listener
             LifecycleListener config = null;
             try {
-                Object configClassname = null;
-                try {
-                    configClassname = mserver.getAttribute(parentName, "configClass");
-                } catch (AttributeNotFoundException e) {
-                    // Ignore, it's normal a host may not have this optional attribute
-                }
-                if (configClassname != null) {
-                    Class clazz = Class.forName(String.valueOf(configClassname));
+                String configClassName = ((Host)getParent()).getConfigClass();
+                if (configClassName != null) {
+                    Class clazz = Class.forName(configClassName);
                     config = (LifecycleListener) clazz.newInstance();
                 } else {
                     config = new ContextConfig();
@@ -5211,8 +5210,7 @@
                 log.debug("AddChild " + parentName + " " + this);
             }
             try {
-                mserver.invoke(parentName, "addChild", new Object[] { this },
-                               new String[] {"org.apache.catalina.Container"});
+                ((Host)getParent()).addChild(this);
             } catch (Exception e) {
                 destroy();
                 throw e;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org