From: markt Date: Sat, 8 May 2010 15:31:53 +0000 (+0000) Subject: Clean up experimental (from Tomcat 5) MBean registration feature of StandardEngine... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=69789858e842fdd92b4f63cd0369748cb0e7d8f7;p=tomcat7.0 Clean up experimental (from Tomcat 5) MBean registration feature of StandardEngine prior to Lifecycle/MBean refactoring for ContainerBase git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@942402 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/core/StandardEngine.java b/java/org/apache/catalina/core/StandardEngine.java index 66a1e260c..bb5dc3788 100644 --- a/java/org/apache/catalina/core/StandardEngine.java +++ b/java/org/apache/catalina/core/StandardEngine.java @@ -14,14 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - - package org.apache.catalina.core; - -import java.io.File; -import java.util.List; - import javax.management.MBeanServer; import javax.management.MalformedObjectNameException; import javax.management.ObjectName; @@ -38,7 +32,6 @@ import org.apache.catalina.util.ServerInfo; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.modeler.Registry; -import org.apache.tomcat.util.modeler.modules.MbeansSource; /** * Standard implementation of the Engine interface. Each @@ -105,20 +98,6 @@ public class StandardEngine */ private String baseDir = null; - /** Optional mbeans config file. This will replace the "hacks" in - * jk and ServerListener. The mbeans file will support (transparent) - * persistence - soon. It'll probably replace jk2.properties and could - * replace server.xml. Of course - the same beans could be loaded and - * managed by an external entity - like the embedding app - which - * can use a different persistence mechanism. - */ - private String mbeansFile = null; - - /** Mbeans loaded by the engine. - */ - private List mbeans; - - /** * The JVM Route ID for this Tomcat instance. All Route ID's must be unique * across the cluster. @@ -226,14 +205,6 @@ public class StandardEngine this.service = service; } - public String getMbeansFile() { - return mbeansFile; - } - - public void setMbeansFile(String mbeansFile) { - this.mbeansFile = mbeansFile; - } - public String getBaseDir() { if( baseDir==null ) { baseDir=System.getProperty("catalina.base"); @@ -315,42 +286,6 @@ public class StandardEngine } } - if( mbeansFile == null ) { - String defaultMBeansFile=getBaseDir() + "/conf/tomcat5-mbeans.xml"; - File f=new File( defaultMBeansFile ); - if( f.exists() ) mbeansFile=f.getAbsolutePath(); - } - if( mbeansFile != null ) { - readEngineMbeans(); - } - if( mbeans != null ) { - try { - Registry.getRegistry(null, null).invoke(mbeans, "init", false); - } catch (Exception e) { - log.error("Error in init() for " + mbeansFile, e); - } - } - - // not needed since the following if statement does the same thing the right way - // remove later after checking - //if( service==null ) { - // try { - // ObjectName serviceName=getParentName(); - // if( mserver.isRegistered( serviceName )) { - // log.info("Registering with the service "); - // try { - // mserver.invoke( serviceName, "setContainer", - // new Object[] { this }, - // new String[] { "org.apache.catalina.Container" } ); - // } catch( Exception ex ) { - // ex.printStackTrace(); - // } - // } - // } catch( Exception ex ) { - // log.error("Error registering with service "); - // } - //} - if( service==null ) { // for consistency...: we are probably in embedded mode try { @@ -364,37 +299,6 @@ public class StandardEngine } - @Override - protected void destroyInternal() throws LifecycleException { - - if( mbeans != null ) { - try { - Registry.getRegistry(null, null) - .invoke(mbeans, "destroy", false); - } catch (Exception e) { - log.error(sm.getString("standardEngine.unregister.mbeans.failed" ,mbeansFile), e); - } - } - // - if( mbeans != null ) { - try { - for( int i=0; i