From: Elias R. (JIRA) <jir...@jb...> - 2005-09-07 21:00:39
|
PropertyEditorManagerService should probably use Thread context loader ---------------------------------------------------------------------- Key: JBAS-2228 URL: http://jira.jboss.com/jira/browse/JBAS-2228 Project: JBoss Application Server Type: Feature Request Versions: JBossAS-4.0.3RC2, JBossAS-3.2.8 Final, JBossAS-5.0 Alpha Reporter: Elias Ross 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. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |