Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-2228

PropertyEditorManagerService should probably use Thread context loader

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Done
    • Major
    • JBossAS-4.0.3RC2, JBossAS-3.2.8RC1, JBossAS-5.0.0.Beta1
    • None
    • None

    Description

      I want to register a property editor that uses classes within my .ear deployment.

      <mbean code="org.jboss.varia.property.PropertyEditorManagerService"
      name="mqube.smsgw:type=Service,name=PropertyEditorManager">
      <attribute name="Editors">
      com.foo.ConnectionClass=com.foo.ConnectionClassEditor
      </attribute>
      </mbean>

      Suggested changes below:

      diff -b -B -U8 -r1.5 PropertyEditorManagerService.java
      — src/main/org/jboss/varia/property/PropertyEditorManagerService.java 27 Aug 2003 04:34:17 -0000 1.5
      +++ src/main/org/jboss/varia/property/PropertyEditorManagerService.java 7 Sep 2005 20:59:06 -0000
      @@ -91,19 +91,19 @@
      *

      • @param typeName The classname of the objetcs to be edited.
      • @param editorTypeName The class of the editor.
        */
        public void registerEditor(final String typeName,
        final String editorTypeName)
        throws ClassNotFoundException { - Class type = Class.forName(typeName); - Class editorType = Class.forName(editorTypeName); - + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + Class type = cl.loadClass(typeName); + Class editorType = cl.loadClass(editorTypeName); PropertyEditorManager.registerEditor(type, editorType); }

      /** Turn a string[] into an comma seperated list. */
      private String makeString(final String[] array)
      {
      StringBuffer buff = new StringBuffer();

      I don't know what the implications of doing this might be. Please advise.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              genman_jira Elias Ross (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: