You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/10/04 15:53:13 UTC

[tomcat] branch 7.0.x updated (a175cad -> 12a37a8)

This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


    from a175cad  Align with 8.5.x
     new e502145  Polish. Formatting.
     new 12a37a8  Polish. Align with 8.5.x. Improve i18n.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../util/modeler}/LocalStrings.properties          |   3 +-
 .../modeler/LocalStrings_fr.properties}            |   4 +-
 .../modeler/LocalStrings_ja.properties}            |   4 +-
 .../util/modeler/LocalStrings_ko.properties}       |   4 +-
 .../util/modeler/LocalStrings_zh_CN.properties     |   3 +-
 .../modules/MbeansDescriptorsDigesterSource.java   |  65 +--------
 .../MbeansDescriptorsIntrospectionSource.java      | 162 +++++++++------------
 .../tomcat/util/modeler/modules/ModelerSource.java |  28 +++-
 8 files changed, 108 insertions(+), 165 deletions(-)
 copy java/org/apache/{catalina/tribes/membership => tomcat/util/modeler}/LocalStrings.properties (87%)
 copy java/org/apache/tomcat/{websocket/pojo/LocalStrings_ru.properties => util/modeler/LocalStrings_fr.properties} (84%)
 copy java/org/apache/tomcat/{websocket/pojo/LocalStrings_ru.properties => util/modeler/LocalStrings_ja.properties} (84%)
 copy java/org/apache/{catalina/ha/deploy/LocalStrings_ru.properties => tomcat/util/modeler/LocalStrings_ko.properties} (83%)
 copy res/META-INF/tomcat7-websocket.jar/services/javax.servlet.ServletContainerInitializer => java/org/apache/tomcat/util/modeler/LocalStrings_zh_CN.properties (93%)


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


[tomcat] 01/02: Polish. Formatting.

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit e502145726b5e01499e8fad9ad787770a040d8b2
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Oct 4 16:23:40 2019 +0100

    Polish. Formatting.
---
 .../MbeansDescriptorsIntrospectionSource.java      | 83 ++++++++++++----------
 1 file changed, 44 insertions(+), 39 deletions(-)

diff --git a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
index 6febc94..ba90d47 100644
--- a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
+++ b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
@@ -194,7 +194,7 @@ public class MbeansDescriptorsIntrospectionSource extends ModelerSource
     }
 
     /**
-     * Process the methods and extract 'attributes', methods, etc
+     * Process the methods and extract 'attributes', methods, etc.
      *
      * @param realClass The class to process
      * @param methods The methods to process
@@ -203,76 +203,81 @@ public class MbeansDescriptorsIntrospectionSource extends ModelerSource
      * @param setAttMap The settable attributes map
      * @param invokeAttMap The invokable attributes map
      */
-    private void initMethods(Class<?> realClass,
-                             Method methods[],
-                             Hashtable<String,Method> attMap,
-                             Hashtable<String,Method> getAttMap,
-                             Hashtable<String,Method> setAttMap,
-                             Hashtable<String,Method> invokeAttMap)
-    {
+    private void initMethods(Class<?> realClass, Method methods[], Hashtable<String,Method> attMap,
+            Hashtable<String,Method> getAttMap, Hashtable<String,Method> setAttMap,
+            Hashtable<String,Method> invokeAttMap) {
+
         for (int j = 0; j < methods.length; ++j) {
-            String name=methods[j].getName();
+            String name = methods[j].getName();
 
-            if( Modifier.isStatic(methods[j].getModifiers()))
+            if (Modifier.isStatic(methods[j].getModifiers())) {
                 continue;
-            if( ! Modifier.isPublic( methods[j].getModifiers() ) ) {
-                if( log.isDebugEnabled())
+            }
+            if (!Modifier.isPublic(methods[j].getModifiers())) {
+                if (log.isDebugEnabled()) {
                     log.debug("Not public " + methods[j] );
+                }
                 continue;
             }
-            if( methods[j].getDeclaringClass() == Object.class )
+            if (methods[j].getDeclaringClass() == Object.class) {
                 continue;
+            }
             Class<?> params[] = methods[j].getParameterTypes();
 
-            if( name.startsWith( "get" ) && params.length==0) {
+            if (name.startsWith("get") && params.length==0) {
                 Class<?> ret = methods[j].getReturnType();
-                if( ! supportedType( ret ) ) {
-                    if( log.isDebugEnabled() )
+                if (!supportedType(ret)) {
+                    if (log.isDebugEnabled()) {
                         log.debug("Unsupported type " + methods[j]);
+                    }
                     continue;
                 }
-                name=unCapitalize( name.substring(3));
+                name=unCapitalize(name.substring(3));
 
-                getAttMap.put( name, methods[j] );
+                getAttMap.put(name, methods[j]);
                 // just a marker, we don't use the value
-                attMap.put( name, methods[j] );
-            } else if( name.startsWith( "is" ) && params.length==0) {
+                attMap.put(name, methods[j]);
+            } else if(name.startsWith("is") && params.length == 0) {
                 Class<?> ret = methods[j].getReturnType();
-                if( Boolean.TYPE != ret  ) {
-                    if( log.isDebugEnabled() )
+                if (Boolean.TYPE != ret) {
+                    if (log.isDebugEnabled()) {
                         log.debug("Unsupported type " + methods[j] + " " + ret );
+                    }
                     continue;
                 }
-                name=unCapitalize( name.substring(2));
+                name = unCapitalize(name.substring(2));
 
-                getAttMap.put( name, methods[j] );
+                getAttMap.put(name, methods[j]);
                 // just a marker, we don't use the value
-                attMap.put( name, methods[j] );
+                attMap.put(name, methods[j]);
 
-            } else if( name.startsWith( "set" ) && params.length==1) {
-                if( ! supportedType( params[0] ) ) {
-                    if( log.isDebugEnabled() )
+            } else if (name.startsWith("set") && params.length == 1) {
+                if (!supportedType(params[0])) {
+                    if (log.isDebugEnabled()) {
                         log.debug("Unsupported type " + methods[j] + " " + params[0]);
+                    }
                     continue;
                 }
-                name=unCapitalize( name.substring(3));
-                setAttMap.put( name, methods[j] );
-                attMap.put( name, methods[j] );
+                name = unCapitalize(name.substring(3));
+                setAttMap.put(name, methods[j]);
+                attMap.put(name, methods[j]);
             } else {
-                if( params.length == 0 ) {
-                    if( specialMethods.get( methods[j].getName() ) != null )
+                if (params.length == 0) {
+                    if (specialMethods.get(methods[j].getName()) != null) {
                         continue;
-                    invokeAttMap.put( name, methods[j]);
+                    }
+                    invokeAttMap.put(name, methods[j]);
                 } else {
-                    boolean supported=true;
-                    for( int i=0; i<params.length; i++ ) {
-                        if( ! supportedType( params[i])) {
-                            supported=false;
+                    boolean supported = true;
+                    for (int i = 0; i < params.length; i++ ) {
+                        if (!supportedType(params[i])) {
+                            supported = false;
                             break;
                         }
                     }
-                    if( supported )
+                    if (supported) {
                         invokeAttMap.put( name, methods[j]);
+                    }
                 }
             }
         }


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


[tomcat] 02/02: Polish. Align with 8.5.x. Improve i18n.

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 12a37a8d0838a7a276838b2fa30c9839a38e366b
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Oct 4 16:51:36 2019 +0100

    Polish. Align with 8.5.x. Improve i18n.
---
 .../tomcat/util/modeler/LocalStrings.properties    | 17 +++++
 .../tomcat/util/modeler/LocalStrings_fr.properties | 18 +++++
 .../tomcat/util/modeler/LocalStrings_ja.properties | 18 +++++
 .../tomcat/util/modeler/LocalStrings_ko.properties | 18 +++++
 .../util/modeler/LocalStrings_zh_CN.properties     | 17 +++++
 .../modules/MbeansDescriptorsDigesterSource.java   | 65 ++----------------
 .../MbeansDescriptorsIntrospectionSource.java      | 79 +++++++---------------
 .../tomcat/util/modeler/modules/ModelerSource.java | 28 +++++---
 8 files changed, 140 insertions(+), 120 deletions(-)

diff --git a/java/org/apache/tomcat/util/modeler/LocalStrings.properties b/java/org/apache/tomcat/util/modeler/LocalStrings.properties
new file mode 100644
index 0000000..b3d9b47
--- /dev/null
+++ b/java/org/apache/tomcat/util/modeler/LocalStrings.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+modules.digesterParseError=Error parsing registry data
+modules.readDescriptorsError=Error reading descriptors
diff --git a/java/org/apache/tomcat/util/modeler/LocalStrings_fr.properties b/java/org/apache/tomcat/util/modeler/LocalStrings_fr.properties
new file mode 100644
index 0000000..30d80ca
--- /dev/null
+++ b/java/org/apache/tomcat/util/modeler/LocalStrings_fr.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+modules.digesterParseError=Erreur lors de l'analyse des données du registre
+modules.readDescriptorsError=Erreur lors de la lecture des descripteurs
+
diff --git a/java/org/apache/tomcat/util/modeler/LocalStrings_ja.properties b/java/org/apache/tomcat/util/modeler/LocalStrings_ja.properties
new file mode 100644
index 0000000..21c9711
--- /dev/null
+++ b/java/org/apache/tomcat/util/modeler/LocalStrings_ja.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+modules.digesterParseError=レジストリデータの解析エラー
+modules.readDescriptorsError=ディスクリプタ読み取り中のエラー
+
diff --git a/java/org/apache/tomcat/util/modeler/LocalStrings_ko.properties b/java/org/apache/tomcat/util/modeler/LocalStrings_ko.properties
new file mode 100644
index 0000000..ffcf3fd
--- /dev/null
+++ b/java/org/apache/tomcat/util/modeler/LocalStrings_ko.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+modules.digesterParseError=레지스트리 데이터를 파싱하는 중 오류 발생
+modules.readDescriptorsError=Descriptor들을 읽는 중 오류 발생
+
diff --git a/java/org/apache/tomcat/util/modeler/LocalStrings_zh_CN.properties b/java/org/apache/tomcat/util/modeler/LocalStrings_zh_CN.properties
new file mode 100644
index 0000000..519a3cd
--- /dev/null
+++ b/java/org/apache/tomcat/util/modeler/LocalStrings_zh_CN.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+modules.readDescriptorsError=读取描述文件出错
+
diff --git a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java
index 9ed89ee..4d1983b 100644
--- a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java
+++ b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java
@@ -21,7 +21,6 @@ package org.apache.tomcat.util.modeler.modules;
 import java.io.InputStream;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import javax.management.ObjectName;
@@ -38,9 +37,9 @@ public class MbeansDescriptorsDigesterSource extends ModelerSource
             LogFactory.getLog(MbeansDescriptorsDigesterSource.class);
     private static final Object dLock = new Object();
 
-    Registry registry;
+    private Registry registry;
     String type;
-    List<ObjectName> mbeans = new ArrayList<ObjectName>();
+    private final List<ObjectName> mbeans = new ArrayList<ObjectName>();
     protected static volatile Digester digester = null;
 
     protected static Digester createDigester() {
@@ -75,56 +74,6 @@ public class MbeansDescriptorsDigesterSource extends ModelerSource
                 "addAttribute",
             "org.apache.tomcat.util.modeler.AttributeInfo");
 
-        /*digester.addObjectCreate
-            ("mbeans-descriptors/mbean/attribute/descriptor/field",
-            "org.apache.tomcat.util.modeler.FieldInfo");
-        digester.addSetProperties
-            ("mbeans-descriptors/mbean/attribute/descriptor/field");
-        digester.addSetNext
-            ("mbeans-descriptors/mbean/attribute/descriptor/field",
-                "addField",
-            "org.apache.tomcat.util.modeler.FieldInfo");
-
-        digester.addObjectCreate
-            ("mbeans-descriptors/mbean/constructor",
-            "org.apache.tomcat.util.modeler.ConstructorInfo");
-        digester.addSetProperties
-            ("mbeans-descriptors/mbean/constructor");
-        digester.addSetNext
-            ("mbeans-descriptors/mbean/constructor",
-                "addConstructor",
-            "org.apache.tomcat.util.modeler.ConstructorInfo");
-
-        digester.addObjectCreate
-            ("mbeans-descriptors/mbean/constructor/descriptor/field",
-            "org.apache.tomcat.util.modeler.FieldInfo");
-        digester.addSetProperties
-            ("mbeans-descriptors/mbean/constructor/descriptor/field");
-        digester.addSetNext
-            ("mbeans-descriptors/mbean/constructor/descriptor/field",
-                "addField",
-            "org.apache.tomcat.util.modeler.FieldInfo");
-
-        digester.addObjectCreate
-            ("mbeans-descriptors/mbean/constructor/parameter",
-            "org.apache.tomcat.util.modeler.ParameterInfo");
-        digester.addSetProperties
-            ("mbeans-descriptors/mbean/constructor/parameter");
-        digester.addSetNext
-            ("mbeans-descriptors/mbean/constructor/parameter",
-                "addParameter",
-            "org.apache.tomcat.util.modeler.ParameterInfo");
-
-        digester.addObjectCreate
-            ("mbeans-descriptors/mbean/descriptor/field",
-            "org.apache.tomcat.util.modeler.FieldInfo");
-        digester.addSetProperties
-            ("mbeans-descriptors/mbean/descriptor/field");
-        digester.addSetNext
-            ("mbeans-descriptors/mbean/descriptor/field",
-                "addField",
-            "org.apache.tomcat.util.modeler.FieldInfo");
-        */
         digester.addObjectCreate
             ("mbeans-descriptors/mbean/notification",
             "org.apache.tomcat.util.modeler.NotificationInfo");
@@ -225,8 +174,7 @@ public class MbeansDescriptorsDigesterSource extends ModelerSource
 
         InputStream stream = (InputStream) source;
 
-        ArrayList<ManagedBean> loadedMbeans = new ArrayList<ManagedBean>();
-
+        List<ManagedBean> loadedMbeans = new ArrayList<ManagedBean>();
         synchronized(dLock) {
             if (digester == null) {
                 digester = createDigester();
@@ -238,16 +186,15 @@ public class MbeansDescriptorsDigesterSource extends ModelerSource
                 digester.push(loadedMbeans);
                 digester.parse(stream);
             } catch (Exception e) {
-                log.error("Error digesting Registry data", e);
+                log.error(sm.getString("modules.digesterParseError"), e);
                 throw e;
             } finally {
                 digester.reset();
             }
 
         }
-        Iterator<ManagedBean> iter = loadedMbeans.iterator();
-        while (iter.hasNext()) {
-            registry.addManagedBean(iter.next());
+        for (ManagedBean loadedMbean : loadedMbeans) {
+            registry.addManagedBean(loadedMbean);
         }
     }
 }
diff --git a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
index ba90d47..f45aba8 100644
--- a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
+++ b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
@@ -41,9 +41,9 @@ public class MbeansDescriptorsIntrospectionSource extends ModelerSource
 {
     private static final Log log = LogFactory.getLog(MbeansDescriptorsIntrospectionSource.class);
 
-    Registry registry;
-    String type;
-    List<ObjectName> mbeans = new ArrayList<ObjectName>();
+    private Registry registry;
+    private String type;
+    private final List<ObjectName> mbeans = new ArrayList<ObjectName>();
 
     public void setRegistry(Registry reg) {
         this.registry=reg;
@@ -57,9 +57,10 @@ public class MbeansDescriptorsIntrospectionSource extends ModelerSource
         this.location=loc;
     }
 
-    /** Used if a single component is loaded
+    /**
+     * Used if a single component is loaded
      *
-     * @param type
+     * @param type The type
      */
     public void setType( String type ) {
        this.type=type;
@@ -90,7 +91,7 @@ public class MbeansDescriptorsIntrospectionSource extends ModelerSource
             registry.addManagedBean(managed);
 
         } catch( Exception ex ) {
-            log.error( "Error reading descriptors ", ex);
+            log.error(sm.getString("modules.readDescriptorsError"), ex);
         }
     }
 
@@ -98,18 +99,13 @@ public class MbeansDescriptorsIntrospectionSource extends ModelerSource
 
     // ------------ Implementation for non-declared introspection classes
 
-    static Hashtable<String,String> specialMethods =
-        new Hashtable<String,String>();
+    private static final Hashtable<String,String> specialMethods = new Hashtable<String,String>();
     static {
         specialMethods.put( "preDeregister", "");
         specialMethods.put( "postDeregister", "");
     }
 
-    private static String strArray[]=new String[0];
-    private static ObjectName objNameArray[]=new ObjectName[0];
-    // createMBean == registerClass + registerMBean
-
-    private static Class<?>[] supportedTypes  = new Class[] {
+    private static final Class<?>[] supportedTypes  = new Class[] {
         Boolean.class,
         Boolean.TYPE,
         Byte.class,
@@ -127,11 +123,11 @@ public class MbeansDescriptorsIntrospectionSource extends ModelerSource
         Double.class,
         Double.TYPE,
         String.class,
-        strArray.getClass(),
+        String[].class,
         BigDecimal.class,
         BigInteger.class,
         ObjectName.class,
-        objNameArray.getClass(),
+        Object[].class,
         java.io.File.class,
     };
 
@@ -349,49 +345,27 @@ public class MbeansDescriptorsIntrospectionSource extends ModelerSource
                     mbean.addAttribute(ai);
             }
 
+            // This map is populated by iterating the methods (which end up as
+            // values in the Map) and obtaining the key from the value. It is
+            // impossible for a key to be associated with a null value.
             for (Entry<String,Method> entry : invokeAttMap.entrySet()) {
                 String name = entry.getKey();
                 Method m = entry.getValue();
-                if(m != null) {
-                    OperationInfo op=new OperationInfo();
-                    op.setName(name);
-                    op.setReturnType(m.getReturnType().getName());
-                    op.setDescription("Introspected operation " + name);
-                    Class<?> parms[] = m.getParameterTypes();
-                    for(int i=0; i<parms.length; i++ ) {
-                        ParameterInfo pi=new ParameterInfo();
-                        pi.setType(parms[i].getName());
-                        pi.setName(("param" + i).intern());
-                        pi.setDescription(("Introspected parameter param" + i).intern());
-                        op.addParameter(pi);
-                    }
-                    mbean.addOperation(op);
-                } else {
-                    log.error("Null arg method for [" + name + "]");
-                }
-            }
 
-            /*Constructor[] constructors = realClass.getConstructors();
-            for(int i=0;i<constructors.length;i++) {
-                ConstructorInfo info = new ConstructorInfo();
-                String className = realClass.getName();
-                int nIndex = -1;
-                if((nIndex = className.lastIndexOf('.'))!=-1) {
-                    className = className.substring(nIndex+1);
-                }
-                info.setName(className);
-                info.setDescription(constructors[i].getName());
-                Class classes[] = constructors[i].getParameterTypes();
-                for(int j=0;j<classes.length;j++) {
-                    ParameterInfo pi = new ParameterInfo();
-                    pi.setType(classes[j].getName());
-                    pi.setName("param" + j);
-                    pi.setDescription("Introspected parameter param" + j);
-                    info.addParameter(pi);
+                OperationInfo op=new OperationInfo();
+                op.setName(name);
+                op.setReturnType(m.getReturnType().getName());
+                op.setDescription("Introspected operation " + name);
+                Class<?> parms[] = m.getParameterTypes();
+                for(int i=0; i<parms.length; i++ ) {
+                    ParameterInfo pi=new ParameterInfo();
+                    pi.setType(parms[i].getName());
+                    pi.setName(("param" + i).intern());
+                    pi.setDescription(("Introspected parameter param" + i).intern());
+                    op.addParameter(pi);
                 }
-                mbean.addConstructor(info);
+                mbean.addOperation(op);
             }
-            */
 
             if( log.isDebugEnabled())
                 log.debug("Setting name: " + type );
@@ -424,4 +398,3 @@ public class MbeansDescriptorsIntrospectionSource extends ModelerSource
 
 }
 
-// End of class: MbeanDescriptorsIntrospectionSource
diff --git a/java/org/apache/tomcat/util/modeler/modules/ModelerSource.java b/java/org/apache/tomcat/util/modeler/modules/ModelerSource.java
index 4a5f00a..4281063 100644
--- a/java/org/apache/tomcat/util/modeler/modules/ModelerSource.java
+++ b/java/org/apache/tomcat/util/modeler/modules/ModelerSource.java
@@ -26,20 +26,23 @@ import java.util.List;
 import javax.management.ObjectName;
 
 import org.apache.tomcat.util.modeler.Registry;
+import org.apache.tomcat.util.res.StringManager;
 
-/** Source for descriptor data. More sources can be added.
- *
+/**
+ * Source for descriptor data. More sources can be added.
  */
 public abstract class ModelerSource {
+    protected static final StringManager sm = StringManager.getManager(Registry.class);
     protected Object source;
     @Deprecated
     protected String location;
 
-    /** Load data, returns a list of items.
+    /**
+     * Load data, returns a list of items.
      *
-     * @param registry
-     * @param location
-     * @param type
+     * @param registry The registry
+     * @param location Ignored
+     * @param type The bean registry type
      * @param source Introspected object or some other source
      * @throws Exception
      *
@@ -52,7 +55,8 @@ public abstract class ModelerSource {
         return loadDescriptors(registry, type, source);
     }
 
-    /** Callback from the BaseMBean to notify that an attribute has changed.
+    /**
+     * Callback from the BaseMBean to notify that an attribute has changed.
      * Can be used to implement persistence.
      *
      * @param oname
@@ -67,7 +71,6 @@ public abstract class ModelerSource {
     }
 
     /**
-     *
      * @deprecated Unused - will be removed in Tomcat 8.0.x
      */
     @Deprecated
@@ -97,6 +100,15 @@ public abstract class ModelerSource {
     }
 
 
+    /**
+     * Load data, returns a list of items.
+     *
+     * @param registry The registry
+     * @param type The bean registry type
+     * @param source Introspected object or some other source
+     * @return a list of object names
+     * @throws Exception Error loading descriptors
+     */
     public abstract List<ObjectName> loadDescriptors(Registry registry,
             String type, Object source) throws Exception;
 }


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