Index: system-jmx/.classpath =================================================================== --- system-jmx/.classpath (revision 112986) +++ system-jmx/.classpath (working copy) @@ -25,5 +25,6 @@ + Index: system-jmx/src/tests/org/jboss/test/system/metadata/value/valuefactory/test/ServiceValueFactoryParameterMetaDataUnitTestCase.java =================================================================== --- system-jmx/src/tests/org/jboss/test/system/metadata/value/valuefactory/test/ServiceValueFactoryParameterMetaDataUnitTestCase.java (revision 112986) +++ system-jmx/src/tests/org/jboss/test/system/metadata/value/valuefactory/test/ServiceValueFactoryParameterMetaDataUnitTestCase.java (working copy) @@ -25,10 +25,10 @@ import static org.jboss.system.metadata.ServiceValueFactoryParameterMetaData.getValue; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; +import org.jboss.common.beans.property.ElementEditor; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.deployers.spi.DeploymentException; -import org.jboss.util.propertyeditor.ElementEditor; import org.w3c.dom.Element; import junit.framework.TestCase; @@ -70,16 +70,16 @@ { super.setUp(); - existingElementEditor = PropertyEditorManager.findEditor(Element.class); + existingElementEditor = PropertyEditorFinder.getInstance().find(Element.class); if (existingElementEditor == null) - PropertyEditorManager.registerEditor(Element.class, ElementEditor.class); + PropertyEditorFinder.getInstance().register(Element.class, ElementEditor.class); } @Override protected void tearDown() throws Exception { if (existingElementEditor == null) - PropertyEditorManager.registerEditor(Element.class, null); + PropertyEditorFinder.getInstance().register(Element.class, null); super.tearDown(); } Index: system-jmx/src/tests/org/jboss/test/system/controller/legacy/OldServiceCreator.java =================================================================== --- system-jmx/src/tests/org/jboss/test/system/controller/legacy/OldServiceCreator.java (revision 112986) +++ system-jmx/src/tests/org/jboss/test/system/controller/legacy/OldServiceCreator.java (working copy) @@ -22,7 +22,6 @@ package org.jboss.test.system.controller.legacy; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.lang.reflect.Constructor; import java.lang.reflect.UndeclaredThrowableException; import java.net.URL; @@ -31,6 +30,7 @@ import javax.management.ObjectInstance; import javax.management.ObjectName; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.deployment.DeploymentException; import org.jboss.logging.Logger; import org.jboss.mx.service.ServiceConstants; @@ -346,7 +346,7 @@ } // Convert the string to the real value - PropertyEditor editor = PropertyEditorManager.findEditor(typeClass); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(typeClass); if (editor == null) { try Index: system-jmx/src/tests/org/jboss/test/system/controller/legacy/OldServiceConfigurator.java =================================================================== --- system-jmx/src/tests/org/jboss/test/system/controller/legacy/OldServiceConfigurator.java (revision 112986) +++ system-jmx/src/tests/org/jboss/test/system/controller/legacy/OldServiceConfigurator.java (working copy) @@ -22,7 +22,6 @@ package org.jboss.test.system.controller.legacy; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; @@ -49,6 +48,8 @@ import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; +import org.jboss.common.beans.property.BeanUtils; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.deployment.DeploymentException; import org.jboss.logging.Logger; import org.jboss.mx.util.JMXExceptionDecoder; @@ -58,7 +59,6 @@ import org.jboss.system.ServiceContext; import org.jboss.util.Classes; import org.jboss.util.StringPropertyReplacer; -import org.jboss.util.propertyeditor.PropertyEditors; import org.jboss.util.xml.DOMWriter; import org.jboss.xb.binding.Unmarshaller; import org.jboss.xb.binding.UnmarshallerFactory; @@ -81,15 +81,6 @@ */ public class OldServiceConfigurator { - /** - * Augment the PropertyEditorManager search path to incorporate the JBoss - * specific editors. This simply references the PropertyEditors.class to - * invoke its static initialization block. - */ - static - { - PropertyEditors.init(); - } // Private Data -------------------------------------------------- @@ -512,7 +503,7 @@ // Replace any ${x} references in the element text if (replace) { - PropertyEditor editor = PropertyEditorManager.findEditor(typeClass); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(typeClass); if (editor == null) { log.warn("Cannot perform property replace on Element"); @@ -530,7 +521,7 @@ if (value == null) { - PropertyEditor editor = PropertyEditorManager.findEditor(typeClass); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(typeClass); if (editor == null) { throw new DeploymentException @@ -595,7 +586,7 @@ } // Apply the properties to the bean - PropertyEditors.mapJavaBeanProperties(bean, beanProps); + BeanUtils.mapJavaBeanProperties(bean, beanProps); return bean; } Index: system-jmx/src/main/org/jboss/system/metadata/ServiceTextValueMetaData.java =================================================================== --- system-jmx/src/main/org/jboss/system/metadata/ServiceTextValueMetaData.java (revision 112986) +++ system-jmx/src/main/org/jboss/system/metadata/ServiceTextValueMetaData.java (working copy) @@ -22,14 +22,15 @@ package org.jboss.system.metadata; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.io.Serializable; import javax.management.MBeanAttributeInfo; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.deployment.DeploymentException; import org.jboss.util.Classes; -import org.jboss.util.propertyeditor.PropertyEditors; +import org.jboss.util.propertyeditor.BlockingModeEditor; +import org.jboss.util.threadpool.BlockingMode; /** * ServiceTextValueMetaData. @@ -44,21 +45,23 @@ * @author Adrian Brock * @version $Revision$ */ +@SuppressWarnings("deprecation") public class ServiceTextValueMetaData extends AbstractMetaDataVisitorNode implements ServiceValueMetaData, Serializable { + static + { + //Ugly hack. Here lies PropertyEditors.init(). Below code is progeny. It is required to properly instantiate + //ThreadPools. The threadpools dont do that for themselves. ThreadPools are in common-core. + try + { + PropertyEditorFinder.getInstance().register(BlockingMode.class, BlockingModeEditor.class); + } + catch (Exception ignored) + { + } + } private static final long serialVersionUID = 1; - - static - { - try - { - PropertyEditors.init(); - } - catch (Exception ignored) - { - } - } /** The text */ private String text; @@ -119,7 +122,7 @@ } } - PropertyEditor editor = PropertyEditorManager.findEditor(typeClass); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(typeClass); if (editor == null) throw new DeploymentException("No property editor for attribute: " + attributeInfo.getName() + "; type=" + typeClass.getName()); Index: system-jmx/src/main/org/jboss/system/metadata/ServiceConstructorMetaData.java =================================================================== --- system-jmx/src/main/org/jboss/system/metadata/ServiceConstructorMetaData.java (revision 112986) +++ system-jmx/src/main/org/jboss/system/metadata/ServiceConstructorMetaData.java (working copy) @@ -22,10 +22,11 @@ package org.jboss.system.metadata; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.io.Serializable; import java.lang.reflect.Constructor; +import org.jboss.common.beans.property.BeanUtils; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.system.ConfigurationException; import org.jboss.util.Classes; import org.jboss.util.StringPropertyReplacer; @@ -147,7 +148,7 @@ typeClass = cl.loadClass(signature[i]); // Convert the string to the real value - PropertyEditor editor = PropertyEditorManager.findEditor(typeClass); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(typeClass); if (editor == null) { try Index: system-jmx/src/main/org/jboss/system/metadata/ServiceElementValueMetaData.java =================================================================== --- system-jmx/src/main/org/jboss/system/metadata/ServiceElementValueMetaData.java (revision 112986) +++ system-jmx/src/main/org/jboss/system/metadata/ServiceElementValueMetaData.java (working copy) @@ -22,9 +22,9 @@ package org.jboss.system.metadata; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.io.Serializable; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.logging.Logger; import org.jboss.util.StringPropertyReplacer; import org.w3c.dom.Element; @@ -97,7 +97,7 @@ // Replace any ${x} references in the element text if (valueContext.isReplace()) { - PropertyEditor editor = PropertyEditorManager.findEditor(Element.class); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(Element.class); if (editor == null) log.warn("Cannot perform property replace on Element"); else Index: system-jmx/src/main/org/jboss/system/metadata/ServiceJavaBeanValueMetaData.java =================================================================== --- system-jmx/src/main/org/jboss/system/metadata/ServiceJavaBeanValueMetaData.java (revision 112986) +++ system-jmx/src/main/org/jboss/system/metadata/ServiceJavaBeanValueMetaData.java (working copy) @@ -25,8 +25,8 @@ import javax.management.MBeanAttributeInfo; +import org.jboss.common.beans.property.BeanUtils; import org.jboss.deployment.DeploymentException; -import org.jboss.util.propertyeditor.PropertyEditors; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -44,6 +44,7 @@ * @author Adrian Brock * @version $Revision$ */ +@SuppressWarnings("deprecation") public class ServiceJavaBeanValueMetaData extends ServiceElementValueMetaData { private static final long serialVersionUID = 1; @@ -101,7 +102,7 @@ } // Apply the properties to the bean - PropertyEditors.mapJavaBeanProperties(bean, beanProps); + BeanUtils.mapJavaBeanProperties(bean, beanProps); return bean; } } Index: system-jmx/src/main/org/jboss/system/metadata/ServiceValueFactoryParameterMetaData.java =================================================================== --- system-jmx/src/main/org/jboss/system/metadata/ServiceValueFactoryParameterMetaData.java (revision 112986) +++ system-jmx/src/main/org/jboss/system/metadata/ServiceValueFactoryParameterMetaData.java (working copy) @@ -23,9 +23,9 @@ package org.jboss.system.metadata; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.lang.reflect.Constructor; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.deployers.spi.DeploymentException; import org.jboss.util.Classes; @@ -151,7 +151,7 @@ if (String.class == typeClass) return textValue; - PropertyEditor editor = PropertyEditorManager.findEditor(typeClass); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(typeClass); if (editor == null) { try Index: system-jmx/src/main/org/jboss/system/deployers/managed/ServiceMetaDataICF.java =================================================================== --- system-jmx/src/main/org/jboss/system/deployers/managed/ServiceMetaDataICF.java (revision 112986) +++ system-jmx/src/main/org/jboss/system/deployers/managed/ServiceMetaDataICF.java (working copy) @@ -35,6 +35,8 @@ import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.info.spi.PropertyInfo; +import org.jboss.common.beans.property.BeanUtils; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.logging.Logger; import org.jboss.managed.api.ManagedProperty; import org.jboss.managed.spi.factory.InstanceClassFactory; @@ -53,7 +55,6 @@ import org.jboss.system.metadata.ServiceTextValueMetaData; import org.jboss.system.metadata.ServiceValueContext; import org.jboss.system.metadata.ServiceValueMetaData; -import org.jboss.util.propertyeditor.PropertyEditors; import org.w3c.dom.Element; /** @@ -221,7 +222,7 @@ catch(Exception e) { // TODO: better way to determine if the bean was installed, as this does not make much sense - PropertyEditor editor = PropertyEditors.getEditor(metaType.getTypeName()); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(BeanUtils.findClass(metaType.getTypeName())); editor.setAsText(text.getText()); value = editor.getValue(); } Index: system-jmx/src/main/org/jboss/system/pm/XMLAttributePersistenceManager.java =================================================================== --- system-jmx/src/main/org/jboss/system/pm/XMLAttributePersistenceManager.java (revision 112986) +++ system-jmx/src/main/org/jboss/system/pm/XMLAttributePersistenceManager.java (working copy) @@ -22,7 +22,6 @@ package org.jboss.system.pm; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; @@ -55,6 +54,7 @@ import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.logging.Logger; import org.jboss.mx.persistence.AttributePersistenceManager; import org.jboss.system.server.ServerConfigLocator; @@ -294,7 +294,7 @@ else { Class clazz = value.getClass(); String type = clazz.getName(); - PropertyEditor peditor = PropertyEditorManager.findEditor(clazz); + PropertyEditor peditor = PropertyEditorFinder.getInstance().find(clazz); if (peditor != null) { // (c) use a PropertyEditor - mark the type and append the value as string @@ -494,7 +494,7 @@ "' of type '" + type + "'"); } - PropertyEditor peditor = PropertyEditorManager.findEditor(clazz); + PropertyEditor peditor = PropertyEditorFinder.getInstance().find(clazz); if (peditor != null) { Index: system-jmx/pom.xml =================================================================== --- system-jmx/pom.xml (revision 112986) +++ system-jmx/pom.xml (working copy) @@ -48,6 +48,10 @@ jboss-common-core + org.jboss.common + jboss-common-beans + + org.jboss jboss-vfs Index: system-jmx/build.xml =================================================================== --- system-jmx/build.xml (revision 112986) +++ system-jmx/build.xml (working copy) @@ -85,6 +85,7 @@ + Index: system/.classpath =================================================================== --- system/.classpath (revision 112986) +++ system/.classpath (working copy) @@ -38,5 +38,6 @@ + Index: system/src/main/org/jboss/system/property/PropertyEditorManagerService.java =================================================================== --- system/src/main/org/jboss/system/property/PropertyEditorManagerService.java (revision 0) +++ system/src/main/org/jboss/system/property/PropertyEditorManagerService.java (revision 0) @@ -0,0 +1,56 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright (c) 2012, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.system.property; + +import org.jboss.common.beans.property.finder.PropertyEditorFinder; +import org.jboss.logging.Logger; + +import java.beans.PropertyEditor; +import java.util.Map; + +/** + * @author Carlo de Wolf + */ +public class PropertyEditorManagerService +{ + private static final Logger log = Logger.getLogger(PropertyEditorManagerService.class); + + private Map, Class extends PropertyEditor>> editors; + + public void setEditors(final Map, Class extends PropertyEditor>> editors) + { + this.editors = editors; + } + + public void start() + { + if (editors == null) + return; + for (Map.Entry, Class extends PropertyEditor>> entry : editors.entrySet()) + { + final Class> type = entry.getKey(); + final Class extends PropertyEditor> editor = entry.getValue(); + PropertyEditorFinder.getInstance().register(type, editor); + log.infof("Registered editor %s for %s", editor, type); + } + } +} \ No newline at end of file Index: system/src/resources/tests/conf/jboss-service-VDFDeploymentScanner.xml =================================================================== --- system/src/resources/tests/conf/jboss-service-VDFDeploymentScanner.xml (revision 112986) +++ system/src/resources/tests/conf/jboss-service-VDFDeploymentScanner.xml (working copy) @@ -80,17 +80,17 @@ - java.math.BigDecimal=org.jboss.util.propertyeditor.BigDecimalEditor - java.lang.Boolean=org.jboss.util.propertyeditor.BooleanEditor - java.lang.Class=org.jboss.util.propertyeditor.ClassEditor - java.util.Date=org.jboss.util.propertyeditor.DateEditor - java.io.File=org.jboss.util.propertyeditor.FileEditor - java.net.InetAddress=org.jboss.util.propertyeditor.InetAddressEditor - java.lang.Integer=org.jboss.util.propertyeditor.IntegerEditor - javax.management.ObjectName=org.jboss.mx.util.propertyeditor.ObjectNameEditor - java.util.Properties=org.jboss.util.propertyeditor.PropertiesEditor - [Ljava.lang.String;=org.jboss.util.propertyeditor.StringArrayEditor - java.net.URL=org.jboss.util.propertyeditor.URLEditor + java.math.BigDecimal=org.jboss.common.beans.property.BigDecimalEditor + java.lang.Boolean=org.jboss.common.beans.property.BooleanEditor + java.lang.Class=org.jboss.common.beans.property.ClassEditor + java.util.Date=org.jboss.common.beans.property.DateEditor + java.io.File=org.jboss.common.beans.property.FileEditor + java.net.InetAddress=org.jboss.common.beans.property.InetAddressEditor + java.lang.Integer=org.jboss.common.beans.property.IntegerEditor + javax.management.ObjectName=org.jboss.common.beans.property.ObjectNameEditor + java.util.Properties=org.jboss.common.beans.property.PropertiesEditor + [Ljava.lang.String;=org.jboss.common.beans.property.StringArrayEditor + java.net.URL=org.jboss.common.beans.property.URLEditor --> Index: system/pom.xml =================================================================== --- system/pom.xml (revision 112986) +++ system/pom.xml (working copy) @@ -126,6 +126,10 @@ + org.jboss.common + jboss-common-beans + + org.jboss.deployers jboss-deployers-vfs-spi Index: system/build.xml =================================================================== --- system/build.xml (revision 112986) +++ system/build.xml (working copy) @@ -81,6 +81,7 @@ + Index: thirdparty/pom.xml =================================================================== --- thirdparty/pom.xml (revision 112986) +++ thirdparty/pom.xml (working copy) @@ -323,6 +323,13 @@ + org.jboss.common + jboss-common-beans + + jboss.common-beans + + + org.jboss jboss-common-core @@ -1508,6 +1515,10 @@ jbosscache-pojo + org.jboss.common + jboss-common-beans + + org.jboss jboss-common-core Index: varia/.classpath =================================================================== --- varia/.classpath (revision 112986) +++ varia/.classpath (working copy) @@ -19,6 +19,7 @@ + @@ -26,4 +27,4 @@ - + \ No newline at end of file Index: varia/src/tests/org/jboss/test/services/binding/test/ServiceBindingTestBase.java =================================================================== --- varia/src/tests/org/jboss/test/services/binding/test/ServiceBindingTestBase.java (revision 112986) +++ varia/src/tests/org/jboss/test/services/binding/test/ServiceBindingTestBase.java (working copy) @@ -41,7 +41,7 @@ import org.jboss.services.binding.ServiceBinding; import org.jboss.services.binding.ServiceBindingMetadata; import org.jboss.services.binding.impl.XSLTServiceBindingValueSourceConfig; -import org.jboss.util.propertyeditor.ElementEditor; +import org.jboss.common.beans.property.ElementEditor; import org.jboss.util.xml.JBossEntityResolver; import org.w3c.dom.Document; import org.w3c.dom.Element; Index: varia/src/main/org/jboss/ant/JMX.java =================================================================== --- varia/src/main/org/jboss/ant/JMX.java (revision 112986) +++ varia/src/main/org/jboss/ant/JMX.java (working copy) @@ -22,7 +22,6 @@ package org.jboss.ant; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.util.ArrayList; import java.util.List; import java.util.Properties; @@ -35,7 +34,8 @@ import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Task; -import org.jboss.util.propertyeditor.PropertyEditors; +import org.jboss.common.beans.property.BeanUtils; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; /** * JMX.java. An ant plugin to call managed operations and set attributes @@ -52,8 +52,8 @@ * classname="org.jboss.ant.JMX"/> * * - * - * + * + * * * * @@ -516,7 +516,7 @@ } /** - * The getValue method uses PropertyEditors to convert + * The getValue method uses PropertyEditorFinder to convert * the string representation of the value to an object, which it returns. * The PropertyEditor to use is determined by the type specified. * @@ -525,7 +525,7 @@ */ public Object getValue() throws Exception { - PropertyEditor editor = PropertyEditors.getEditor(type); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(BeanUtils.findClass(type)); editor.setAsText(arg); return editor.getValue(); } @@ -594,29 +594,29 @@ return editor; } - private Class> getEditorClass() throws ClassNotFoundException + private Class extends PropertyEditor> getEditorClass() throws ClassNotFoundException { //with a little luck, one of these will work with Ant's classloaders try { - return Class.forName(editor); + return (Class extends PropertyEditor>) Class.forName(editor); } catch (ClassNotFoundException e) { } // end of try-catch try { - return getClass().getClassLoader().loadClass(editor); + return (Class extends PropertyEditor>)getClass().getClassLoader().loadClass(editor); } catch (ClassNotFoundException e) { } // end of try-catch - return Thread.currentThread().getContextClassLoader().loadClass(editor); + return (Class extends PropertyEditor>)Thread.currentThread().getContextClassLoader().loadClass(editor); } public void execute() throws ClassNotFoundException { - PropertyEditorManager.registerEditor(getTypeClass(), getEditorClass()); + PropertyEditorFinder.getInstance().register(getTypeClass(), getEditorClass()); } } Index: varia/src/main/org/jboss/varia/property/PropertyEditorManagerService.java =================================================================== --- varia/src/main/org/jboss/varia/property/PropertyEditorManagerService.java (revision 112986) +++ varia/src/main/org/jboss/varia/property/PropertyEditorManagerService.java (working copy) @@ -22,7 +22,6 @@ package org.jboss.varia.property; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.ArrayList; @@ -36,10 +35,12 @@ import javax.management.MalformedObjectNameException; import javax.management.ObjectName; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.system.ServiceMBeanSupport; + /** - * A service to access java.beans.PropertyEditorManager. + * A service to access org.jboss.common.beans.property.finder.PropertyEditorFinder service. * * @author Jason Dillon * @version $Revision$ @@ -52,8 +53,8 @@ * These will be removed in destroyService(). * This is to prevent memory leakage of the class loader. */ - private List registeredEditors = Collections.synchronizedList(new ArrayList()); - + private final List registeredEditors = Collections.synchronizedList(new ArrayList()); + private final PropertyEditorFinder propertyEditorFinder = PropertyEditorFinder.getInstance(); /////////////////////////////////////////////////////////////////////////// // PropertyEditorManager Access // /////////////////////////////////////////////////////////////////////////// @@ -68,7 +69,7 @@ */ public PropertyEditor findEditor(final Class type) { - return PropertyEditorManager.findEditor(type); + return propertyEditorFinder.find(type); } /** @@ -84,7 +85,7 @@ { Class type = Class.forName(typeName); - return PropertyEditorManager.findEditor(type); + return propertyEditorFinder.find(type); } /** @@ -98,7 +99,7 @@ public void registerEditor(final Class type, final Class editorType) { registeredEditors.add(type); - PropertyEditorManager.registerEditor(type, editorType); + propertyEditorFinder.register(type, editorType); } /** @@ -157,7 +158,7 @@ */ public String getEditorSearchPath() { - return makeString(PropertyEditorManager.getEditorSearchPath()); + return makeString(propertyEditorFinder.getEditorSearchPackages()); } /** @@ -169,7 +170,7 @@ */ public void setEditorSearchPath(final String path) { - PropertyEditorManager.setEditorSearchPath(makeArray(path)); + propertyEditorFinder.setEditorSearchPackages(makeArray(path)); } @@ -240,7 +241,7 @@ while (iter.hasNext()) { Class type = (Class)iter.next(); - PropertyEditorManager.registerEditor(type, null); + propertyEditorFinder.register(type, null); iter.remove(); } } Index: varia/src/main/org/jboss/services/deployment/metadata/ConfigInfoBinding.java =================================================================== --- varia/src/main/org/jboss/services/deployment/metadata/ConfigInfoBinding.java (revision 112986) +++ varia/src/main/org/jboss/services/deployment/metadata/ConfigInfoBinding.java (working copy) @@ -22,8 +22,9 @@ package org.jboss.services.deployment.metadata; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; + +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.xb.binding.GenericObjectModelFactory; import org.jboss.xb.binding.UnmarshallingContext; import org.xml.sax.Attributes; @@ -197,7 +198,7 @@ throw new RuntimeException("Class not found for property '" + pi.getName() + "' of type '" + pi.getType() + "'"); } - PropertyEditor peditor = PropertyEditorManager.findEditor(clazz); + PropertyEditor peditor = PropertyEditorFinder.getInstance().find(clazz); if (peditor != null) { peditor.setAsText(value); Index: varia/src/main/org/jboss/services/binding/impl/StringReplacementServiceBindingValueSourceImpl.java =================================================================== --- varia/src/main/org/jboss/services/binding/impl/StringReplacementServiceBindingValueSourceImpl.java (revision 112986) +++ varia/src/main/org/jboss/services/binding/impl/StringReplacementServiceBindingValueSourceImpl.java (working copy) @@ -27,6 +27,7 @@ import java.io.IOException; import java.net.URL; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.services.binding.ElementServiceBindingValueSource; import org.jboss.services.binding.ServiceBinding; import org.jboss.services.binding.StringServiceBindingValueSource; @@ -61,7 +62,7 @@ if (input == null) throw new IllegalArgumentException("input cannot be null"); - PropertyEditor editor = PropertyEditorManager.findEditor(Element.class); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(Element.class); if (editor == null) throw new IllegalStateException("Cannot find PropertyEditor for type Element"); Index: varia/src/main/org/jboss/services/binding/impl/XSLTServiceBindingValueSourceImpl.java =================================================================== --- varia/src/main/org/jboss/services/binding/impl/XSLTServiceBindingValueSourceImpl.java (revision 112986) +++ varia/src/main/org/jboss/services/binding/impl/XSLTServiceBindingValueSourceImpl.java (working copy) @@ -46,6 +46,7 @@ import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.logging.Logger; import org.jboss.services.binding.ElementServiceBindingValueSource; import org.jboss.services.binding.ServiceBinding; @@ -124,7 +125,7 @@ if (input == null) throw new IllegalArgumentException("input cannot be null"); - PropertyEditor editor = PropertyEditorManager.findEditor(Element.class); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(Element.class); if (editor == null) throw new IllegalStateException("Cannot find PropertyEditor for type Element"); Index: varia/src/main/org/jboss/jmx/adaptor/control/Server.java =================================================================== --- varia/src/main/org/jboss/jmx/adaptor/control/Server.java (revision 112986) +++ varia/src/main/org/jboss/jmx/adaptor/control/Server.java (working copy) @@ -23,7 +23,6 @@ import java.beans.IntrospectionException; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.util.HashMap; import java.util.Iterator; import java.util.Set; @@ -39,12 +38,13 @@ import javax.management.ObjectName; import javax.management.ReflectionException; +import org.jboss.common.beans.property.BeanUtils; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.jmx.adaptor.model.DomainData; import org.jboss.jmx.adaptor.model.MBeanData; import org.jboss.logging.Logger; import org.jboss.mx.util.MBeanServerLocator; import org.jboss.util.Classes; -import org.jboss.util.propertyeditor.PropertyEditors; /** Utility methods related to the MBeanServer interface * @@ -160,7 +160,7 @@ } PropertyEditor editor = null; if( typeClass != null ) - editor = PropertyEditorManager.findEditor(typeClass); + editor = PropertyEditorFinder.getInstance().find(typeClass); return new AttrResultInfo(attrName, editor, value, throwable); } @@ -187,7 +187,7 @@ Attribute attr = null; try { - Object realValue = PropertyEditors.convertValue(value, attrType); + Object realValue = BeanUtils.convertValue(value, attrType); attr = new Attribute(attrName, realValue); } catch(ClassNotFoundException e) @@ -236,7 +236,7 @@ String arg = args[p]; try { - Object argValue = PropertyEditors.convertValue(arg, argTypes[p]); + Object argValue = BeanUtils.convertValue(arg, argTypes[p]); typedArgs[p] = argValue; } catch(ClassNotFoundException e) Index: varia/src/resources/jmx/html/inspectMBean.jsp =================================================================== --- varia/src/resources/jmx/html/inspectMBean.jsp (revision 112986) +++ varia/src/resources/jmx/html/inspectMBean.jsp (working copy) @@ -9,7 +9,7 @@ java.lang.reflect.Array, java.io.StringWriter, java.beans.PropertyEditor, - org.jboss.util.propertyeditor.PropertyEditors" + org.jboss.common.beans.property.BeanUtils" %> <% @@ -237,7 +237,7 @@ out.print("True"); out.print("False"); // For wrappers, enable a 'null' selection - if ( attrType.equals( "java.lang.Boolean" ) && PropertyEditors.isNullHandlingEnabled() ) + if ( attrType.equals( "java.lang.Boolean" ) && BeanUtils.isNullHandlingEnabled() ) { out.print("True"); } Index: varia/src/resources/jmx/html/displayOpResult.jsp =================================================================== --- varia/src/resources/jmx/html/displayOpResult.jsp (revision 112986) +++ varia/src/resources/jmx/html/displayOpResult.jsp (working copy) @@ -3,7 +3,7 @@ import="java.net.*, java.io.*, java.beans.PropertyEditor, - org.jboss.util.propertyeditor.PropertyEditors" + org.jboss.common.beans.property.finder.PropertyEditorFinder" %> <% String hostname = ""; @@ -73,7 +73,7 @@ { String opResultString = null; - PropertyEditor propertyEditor = PropertyEditors.findEditor(opResultInfo.result.getClass()); + PropertyEditor propertyEditor = PropertyEditorFinder.getInstance().find(opResultInfo.result.getClass()); if(propertyEditor != null) { propertyEditor.setValue(opResultInfo.result); Index: varia/pom.xml =================================================================== --- varia/pom.xml (revision 112986) +++ varia/pom.xml (working copy) @@ -52,13 +52,17 @@ opensaml - org.jboss jboss-common-core - + + org.jboss.common + jboss-common-beans + + + org.jboss.cluster jboss-ha-server-api Index: varia/build.xml =================================================================== --- varia/build.xml (revision 112986) +++ varia/build.xml (working copy) @@ -93,6 +93,7 @@ + Index: j2se/.classpath =================================================================== --- j2se/.classpath (revision 112986) +++ j2se/.classpath (working copy) @@ -10,6 +10,7 @@ + Index: j2se/src/main/org/jboss/mx/util/MBeanInstaller.java =================================================================== --- j2se/src/main/org/jboss/mx/util/MBeanInstaller.java (revision 112986) +++ j2se/src/main/org/jboss/mx/util/MBeanInstaller.java (working copy) @@ -22,7 +22,6 @@ package org.jboss.mx.util; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.io.InputStream; import java.util.Date; import java.util.HashMap; @@ -37,6 +36,7 @@ import javax.management.ObjectName; import javax.management.ReflectionException; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.logging.Logger; import org.jboss.mx.loading.MBeanElement; import org.jboss.mx.server.ObjectInputStreamWithClassLoader; @@ -110,19 +110,7 @@ * Logger instance. */ private static final Logger log = Logger.getLogger(MBeanInstaller.class); - - /** Augment the PropertyEditorManager search path to incorporate the JBoss - specific editors. This simply references the PropertyEditors.class to - invoke its static initialization block. - */ - static - { - Class c = org.jboss.util.propertyeditor.PropertyEditors.class; - if (c == null) - throw new UnreachableStatementException(); - } - // Attributes ---------------------------------------------------- /** @@ -241,7 +229,7 @@ try { Class typeClass = server.getClassLoaderRepository().loadClass(classes[i]); - PropertyEditor editor = PropertyEditorManager.findEditor(typeClass); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(typeClass); if (editor == null) throw new IllegalArgumentException("No property editor for type=" + typeClass); Index: j2se/src/main/org/jboss/mx/util/propertyeditor/ObjectNameEditor.java =================================================================== --- j2se/src/main/org/jboss/mx/util/propertyeditor/ObjectNameEditor.java (revision 112986) +++ j2se/src/main/org/jboss/mx/util/propertyeditor/ObjectNameEditor.java (working copy) @@ -36,6 +36,7 @@ public class ObjectNameEditor extends TextPropertyEditorSupport { + //TODO: push to beans /** * Returns a ObjectName for the input object converted to a string. * Index: j2se/pom.xml =================================================================== --- j2se/pom.xml (revision 112986) +++ j2se/pom.xml (working copy) @@ -62,6 +62,10 @@ + org.jboss.common + jboss-common-beans + + org.jboss jboss-common-core Index: j2se/build.xml =================================================================== --- j2se/build.xml (revision 112986) +++ j2se/build.xml (working copy) @@ -70,6 +70,7 @@ + Index: component-matrix/pom.xml =================================================================== --- component-matrix/pom.xml (revision 112986) +++ component-matrix/pom.xml (working copy) @@ -68,6 +68,7 @@ 1.1.4.Final 1.2.0.Final 2.2.18.GA + 1.0.4.Final-SNAPSHOT 2.0.10.GA 1.0.3 5.1.0.SP1 @@ -1435,8 +1436,14 @@ jboss-common-core ${version.org.jboss.common.core} - + + org.jboss.common + jboss-common-beans + ${version.org.jboss.common.beans} + + + org.jboss.integration jboss-classloading-spi ${version.org.jboss.integration} Index: server/.classpath =================================================================== --- server/.classpath (revision 112986) +++ server/.classpath (working copy) @@ -19,6 +19,7 @@ + Index: server/src/main/org/jboss/ejb/plugins/EntityInstanceCache.java =================================================================== --- server/src/main/org/jboss/ejb/plugins/EntityInstanceCache.java (revision 112986) +++ server/src/main/org/jboss/ejb/plugins/EntityInstanceCache.java (working copy) @@ -27,6 +27,7 @@ import javax.ejb.TimerService; import javax.management.ObjectName; +import org.jboss.common.beans.property.BeanUtils; import org.jboss.ejb.Container; import org.jboss.ejb.EntityContainer; import org.jboss.ejb.EnterpriseContext; @@ -35,7 +36,6 @@ import org.jboss.ejb.txtimer.EJBTimerService; import org.jboss.metadata.EntityMetaData; import org.jboss.metadata.ConfigurationMetaData; -import org.jboss.util.propertyeditor.PropertyEditors; /** * Cache subclass for entity beans. @@ -91,7 +91,7 @@ { EntityMetaData metaData = (EntityMetaData) m_container.getBeanMetaData(); String primKeyClass = metaData.getPrimaryKeyClass(); - Object key = PropertyEditors.convertValue(id, primKeyClass); + Object key = BeanUtils.convertValue(id, primKeyClass); remove(key); } Index: server/src/main/org/jboss/naming/JNDIBinding.java =================================================================== --- server/src/main/org/jboss/naming/JNDIBinding.java (revision 112986) +++ server/src/main/org/jboss/naming/JNDIBinding.java (working copy) @@ -23,7 +23,8 @@ import java.beans.PropertyEditor; -import org.jboss.util.propertyeditor.PropertyEditors; +import org.jboss.common.beans.property.BeanUtils; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; /** * A representation of a binding into JNDI. @@ -143,7 +144,7 @@ } else if( type != null ) { - PropertyEditor pe = PropertyEditors.getEditor(type); + PropertyEditor pe = PropertyEditorFinder.getInstance().find(BeanUtils.findClass(type)); pe.setAsText(text); value = pe.getValue(); } Index: server/src/etc/conf/standard/bootstrap/properties.xml =================================================================== --- server/src/etc/conf/standard/bootstrap/properties.xml (revision 0) +++ server/src/etc/conf/standard/bootstrap/properties.xml (revision 0) @@ -0,0 +1,19 @@ + + + + + + ${jboss.lib.url}jboss-system.jar + + + + + + + java.util.Properties + org.jboss.util.propertyeditor.PropertiesEditor + + + + + Index: server/src/etc/conf/default/bootstrap/properties.xml =================================================================== --- server/src/etc/conf/default/bootstrap/properties.xml (revision 0) +++ server/src/etc/conf/default/bootstrap/properties.xml (revision 0) @@ -0,0 +1,19 @@ + + + + + + ${jboss.lib.url}jboss-system.jar + + + + + + + java.util.Properties + org.jboss.util.propertyeditor.PropertiesEditor + + + + + Index: server/src/etc/conf/minimal/bootstrap/properties.xml =================================================================== --- server/src/etc/conf/minimal/bootstrap/properties.xml (revision 0) +++ server/src/etc/conf/minimal/bootstrap/properties.xml (revision 0) @@ -0,0 +1,19 @@ + + + + + + ${jboss.lib.url}jboss-system.jar + + + + + + + java.util.Properties + org.jboss.util.propertyeditor.PropertiesEditor + + + + + Index: server/src/etc/conf/all/bootstrap.xml =================================================================== --- server/src/etc/conf/all/bootstrap.xml (revision 112986) +++ server/src/etc/conf/all/bootstrap.xml (working copy) @@ -13,5 +13,6 @@ bootstrap/deployers.xml bootstrap/profile.xml bootstrap/security.xml + bootstrap/properties.xml Index: server/src/etc/conf/all/bootstrap/properties.xml =================================================================== --- server/src/etc/conf/all/bootstrap/properties.xml (revision 0) +++ server/src/etc/conf/all/bootstrap/properties.xml (revision 0) @@ -0,0 +1,19 @@ + + + + + + ${jboss.lib.url}jboss-system.jar + + + + + + + java.util.Properties + org.jboss.util.propertyeditor.PropertiesEditor + + + + + Index: server/src/etc/conf/web/bootstrap/properties.xml =================================================================== --- server/src/etc/conf/web/bootstrap/properties.xml (revision 0) +++ server/src/etc/conf/web/bootstrap/properties.xml (revision 0) @@ -0,0 +1,19 @@ + + + + + + ${jboss.lib.url}jboss-system.jar + + + + + + + java.util.Properties + org.jboss.util.propertyeditor.PropertiesEditor + + + + + Index: server/pom.xml =================================================================== --- server/pom.xml (revision 112986) +++ server/pom.xml (working copy) @@ -196,6 +196,11 @@ + org.jboss.common + jboss-common-beans + + + org.jboss jboss-common-core Index: server/build.xml =================================================================== --- server/build.xml (revision 112986) +++ server/build.xml (working copy) @@ -84,6 +84,7 @@ + Index: main/.classpath =================================================================== --- main/.classpath (revision 112986) +++ main/.classpath (working copy) @@ -4,5 +4,7 @@ + + Index: main/src/main/org/jboss/Main.java =================================================================== --- main/src/main/org/jboss/Main.java (revision 112986) +++ main/src/main/org/jboss/Main.java (working copy) @@ -61,8 +61,11 @@ */ public class Main { - /** EDU.oswego.cs.dl.util.concurrent */ - private String concurrentLib = "concurrent.jar"; + /** EDU.oswego.cs.dl.util.concurrent */ + private String concurrentLib = "concurrent.jar"; + + /** PEs and utils. */ + private String commonBeansLIb = "jboss-common-beans.jar"; /** A URL for obtaining microkernel patches */ private URL bootURL; @@ -197,6 +200,8 @@ // jmx UnifiedLoaderRepository needs a concurrent class... loader.addLibrary(concurrentLib); + // PEs and utils are required at boot + loader.addLibrary(commonBeansLIb); // Add any extra libraries after the boot libs for (int i = 0; i < extraLibraries.size(); i++) @@ -535,7 +540,6 @@ if (System.getProperty("jboss.vfs.forceCopy") == null) System.setProperty("jboss.vfs.forceCopy", "true"); } - /** * This is where the magic begins. * Index: testsuite/.classpath =================================================================== --- testsuite/.classpath (revision 112986) +++ testsuite/.classpath (working copy) @@ -61,5 +61,6 @@ + Index: testsuite/src/main/org/jboss/test/varia/property/PropertyEditorManagerServiceTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/varia/property/PropertyEditorManagerServiceTestCase.java (revision 112986) +++ testsuite/src/main/org/jboss/test/varia/property/PropertyEditorManagerServiceTestCase.java (working copy) @@ -21,11 +21,11 @@ */ package org.jboss.test.varia.property; -import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.util.Properties; +import org.jboss.common.beans.property.ByteEditor; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.test.JBossTestCase; import org.jboss.varia.property.PropertyEditorManagerService; @@ -39,10 +39,10 @@ */ public class PropertyEditorManagerServiceTestCase extends JBossTestCase { - + PropertyEditorManagerService s = new PropertyEditorManagerService(); Class bc = Byte.class; - Class be = org.jboss.util.propertyeditor.ByteEditor.class; + Class be = ByteEditor.class; Class sc = String.class; Class de = DummyEditor.class; @@ -62,8 +62,8 @@ protected void setUp() { getLog().debug("+++ " + getName()); - PropertyEditorManager.registerEditor(bc, null); - PropertyEditorManager.registerEditor(sc, null); + PropertyEditorFinder.getInstance().register(bc, null); + PropertyEditorFinder.getInstance().register(sc, null); } /** @@ -78,7 +78,7 @@ assertEquals(be, s.findEditor("java.lang.Byte").getClass()); s.registerEditor(bc.getName(), be.getName()); - String ed = "org.jboss.util.propertyeditor,org.example.editor"; + String ed = "org.jboss.common.beans.property,org.example.editor"; s.setEditorSearchPath(ed); assertEquals(ed, s.getEditorSearchPath()); @@ -102,7 +102,7 @@ s.start(); s.destroy(); assertEquals(null, s.findEditor(tc)); - assertEquals(null, PropertyEditorManager.findEditor(tc)); + assertEquals(null, PropertyEditorFinder.getInstance().find(tc)); assertEquals(0, s.getRegisteredEditors().length); } Index: testsuite/src/main/org/jboss/test/jbossts/crash/AppServerJDBCXARecovery.java =================================================================== --- testsuite/src/main/org/jboss/test/jbossts/crash/AppServerJDBCXARecovery.java (revision 112986) +++ testsuite/src/main/org/jboss/test/jbossts/crash/AppServerJDBCXARecovery.java (working copy) @@ -48,13 +48,13 @@ import java.io.ByteArrayInputStream; import java.lang.reflect.Method; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.security.NoSuchAlgorithmException; import java.security.InvalidKeyException; import java.math.BigInteger; import org.jboss.security.SecurityAssociation; import org.jboss.security.SimplePrincipal; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.logging.Logger; /** @@ -448,7 +448,7 @@ } Method setter = clazz.getMethod("set" + name, new Class[] { type }); - PropertyEditor editor = PropertyEditorManager.findEditor(type); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(type); editor.setAsText(value); setter.invoke(xads, new Object[] { editor.getValue() }); } Index: testsuite/src/main/org/jboss/test/util/test/PropertyEditorsUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/util/test/PropertyEditorsUnitTestCase.java (revision 112986) +++ testsuite/src/main/org/jboss/test/util/test/PropertyEditorsUnitTestCase.java (working copy) @@ -22,7 +22,6 @@ package org.jboss.test.util.test; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.io.File; import java.net.InetAddress; import java.net.URL; @@ -38,19 +37,22 @@ import javax.management.ObjectName; import junit.framework.Test; +import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jboss.common.beans.property.DateEditor; +import org.jboss.common.beans.property.DocumentEditor; +import org.jboss.common.beans.property.ElementEditor; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; +import org.jboss.logging.Logger; import org.jboss.test.JBossTestCase; -import org.jboss.util.propertyeditor.DateEditor; -import org.jboss.util.propertyeditor.DocumentEditor; -import org.jboss.util.propertyeditor.ElementEditor; import org.w3c.dom.Node; import org.w3c.dom.NodeList; /** * Unit tests for the custom JBoss property editors * - * @see org.jboss.util.propertyeditor.PropertyEditors + * @see PropertyEditorFinder * * @author Scott.Stark@jboss.org * @author Dimitris.Andreadis@jboss.org @@ -58,19 +60,6 @@ */ public class PropertyEditorsUnitTestCase extends JBossTestCase { - Calendar calendar = Calendar.getInstance(); - - /** Augment the PropertyEditorManager search path to incorporate the JBoss - specific editors. This simply references the PropertyEditors.class to - invoke its static initialization block. - */ - static - { - // Class c = org.jboss.util.propertyeditor.PropertyEditors.class; - // JBAS-3617 - on linux the above initializer doesn't work! - org.jboss.util.propertyeditor.PropertyEditors.init(); - } - static class StringArrayComparator implements Comparator { public int compare(Object o1, Object o2) @@ -118,11 +107,12 @@ // so it must be defined explicitly when running under some JVMs TestSuite suite = new TestSuite(); suite.addTest(new PropertyEditorsUnitTestCase("testEditorSearchPath")); - suite.addTest(new PropertyEditorsUnitTestCase("testJavaLangEditors")); - suite.addTest(new PropertyEditorsUnitTestCase("testJBossEditors")); suite.addTest(new PropertyEditorsUnitTestCase("testDateEditor")); suite.addTest(new PropertyEditorsUnitTestCase("testDocumentElementEditors")); + addJavaLangEditors(suite); + addJBossEditors(suite); + return suite; } @@ -131,29 +121,36 @@ super(name); } + private static void addTests(final TestSuite suite, final Class[] types, final String[][] inputData, final Object[][] expectedData, final String[][] expectedStringData, final Comparator[] comparators) + { + for (int t = 0; t < types.length; t++) + { + suite.addTest(new PropertyEditorTest(types[t], inputData[t], expectedData[t], expectedStringData[t], comparators[t])); + } + } + public void testEditorSearchPath() throws Exception { getLog().debug("+++ testEditorSearchPath"); - String[] searchPath = PropertyEditorManager.getEditorSearchPath(); + String[] searchPath = PropertyEditorFinder.getInstance().getEditorSearchPackages(); boolean foundJBossPath = false; for(int p = 0; p < searchPath.length; p ++) { String path = searchPath[p]; getLog().debug("path["+p+"]="+path); - foundJBossPath |= path.equals("org.jboss.util.propertyeditor"); + foundJBossPath |= path.equals("org.jboss.common.beans.property"); } - assertTrue("Found org.jboss.util.propertyeditor in search path", foundJBossPath); + assertTrue("Found 'org.jboss.common.beans.property' in search path", foundJBossPath); } /** The mechanism for mapping java.lang.* variants of the primative types misses editors for java.lang.Boolean and java.lang.Integer. Here we test the java.lang.* variants we expect editors for. **/ - public void testJavaLangEditors() + private static void addJavaLangEditors(final TestSuite suite) throws Exception { - getLog().debug("+++ testJavaLangEditors"); // The supported java.lang.* types Class[] types = { Boolean.class, @@ -192,7 +189,7 @@ }; // The expected string output from getAsText() String[][] expectedStringData = { - {"true", "false", "true", "false", "true", "false", "null"}, + {"true", "false", "true", "false", "true", "false", null}, {"1", "-1", "0", "26"}, {"1", "-1", "0", "160"}, {"1", "-1", "0", "160"}, @@ -200,22 +197,21 @@ {"1.0", "-1.0", "0.0", "1000.1"}, {"1.0", "-1.0", "0.0", "1000.1"}, {"1", "-1", "0"}, - {"A", "a", "Z", "z"}, + {"A", "a", "Z", "z"}, }; Comparator[] comparators = new Comparator[types.length]; - doTests(types, inputData, expectedData, expectedStringData, comparators); + addTests(suite, types, inputData, expectedData, expectedStringData, comparators); } /** Test custom JBoss property editors. **/ - public void testJBossEditors() + private static void addJBossEditors(final TestSuite suite) throws Exception { - getLog().debug("+++ testJBossEditors"); Class[] types = { javax.management.ObjectName.class, - java.util.Properties.class, +// java.util.Properties.class, java.io.File.class, java.net.URL.class, java.lang.String.class, @@ -230,8 +226,8 @@ String[][] inputData = { // javax.management.ObjectName.class {"jboss.test:test=1"}, - // java.util.Properties.class - {"prop1=value1\nprop2=value2\nprop3=value3\nprop32=${prop3}\nprop4=${user.home}\nprop5=${some.win32.path}"}, +// // java.util.Properties.class +// {"prop1=value1\nprop2=value2\nprop3=value3\nprop32=${prop3}\nprop4=${user.home}\nprop5=${some.win32.path}"}, // java.io.File.class {"/tmp/test1", "/tmp/subdir/../test2"}, // java.net.URL.class @@ -251,6 +247,7 @@ // Date.class {"Jan 4, 2005", "Tue Jan 4 23:38:21 PST 2005", "Tue, 04 Jan 2005 23:38:48 -0800"} }; + final Calendar calendar = Calendar.getInstance(); // The expected instance for each inputData value calendar.set(2005, 0, 4, 0, 0, 0); calendar.set(Calendar.MILLISECOND, 0); @@ -260,17 +257,17 @@ Date date2 = calendar.getTime(); calendar.set(2005, 0, 4, 23, 38, 48); Date date3 = calendar.getTime(); - Properties props = new Properties(); - props.setProperty("prop1", "value1"); - props.setProperty("prop2", "value2"); - props.setProperty("prop3", "value3"); - props.setProperty("prop32", "value3"); - props.setProperty("prop4", System.getProperty("user.home")); - System.setProperty("some.win32.path", "C:\\disk1\\root\\"); - props.setProperty("prop5", "C:\\disk1\\root\\"); +// Properties props = new Properties(); +// props.setProperty("prop1", "value1"); +// props.setProperty("prop2", "value2"); +// props.setProperty("prop3", "value3"); +// props.setProperty("prop32", "value3"); +// props.setProperty("prop4", System.getProperty("user.home")); +// System.setProperty("some.win32.path", "C:\\disk1\\root\\"); +// props.setProperty("prop5", "C:\\disk1\\root\\"); Object[][] expectedData = { {new ObjectName("jboss.test:test=1")}, - {props}, +// {props}, {new File("/tmp/test1").getCanonicalFile(), new File("/tmp/test2").getCanonicalFile()}, {new URL("http://www.jboss.org")}, {new String("JBoss, Home of Professional Open Source")}, @@ -287,9 +284,9 @@ // javax.management.ObjectName.class {"jboss.test:test=1"}, // java.util.Properties.class - {"prop1=value1\nprop2=value2\nprop3=value3\nprop32=${prop3}\nprop4=${user.home}\nprop5=${some.win32.path}"}, +// {"prop1=value1\nprop2=value2\nprop3=value3\nprop32=${prop3}\nprop4=${user.home}\nprop5=${some.win32.path}"}, // java.io.File.class - {"/tmp/test1", "/tmp/subdir/../test2"}, + {"/tmp/test1", "/tmp/test2"}, // java.net.URL.class {"http://www.jboss.org"}, // java.lang.String.class @@ -299,7 +296,7 @@ // InetAddress.class, localhost must be defined for this to work {"127.0.0.1", "localhost"}, // String[].class - {"1,2,3", "a,b,c", "", "#,%,\\,,.,_$,,v"}, + {"1,2,3", "a,b,c", "", "#,%,\\,,.,_$,\\,v"}, // Class[].class {"java.lang.Integer,java.lang.Float"}, // int[].class @@ -310,7 +307,7 @@ // The Comparator for non-trival types Comparator[] comparators = { null, // ObjectName - null, // Properties +// null, // Properties null, // File null, // URL null, // String @@ -322,7 +319,7 @@ null // Date }; - doTests(types, inputData, expectedData, expectedStringData, comparators); + addTests(suite, types, inputData, expectedData, expectedStringData, comparators); } public void testDateEditor() throws Exception @@ -418,7 +415,7 @@ { Class type = types[t]; getLog().debug("Checking property editor for: "+type); - PropertyEditor editor = PropertyEditorManager.findEditor(type); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(type); assertTrue("Found property editor for: "+type, editor != null); getLog().debug("Found property editor for: "+type+", editor="+editor.getClass().getName()); assertTrue("inputData.length == expectedData.length", inputData[t].length == expectedData[t].length); @@ -442,12 +439,13 @@ String expectedStringOutput = expectedStringData[t][i]; String stringOutput = editor.getAsText(); + getLog().debug("editor " + editor.getClass()); getLog().debug("setAsText '" + logString(input) + "'"); getLog().debug("getAsText '" + logString(stringOutput) + "'"); - + boolean stringOutputEquals = stringOutput != null ? stringOutput.equals(expectedStringOutput) : expectedStringOutput == null; - assertTrue("PropertyEditor: " + editor.getClass().getName() + ", getAsText() == expectedStringOutput '" + + assertTrue("PropertyEditor: " + editor.getClass().getName() + ", getAsText() '" + logString(stringOutput) + "' == expectedStringOutput '" + logString(expectedStringOutput) + "'", stringOutputEquals); } } @@ -470,4 +468,63 @@ { return s != null ? s : ""; } + + public static class PropertyEditorTest extends TestCase + { + private static final Logger log = Logger.getLogger(PropertyEditorTest.class); + + private final Class> type; + private final String[] inputData; + private final Object[] expectedData; + private final String[] expectedStringData; + private final Comparator c; + + private PropertyEditorTest(final Class> type, final String[] inputData, final Object[] expectedData, final String[] expectedStringData, final Comparator c) + { + super("testPropertyEditor " + type); + this.type = type; + this.inputData = inputData; + this.expectedData = expectedData; + this.expectedStringData = expectedStringData; + this.c = c; + } + + @Override + protected void runTest() + { + log.debug("Checking property editor for: "+type); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(type); + assertTrue("Found property editor for: "+type, editor != null); + log.debug("Found property editor for: "+type+", editor="+editor.getClass().getName()); + assertTrue("inputData.length == expectedData.length", inputData.length == expectedData.length); + for(int i = 0; i < inputData.length; i ++) + { + String input = inputData[i]; + editor.setAsText(input); + Object expected = expectedData[i]; + Object output = editor.getValue(); + boolean equals = false; + if (c == null) + { + equals = output != null ? output.equals(expected) : expected == null; + } + else + { + equals = c.compare(output, expected) == 0; + } + assertTrue("Transform of "+input+" equals "+expected+", output="+output, equals); + + String expectedStringOutput = expectedStringData[i]; + String stringOutput = editor.getAsText(); + log.debug("editor " + editor.getClass()); + log.debug("setAsText '" + logString(input) + "'"); + log.debug("getAsText '" + logString(stringOutput) + "'"); + + boolean stringOutputEquals = stringOutput != null ? + stringOutput.equals(expectedStringOutput) : expectedStringOutput == null; + assertTrue("PropertyEditor: " + editor.getClass().getName() + ", getAsText() '" + logString(stringOutput) + "' == expectedStringOutput '" + + logString(expectedStringOutput) + "'", stringOutputEquals); + } + } + } } Index: testsuite/src/main/org/jboss/test/bootstrap/property/properties/PropertyAware.java =================================================================== --- testsuite/src/main/org/jboss/test/bootstrap/property/properties/PropertyAware.java (revision 0) +++ testsuite/src/main/org/jboss/test/bootstrap/property/properties/PropertyAware.java (revision 0) @@ -0,0 +1,52 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2011, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.test.bootstrap.property.properties; + +import java.util.Properties; + +import org.jboss.system.ServiceMBeanSupport; + +/** + * @author baranowb + * + */ +public class PropertyAware extends ServiceMBeanSupport implements PropertyAwareMBean { + + private Properties properties; + + /* (non-Javadoc) + * @see org.jboss.test.bootstrap.property.PropertyAwareInterface#setProperties(java.util.Properties) + */ + @Override + public void setProperties(Properties b) { + this.properties = b; + } + + /* (non-Javadoc) + * @see org.jboss.test.bootstrap.property.PropertyAwareInterface#getProperties() + */ + @Override + public Properties getProperties() { + return this.properties; + } +} Index: testsuite/src/main/org/jboss/test/bootstrap/property/properties/PropertyAwareMBean.java =================================================================== --- testsuite/src/main/org/jboss/test/bootstrap/property/properties/PropertyAwareMBean.java (revision 0) +++ testsuite/src/main/org/jboss/test/bootstrap/property/properties/PropertyAwareMBean.java (revision 0) @@ -0,0 +1,36 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2011, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.test.bootstrap.property.properties; + +import java.util.Properties; + +/** + * @author baranowb + * + */ +public interface PropertyAwareMBean { + + public void setProperties(Properties b); + public Properties getProperties(); + +} Index: testsuite/src/main/org/jboss/test/bootstrap/property/properties/PropertiesTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/bootstrap/property/properties/PropertiesTestCase.java (revision 0) +++ testsuite/src/main/org/jboss/test/bootstrap/property/properties/PropertiesTestCase.java (revision 0) @@ -0,0 +1,66 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2011, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.test.bootstrap.property.properties; + +import java.util.Properties; + +import javax.management.MBeanServerConnection; +import javax.management.ObjectName; + +import junit.framework.Test; + +import org.jboss.test.JBossTestCase; + +/** + * @author baranowb + * + */ +public class PropertiesTestCase extends JBossTestCase +{ + org.jboss.logging.Logger log = getLog(); + + static boolean deployed = false; + static int test = 0; + + public PropertiesTestCase(String name) + { + + super(name); + + } + + public void testAspect() throws Exception + { + MBeanServerConnection server = getServer(); + ObjectName testerName = new ObjectName("test:type=property,name=properties"); + Properties expected = new Properties(); + expected.setProperty("x", System.getProperty("user.home")); + Properties actual = (Properties) server.getAttribute(testerName, "Properties"); + assertEquals(expected, actual); + } + + public static Test suite() throws Exception + { + return getDeploySetup(PropertiesTestCase.class, "property-properties.jar"); + } +} Index: testsuite/src/main/org/jboss/test/jmx/xmbean/XMLFilePersistenceManager.java =================================================================== --- testsuite/src/main/org/jboss/test/jmx/xmbean/XMLFilePersistenceManager.java (revision 112986) +++ testsuite/src/main/org/jboss/test/jmx/xmbean/XMLFilePersistenceManager.java (working copy) @@ -42,9 +42,10 @@ import org.jboss.mx.modelmbean.ModelMBeanInvoker; import org.jboss.mx.persistence.PersistenceManager; +import org.jboss.common.beans.property.BeanUtils; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.logging.Logger; import org.jboss.util.StringPropertyReplacer; -import org.jboss.util.propertyeditor.PropertyEditors; /** * XML File Persistence Manager. @@ -314,7 +315,7 @@ */ private Object convert(String val, String oType) throws Exception { - PropertyEditor editor = PropertyEditors.getEditor(oType); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(BeanUtils.findClass(oType)); editor.setAsText(val); return editor.getValue(); } Index: testsuite/src/main/org/jboss/test/xml/MBeanServerUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/xml/MBeanServerUnitTestCase.java (revision 112986) +++ testsuite/src/main/org/jboss/test/xml/MBeanServerUnitTestCase.java (working copy) @@ -130,34 +130,26 @@ assertEquals("There is 1 mbean", 1, mbeans.size()); MBeanData mbean = (MBeanData) mbeans.get(0); - assertTrue("ClassName == org.jboss.security.auth.login.DynamicLoginConfig", - mbean.getCode().equals("org.jboss.security.auth.login.DynamicLoginConfig")); - assertTrue("Name == jboss.security.tests:service=DynamicLoginConfig", - mbean.getName().equals("jboss.security.tests:service=DynamicLoginConfig")); + assertEquals("Wrong class name","org.jboss.security.auth.login.DynamicLoginConfig", mbean.getCode()); + assertEquals("Name","jboss.security.tests:service=DynamicLoginConfig", mbean.getName()); Map attributes = mbean.getAttributeMap(); - assertTrue("There are 2 attributes", - attributes.size() == 2); + assertEquals("Wrong number of attributes", 2, attributes.size()); MBeanAttribute attr = (MBeanAttribute) attributes.get("PolicyConfig"); Object value = attr.getValue(); assertTrue("Value isA PolicyConfig", value instanceof PolicyConfig ); PolicyConfig pc = (PolicyConfig) value; - assertTrue("There 1 AuthenticationInfo", - pc.size() == 1); + assertEquals("Wrong number of AuthenticationInfo", 1, pc.size()); AuthenticationInfo auth = pc.get("conf1"); - assertTrue("The AuthenticationInfo name ic config1", - auth != null); + assertNotNull("The AuthenticationInfo name ic config1", auth); AppConfigurationEntry[] ace = auth.getAppConfigurationEntry(); - assertTrue("The AppConfigurationEntry has one entry", - ace != null && ace.length == 1); - assertTrue("LoginModuleName", - ace[0].getLoginModuleName().equals("org.jboss.security.auth.spi.IdentityLoginModule")); + assertNotNull("AppConfiguration entry must not be null",ace); + assertEquals("The AppConfigurationEntry must have one entry", 1 ,ace.length); + assertEquals("LoginModuleName", "org.jboss.security.auth.spi.IdentityLoginModule", ace[0].getLoginModuleName()); attr = (MBeanAttribute) attributes.get("UserHome"); - assertTrue("Name == UserHome", - attr.getName().equals("UserHome")); - assertTrue("Text != null", - attr.getText() != null); + assertEquals("UserHome", attr.getName()); + assertNotNull("Text != null", attr.getText() ); } /** @@ -253,50 +245,45 @@ // Validate the bindings JNDIBinding[] values = bindings.getBindings(); - assertTrue("There are 5 bindings("+values.length+")", values.length == 5); + assertEquals("Wrong bindings count", 5, values.length); JNDIBinding key1 = values[0]; - assertTrue("values[0] name is ctx1/key1", key1.getName().equals("ctx1/key1")); - assertTrue("values[0] is string of value1", key1.getText().equals("value1")); + assertEquals("values[0]", "ctx1/key1",key1.getName()); + assertEquals("values[0] text", "value1",key1.getText()); JNDIBinding userHome = values[1]; - assertTrue("values[1] name is ctx1/user.home", userHome.getName().equals("ctx1/user.home")); + assertEquals("values[1]", "ctx1/user.home",userHome.getName()); String p = System.getProperty("user.home"); - assertTrue("values[1] is property ${user.home}", userHome.getText().equals(p)); + assertEquals("values[1] property( ${user.home} )", p,userHome.getText()); // Test binding from a text to URL based on the type attribute PropertyEditor JNDIBinding jbossHome = values[2]; - assertTrue("values[2] name is ctx1/key2", jbossHome.getName().equals("ctx1/key2")); - assertTrue("values[2] is http://www.jboss.org", - jbossHome.getText().equals("http://www.jboss.org")); - assertTrue("values[2] type is java.net.URL", - jbossHome.getType().equals("java.net.URL")); + assertEquals("values[2]", "ctx1/key2", jbossHome.getName()); + assertEquals("values[2] text", "http://www.jboss.org", jbossHome.getText()); + assertEquals("values[2] type","java.net.URL", jbossHome.getType()); Object value2 = jbossHome.getValue(); - assertTrue("values[2] value is URL(http://www.jboss.org)", - value2.equals(new URL("http://www.jboss.org"))); + assertEquals("values[2] as URL(http://www.jboss.org)", new URL("http://www.jboss.org"), value2); // Test a binding from an xml fragment from a foreign namespace. JNDIBinding properties = values[3]; Object value = properties.getValue(); - assertTrue("values[3] name is ctx2/key1", properties.getName().equals("ctx2/key1")); - assertTrue("values[3] is java.util.Properties", value instanceof Properties); + assertEquals("values[3]", "ctx2/key1", properties.getName()); + assertEquals("values[3] is java.util.Properties", Properties.class,value.getClass()); Properties props = (Properties) value; - assertTrue("Properties(key1) == value1", props.getProperty("key1").equals("value1")); - assertTrue("Properties(key2) == value2", props.getProperty("key2").equals("value2")); + assertEquals("Properties(key1)", "value1", props.getProperty("key1")); + assertEquals("Properties(key2)", "value2", props.getProperty("key2")); // Test binding from a text to InetAddress based on the editor attribute PropertyEditor JNDIBinding host = values[4]; - assertTrue("values[4] name is hosts/localhost", host.getName().equals("hosts/localhost")); + assertEquals("values[4] ", "hosts/localhost", host.getName()); assertTrue(host.isTrim()); - assertTrue("values[4] text is 127.0.0.1", - host.getText().equals("127.0.0.1")); - assertTrue("values[4] editor is org.jboss.util.propertyeditor.InetAddressEditor", - host.getEditor().equals("org.jboss.util.propertyeditor.InetAddressEditor")); + assertEquals("values[4] text","127.0.0.1", + host.getText()); + assertEquals("values[4] editor","org.jboss.common.beans.property.InetAddressEditor", host.getEditor()); Object value4 = host.getValue(); InetAddress hostValue = (InetAddress) value4; InetAddress localhost = InetAddress.getByName("127.0.0.1"); - assertTrue("values[4] value is InetAddress(127.0.0.1)", - hostValue.getHostAddress().equals(localhost.getHostAddress())); + assertEquals("values[4] value InetAddress(127.0.0.1)",localhost.getHostAddress(), hostValue.getHostAddress()); } Index: testsuite/src/main/org/jboss/test/xml/mbeanserver/XMBean2UnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/xml/mbeanserver/XMBean2UnitTestCase.java (revision 112986) +++ testsuite/src/main/org/jboss/test/xml/mbeanserver/XMBean2UnitTestCase.java (working copy) @@ -70,22 +70,23 @@ String xmlPath = getResourcePath("xml/mbeanserver/testXMBean2.xml"); Object root = unmarshaller.unmarshal(xmlPath, resolver); - assertTrue("", root instanceof ModelMBeanInfoSupportWrapper); + assertInstanceOf( root,ModelMBeanInfoSupportWrapper.class); ModelMBeanInfoSupportWrapper mbean = (ModelMBeanInfoSupportWrapper) root; Descriptor descriptor = mbean.getDescriptors(); Object i = descriptor.getFieldValue("interceptors"); Interceptor[] interceptors = (Interceptor[]) i; SomeBeanInterceptor sbi = (SomeBeanInterceptor) interceptors[0]; assertTrue(sbi.isFlag()); - assertTrue("aClass == Integer.class", sbi.getaClass() == Integer.class); + assertEquals("Bean interceptor aclass", Integer.class,sbi.getaClass()); + URL homePage = new URL("http://www.jboss.org/"); - assertTrue("homePage == URL(http://www.jboss.org/)", sbi.getHomePage().equals(homePage)); + assertEquals("homePage",homePage, sbi.getHomePage()); Long l = new Long(123456789); - assertTrue("aLong == 123456789", sbi.getaLong().equals(l)); - assertTrue("aString == string1", sbi.getaString().equals("string1")); - assertTrue("anInt == 1234", sbi.getAnInt() == 1234); + assertEquals("aLong", l,sbi.getaLong()); + assertEquals("aString", "string1",sbi.getaString()); + assertEquals("anInt",1234, sbi.getAnInt()); InetAddress localhost = InetAddress.getByName("127.0.0.1"); - assertTrue("address == 127.0.0.1", sbi.getAddress().equals(localhost)); + assertEquals("address", localhost,sbi.getAddress()); String[] strings = {"string1", "string2", "string3"}; assertTrue("someStrings == {string1, string2, string3}", Arrays.equals(strings, sbi.getSomeStrings())); @@ -93,20 +94,19 @@ someProperties.setProperty("prop1", "value1"); someProperties.setProperty("prop2", "value2"); someProperties.setProperty("prop3", "value3"); - assertTrue("someProperties == {string1, string2, string3}", - sbi.getSomeProperties().equals(someProperties)); + assertEquals("someProperties", someProperties,sbi.getSomeProperties()); Object i1 = interceptors[1]; - assertTrue(i1 instanceof PersistenceInterceptor2); + assertInstanceOf(i1, PersistenceInterceptor2.class); Object i2 = interceptors[2]; - assertTrue(i2 instanceof ModelMBeanInterceptor); + assertInstanceOf(i2,ModelMBeanInterceptor.class); Object i3 = interceptors[3]; - assertTrue(i3 instanceof ObjectReferenceInterceptor); + assertInstanceOf(i3 , ObjectReferenceInterceptor.class); String clazz = mbean.getClassName(); - assertTrue("class is org.jboss.naming.JNDIBindingService", - clazz.equals("org.jboss.naming.JNDIBindingService")); + assertEquals("Classname",org.jboss.naming.JNDIBindingService.class.getName(),clazz); + ModelMBeanInfo info = mbean.getMBeanInfo(); MBeanAttributeInfo[] attrs = info.getAttributes(); assertTrue("There are 2 attributes", attrs.length == 2); Index: testsuite/src/main/org/jboss/test/xml/mbeanserver/JavaBeanSchemaInitializer.java =================================================================== --- testsuite/src/main/org/jboss/test/xml/mbeanserver/JavaBeanSchemaInitializer.java (revision 112986) +++ testsuite/src/main/org/jboss/test/xml/mbeanserver/JavaBeanSchemaInitializer.java (working copy) @@ -25,6 +25,7 @@ import javax.xml.namespace.QName; import javax.xml.namespace.NamespaceContext; +import org.jboss.common.beans.property.BeanUtils; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingInitializer; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding; @@ -32,7 +33,6 @@ import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding; import org.jboss.xb.binding.sunday.unmarshalling.impl.runtime.RtElementHandler; -import org.jboss.util.propertyeditor.PropertyEditors; import org.xml.sax.Attributes; /** @@ -50,10 +50,6 @@ /** The javabean binding */ private static final QName javabeanTypeQName = new QName(JavaBeanSchemaInitializer.JAVABEAN_NS, "javabeanType"); - static - { - PropertyEditors.init(); - } public SchemaBinding init(SchemaBinding schema) { @@ -154,7 +150,7 @@ bean = holder.getBean(); Properties props = holder.getProperties(); //System.out.println("Converting properties: "+props); - PropertyEditors.mapJavaBeanProperties(bean, props, true); + BeanUtils.mapJavaBeanProperties(bean, props, true); } catch (Exception e) { Index: testsuite/src/main/org/jboss/test/xml/JNDIBindingUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/xml/JNDIBindingUnitTestCase.java (revision 112986) +++ testsuite/src/main/org/jboss/test/xml/JNDIBindingUnitTestCase.java (working copy) @@ -58,47 +58,41 @@ assertTrue("There are 5 bindings("+values.length+")", values.length == 5); JNDIBinding key1 = values[0]; - assertTrue("values[0] name is ctx1/key1", key1.getName().equals("ctx1/key1")); - assertTrue("values[0] is string of value1", key1.getText().equals("value1")); + assertEquals("values[0] name is ctx1/key1", "ctx1/key1",key1.getName()); + assertEquals("values[0] is string of value1","value1", key1.getText()); JNDIBinding userHome = values[1]; - assertTrue("values[1] name is ctx1/user.home", userHome.getName().equals("ctx1/user.home")); + assertEquals("values[1] name is ctx1/user.home", "ctx1/user.home",userHome.getName()); String p = System.getProperty("user.home"); - assertTrue("values[1] is property ${user.home}", userHome.getText().equals(p)); + assertEquals("values[1] is property ${user.home}", p, userHome.getText()); // Test binding from a text to URL based on the type attribute PropertyEditor JNDIBinding jbossHome = values[2]; - assertTrue("values[2] name is ctx1/key2", jbossHome.getName().equals("ctx1/key2")); - assertTrue("values[2] is http://www.jboss.org", - jbossHome.getText().equals("http://www.jboss.org")); - assertTrue("values[2] type is java.net.URL", - jbossHome.getType().equals("java.net.URL")); + assertEquals("values[2] name is ctx1/key2", "ctx1/key2", jbossHome.getName()); + assertEquals("values[2] is http://www.jboss.org", "http://www.jboss.org", jbossHome.getText()); + assertEquals("values[2] type is java.net.URL", "java.net.URL", jbossHome.getType()); Object value2 = jbossHome.getValue(); - assertTrue("values[2] value is URL(http://www.jboss.org)", - value2.equals(new URL("http://www.jboss.org"))); + assertEquals("values[2] value is URL(http://www.jboss.org)", new URL("http://www.jboss.org"), value2); // Test a binding from an xml fragment from a foreign namespace. JNDIBinding properties = values[3]; Object value = properties.getValue(); - assertTrue("values[3] name is ctx2/key1", properties.getName().equals("ctx2/key1")); + assertEquals("values[3] name is ctx2/key1", "ctx2/key1",properties.getName()); assertTrue("values[3] is java.util.Properties", value instanceof Properties); Properties props = (Properties) value; - assertTrue("Properties(key1) == value1", props.getProperty("key1").equals("value1")); - assertTrue("Properties(key2) == value2", props.getProperty("key2").equals("value2")); + assertEquals("Properties(key1) == value1", "value1", props.getProperty("key1")); + assertEquals("Properties(key2) == value2", "value2", props.getProperty("key2")); // Test binding from a text to InetAddress based on the editor attribute PropertyEditor JNDIBinding host = values[4]; - assertTrue("values[4] name is hosts/localhost", host.getName().equals("hosts/localhost")); + assertEquals("values[4] name is hosts/localhost", "hosts/localhost",host.getName()); assertTrue(host.isTrim()); - assertTrue("values[4] text is 127.0.0.1", - host.getText().equals("127.0.0.1")); - assertTrue("values[4] editor is org.jboss.util.propertyeditor.InetAddressEditor", - host.getEditor().equals("org.jboss.util.propertyeditor.InetAddressEditor")); + assertEquals("values[4] text is 127.0.0.1", "127.0.0.1", host.getText()); + assertEquals("values[4] editor is org.jboss.common.beans.property.InetAddressEditor", "org.jboss.common.beans.property.InetAddressEditor" , host.getEditor()); Object value4 = host.getValue(); InetAddress hostValue = (InetAddress) value4; InetAddress localhost = InetAddress.getByName("127.0.0.1"); - assertTrue("values[4] value is InetAddress(127.0.0.1)", - hostValue.getHostAddress().equals(localhost.getHostAddress())); + assertEquals("values[4] value is InetAddress(127.0.0.1)", localhost.getHostAddress(), hostValue.getHostAddress()); } // Private Index: testsuite/src/resources/naming/services/bindings-service.xml =================================================================== --- testsuite/src/resources/naming/services/bindings-service.xml (revision 112986) +++ testsuite/src/resources/naming/services/bindings-service.xml (working copy) @@ -14,7 +14,7 @@ - + 127.0.0.1 Index: testsuite/src/resources/bootstrap/property/properties/META-INF/jboss-service.xml =================================================================== --- testsuite/src/resources/bootstrap/property/properties/META-INF/jboss-service.xml (revision 0) +++ testsuite/src/resources/bootstrap/property/properties/META-INF/jboss-service.xml (revision 0) @@ -0,0 +1,7 @@ + + + + x=${user.home} + + \ No newline at end of file Index: testsuite/src/resources/xml/mbeanserver/testBinding.xml =================================================================== --- testsuite/src/resources/xml/mbeanserver/testBinding.xml (revision 112986) +++ testsuite/src/resources/xml/mbeanserver/testBinding.xml (working copy) @@ -37,7 +37,7 @@ - + 127.0.0.1 Index: testsuite/src/resources/xml/naming/testBindings.xml =================================================================== --- testsuite/src/resources/xml/naming/testBindings.xml (revision 112986) +++ testsuite/src/resources/xml/naming/testBindings.xml (working copy) @@ -28,7 +28,7 @@ - + 127.0.0.1 Index: testsuite/src/etc/cluster-harness/conf/jboss-service-bench1.xml =================================================================== --- testsuite/src/etc/cluster-harness/conf/jboss-service-bench1.xml (revision 112986) +++ testsuite/src/etc/cluster-harness/conf/jboss-service-bench1.xml (working copy) @@ -81,17 +81,17 @@ - java.math.BigDecimal=org.jboss.util.propertyeditor.BigDecimalEditor - java.lang.Boolean=org.jboss.util.propertyeditor.BooleanEditor - java.lang.Class=org.jboss.util.propertyeditor.ClassEditor - java.util.Date=org.jboss.util.propertyeditor.DateEditor - java.io.File=org.jboss.util.propertyeditor.FileEditor - java.net.InetAddress=org.jboss.util.propertyeditor.InetAddressEditor - java.lang.Integer=org.jboss.util.propertyeditor.IntegerEditor - javax.management.ObjectName=org.jboss.mx.util.propertyeditor.ObjectNameEditor - java.util.Properties=org.jboss.util.propertyeditor.PropertiesEditor - [Ljava.lang.String;=org.jboss.util.propertyeditor.StringArrayEditor - java.net.URL=org.jboss.util.propertyeditor.URLEditor + java.math.BigDecimal=org.jboss.common.beans.property.BigDecimalEditor + java.lang.Boolean=org.jboss.common.beans.property.BooleanEditor + java.lang.Class=org.jboss.common.beans.property.ClassEditor + java.util.Date=org.jboss.common.beans.property.DateEditor + java.io.File=org.jboss.common.beans.property.FileEditor + java.net.InetAddress=org.jboss.common.beans.property.InetAddressEditor + java.lang.Integer=org.jboss.common.beans.property.IntegerEditor + javax.management.ObjectName=org.jboss.common.beans.property.ObjectNameEditor + java.util.Properties=org.jboss.common.beans.property.PropertiesEditor + [Ljava.lang.String;=org.jboss.common.beans.property.StringArrayEditor + java.net.URL=org.jboss.common.beans.property.URLEditor --> Index: testsuite/src/etc/cluster-harness/conf/jboss-service-bench2.xml =================================================================== --- testsuite/src/etc/cluster-harness/conf/jboss-service-bench2.xml (revision 112986) +++ testsuite/src/etc/cluster-harness/conf/jboss-service-bench2.xml (working copy) @@ -81,17 +81,17 @@ - java.math.BigDecimal=org.jboss.util.propertyeditor.BigDecimalEditor - java.lang.Boolean=org.jboss.util.propertyeditor.BooleanEditor - java.lang.Class=org.jboss.util.propertyeditor.ClassEditor - java.util.Date=org.jboss.util.propertyeditor.DateEditor - java.io.File=org.jboss.util.propertyeditor.FileEditor - java.net.InetAddress=org.jboss.util.propertyeditor.InetAddressEditor - java.lang.Integer=org.jboss.util.propertyeditor.IntegerEditor - javax.management.ObjectName=org.jboss.mx.util.propertyeditor.ObjectNameEditor - java.util.Properties=org.jboss.util.propertyeditor.PropertiesEditor - [Ljava.lang.String;=org.jboss.util.propertyeditor.StringArrayEditor - java.net.URL=org.jboss.util.propertyeditor.URLEditor + java.math.BigDecimal=org.jboss.common.beans.property.BigDecimalEditor + java.lang.Boolean=org.jboss.common.beans.property.BooleanEditor + java.lang.Class=org.jboss.common.beans.property.ClassEditor + java.util.Date=org.jboss.common.beans.property.DateEditor + java.io.File=org.jboss.common.beans.property.FileEditor + java.net.InetAddress=org.jboss.common.beans.property.InetAddressEditor + java.lang.Integer=org.jboss.common.beans.property.IntegerEditor + javax.management.ObjectName=org.jboss.common.beans.property.ObjectNameEditor + java.util.Properties=org.jboss.common.beans.property.PropertiesEditor + [Ljava.lang.String;=org.jboss.common.beans.property.StringArrayEditor + java.net.URL=org.jboss.common.beans.property.URLEditor --> Index: testsuite/imports/sections/property.xml =================================================================== --- testsuite/imports/sections/property.xml (revision 0) +++ testsuite/imports/sections/property.xml (revision 0) @@ -0,0 +1,48 @@ + + + + + + JBossProprties test archive builder + + + + + + + + + + + + + + + + + + + + Index: testsuite/imports/test-jars.xml =================================================================== --- testsuite/imports/test-jars.xml (revision 112986) +++ testsuite/imports/test-jars.xml (working copy) @@ -84,7 +84,8 @@ - + + @@ -4779,7 +4781,7 @@ - + Index: connector/.classpath =================================================================== --- connector/.classpath (revision 112986) +++ connector/.classpath (working copy) @@ -20,5 +20,6 @@ + Index: connector/src/main/org/jboss/resource/adapter/jdbc/xa/XAManagedConnectionFactory.java =================================================================== --- connector/src/main/org/jboss/resource/adapter/jdbc/xa/XAManagedConnectionFactory.java (revision 112986) +++ connector/src/main/org/jboss/resource/adapter/jdbc/xa/XAManagedConnectionFactory.java (working copy) @@ -21,11 +21,11 @@ */ package org.jboss.resource.adapter.jdbc.xa; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnectionFactory; import org.jboss.resource.adapter.jdbc.URLSelectorStrategy; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.beans.PropertyEditorManager; import java.beans.PropertyEditor; import javax.sql.XADataSource; import javax.sql.XAConnection; @@ -191,7 +191,7 @@ } // end of try-catch Method setter = clazz.getMethod("set" + name, new Class[]{type}); - PropertyEditor editor = PropertyEditorManager.findEditor(type); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(type); if(editor == null) { throw new JBossResourceException("No property editor found for type: " + type); @@ -597,7 +597,7 @@ } Method setter = clazz.getMethod("set" + name, new Class[] { type }); - PropertyEditor editor = PropertyEditorManager.findEditor(type); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(type); if (editor == null) throw new JBossResourceException("No property editor found for type: " + type); editor.setAsText(value); Index: connector/src/main/org/jboss/resource/deployment/AdminObjectFactory.java =================================================================== --- connector/src/main/org/jboss/resource/deployment/AdminObjectFactory.java (revision 112986) +++ connector/src/main/org/jboss/resource/deployment/AdminObjectFactory.java (working copy) @@ -21,10 +21,7 @@ */ package org.jboss.resource.deployment; -import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.util.Collection; import java.util.Iterator; import java.util.Map; Index: connector/src/main/org/jboss/resource/deployment/ConfigPropertyHandler.java =================================================================== --- connector/src/main/org/jboss/resource/deployment/ConfigPropertyHandler.java (revision 112986) +++ connector/src/main/org/jboss/resource/deployment/ConfigPropertyHandler.java (working copy) @@ -22,11 +22,11 @@ package org.jboss.resource.deployment; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.logging.Logger; import org.jboss.resource.metadata.ConfigPropertyMetaData; import org.jboss.util.Classes; @@ -278,7 +278,7 @@ */ private Object getValue(String propertyName, Class actualType, String value, boolean mustExist) { - PropertyEditor editor = PropertyEditorManager.findEditor(actualType); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(actualType); if (editor == null) { String error = "No property editor found for property " + propertyName; Index: connector/src/main/org/jboss/resource/deployment/ResourceAdapterFactory.java =================================================================== --- connector/src/main/org/jboss/resource/deployment/ResourceAdapterFactory.java (revision 112986) +++ connector/src/main/org/jboss/resource/deployment/ResourceAdapterFactory.java (working copy) @@ -21,13 +21,8 @@ */ package org.jboss.resource.deployment; -import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.HashMap; import java.util.Iterator; -import java.util.Map; import javax.resource.spi.ResourceAdapter; Index: connector/src/main/org/jboss/resource/connectionmanager/ManagedConnectionFactoryDeployment.java =================================================================== --- connector/src/main/org/jboss/resource/connectionmanager/ManagedConnectionFactoryDeployment.java (revision 112986) +++ connector/src/main/org/jboss/resource/connectionmanager/ManagedConnectionFactoryDeployment.java (working copy) @@ -22,7 +22,6 @@ package org.jboss.resource.connectionmanager; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.io.File; @@ -55,9 +54,9 @@ import javax.security.auth.Subject; import javax.transaction.xa.XAResource; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.deployers.spi.DeploymentException; import org.jboss.logging.Logger; -import org.jboss.metadata.MetaData; import org.jboss.resource.connectionmanager.xa.XAResourceWrapperImpl; import org.jboss.resource.metadata.ConfigPropertyMetaData; import org.jboss.resource.metadata.ConnectionDefinitionMetaData; @@ -80,8 +79,6 @@ import org.jboss.util.NestedRuntimeException; import org.jboss.util.StringPropertyReplacer; import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; /** @@ -1021,7 +1018,7 @@ continue; } } - PropertyEditor pe = PropertyEditorManager.findEditor(clazz); + PropertyEditor pe = PropertyEditorFinder.getInstance().find(clazz); if (pe == null) { log.warn("Unable to find a PropertyEditor for class '" + clazz + "' of property '" + name + "' - " @@ -1081,7 +1078,7 @@ continue; } } - PropertyEditor pe = PropertyEditorManager.findEditor(clazz); + PropertyEditor pe = PropertyEditorFinder.getInstance().find(clazz); if (pe == null) { log.warn("Unable to find a PropertyEditor for class '" + clazz + "' of property '" + name + "' - " Index: connector/src/main/org/jboss/resource/connectionmanager/RARDeployment.java =================================================================== --- connector/src/main/org/jboss/resource/connectionmanager/RARDeployment.java (revision 112986) +++ connector/src/main/org/jboss/resource/connectionmanager/RARDeployment.java (working copy) @@ -22,7 +22,6 @@ package org.jboss.resource.connectionmanager; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Collection; @@ -37,6 +36,7 @@ import javax.resource.spi.ResourceAdapter; import javax.resource.spi.ResourceAdapterAssociation; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.deployers.spi.DeploymentException; import org.jboss.logging.Logger; import org.jboss.metadata.MetaData; @@ -504,7 +504,7 @@ continue; } } - PropertyEditor pe = PropertyEditorManager.findEditor(clazz); + PropertyEditor pe = PropertyEditorFinder.getInstance().find(clazz); if (pe == null) { log.warn("Unable to find a PropertyEditor for class '" + clazz + "' of property '" + name + "' - " Index: connector/pom.xml =================================================================== --- connector/pom.xml (revision 112986) +++ connector/pom.xml (working copy) @@ -73,6 +73,10 @@ mail + org.jboss.common + jboss-common-beans + + org.jboss jboss-common-core Index: connector/build.xml =================================================================== --- connector/build.xml (revision 112986) +++ connector/build.xml (working copy) @@ -91,6 +91,7 @@ + Index: build/build-distr.xml =================================================================== --- build/build-distr.xml (revision 112986) +++ build/build-distr.xml (working copy) @@ -2070,6 +2070,8 @@ + Index: console/.classpath =================================================================== --- console/.classpath (revision 112986) +++ console/.classpath (working copy) @@ -13,5 +13,6 @@ + Index: console/src/main/org/jboss/console/plugins/helpers/jmx/Server.java =================================================================== --- console/src/main/org/jboss/console/plugins/helpers/jmx/Server.java (revision 112986) +++ console/src/main/org/jboss/console/plugins/helpers/jmx/Server.java (working copy) @@ -21,6 +21,7 @@ */ package org.jboss.console.plugins.helpers.jmx; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.logging.Logger; import org.jboss.mx.util.MBeanServerLocator; @@ -36,7 +37,6 @@ import javax.management.ObjectName; import javax.management.ReflectionException; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.util.HashMap; import java.util.Iterator; import java.util.Set; @@ -155,7 +155,7 @@ } PropertyEditor editor = null; if( typeClass != null ) - editor = PropertyEditorManager.findEditor(typeClass); + editor = PropertyEditorFinder.getInstance().find(typeClass); return new AttrResultInfo(attrName, editor, value, throwable); } @@ -182,7 +182,7 @@ Class argType = getPrimativeClass(attrType); if( argType == null ) argType = loader.loadClass(attrType); - PropertyEditor editor = PropertyEditorManager.findEditor(argType); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(argType); // Ignore attributes without valid editors if( editor == null ) { @@ -234,7 +234,7 @@ Class argType = getPrimativeClass(argTypes[p]); if( argType == null ) argType = loader.loadClass(argTypes[p]); - PropertyEditor editor = PropertyEditorManager.findEditor(argType); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(argType); if( editor == null ) throw new IntrospectionException("Failed to find PropertyEditor for type: "+argTypes[p]); editor.setAsText(arg); Index: console/src/main/org/jboss/console/twiddle/command/SetAttrsCommand.java =================================================================== --- console/src/main/org/jboss/console/twiddle/command/SetAttrsCommand.java (revision 112986) +++ console/src/main/org/jboss/console/twiddle/command/SetAttrsCommand.java (working copy) @@ -36,8 +36,10 @@ import gnu.getopt.Getopt; import gnu.getopt.LongOpt; + +import org.jboss.common.beans.property.BeanUtils; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.util.Strings; -import org.jboss.util.propertyeditor.PropertyEditors; /** * Sets one or more attributes in an MBean @@ -170,7 +172,7 @@ throw new CommandException("attribute " + attr_name + " not found"); type = attr_info.getType(); - PropertyEditor editor = PropertyEditors.getEditor(type); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(BeanUtils.findClass(type)); editor.setAsText((String) attr_value); real_value = editor.getValue(); Index: console/src/main/org/jboss/console/twiddle/command/InvokeCommand.java =================================================================== --- console/src/main/org/jboss/console/twiddle/command/InvokeCommand.java (revision 112986) +++ console/src/main/org/jboss/console/twiddle/command/InvokeCommand.java (working copy) @@ -33,9 +33,12 @@ import gnu.getopt.Getopt; import gnu.getopt.LongOpt; + +import org.jboss.common.beans.property.BeanUtils; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.util.Strings; -import org.jboss.util.propertyeditor.PropertyEditors; + /** * Invoke an operation on an MBean. * @@ -225,7 +228,7 @@ for (int i = 0; i < count; i++) { String argType = matchOp.getArgType(i); - PropertyEditor editor = PropertyEditors.getEditor(argType); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(BeanUtils.findClass(argType)); editor.setAsText((String) opArgs.get(i)); params[i] = editor.getValue(); } @@ -244,7 +247,7 @@ { try { - PropertyEditor editor = PropertyEditors.getEditor(result.getClass()); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(result.getClass()); editor.setValue(result); resultText = editor.getAsText(); log.debug("Converted result: " + resultText); Index: console/src/main/org/jboss/console/twiddle/command/SetCommand.java =================================================================== --- console/src/main/org/jboss/console/twiddle/command/SetCommand.java (revision 112986) +++ console/src/main/org/jboss/console/twiddle/command/SetCommand.java (working copy) @@ -35,8 +35,9 @@ import javax.management.MBeanServerConnection; import javax.management.ObjectName; +import org.jboss.common.beans.property.BeanUtils; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.util.Strings; -import org.jboss.util.propertyeditor.PropertyEditors; /** @@ -211,7 +212,7 @@ */ private Object convert (String val,String oType) throws Exception { - PropertyEditor editor = PropertyEditors.getEditor(oType); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(BeanUtils.findClass(oType)); editor.setAsText(val); return editor.getValue(); } Index: console/src/bin/twiddle.sh =================================================================== --- console/src/bin/twiddle.sh (revision 112986) +++ console/src/bin/twiddle.sh (working copy) @@ -52,7 +52,7 @@ fi # Setup the classpath -JBOSS_BOOT_CLASSPATH="$JBOSS_HOME/bin/twiddle.jar" +JBOSS_BOOT_CLASSPATH="$JBOSS_HOME/lib/jboss-common-beans.jar:$JBOSS_HOME/bin/twiddle.jar" if [ "x$JBOSS_CLASSPATH" = "x" ]; then JBOSS_CLASSPATH="$JBOSS_BOOT_CLASSPATH" Index: console/pom.xml =================================================================== --- console/pom.xml (revision 112986) +++ console/pom.xml (working copy) @@ -61,6 +61,10 @@ servlet-api + org.jboss.common + jboss-common-beans + + org.jboss jboss-common-core Index: console/build.xml =================================================================== --- console/build.xml (revision 112986) +++ console/build.xml (working copy) @@ -82,6 +82,7 @@ + Index: mbeans/.classpath =================================================================== --- mbeans/.classpath (revision 112986) +++ mbeans/.classpath (working copy) @@ -10,5 +10,6 @@ + Index: mbeans/src/main/org/jboss/mx/metadata/JBossXMBean10.java =================================================================== --- mbeans/src/main/org/jboss/mx/metadata/JBossXMBean10.java (revision 112986) +++ mbeans/src/main/org/jboss/mx/metadata/JBossXMBean10.java (working copy) @@ -23,7 +23,7 @@ import java.beans.IntrospectionException; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; + import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -44,12 +44,13 @@ import org.dom4j.Attribute; import org.dom4j.Element; +import org.jboss.common.beans.property.BeanUtils; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.logging.Logger; import org.jboss.mx.modelmbean.XMBeanConstants; import org.jboss.mx.util.JBossNotCompliantMBeanException; import org.jboss.util.Classes; import org.jboss.util.StringPropertyReplacer; -import org.jboss.util.propertyeditor.PropertyEditors; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -525,7 +526,7 @@ // Replace any ${x} references in the element text if( replace ) { - PropertyEditor editor = PropertyEditorManager.findEditor(typeClass); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(typeClass); if( editor == null ) { log.warn("Cannot perform property replace on Element"); @@ -543,7 +544,7 @@ if (value == null) { - PropertyEditor editor = PropertyEditorManager.findEditor(typeClass); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(typeClass); if (editor == null) { throw new JBossNotCompliantMBeanException @@ -623,7 +624,7 @@ Object value = null; try { - value = PropertyEditors.convertValue(unconverted, typeName); + value = BeanUtils.convertValue(unconverted, typeName); } catch (ClassNotFoundException e) { Index: mbeans/src/main/org/jboss/mx/modelmbean/ModelMBeanInvoker.java =================================================================== --- mbeans/src/main/org/jboss/mx/modelmbean/ModelMBeanInvoker.java (revision 112986) +++ mbeans/src/main/org/jboss/mx/modelmbean/ModelMBeanInvoker.java (working copy) @@ -26,7 +26,6 @@ import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.util.ArrayList; @@ -61,6 +60,7 @@ import javax.management.modelmbean.ModelMBeanInfoSupport; import javax.management.modelmbean.ModelMBeanOperationInfo; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.logging.Logger; import org.jboss.mx.interceptor.AbstractInterceptor; import org.jboss.mx.interceptor.Interceptor; @@ -776,7 +776,7 @@ if (setter != null) { Class ptype = pd.getPropertyType(); - PropertyEditor editor = PropertyEditorManager.findEditor(ptype); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(ptype); if (editor == null) throw new IntrospectionException("Cannot convert string to interceptor attribute:" + name); editor.setAsText(text); Index: mbeans/pom.xml =================================================================== --- mbeans/pom.xml (revision 112986) +++ mbeans/pom.xml (working copy) @@ -64,6 +64,10 @@ bcel + org.jboss.common + jboss-common-beans + + org.jboss jboss-common-core Index: mbeans/build.xml =================================================================== --- mbeans/build.xml (revision 112986) +++ mbeans/build.xml (working copy) @@ -87,6 +87,7 @@ + Index: security/.classpath =================================================================== --- security/.classpath (revision 112986) +++ security/.classpath (working copy) @@ -19,5 +19,6 @@ + Index: security/src/main/org/jboss/security/plugins/JaasSecurityManagerService.java =================================================================== --- security/src/main/org/jboss/security/plugins/JaasSecurityManagerService.java (revision 112986) +++ security/src/main/org/jboss/security/plugins/JaasSecurityManagerService.java (working copy) @@ -21,7 +21,6 @@ */ package org.jboss.security.plugins; -import java.beans.PropertyEditorManager; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; @@ -52,6 +51,7 @@ import javax.security.auth.callback.CallbackHandler; import javax.security.jacc.PolicyContext; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.logging.Logger; import org.jboss.security.AuthenticationManager; import org.jboss.security.SecurityAssociation; @@ -520,8 +520,8 @@ securityManagement.setAuthenticationMgrClass(securityMgrClassName); // Register the Principal property editor - PropertyEditorManager.registerEditor(Principal.class, PrincipalEditor.class); - PropertyEditorManager.registerEditor(SecurityDomain.class, SecurityDomainEditor.class); + PropertyEditorFinder.getInstance().register(Principal.class, PrincipalEditor.class); + PropertyEditorFinder.getInstance().register(SecurityDomain.class, SecurityDomainEditor.class); log.debug("Registered PrincipalEditor, SecurityDomainEditor"); log.debug("ServerMode="+this.serverMode); Index: security/pom.xml =================================================================== --- security/pom.xml (revision 112986) +++ security/pom.xml (working copy) @@ -73,6 +73,11 @@ + org.jboss.common + jboss-common-beans + + + org.jboss jboss-common-core Index: security/build.xml =================================================================== --- security/build.xml (revision 112986) +++ security/build.xml (working copy) @@ -76,6 +76,7 @@ +
getValue
@@ -314,7 +315,7 @@ */ private Object convert(String val, String oType) throws Exception { - PropertyEditor editor = PropertyEditors.getEditor(oType); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(BeanUtils.findClass(oType)); editor.setAsText(val); return editor.getValue(); } Index: testsuite/src/main/org/jboss/test/xml/MBeanServerUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/xml/MBeanServerUnitTestCase.java (revision 112986) +++ testsuite/src/main/org/jboss/test/xml/MBeanServerUnitTestCase.java (working copy) @@ -130,34 +130,26 @@ assertEquals("There is 1 mbean", 1, mbeans.size()); MBeanData mbean = (MBeanData) mbeans.get(0); - assertTrue("ClassName == org.jboss.security.auth.login.DynamicLoginConfig", - mbean.getCode().equals("org.jboss.security.auth.login.DynamicLoginConfig")); - assertTrue("Name == jboss.security.tests:service=DynamicLoginConfig", - mbean.getName().equals("jboss.security.tests:service=DynamicLoginConfig")); + assertEquals("Wrong class name","org.jboss.security.auth.login.DynamicLoginConfig", mbean.getCode()); + assertEquals("Name","jboss.security.tests:service=DynamicLoginConfig", mbean.getName()); Map attributes = mbean.getAttributeMap(); - assertTrue("There are 2 attributes", - attributes.size() == 2); + assertEquals("Wrong number of attributes", 2, attributes.size()); MBeanAttribute attr = (MBeanAttribute) attributes.get("PolicyConfig"); Object value = attr.getValue(); assertTrue("Value isA PolicyConfig", value instanceof PolicyConfig ); PolicyConfig pc = (PolicyConfig) value; - assertTrue("There 1 AuthenticationInfo", - pc.size() == 1); + assertEquals("Wrong number of AuthenticationInfo", 1, pc.size()); AuthenticationInfo auth = pc.get("conf1"); - assertTrue("The AuthenticationInfo name ic config1", - auth != null); + assertNotNull("The AuthenticationInfo name ic config1", auth); AppConfigurationEntry[] ace = auth.getAppConfigurationEntry(); - assertTrue("The AppConfigurationEntry has one entry", - ace != null && ace.length == 1); - assertTrue("LoginModuleName", - ace[0].getLoginModuleName().equals("org.jboss.security.auth.spi.IdentityLoginModule")); + assertNotNull("AppConfiguration entry must not be null",ace); + assertEquals("The AppConfigurationEntry must have one entry", 1 ,ace.length); + assertEquals("LoginModuleName", "org.jboss.security.auth.spi.IdentityLoginModule", ace[0].getLoginModuleName()); attr = (MBeanAttribute) attributes.get("UserHome"); - assertTrue("Name == UserHome", - attr.getName().equals("UserHome")); - assertTrue("Text != null", - attr.getText() != null); + assertEquals("UserHome", attr.getName()); + assertNotNull("Text != null", attr.getText() ); } /** @@ -253,50 +245,45 @@ // Validate the bindings JNDIBinding[] values = bindings.getBindings(); - assertTrue("There are 5 bindings("+values.length+")", values.length == 5); + assertEquals("Wrong bindings count", 5, values.length); JNDIBinding key1 = values[0]; - assertTrue("values[0] name is ctx1/key1", key1.getName().equals("ctx1/key1")); - assertTrue("values[0] is string of value1", key1.getText().equals("value1")); + assertEquals("values[0]", "ctx1/key1",key1.getName()); + assertEquals("values[0] text", "value1",key1.getText()); JNDIBinding userHome = values[1]; - assertTrue("values[1] name is ctx1/user.home", userHome.getName().equals("ctx1/user.home")); + assertEquals("values[1]", "ctx1/user.home",userHome.getName()); String p = System.getProperty("user.home"); - assertTrue("values[1] is property ${user.home}", userHome.getText().equals(p)); + assertEquals("values[1] property( ${user.home} )", p,userHome.getText()); // Test binding from a text to URL based on the type attribute PropertyEditor JNDIBinding jbossHome = values[2]; - assertTrue("values[2] name is ctx1/key2", jbossHome.getName().equals("ctx1/key2")); - assertTrue("values[2] is http://www.jboss.org", - jbossHome.getText().equals("http://www.jboss.org")); - assertTrue("values[2] type is java.net.URL", - jbossHome.getType().equals("java.net.URL")); + assertEquals("values[2]", "ctx1/key2", jbossHome.getName()); + assertEquals("values[2] text", "http://www.jboss.org", jbossHome.getText()); + assertEquals("values[2] type","java.net.URL", jbossHome.getType()); Object value2 = jbossHome.getValue(); - assertTrue("values[2] value is URL(http://www.jboss.org)", - value2.equals(new URL("http://www.jboss.org"))); + assertEquals("values[2] as URL(http://www.jboss.org)", new URL("http://www.jboss.org"), value2); // Test a binding from an xml fragment from a foreign namespace. JNDIBinding properties = values[3]; Object value = properties.getValue(); - assertTrue("values[3] name is ctx2/key1", properties.getName().equals("ctx2/key1")); - assertTrue("values[3] is java.util.Properties", value instanceof Properties); + assertEquals("values[3]", "ctx2/key1", properties.getName()); + assertEquals("values[3] is java.util.Properties", Properties.class,value.getClass()); Properties props = (Properties) value; - assertTrue("Properties(key1) == value1", props.getProperty("key1").equals("value1")); - assertTrue("Properties(key2) == value2", props.getProperty("key2").equals("value2")); + assertEquals("Properties(key1)", "value1", props.getProperty("key1")); + assertEquals("Properties(key2)", "value2", props.getProperty("key2")); // Test binding from a text to InetAddress based on the editor attribute PropertyEditor JNDIBinding host = values[4]; - assertTrue("values[4] name is hosts/localhost", host.getName().equals("hosts/localhost")); + assertEquals("values[4] ", "hosts/localhost", host.getName()); assertTrue(host.isTrim()); - assertTrue("values[4] text is 127.0.0.1", - host.getText().equals("127.0.0.1")); - assertTrue("values[4] editor is org.jboss.util.propertyeditor.InetAddressEditor", - host.getEditor().equals("org.jboss.util.propertyeditor.InetAddressEditor")); + assertEquals("values[4] text","127.0.0.1", + host.getText()); + assertEquals("values[4] editor","org.jboss.common.beans.property.InetAddressEditor", host.getEditor()); Object value4 = host.getValue(); InetAddress hostValue = (InetAddress) value4; InetAddress localhost = InetAddress.getByName("127.0.0.1"); - assertTrue("values[4] value is InetAddress(127.0.0.1)", - hostValue.getHostAddress().equals(localhost.getHostAddress())); + assertEquals("values[4] value InetAddress(127.0.0.1)",localhost.getHostAddress(), hostValue.getHostAddress()); } Index: testsuite/src/main/org/jboss/test/xml/mbeanserver/XMBean2UnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/xml/mbeanserver/XMBean2UnitTestCase.java (revision 112986) +++ testsuite/src/main/org/jboss/test/xml/mbeanserver/XMBean2UnitTestCase.java (working copy) @@ -70,22 +70,23 @@ String xmlPath = getResourcePath("xml/mbeanserver/testXMBean2.xml"); Object root = unmarshaller.unmarshal(xmlPath, resolver); - assertTrue("", root instanceof ModelMBeanInfoSupportWrapper); + assertInstanceOf( root,ModelMBeanInfoSupportWrapper.class); ModelMBeanInfoSupportWrapper mbean = (ModelMBeanInfoSupportWrapper) root; Descriptor descriptor = mbean.getDescriptors(); Object i = descriptor.getFieldValue("interceptors"); Interceptor[] interceptors = (Interceptor[]) i; SomeBeanInterceptor sbi = (SomeBeanInterceptor) interceptors[0]; assertTrue(sbi.isFlag()); - assertTrue("aClass == Integer.class", sbi.getaClass() == Integer.class); + assertEquals("Bean interceptor aclass", Integer.class,sbi.getaClass()); + URL homePage = new URL("http://www.jboss.org/"); - assertTrue("homePage == URL(http://www.jboss.org/)", sbi.getHomePage().equals(homePage)); + assertEquals("homePage",homePage, sbi.getHomePage()); Long l = new Long(123456789); - assertTrue("aLong == 123456789", sbi.getaLong().equals(l)); - assertTrue("aString == string1", sbi.getaString().equals("string1")); - assertTrue("anInt == 1234", sbi.getAnInt() == 1234); + assertEquals("aLong", l,sbi.getaLong()); + assertEquals("aString", "string1",sbi.getaString()); + assertEquals("anInt",1234, sbi.getAnInt()); InetAddress localhost = InetAddress.getByName("127.0.0.1"); - assertTrue("address == 127.0.0.1", sbi.getAddress().equals(localhost)); + assertEquals("address", localhost,sbi.getAddress()); String[] strings = {"string1", "string2", "string3"}; assertTrue("someStrings == {string1, string2, string3}", Arrays.equals(strings, sbi.getSomeStrings())); @@ -93,20 +94,19 @@ someProperties.setProperty("prop1", "value1"); someProperties.setProperty("prop2", "value2"); someProperties.setProperty("prop3", "value3"); - assertTrue("someProperties == {string1, string2, string3}", - sbi.getSomeProperties().equals(someProperties)); + assertEquals("someProperties", someProperties,sbi.getSomeProperties()); Object i1 = interceptors[1]; - assertTrue(i1 instanceof PersistenceInterceptor2); + assertInstanceOf(i1, PersistenceInterceptor2.class); Object i2 = interceptors[2]; - assertTrue(i2 instanceof ModelMBeanInterceptor); + assertInstanceOf(i2,ModelMBeanInterceptor.class); Object i3 = interceptors[3]; - assertTrue(i3 instanceof ObjectReferenceInterceptor); + assertInstanceOf(i3 , ObjectReferenceInterceptor.class); String clazz = mbean.getClassName(); - assertTrue("class is org.jboss.naming.JNDIBindingService", - clazz.equals("org.jboss.naming.JNDIBindingService")); + assertEquals("Classname",org.jboss.naming.JNDIBindingService.class.getName(),clazz); + ModelMBeanInfo info = mbean.getMBeanInfo(); MBeanAttributeInfo[] attrs = info.getAttributes(); assertTrue("There are 2 attributes", attrs.length == 2); Index: testsuite/src/main/org/jboss/test/xml/mbeanserver/JavaBeanSchemaInitializer.java =================================================================== --- testsuite/src/main/org/jboss/test/xml/mbeanserver/JavaBeanSchemaInitializer.java (revision 112986) +++ testsuite/src/main/org/jboss/test/xml/mbeanserver/JavaBeanSchemaInitializer.java (working copy) @@ -25,6 +25,7 @@ import javax.xml.namespace.QName; import javax.xml.namespace.NamespaceContext; +import org.jboss.common.beans.property.BeanUtils; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingInitializer; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding; @@ -32,7 +33,6 @@ import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding; import org.jboss.xb.binding.sunday.unmarshalling.impl.runtime.RtElementHandler; -import org.jboss.util.propertyeditor.PropertyEditors; import org.xml.sax.Attributes; /** @@ -50,10 +50,6 @@ /** The javabean binding */ private static final QName javabeanTypeQName = new QName(JavaBeanSchemaInitializer.JAVABEAN_NS, "javabeanType"); - static - { - PropertyEditors.init(); - } public SchemaBinding init(SchemaBinding schema) { @@ -154,7 +150,7 @@ bean = holder.getBean(); Properties props = holder.getProperties(); //System.out.println("Converting properties: "+props); - PropertyEditors.mapJavaBeanProperties(bean, props, true); + BeanUtils.mapJavaBeanProperties(bean, props, true); } catch (Exception e) { Index: testsuite/src/main/org/jboss/test/xml/JNDIBindingUnitTestCase.java =================================================================== --- testsuite/src/main/org/jboss/test/xml/JNDIBindingUnitTestCase.java (revision 112986) +++ testsuite/src/main/org/jboss/test/xml/JNDIBindingUnitTestCase.java (working copy) @@ -58,47 +58,41 @@ assertTrue("There are 5 bindings("+values.length+")", values.length == 5); JNDIBinding key1 = values[0]; - assertTrue("values[0] name is ctx1/key1", key1.getName().equals("ctx1/key1")); - assertTrue("values[0] is string of value1", key1.getText().equals("value1")); + assertEquals("values[0] name is ctx1/key1", "ctx1/key1",key1.getName()); + assertEquals("values[0] is string of value1","value1", key1.getText()); JNDIBinding userHome = values[1]; - assertTrue("values[1] name is ctx1/user.home", userHome.getName().equals("ctx1/user.home")); + assertEquals("values[1] name is ctx1/user.home", "ctx1/user.home",userHome.getName()); String p = System.getProperty("user.home"); - assertTrue("values[1] is property ${user.home}", userHome.getText().equals(p)); + assertEquals("values[1] is property ${user.home}", p, userHome.getText()); // Test binding from a text to URL based on the type attribute PropertyEditor JNDIBinding jbossHome = values[2]; - assertTrue("values[2] name is ctx1/key2", jbossHome.getName().equals("ctx1/key2")); - assertTrue("values[2] is http://www.jboss.org", - jbossHome.getText().equals("http://www.jboss.org")); - assertTrue("values[2] type is java.net.URL", - jbossHome.getType().equals("java.net.URL")); + assertEquals("values[2] name is ctx1/key2", "ctx1/key2", jbossHome.getName()); + assertEquals("values[2] is http://www.jboss.org", "http://www.jboss.org", jbossHome.getText()); + assertEquals("values[2] type is java.net.URL", "java.net.URL", jbossHome.getType()); Object value2 = jbossHome.getValue(); - assertTrue("values[2] value is URL(http://www.jboss.org)", - value2.equals(new URL("http://www.jboss.org"))); + assertEquals("values[2] value is URL(http://www.jboss.org)", new URL("http://www.jboss.org"), value2); // Test a binding from an xml fragment from a foreign namespace. JNDIBinding properties = values[3]; Object value = properties.getValue(); - assertTrue("values[3] name is ctx2/key1", properties.getName().equals("ctx2/key1")); + assertEquals("values[3] name is ctx2/key1", "ctx2/key1",properties.getName()); assertTrue("values[3] is java.util.Properties", value instanceof Properties); Properties props = (Properties) value; - assertTrue("Properties(key1) == value1", props.getProperty("key1").equals("value1")); - assertTrue("Properties(key2) == value2", props.getProperty("key2").equals("value2")); + assertEquals("Properties(key1) == value1", "value1", props.getProperty("key1")); + assertEquals("Properties(key2) == value2", "value2", props.getProperty("key2")); // Test binding from a text to InetAddress based on the editor attribute PropertyEditor JNDIBinding host = values[4]; - assertTrue("values[4] name is hosts/localhost", host.getName().equals("hosts/localhost")); + assertEquals("values[4] name is hosts/localhost", "hosts/localhost",host.getName()); assertTrue(host.isTrim()); - assertTrue("values[4] text is 127.0.0.1", - host.getText().equals("127.0.0.1")); - assertTrue("values[4] editor is org.jboss.util.propertyeditor.InetAddressEditor", - host.getEditor().equals("org.jboss.util.propertyeditor.InetAddressEditor")); + assertEquals("values[4] text is 127.0.0.1", "127.0.0.1", host.getText()); + assertEquals("values[4] editor is org.jboss.common.beans.property.InetAddressEditor", "org.jboss.common.beans.property.InetAddressEditor" , host.getEditor()); Object value4 = host.getValue(); InetAddress hostValue = (InetAddress) value4; InetAddress localhost = InetAddress.getByName("127.0.0.1"); - assertTrue("values[4] value is InetAddress(127.0.0.1)", - hostValue.getHostAddress().equals(localhost.getHostAddress())); + assertEquals("values[4] value is InetAddress(127.0.0.1)", localhost.getHostAddress(), hostValue.getHostAddress()); } // Private Index: testsuite/src/resources/naming/services/bindings-service.xml =================================================================== --- testsuite/src/resources/naming/services/bindings-service.xml (revision 112986) +++ testsuite/src/resources/naming/services/bindings-service.xml (working copy) @@ -14,7 +14,7 @@ - + 127.0.0.1 Index: testsuite/src/resources/bootstrap/property/properties/META-INF/jboss-service.xml =================================================================== --- testsuite/src/resources/bootstrap/property/properties/META-INF/jboss-service.xml (revision 0) +++ testsuite/src/resources/bootstrap/property/properties/META-INF/jboss-service.xml (revision 0) @@ -0,0 +1,7 @@ + + + + x=${user.home} + + \ No newline at end of file Index: testsuite/src/resources/xml/mbeanserver/testBinding.xml =================================================================== --- testsuite/src/resources/xml/mbeanserver/testBinding.xml (revision 112986) +++ testsuite/src/resources/xml/mbeanserver/testBinding.xml (working copy) @@ -37,7 +37,7 @@ - + 127.0.0.1 Index: testsuite/src/resources/xml/naming/testBindings.xml =================================================================== --- testsuite/src/resources/xml/naming/testBindings.xml (revision 112986) +++ testsuite/src/resources/xml/naming/testBindings.xml (working copy) @@ -28,7 +28,7 @@ - + 127.0.0.1 Index: testsuite/src/etc/cluster-harness/conf/jboss-service-bench1.xml =================================================================== --- testsuite/src/etc/cluster-harness/conf/jboss-service-bench1.xml (revision 112986) +++ testsuite/src/etc/cluster-harness/conf/jboss-service-bench1.xml (working copy) @@ -81,17 +81,17 @@ - java.math.BigDecimal=org.jboss.util.propertyeditor.BigDecimalEditor - java.lang.Boolean=org.jboss.util.propertyeditor.BooleanEditor - java.lang.Class=org.jboss.util.propertyeditor.ClassEditor - java.util.Date=org.jboss.util.propertyeditor.DateEditor - java.io.File=org.jboss.util.propertyeditor.FileEditor - java.net.InetAddress=org.jboss.util.propertyeditor.InetAddressEditor - java.lang.Integer=org.jboss.util.propertyeditor.IntegerEditor - javax.management.ObjectName=org.jboss.mx.util.propertyeditor.ObjectNameEditor - java.util.Properties=org.jboss.util.propertyeditor.PropertiesEditor - [Ljava.lang.String;=org.jboss.util.propertyeditor.StringArrayEditor - java.net.URL=org.jboss.util.propertyeditor.URLEditor + java.math.BigDecimal=org.jboss.common.beans.property.BigDecimalEditor + java.lang.Boolean=org.jboss.common.beans.property.BooleanEditor + java.lang.Class=org.jboss.common.beans.property.ClassEditor + java.util.Date=org.jboss.common.beans.property.DateEditor + java.io.File=org.jboss.common.beans.property.FileEditor + java.net.InetAddress=org.jboss.common.beans.property.InetAddressEditor + java.lang.Integer=org.jboss.common.beans.property.IntegerEditor + javax.management.ObjectName=org.jboss.common.beans.property.ObjectNameEditor + java.util.Properties=org.jboss.common.beans.property.PropertiesEditor + [Ljava.lang.String;=org.jboss.common.beans.property.StringArrayEditor + java.net.URL=org.jboss.common.beans.property.URLEditor --> Index: testsuite/src/etc/cluster-harness/conf/jboss-service-bench2.xml =================================================================== --- testsuite/src/etc/cluster-harness/conf/jboss-service-bench2.xml (revision 112986) +++ testsuite/src/etc/cluster-harness/conf/jboss-service-bench2.xml (working copy) @@ -81,17 +81,17 @@ - java.math.BigDecimal=org.jboss.util.propertyeditor.BigDecimalEditor - java.lang.Boolean=org.jboss.util.propertyeditor.BooleanEditor - java.lang.Class=org.jboss.util.propertyeditor.ClassEditor - java.util.Date=org.jboss.util.propertyeditor.DateEditor - java.io.File=org.jboss.util.propertyeditor.FileEditor - java.net.InetAddress=org.jboss.util.propertyeditor.InetAddressEditor - java.lang.Integer=org.jboss.util.propertyeditor.IntegerEditor - javax.management.ObjectName=org.jboss.mx.util.propertyeditor.ObjectNameEditor - java.util.Properties=org.jboss.util.propertyeditor.PropertiesEditor - [Ljava.lang.String;=org.jboss.util.propertyeditor.StringArrayEditor - java.net.URL=org.jboss.util.propertyeditor.URLEditor + java.math.BigDecimal=org.jboss.common.beans.property.BigDecimalEditor + java.lang.Boolean=org.jboss.common.beans.property.BooleanEditor + java.lang.Class=org.jboss.common.beans.property.ClassEditor + java.util.Date=org.jboss.common.beans.property.DateEditor + java.io.File=org.jboss.common.beans.property.FileEditor + java.net.InetAddress=org.jboss.common.beans.property.InetAddressEditor + java.lang.Integer=org.jboss.common.beans.property.IntegerEditor + javax.management.ObjectName=org.jboss.common.beans.property.ObjectNameEditor + java.util.Properties=org.jboss.common.beans.property.PropertiesEditor + [Ljava.lang.String;=org.jboss.common.beans.property.StringArrayEditor + java.net.URL=org.jboss.common.beans.property.URLEditor --> Index: testsuite/imports/sections/property.xml =================================================================== --- testsuite/imports/sections/property.xml (revision 0) +++ testsuite/imports/sections/property.xml (revision 0) @@ -0,0 +1,48 @@ + + + + + + JBossProprties test archive builder + + + + + + + + + + + + + + + + + + + + Index: testsuite/imports/test-jars.xml =================================================================== --- testsuite/imports/test-jars.xml (revision 112986) +++ testsuite/imports/test-jars.xml (working copy) @@ -84,7 +84,8 @@ - + + @@ -4779,7 +4781,7 @@ - + Index: connector/.classpath =================================================================== --- connector/.classpath (revision 112986) +++ connector/.classpath (working copy) @@ -20,5 +20,6 @@ + Index: connector/src/main/org/jboss/resource/adapter/jdbc/xa/XAManagedConnectionFactory.java =================================================================== --- connector/src/main/org/jboss/resource/adapter/jdbc/xa/XAManagedConnectionFactory.java (revision 112986) +++ connector/src/main/org/jboss/resource/adapter/jdbc/xa/XAManagedConnectionFactory.java (working copy) @@ -21,11 +21,11 @@ */ package org.jboss.resource.adapter.jdbc.xa; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnectionFactory; import org.jboss.resource.adapter.jdbc.URLSelectorStrategy; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.beans.PropertyEditorManager; import java.beans.PropertyEditor; import javax.sql.XADataSource; import javax.sql.XAConnection; @@ -191,7 +191,7 @@ } // end of try-catch Method setter = clazz.getMethod("set" + name, new Class[]{type}); - PropertyEditor editor = PropertyEditorManager.findEditor(type); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(type); if(editor == null) { throw new JBossResourceException("No property editor found for type: " + type); @@ -597,7 +597,7 @@ } Method setter = clazz.getMethod("set" + name, new Class[] { type }); - PropertyEditor editor = PropertyEditorManager.findEditor(type); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(type); if (editor == null) throw new JBossResourceException("No property editor found for type: " + type); editor.setAsText(value); Index: connector/src/main/org/jboss/resource/deployment/AdminObjectFactory.java =================================================================== --- connector/src/main/org/jboss/resource/deployment/AdminObjectFactory.java (revision 112986) +++ connector/src/main/org/jboss/resource/deployment/AdminObjectFactory.java (working copy) @@ -21,10 +21,7 @@ */ package org.jboss.resource.deployment; -import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.util.Collection; import java.util.Iterator; import java.util.Map; Index: connector/src/main/org/jboss/resource/deployment/ConfigPropertyHandler.java =================================================================== --- connector/src/main/org/jboss/resource/deployment/ConfigPropertyHandler.java (revision 112986) +++ connector/src/main/org/jboss/resource/deployment/ConfigPropertyHandler.java (working copy) @@ -22,11 +22,11 @@ package org.jboss.resource.deployment; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.logging.Logger; import org.jboss.resource.metadata.ConfigPropertyMetaData; import org.jboss.util.Classes; @@ -278,7 +278,7 @@ */ private Object getValue(String propertyName, Class actualType, String value, boolean mustExist) { - PropertyEditor editor = PropertyEditorManager.findEditor(actualType); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(actualType); if (editor == null) { String error = "No property editor found for property " + propertyName; Index: connector/src/main/org/jboss/resource/deployment/ResourceAdapterFactory.java =================================================================== --- connector/src/main/org/jboss/resource/deployment/ResourceAdapterFactory.java (revision 112986) +++ connector/src/main/org/jboss/resource/deployment/ResourceAdapterFactory.java (working copy) @@ -21,13 +21,8 @@ */ package org.jboss.resource.deployment; -import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.HashMap; import java.util.Iterator; -import java.util.Map; import javax.resource.spi.ResourceAdapter; Index: connector/src/main/org/jboss/resource/connectionmanager/ManagedConnectionFactoryDeployment.java =================================================================== --- connector/src/main/org/jboss/resource/connectionmanager/ManagedConnectionFactoryDeployment.java (revision 112986) +++ connector/src/main/org/jboss/resource/connectionmanager/ManagedConnectionFactoryDeployment.java (working copy) @@ -22,7 +22,6 @@ package org.jboss.resource.connectionmanager; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.io.File; @@ -55,9 +54,9 @@ import javax.security.auth.Subject; import javax.transaction.xa.XAResource; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.deployers.spi.DeploymentException; import org.jboss.logging.Logger; -import org.jboss.metadata.MetaData; import org.jboss.resource.connectionmanager.xa.XAResourceWrapperImpl; import org.jboss.resource.metadata.ConfigPropertyMetaData; import org.jboss.resource.metadata.ConnectionDefinitionMetaData; @@ -80,8 +79,6 @@ import org.jboss.util.NestedRuntimeException; import org.jboss.util.StringPropertyReplacer; import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; /** @@ -1021,7 +1018,7 @@ continue; } } - PropertyEditor pe = PropertyEditorManager.findEditor(clazz); + PropertyEditor pe = PropertyEditorFinder.getInstance().find(clazz); if (pe == null) { log.warn("Unable to find a PropertyEditor for class '" + clazz + "' of property '" + name + "' - " @@ -1081,7 +1078,7 @@ continue; } } - PropertyEditor pe = PropertyEditorManager.findEditor(clazz); + PropertyEditor pe = PropertyEditorFinder.getInstance().find(clazz); if (pe == null) { log.warn("Unable to find a PropertyEditor for class '" + clazz + "' of property '" + name + "' - " Index: connector/src/main/org/jboss/resource/connectionmanager/RARDeployment.java =================================================================== --- connector/src/main/org/jboss/resource/connectionmanager/RARDeployment.java (revision 112986) +++ connector/src/main/org/jboss/resource/connectionmanager/RARDeployment.java (working copy) @@ -22,7 +22,6 @@ package org.jboss.resource.connectionmanager; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Collection; @@ -37,6 +36,7 @@ import javax.resource.spi.ResourceAdapter; import javax.resource.spi.ResourceAdapterAssociation; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.deployers.spi.DeploymentException; import org.jboss.logging.Logger; import org.jboss.metadata.MetaData; @@ -504,7 +504,7 @@ continue; } } - PropertyEditor pe = PropertyEditorManager.findEditor(clazz); + PropertyEditor pe = PropertyEditorFinder.getInstance().find(clazz); if (pe == null) { log.warn("Unable to find a PropertyEditor for class '" + clazz + "' of property '" + name + "' - " Index: connector/pom.xml =================================================================== --- connector/pom.xml (revision 112986) +++ connector/pom.xml (working copy) @@ -73,6 +73,10 @@ mail + org.jboss.common + jboss-common-beans + + org.jboss jboss-common-core Index: connector/build.xml =================================================================== --- connector/build.xml (revision 112986) +++ connector/build.xml (working copy) @@ -91,6 +91,7 @@ + Index: build/build-distr.xml =================================================================== --- build/build-distr.xml (revision 112986) +++ build/build-distr.xml (working copy) @@ -2070,6 +2070,8 @@ + Index: console/.classpath =================================================================== --- console/.classpath (revision 112986) +++ console/.classpath (working copy) @@ -13,5 +13,6 @@ + Index: console/src/main/org/jboss/console/plugins/helpers/jmx/Server.java =================================================================== --- console/src/main/org/jboss/console/plugins/helpers/jmx/Server.java (revision 112986) +++ console/src/main/org/jboss/console/plugins/helpers/jmx/Server.java (working copy) @@ -21,6 +21,7 @@ */ package org.jboss.console.plugins.helpers.jmx; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.logging.Logger; import org.jboss.mx.util.MBeanServerLocator; @@ -36,7 +37,6 @@ import javax.management.ObjectName; import javax.management.ReflectionException; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.util.HashMap; import java.util.Iterator; import java.util.Set; @@ -155,7 +155,7 @@ } PropertyEditor editor = null; if( typeClass != null ) - editor = PropertyEditorManager.findEditor(typeClass); + editor = PropertyEditorFinder.getInstance().find(typeClass); return new AttrResultInfo(attrName, editor, value, throwable); } @@ -182,7 +182,7 @@ Class argType = getPrimativeClass(attrType); if( argType == null ) argType = loader.loadClass(attrType); - PropertyEditor editor = PropertyEditorManager.findEditor(argType); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(argType); // Ignore attributes without valid editors if( editor == null ) { @@ -234,7 +234,7 @@ Class argType = getPrimativeClass(argTypes[p]); if( argType == null ) argType = loader.loadClass(argTypes[p]); - PropertyEditor editor = PropertyEditorManager.findEditor(argType); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(argType); if( editor == null ) throw new IntrospectionException("Failed to find PropertyEditor for type: "+argTypes[p]); editor.setAsText(arg); Index: console/src/main/org/jboss/console/twiddle/command/SetAttrsCommand.java =================================================================== --- console/src/main/org/jboss/console/twiddle/command/SetAttrsCommand.java (revision 112986) +++ console/src/main/org/jboss/console/twiddle/command/SetAttrsCommand.java (working copy) @@ -36,8 +36,10 @@ import gnu.getopt.Getopt; import gnu.getopt.LongOpt; + +import org.jboss.common.beans.property.BeanUtils; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.util.Strings; -import org.jboss.util.propertyeditor.PropertyEditors; /** * Sets one or more attributes in an MBean @@ -170,7 +172,7 @@ throw new CommandException("attribute " + attr_name + " not found"); type = attr_info.getType(); - PropertyEditor editor = PropertyEditors.getEditor(type); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(BeanUtils.findClass(type)); editor.setAsText((String) attr_value); real_value = editor.getValue(); Index: console/src/main/org/jboss/console/twiddle/command/InvokeCommand.java =================================================================== --- console/src/main/org/jboss/console/twiddle/command/InvokeCommand.java (revision 112986) +++ console/src/main/org/jboss/console/twiddle/command/InvokeCommand.java (working copy) @@ -33,9 +33,12 @@ import gnu.getopt.Getopt; import gnu.getopt.LongOpt; + +import org.jboss.common.beans.property.BeanUtils; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.util.Strings; -import org.jboss.util.propertyeditor.PropertyEditors; + /** * Invoke an operation on an MBean. * @@ -225,7 +228,7 @@ for (int i = 0; i < count; i++) { String argType = matchOp.getArgType(i); - PropertyEditor editor = PropertyEditors.getEditor(argType); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(BeanUtils.findClass(argType)); editor.setAsText((String) opArgs.get(i)); params[i] = editor.getValue(); } @@ -244,7 +247,7 @@ { try { - PropertyEditor editor = PropertyEditors.getEditor(result.getClass()); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(result.getClass()); editor.setValue(result); resultText = editor.getAsText(); log.debug("Converted result: " + resultText); Index: console/src/main/org/jboss/console/twiddle/command/SetCommand.java =================================================================== --- console/src/main/org/jboss/console/twiddle/command/SetCommand.java (revision 112986) +++ console/src/main/org/jboss/console/twiddle/command/SetCommand.java (working copy) @@ -35,8 +35,9 @@ import javax.management.MBeanServerConnection; import javax.management.ObjectName; +import org.jboss.common.beans.property.BeanUtils; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.util.Strings; -import org.jboss.util.propertyeditor.PropertyEditors; /** @@ -211,7 +212,7 @@ */ private Object convert (String val,String oType) throws Exception { - PropertyEditor editor = PropertyEditors.getEditor(oType); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(BeanUtils.findClass(oType)); editor.setAsText(val); return editor.getValue(); } Index: console/src/bin/twiddle.sh =================================================================== --- console/src/bin/twiddle.sh (revision 112986) +++ console/src/bin/twiddle.sh (working copy) @@ -52,7 +52,7 @@ fi # Setup the classpath -JBOSS_BOOT_CLASSPATH="$JBOSS_HOME/bin/twiddle.jar" +JBOSS_BOOT_CLASSPATH="$JBOSS_HOME/lib/jboss-common-beans.jar:$JBOSS_HOME/bin/twiddle.jar" if [ "x$JBOSS_CLASSPATH" = "x" ]; then JBOSS_CLASSPATH="$JBOSS_BOOT_CLASSPATH" Index: console/pom.xml =================================================================== --- console/pom.xml (revision 112986) +++ console/pom.xml (working copy) @@ -61,6 +61,10 @@ servlet-api + org.jboss.common + jboss-common-beans + + org.jboss jboss-common-core Index: console/build.xml =================================================================== --- console/build.xml (revision 112986) +++ console/build.xml (working copy) @@ -82,6 +82,7 @@ + Index: mbeans/.classpath =================================================================== --- mbeans/.classpath (revision 112986) +++ mbeans/.classpath (working copy) @@ -10,5 +10,6 @@ + Index: mbeans/src/main/org/jboss/mx/metadata/JBossXMBean10.java =================================================================== --- mbeans/src/main/org/jboss/mx/metadata/JBossXMBean10.java (revision 112986) +++ mbeans/src/main/org/jboss/mx/metadata/JBossXMBean10.java (working copy) @@ -23,7 +23,7 @@ import java.beans.IntrospectionException; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; + import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -44,12 +44,13 @@ import org.dom4j.Attribute; import org.dom4j.Element; +import org.jboss.common.beans.property.BeanUtils; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.logging.Logger; import org.jboss.mx.modelmbean.XMBeanConstants; import org.jboss.mx.util.JBossNotCompliantMBeanException; import org.jboss.util.Classes; import org.jboss.util.StringPropertyReplacer; -import org.jboss.util.propertyeditor.PropertyEditors; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -525,7 +526,7 @@ // Replace any ${x} references in the element text if( replace ) { - PropertyEditor editor = PropertyEditorManager.findEditor(typeClass); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(typeClass); if( editor == null ) { log.warn("Cannot perform property replace on Element"); @@ -543,7 +544,7 @@ if (value == null) { - PropertyEditor editor = PropertyEditorManager.findEditor(typeClass); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(typeClass); if (editor == null) { throw new JBossNotCompliantMBeanException @@ -623,7 +624,7 @@ Object value = null; try { - value = PropertyEditors.convertValue(unconverted, typeName); + value = BeanUtils.convertValue(unconverted, typeName); } catch (ClassNotFoundException e) { Index: mbeans/src/main/org/jboss/mx/modelmbean/ModelMBeanInvoker.java =================================================================== --- mbeans/src/main/org/jboss/mx/modelmbean/ModelMBeanInvoker.java (revision 112986) +++ mbeans/src/main/org/jboss/mx/modelmbean/ModelMBeanInvoker.java (working copy) @@ -26,7 +26,6 @@ import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.util.ArrayList; @@ -61,6 +60,7 @@ import javax.management.modelmbean.ModelMBeanInfoSupport; import javax.management.modelmbean.ModelMBeanOperationInfo; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.logging.Logger; import org.jboss.mx.interceptor.AbstractInterceptor; import org.jboss.mx.interceptor.Interceptor; @@ -776,7 +776,7 @@ if (setter != null) { Class ptype = pd.getPropertyType(); - PropertyEditor editor = PropertyEditorManager.findEditor(ptype); + PropertyEditor editor = PropertyEditorFinder.getInstance().find(ptype); if (editor == null) throw new IntrospectionException("Cannot convert string to interceptor attribute:" + name); editor.setAsText(text); Index: mbeans/pom.xml =================================================================== --- mbeans/pom.xml (revision 112986) +++ mbeans/pom.xml (working copy) @@ -64,6 +64,10 @@ bcel + org.jboss.common + jboss-common-beans + + org.jboss jboss-common-core Index: mbeans/build.xml =================================================================== --- mbeans/build.xml (revision 112986) +++ mbeans/build.xml (working copy) @@ -87,6 +87,7 @@ + Index: security/.classpath =================================================================== --- security/.classpath (revision 112986) +++ security/.classpath (working copy) @@ -19,5 +19,6 @@ + Index: security/src/main/org/jboss/security/plugins/JaasSecurityManagerService.java =================================================================== --- security/src/main/org/jboss/security/plugins/JaasSecurityManagerService.java (revision 112986) +++ security/src/main/org/jboss/security/plugins/JaasSecurityManagerService.java (working copy) @@ -21,7 +21,6 @@ */ package org.jboss.security.plugins; -import java.beans.PropertyEditorManager; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; @@ -52,6 +51,7 @@ import javax.security.auth.callback.CallbackHandler; import javax.security.jacc.PolicyContext; +import org.jboss.common.beans.property.finder.PropertyEditorFinder; import org.jboss.logging.Logger; import org.jboss.security.AuthenticationManager; import org.jboss.security.SecurityAssociation; @@ -520,8 +520,8 @@ securityManagement.setAuthenticationMgrClass(securityMgrClassName); // Register the Principal property editor - PropertyEditorManager.registerEditor(Principal.class, PrincipalEditor.class); - PropertyEditorManager.registerEditor(SecurityDomain.class, SecurityDomainEditor.class); + PropertyEditorFinder.getInstance().register(Principal.class, PrincipalEditor.class); + PropertyEditorFinder.getInstance().register(SecurityDomain.class, SecurityDomainEditor.class); log.debug("Registered PrincipalEditor, SecurityDomainEditor"); log.debug("ServerMode="+this.serverMode); Index: security/pom.xml =================================================================== --- security/pom.xml (revision 112986) +++ security/pom.xml (working copy) @@ -73,6 +73,11 @@ + org.jboss.common + jboss-common-beans + + + org.jboss jboss-common-core Index: security/build.xml =================================================================== --- security/build.xml (revision 112986) +++ security/build.xml (working copy) @@ -76,6 +76,7 @@ +