Author: markt
Date: Fri Dec 23 19:28:58 2011
New Revision: 1222809
URL: http://svn.apache.org/viewvc?rev=1222809&view=rev
Log:
More unused code removal.
A little refactoring to allow some methods to be removed to simplify
later refactoring
Modified:
tomcat/trunk/java/org/apache/catalina/ha/jmx/ClusterJmxHelper.java
tomcat/trunk/java/org/apache/tomcat/util/modeler/Registry.java
tomcat/trunk/java/org/apache/tomcat/util/modeler/RegistryMBean.java
Modified: tomcat/trunk/java/org/apache/catalina/ha/jmx/ClusterJmxHelper.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/jmx/ClusterJmxHelper.java?rev=1222809&r1=1222808&r2=1222809&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ha/jmx/ClusterJmxHelper.java
(original)
+++ tomcat/trunk/java/org/apache/catalina/ha/jmx/ClusterJmxHelper.java Fri Dec
23 19:28:58 2011
@@ -37,12 +37,10 @@ import org.apache.tomcat.util.modeler.Re
*/
public class ClusterJmxHelper {
- protected static Registry registry = Registry.getRegistry(null,null);
+ protected static final Registry registry = Registry.getRegistry(null,null);
private static final Log log = LogFactory.getLog(ClusterJmxHelper.class);
- protected static boolean jmxEnabled = true;
-
protected static MBeanServer mbeanServer = null;
public static Registry getRegistry() {
@@ -63,7 +61,8 @@ public class ClusterJmxHelper {
protected static boolean initMetaData(Class<?> clazz) {
try {
if (clazz==null) return false;
-
getRegistry().loadMetadata(clazz.getResourceAsStream("mbeans-descriptors.xml"));
+ getRegistry().load(null,
+ clazz.getResourceAsStream("mbeans-descriptors.xml"), null);
}catch (Exception x) {
log.warn("Unable to load meta data for class:"+clazz.getName());
return false;
Modified: tomcat/trunk/java/org/apache/tomcat/util/modeler/Registry.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/modeler/Registry.java?rev=1222809&r1=1222808&r2=1222809&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/modeler/Registry.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/modeler/Registry.java Fri Dec 23
19:28:58 2011
@@ -196,44 +196,6 @@ public class Registry implements Registr
searchedPaths=new HashMap<String,URL>();
}
- /**
- * Load an extended mlet file. The source can be an URL, File or
- * InputStream.
- *
- * All mbeans will be instantiated, registered and the attributes will be
- * set. The result is a list of ObjectNames.
- *
- * @param source InputStream or URL of the file
- * @param cl ClassLoader to be used to load the mbeans, or null to use the
- * default JMX mechanism ( i.e. all registered loaders )
- * @return List of ObjectName for the loaded mbeans
- * @throws Exception
- *
- * @since 1.1
- */
- @Override
- public List<ObjectName> loadMBeans( Object source, ClassLoader cl )
- throws Exception
- {
- return load("MbeansSource", source, null );
- }
-
-
- /** Load descriptors. The source can be a File or URL or InputStream for
the
- * descriptors file. In the case of File and URL, if the extension is
".ser"
- * a serialized version will be loaded.
- *
- * This method should be used to explicitly load metadata - but this is not
- * required in most cases. The registerComponent() method will find
metadata
- * in the same package.
- *
- * @param source
- */
- @Override
- public void loadMetadata(Object source ) throws Exception {
- load( null, source, null );
- }
-
/** Register a bean by creating a modeler mbean and adding it to the
* MBeanServer.
*
Modified: tomcat/trunk/java/org/apache/tomcat/util/modeler/RegistryMBean.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/modeler/RegistryMBean.java?rev=1222809&r1=1222808&r2=1222809&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/modeler/RegistryMBean.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/modeler/RegistryMBean.java Fri Dec
23 19:28:58 2011
@@ -40,24 +40,6 @@ import javax.management.ObjectName;
*/
public interface RegistryMBean {
- /**
- * Load an extended mlet file. The source can be an URL, File or
- * InputStream.
- *
- * All mbeans will be instantiated, registered and the attributes will be
- * set. The result is a list of ObjectNames.
- *
- * @param source InputStream or URL of the file
- * @param cl ClassLoader to be used to load the mbeans, or null to use the
- * default JMX mechanism ( i.e. all registered loaders )
- * @return List of ObjectName for the loaded mbeans
- * @throws Exception
- *
- * @since 1.1
- */
- public List<ObjectName> loadMBeans( Object source, ClassLoader cl )
- throws Exception;
-
/** Invoke an operation on a set of mbeans.
*
* @param mbeans List of ObjectNames
@@ -129,14 +111,4 @@ public interface RegistryMBean {
* @since 1.1
*/
public void stop();
-
- /** Load descriptors. The source can be a File, URL pointing to an
- * mbeans-descriptors.xml.
- *
- * Also ( experimental for now ) a ClassLoader - in which case META-INF/
will
- * be used.
- *
- * @param source
- */
- public void loadMetadata(Object source ) throws Exception;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]