You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2014/08/05 20:13:57 UTC

svn commit: r1615969 - in /qpid/trunk/qpid/java: broker-core/src/main/java/org/apache/qpid/server/model/ broker-core/src/test/java/org/apache/qpid/server/model/ broker-core/src/test/java/org/apache/qpid/server/model/testmodel/ broker-plugins/management...

Author: rgodfrey
Date: Tue Aug  5 18:13:55 2014
New Revision: 1615969

URL: http://svn.apache.org/r1615969
Log:
QPID-5940 : Make ConfiguredObjectTypeRegistry more easy to test, and add some tests

Added:
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/ConfigureObjectTypeRegistryTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/Test2RootCategory.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/Test2RootCategoryImpl.java
      - copied, changed from r1615458, qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/TestRootCategoryImpl.java
Modified:
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractUnresolvedObject.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/BrokerModel.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectTypeRegistry.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Model.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/TestModel.java
    qpid/trunk/qpid/java/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MetaDataServlet.java
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/AbstractSpecialisedAttributeLister.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AuthenticationProviderRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/GroupProviderRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesProviderRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QueueRestTest.java

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java?rev=1615969&r1=1615968&r2=1615969&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java Tue Aug  5 18:13:55 2014
@@ -197,9 +197,9 @@ public abstract class AbstractConfigured
 
         _category = ConfiguredObjectTypeRegistry.getCategory(getClass());
 
-        _attributeTypes = ConfiguredObjectTypeRegistry.getAttributeTypes(getClass());
-        _automatedFields = ConfiguredObjectTypeRegistry.getAutomatedFields(getClass());
-        _stateChangeMethods = ConfiguredObjectTypeRegistry.getStateChangeMethods(getClass());
+        _attributeTypes = model.getTypeRegistry().getAttributeTypes(getClass());
+        _automatedFields = model.getTypeRegistry().getAutomatedFields(getClass());
+        _stateChangeMethods = model.getTypeRegistry().getStateChangeMethods(getClass());
 
         Object idObj = attributes.get(ID);
 
@@ -1044,7 +1044,7 @@ public abstract class AbstractConfigured
 
     public final Collection<String> getAttributeNames()
     {
-        return ConfiguredObjectTypeRegistry.getAttributeNames(getClass());
+        return _model.getTypeRegistry().getAttributeNames(getClass());
     }
 
     @Override
@@ -1369,7 +1369,7 @@ public abstract class AbstractConfigured
     @Override
     public Map<String,Number> getStatistics()
     {
-        Collection<ConfiguredObjectStatistic> stats = ConfiguredObjectTypeRegistry.getStatistics(getClass());
+        Collection<ConfiguredObjectStatistic> stats = _model.getTypeRegistry().getStatistics(getClass());
         Map<String,Number> map = new HashMap<String,Number>();
         for(ConfiguredObjectStatistic stat : stats)
         {
@@ -1439,7 +1439,7 @@ public abstract class AbstractConfigured
                               new Strings.MapResolver(inheritedContext),
                               Strings.JAVA_SYS_PROPS_RESOLVER,
                               Strings.ENV_VARS_RESOLVER,
-                              ConfiguredObjectTypeRegistry.getDefaultContextResolver());
+                              object.getModel().getTypeRegistry().getDefaultContextResolver());
     }
 
     private static OwnAttributeResolver getOwnAttributeResolver(final ConfiguredObject<?> object)

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractUnresolvedObject.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractUnresolvedObject.java?rev=1615969&r1=1615968&r2=1615969&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractUnresolvedObject.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractUnresolvedObject.java Tue Aug  5 18:13:55 2014
@@ -50,7 +50,7 @@ public abstract class AbstractUnresolved
         _parents = parents;
 
         Collection<ConfiguredObjectAttribute<? super C, ?>> attributes =
-                ConfiguredObjectTypeRegistry.getAttributes(clazz);
+                parents[0].getModel().getTypeRegistry().getAttributes(clazz);
         for(ConfiguredObjectAttribute<? super C, ?> attribute : attributes)
         {
             if(attribute.isPersisted())

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/BrokerModel.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/BrokerModel.java?rev=1615969&r1=1615968&r2=1615969&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/BrokerModel.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/BrokerModel.java Tue Aug  5 18:13:55 2014
@@ -28,6 +28,9 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.qpid.server.plugin.ConfiguredObjectRegistration;
+import org.apache.qpid.server.plugin.QpidServiceLoader;
+
 public final class BrokerModel extends Model
 {
 
@@ -52,6 +55,7 @@ public final class BrokerModel extends M
 
     private final Set<Class<? extends ConfiguredObject>> _supportedTypes =
             new HashSet<Class<? extends ConfiguredObject>>();
+    private final ConfiguredObjectTypeRegistry _typeRegistry;
 
     private Class<? extends ConfiguredObject> _rootCategory;
     private final ConfiguredObjectFactory _objectFactory;
@@ -101,8 +105,15 @@ public final class BrokerModel extends M
         addRelationship(Session.class, Publisher.class);
 
         _objectFactory = new ConfiguredObjectFactoryImpl(this);
+        _typeRegistry = new ConfiguredObjectTypeRegistry((new QpidServiceLoader<ConfiguredObjectRegistration>()).instancesOf(ConfiguredObjectRegistration.class), getSupportedCategories());
     }
 
+    public final ConfiguredObjectTypeRegistry getTypeRegistry()
+    {
+        return _typeRegistry;
+    }
+
+
     public static Model getInstance()
     {
         return MODEL_INSTANCE;

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectTypeRegistry.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectTypeRegistry.java?rev=1615969&r1=1615968&r2=1615969&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectTypeRegistry.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectTypeRegistry.java Tue Aug  5 18:13:55 2014
@@ -36,8 +36,8 @@ import java.util.SortedSet;
 import java.util.TreeSet;
 
 import org.apache.log4j.Logger;
+
 import org.apache.qpid.server.plugin.ConfiguredObjectRegistration;
-import org.apache.qpid.server.plugin.QpidServiceLoader;
 import org.apache.qpid.server.util.ServerScopedRuntimeException;
 import org.apache.qpid.util.Strings;
 
@@ -56,66 +56,71 @@ public class ConfiguredObjectTypeRegistr
     };
 
 
-    private static final Map<Class<? extends ConfiguredObject>, Collection<ConfiguredObjectAttribute<?,?>>> _allAttributes =
+    private final Map<Class<? extends ConfiguredObject>, Collection<ConfiguredObjectAttribute<?,?>>> _allAttributes =
             Collections.synchronizedMap(new HashMap<Class<? extends ConfiguredObject>, Collection<ConfiguredObjectAttribute<?, ?>>>());
 
-    private static final Map<Class<? extends ConfiguredObject>, Collection<ConfiguredObjectStatistic<?,?>>> _allStatistics =
+    private final Map<Class<? extends ConfiguredObject>, Collection<ConfiguredObjectStatistic<?,?>>> _allStatistics =
             Collections.synchronizedMap(new HashMap<Class<? extends ConfiguredObject>, Collection<ConfiguredObjectStatistic<?, ?>>>());
 
-    private static final Map<Class<? extends ConfiguredObject>, Map<String, ConfiguredObjectAttribute<?,?>>> _allAttributeTypes =
+    private final Map<Class<? extends ConfiguredObject>, Map<String, ConfiguredObjectAttribute<?,?>>> _allAttributeTypes =
             Collections.synchronizedMap(new HashMap<Class<? extends ConfiguredObject>, Map<String, ConfiguredObjectAttribute<?, ?>>>());
 
-    private static final Map<Class<? extends ConfiguredObject>, Map<String, AutomatedField>> _allAutomatedFields =
+    private final Map<Class<? extends ConfiguredObject>, Map<String, AutomatedField>> _allAutomatedFields =
             Collections.synchronizedMap(new HashMap<Class<? extends ConfiguredObject>, Map<String, AutomatedField>>());
 
-    private static final Map<String, String> _defaultContext =
+    private final Map<String, String> _defaultContext =
             Collections.synchronizedMap(new HashMap<String, String>());
 
-    private static final Map<Class<? extends ConfiguredObject>,Set<Class<? extends ConfiguredObject>>> _knownTypes =
+    private final Map<Class<? extends ConfiguredObject>,Set<Class<? extends ConfiguredObject>>> _knownTypes =
             Collections.synchronizedMap(new HashMap<Class<? extends ConfiguredObject>, Set<Class<? extends ConfiguredObject>>>());
 
-    private static final Map<Class<? extends ConfiguredObject>, Collection<ConfiguredObjectAttribute<?,?>>> _typeSpecificAttributes =
+    private final Map<Class<? extends ConfiguredObject>, Collection<ConfiguredObjectAttribute<?,?>>> _typeSpecificAttributes =
             Collections.synchronizedMap(new HashMap<Class<? extends ConfiguredObject>, Collection<ConfiguredObjectAttribute<?, ?>>>());
 
-    private static final Map<Class<? extends ConfiguredObject>, Map<State, Map<State, Method>>> _stateChangeMethods =
+    private final Map<Class<? extends ConfiguredObject>, Map<State, Map<State, Method>>> _stateChangeMethods =
             Collections.synchronizedMap(new HashMap<Class<? extends ConfiguredObject>, Map<State, Map<State, Method>>>());
 
-    static
+    public ConfiguredObjectTypeRegistry(Iterable<ConfiguredObjectRegistration> configuredObjectRegistrations, Collection<Class<? extends ConfiguredObject>> categoriesRestriction)
     {
-        QpidServiceLoader<ConfiguredObjectRegistration> loader = new QpidServiceLoader<>();
 
         Set<Class<? extends ConfiguredObject>> categories = new HashSet<>();
         Set<Class<? extends ConfiguredObject>> types = new HashSet<>();
 
-        for (ConfiguredObjectRegistration registration : loader.instancesOf(ConfiguredObjectRegistration.class))
+        for (ConfiguredObjectRegistration registration : configuredObjectRegistrations)
         {
             for (Class<? extends ConfiguredObject> configuredObjectClass : registration.getConfiguredObjectClasses())
             {
-                try
+                if(categoriesRestriction.isEmpty() || categoriesRestriction.contains(getCategory(configuredObjectClass)))
                 {
-                    process(configuredObjectClass);
-                    ManagedObject annotation = configuredObjectClass.getAnnotation(ManagedObject.class);
-                    if (annotation.category())
-                    {
-                        categories.add(configuredObjectClass);
-                    }
-                    else
+                    try
                     {
-                        Class<? extends ConfiguredObject> category = getCategory(configuredObjectClass);
-                        if(category != null)
+                        process(configuredObjectClass);
+                        ManagedObject annotation = configuredObjectClass.getAnnotation(ManagedObject.class);
+                        if (annotation.category())
                         {
-                            categories.add(category);
+                            categories.add(configuredObjectClass);
+                        }
+                        else
+                        {
+                            Class<? extends ConfiguredObject> category = getCategory(configuredObjectClass);
+                            if (category != null)
+                            {
+                                categories.add(category);
+                            }
+                        }
+                        if (!"".equals(annotation.type()))
+                        {
+                            types.add(configuredObjectClass);
                         }
                     }
-                    if (!"".equals(annotation.type()))
+                    catch (NoClassDefFoundError ncdfe)
                     {
-                        types.add(configuredObjectClass);
+                        LOGGER.warn("A class definition could not be found while processing the model for '"
+                                    + configuredObjectClass.getName()
+                                    + "': "
+                                    + ncdfe.getMessage());
                     }
                 }
-                catch(NoClassDefFoundError ncdfe)
-                {
-                    LOGGER.warn("A class definition could not be found while processing the model for '" + configuredObjectClass.getName() + "': " + ncdfe.getMessage());
-                }
             }
         }
         for (Class<? extends ConfiguredObject> categoryClass : categories)
@@ -188,7 +193,7 @@ public class ConfiguredObjectTypeRegistr
         return null;
     }
 
-    public static Class<? extends ConfiguredObject> getTypeClass(final Class<? extends ConfiguredObject> clazz)
+    private Class<? extends ConfiguredObject> getTypeClass(final Class<? extends ConfiguredObject> clazz)
     {
         String typeName = getType(clazz);
         Class<? extends ConfiguredObject> typeClass = null;
@@ -218,7 +223,7 @@ public class ConfiguredObjectTypeRegistr
 
     }
 
-    public static Collection<Class<? extends ConfiguredObject>> getTypeSpecialisations(Class<? extends ConfiguredObject> clazz)
+    public Collection<Class<? extends ConfiguredObject>> getTypeSpecialisations(Class<? extends ConfiguredObject> clazz)
     {
         Class<? extends ConfiguredObject> categoryClass = getCategory(clazz);
         if(categoryClass == null)
@@ -234,7 +239,7 @@ public class ConfiguredObjectTypeRegistr
 
     }
 
-    public static Collection<ConfiguredObjectAttribute<?,?>> getTypeSpecificAttributes(Class<? extends ConfiguredObject> clazz)
+    public Collection<ConfiguredObjectAttribute<?,?>> getTypeSpecificAttributes(Class<? extends ConfiguredObject> clazz)
     {
         Class<? extends ConfiguredObject> typeClass = getTypeClass(clazz);
         if(typeClass == null)
@@ -308,7 +313,7 @@ public class ConfiguredObjectTypeRegistr
         return "";
     }
 
-    public static Strings.Resolver getDefaultContextResolver()
+    public Strings.Resolver getDefaultContextResolver()
     {
         return new Strings.MapResolver(_defaultContext);
     }
@@ -345,7 +350,7 @@ public class ConfiguredObjectTypeRegistr
 
 
 
-    private static <X extends ConfiguredObject> void process(final Class<X> clazz)
+    private <X extends ConfiguredObject> void process(final Class<X> clazz)
     {
         synchronized (_allAttributes)
         {
@@ -451,7 +456,7 @@ public class ConfiguredObjectTypeRegistr
         }
     }
 
-    private static void initialiseWithParentAttributes(final SortedSet<ConfiguredObjectAttribute<?, ?>> attributeSet,
+    private void initialiseWithParentAttributes(final SortedSet<ConfiguredObjectAttribute<?, ?>> attributeSet,
                                                        final SortedSet<ConfiguredObjectStatistic<?, ?>> statisticSet,
                                                        final Class<? extends ConfiguredObject> parent)
     {
@@ -473,7 +478,7 @@ public class ConfiguredObjectTypeRegistr
         }
     }
 
-    private static <X extends ConfiguredObject> void processAttributesTypesAndFields(final Class<X> clazz)
+    private <X extends ConfiguredObject> void processAttributesTypesAndFields(final Class<X> clazz)
     {
         Map<String,ConfiguredObjectAttribute<?,?>> attrMap = new HashMap<String, ConfiguredObjectAttribute<?, ?>>();
         Map<String,AutomatedField> fieldMap = new HashMap<String, AutomatedField>();
@@ -493,7 +498,7 @@ public class ConfiguredObjectTypeRegistr
         _allAutomatedFields.put(clazz, fieldMap);
     }
 
-    private static <X extends ConfiguredObject> void processDefaultContext(final Class<X> clazz)
+    private <X extends ConfiguredObject> void processDefaultContext(final Class<X> clazz)
     {
         for(Field field : clazz.getDeclaredFields())
         {
@@ -520,7 +525,7 @@ public class ConfiguredObjectTypeRegistr
         }
     }
 
-    private static void processStateChangeMethods(Class<? extends ConfiguredObject> clazz)
+    private void processStateChangeMethods(Class<? extends ConfiguredObject> clazz)
     {
         Map<State, Map<State, Method>> map = new HashMap<>();
 
@@ -543,7 +548,7 @@ public class ConfiguredObjectTypeRegistr
         }
     }
 
-    private static void inheritTransitions(final Class<? extends ConfiguredObject> parent,
+    private void inheritTransitions(final Class<? extends ConfiguredObject> parent,
                                            final Map<State, Map<State, Method>> map)
     {
         Map<State, Map<State, Method>> parentMap = _stateChangeMethods.get(parent);
@@ -567,7 +572,7 @@ public class ConfiguredObjectTypeRegistr
         }
     }
 
-    private static void addStateTransitions(final Class<? extends ConfiguredObject> clazz,
+    private void addStateTransitions(final Class<? extends ConfiguredObject> clazz,
                                             final Map<State, Map<State, Method>> map)
     {
         for(Method m : clazz.getDeclaredMethods())
@@ -593,7 +598,7 @@ public class ConfiguredObjectTypeRegistr
         }
     }
 
-    private static void addStateTransition(final State fromState,
+    private void addStateTransition(final State fromState,
                                            final State toState,
                                            final Method method,
                                            final Map<State, Map<State, Method>> map)
@@ -614,7 +619,7 @@ public class ConfiguredObjectTypeRegistr
         }
     }
 
-    private static AutomatedField findField(final ConfiguredObjectAttribute<?, ?> attr, Class<?> objClass)
+    private AutomatedField findField(final ConfiguredObjectAttribute<?, ?> attr, Class<?> objClass)
     {
         Class<?> clazz = objClass;
         while(clazz != null)
@@ -665,7 +670,7 @@ public class ConfiguredObjectTypeRegistr
         throw new ServerScopedRuntimeException("Unable to find field definition for automated field " + attr.getName() + " in class " + objClass.getName());
     }
 
-    public static <X extends ConfiguredObject> Collection<String> getAttributeNames(Class<X> clazz)
+    public <X extends ConfiguredObject> Collection<String> getAttributeNames(Class<X> clazz)
     {
         final Collection<ConfiguredObjectAttribute<? super X, ?>> attrs = getAttributes(clazz);
 
@@ -706,7 +711,7 @@ public class ConfiguredObjectTypeRegistr
 
     }
 
-    protected static <X extends ConfiguredObject> Collection<ConfiguredObjectAttribute<? super X, ?>> getAttributes(final Class<X> clazz)
+    protected <X extends ConfiguredObject> Collection<ConfiguredObjectAttribute<? super X, ?>> getAttributes(final Class<X> clazz)
     {
         if(!_allAttributes.containsKey(clazz))
         {
@@ -717,7 +722,7 @@ public class ConfiguredObjectTypeRegistr
     }
 
 
-    protected static Collection<ConfiguredObjectStatistic> getStatistics(final Class<? extends ConfiguredObject> clazz)
+    protected Collection<ConfiguredObjectStatistic> getStatistics(final Class<? extends ConfiguredObject> clazz)
     {
         if(!_allAttributes.containsKey(clazz))
         {
@@ -728,7 +733,7 @@ public class ConfiguredObjectTypeRegistr
     }
 
 
-    public static Map<String, ConfiguredObjectAttribute<?, ?>> getAttributeTypes(final Class<? extends ConfiguredObject> clazz)
+    public Map<String, ConfiguredObjectAttribute<?, ?>> getAttributeTypes(final Class<? extends ConfiguredObject> clazz)
     {
         if(!_allAttributes.containsKey(clazz))
         {
@@ -737,7 +742,7 @@ public class ConfiguredObjectTypeRegistr
         return _allAttributeTypes.get(clazz);
     }
 
-    static Map<String, AutomatedField> getAutomatedFields(Class<? extends ConfiguredObject> clazz)
+    Map<String, AutomatedField> getAutomatedFields(Class<? extends ConfiguredObject> clazz)
     {
         if(!_allAttributes.containsKey(clazz))
         {
@@ -746,7 +751,7 @@ public class ConfiguredObjectTypeRegistr
         return _allAutomatedFields.get(clazz);
     }
 
-    static Map<State, Map<State, Method>> getStateChangeMethods(final Class<? extends ConfiguredObject> objectClass)
+    Map<State, Map<State, Method>> getStateChangeMethods(final Class<? extends ConfiguredObject> objectClass)
     {
         if(!_allAttributes.containsKey(objectClass))
         {

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Model.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Model.java?rev=1615969&r1=1615968&r2=1615969&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Model.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Model.java Tue Aug  5 18:13:55 2014
@@ -145,6 +145,7 @@ public abstract class Model
         return allDescendants.contains(descendantClass);
     }
 
+
     public abstract Collection<Class<? extends ConfiguredObject>> getSupportedCategories();
     public abstract Collection<Class<? extends ConfiguredObject>> getChildTypes(Class<? extends ConfiguredObject> parent);
 
@@ -156,4 +157,6 @@ public abstract class Model
 
     public abstract ConfiguredObjectFactory getObjectFactory();
 
+    public abstract ConfiguredObjectTypeRegistry getTypeRegistry();
+
 }

Added: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/ConfigureObjectTypeRegistryTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/ConfigureObjectTypeRegistryTest.java?rev=1615969&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/ConfigureObjectTypeRegistryTest.java (added)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/ConfigureObjectTypeRegistryTest.java Tue Aug  5 18:13:55 2014
@@ -0,0 +1,95 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.model;
+
+import java.util.Collection;
+
+import junit.framework.TestCase;
+
+import org.apache.qpid.server.model.testmodel.Test2RootCategory;
+import org.apache.qpid.server.model.testmodel.Test2RootCategoryImpl;
+import org.apache.qpid.server.model.testmodel.TestModel;
+import org.apache.qpid.server.model.testmodel.TestRootCategory;
+import org.apache.qpid.server.model.testmodel.TestRootCategoryImpl;
+
+public class ConfigureObjectTypeRegistryTest extends TestCase
+{
+    private ConfiguredObjectTypeRegistry _typeRegistry;
+
+    @Override
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        Model model = TestModel.getInstance();
+        _typeRegistry = model.getTypeRegistry();
+    }
+
+    public void testAllTypesRegistered()
+    {
+        Collection<Class<? extends ConfiguredObject>> types =
+                _typeRegistry.getTypeSpecialisations(TestRootCategory.class);
+
+        assertEquals(2, types.size());
+        assertTrue(types.contains(TestRootCategoryImpl.class));
+
+        assertTrue(types.contains(Test2RootCategoryImpl.class));
+    }
+
+    public void testTypeSpecificAttributes()
+    {
+        Collection<ConfiguredObjectAttribute<?, ?>> special =
+                _typeRegistry.getTypeSpecificAttributes(Test2RootCategoryImpl.class);
+        assertEquals(1, special.size());
+        ConfiguredObjectAttribute attr = special.iterator().next();
+        assertEquals("derivedAttribute",attr.getName());
+        assertTrue(attr.isDerived());
+
+        special = _typeRegistry.getTypeSpecificAttributes(TestRootCategoryImpl.class);
+        assertEquals(0, special.size());
+
+    }
+
+    public void testDefaultedValues()
+    {
+        checkDefaultedValue(_typeRegistry.getAttributes((Class) TestRootCategoryImpl.class),
+                            TestRootCategory.DEFAULTED_VALUE_DEFAULT);
+
+        checkDefaultedValue(_typeRegistry.getAttributes((Class) Test2RootCategoryImpl.class),
+                            Test2RootCategory.DEFAULTED_VALUE_DEFAULT);
+    }
+
+    private void checkDefaultedValue(final Collection<ConfiguredObjectAttribute<?, ?>> attrs,
+                                     final String defaultedValueDefault)
+    {
+        boolean found = false;
+        for(ConfiguredObjectAttribute<?, ?> attr : attrs)
+        {
+            if(attr.getName().equals("defaultedValue"))
+            {
+                assertEquals(defaultedValueDefault, ((ConfiguredAutomatedAttribute)attr).defaultValue());
+                found = true;
+                break;
+            }
+
+        }
+        assertTrue("Could not find attribute defaultedValue", found);
+    }
+}

Added: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/Test2RootCategory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/Test2RootCategory.java?rev=1615969&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/Test2RootCategory.java (added)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/Test2RootCategory.java Tue Aug  5 18:13:55 2014
@@ -0,0 +1,35 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.model.testmodel;
+
+import org.apache.qpid.server.model.DerivedAttribute;
+import org.apache.qpid.server.model.ManagedAttribute;
+
+public interface Test2RootCategory<X extends Test2RootCategory<X>> extends TestRootCategory<X>
+{
+    String DEFAULTED_VALUE_DEFAULT = "differentDefault";
+    @Override
+    @ManagedAttribute( defaultValue = DEFAULTED_VALUE_DEFAULT)
+    String getDefaultedValue();
+
+    @DerivedAttribute
+    public int getDerivedAttribute();
+}

Copied: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/Test2RootCategoryImpl.java (from r1615458, qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/TestRootCategoryImpl.java)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/Test2RootCategoryImpl.java?p2=qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/Test2RootCategoryImpl.java&p1=qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/TestRootCategoryImpl.java&r1=1615458&r2=1615969&rev=1615969&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/TestRootCategoryImpl.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/Test2RootCategoryImpl.java Tue Aug  5 18:13:55 2014
@@ -30,9 +30,9 @@ import org.apache.qpid.server.model.Mana
 import org.apache.qpid.server.model.ManagedObjectFactoryConstructor;
 import org.apache.qpid.server.model.State;
 
-@ManagedObject( category = false , type = "test" )
-public class TestRootCategoryImpl extends AbstractConfiguredObject<TestRootCategoryImpl>
-        implements TestRootCategory<TestRootCategoryImpl>
+@ManagedObject( category = false , type = "test2" )
+public class Test2RootCategoryImpl extends AbstractConfiguredObject<Test2RootCategoryImpl>
+        implements Test2RootCategory<Test2RootCategoryImpl>
 {
     @ManagedAttributeField
     private String _automatedPersistedValue;
@@ -50,7 +50,7 @@ public class TestRootCategoryImpl extend
     private Map<String,String> _mapValue;
 
     @ManagedObjectFactoryConstructor
-    public TestRootCategoryImpl(final Map<String, Object> attributes)
+    public Test2RootCategoryImpl(final Map<String, Object> attributes)
     {
         super(parentsMap(), attributes, newTaskExecutor(), TestModel.getInstance());
     }
@@ -62,8 +62,8 @@ public class TestRootCategoryImpl extend
         return currentThreadTaskExecutor;
     }
 
-    public TestRootCategoryImpl(final Map<String, Object> attributes,
-                                final TaskExecutor taskExecutor)
+    public Test2RootCategoryImpl(final Map<String, Object> attributes,
+                                 final TaskExecutor taskExecutor)
     {
         super(parentsMap(), attributes, taskExecutor);
     }
@@ -93,6 +93,12 @@ public class TestRootCategoryImpl extend
     }
 
     @Override
+    public int getDerivedAttribute()
+    {
+        return 0;
+    }
+
+    @Override
     public String getStringValue()
     {
         return _stringValue;

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/TestModel.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/TestModel.java?rev=1615969&r1=1615968&r2=1615969&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/TestModel.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/testmodel/TestModel.java Tue Aug  5 18:13:55 2014
@@ -27,7 +27,9 @@ import java.util.Collections;
 import org.apache.qpid.server.model.ConfiguredObject;
 import org.apache.qpid.server.model.ConfiguredObjectFactory;
 import org.apache.qpid.server.model.ConfiguredObjectFactoryImpl;
+import org.apache.qpid.server.model.ConfiguredObjectTypeRegistry;
 import org.apache.qpid.server.model.Model;
+import org.apache.qpid.server.plugin.ConfiguredObjectRegistration;
 
 public class TestModel extends Model
 {
@@ -38,6 +40,7 @@ public class TestModel extends Model
             };
 
     private final ConfiguredObjectFactory _objectFactory;
+    private ConfiguredObjectTypeRegistry _registry;
 
     private TestModel()
     {
@@ -47,6 +50,21 @@ public class TestModel extends Model
     public TestModel(final ConfiguredObjectFactory objectFactory)
     {
         _objectFactory = objectFactory == null ? new ConfiguredObjectFactoryImpl(this) : objectFactory;
+        ConfiguredObjectRegistration configuredObjectRegistration = new ConfiguredObjectRegistration()
+        {
+            @Override
+            public Collection<Class<? extends ConfiguredObject>> getConfiguredObjectClasses()
+            {
+                return Arrays.<Class<? extends ConfiguredObject>>asList(TestRootCategoryImpl.class, Test2RootCategoryImpl.class);
+            }
+
+            @Override
+            public String getType()
+            {
+                return "test";
+            }
+        };
+        _registry = new ConfiguredObjectTypeRegistry(Arrays.asList(configuredObjectRegistration), getSupportedCategories());
     }
 
 
@@ -92,6 +110,12 @@ public class TestModel extends Model
         return _objectFactory;
     }
 
+    @Override
+    public ConfiguredObjectTypeRegistry getTypeRegistry()
+    {
+        return _registry;
+    }
+
     public static Model getInstance()
     {
         return INSTANCE;

Modified: qpid/trunk/qpid/java/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java?rev=1615969&r1=1615968&r2=1615969&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java Tue Aug  5 18:13:55 2014
@@ -52,7 +52,6 @@ import org.apache.qpid.server.message.in
 import org.apache.qpid.server.message.internal.InternalMessageHeader;
 import org.apache.qpid.server.model.ConfigurationChangeListener;
 import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.ConfiguredObjectTypeRegistry;
 import org.apache.qpid.server.model.ManagedObject;
 import org.apache.qpid.server.model.State;
 import org.apache.qpid.server.plugin.MessageConverter;
@@ -236,7 +235,7 @@ class ManagementNode implements MessageS
                 }
             }
             managedEntityType = new ManagedEntityType(clazz.getName(), parentSet.toArray(new ManagedEntityType[parentSet.size()]),
-                                                      (String[])(ConfiguredObjectTypeRegistry.getAttributeNames(
+                                                      (String[])(_managedObject.getModel().getTypeRegistry().getAttributeNames(
                                                               clazz).toArray(new String[0])),
                                                       opsList.toArray(new String[opsList.size()]));
             _entityTypes.put(clazz.getName(),managedEntityType);

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MetaDataServlet.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MetaDataServlet.java?rev=1615969&r1=1615968&r2=1615969&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MetaDataServlet.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MetaDataServlet.java Tue Aug  5 18:13:55 2014
@@ -82,7 +82,8 @@ public class MetaDataServlet extends Abs
     private Map<String,Map> processCategory(final Class<? extends ConfiguredObject> clazz)
     {
         Map<String, Map> typeToDataMap = new TreeMap<>();
-        for(Class<? extends ConfiguredObject> type : ConfiguredObjectTypeRegistry.getTypeSpecialisations(clazz))
+        ConfiguredObjectTypeRegistry typeRegistry = _instance.getTypeRegistry();
+        for(Class<? extends ConfiguredObject> type : typeRegistry.getTypeSpecialisations(clazz))
         {
             typeToDataMap.put(ConfiguredObjectTypeRegistry.getType(type), processType(type));
         }
@@ -99,7 +100,7 @@ public class MetaDataServlet extends Abs
     private Map<String,Map> processAttributes(final Class<? extends ConfiguredObject> type)
     {
         Collection<ConfiguredObjectAttribute<?, ?>> attributes =
-            ConfiguredObjectTypeRegistry.getAttributeTypes(type).values();
+            _instance.getTypeRegistry().getAttributeTypes(type).values();
 
         Map<String,Map> attributeDetails = new LinkedHashMap<>();
         for(ConfiguredObjectAttribute<?, ?> attribute : attributes)

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/AbstractSpecialisedAttributeLister.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/AbstractSpecialisedAttributeLister.java?rev=1615969&r1=1615968&r2=1615969&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/AbstractSpecialisedAttributeLister.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/AbstractSpecialisedAttributeLister.java Tue Aug  5 18:13:55 2014
@@ -42,15 +42,16 @@ abstract class AbstractSpecialisedAttrib
     @Override
     final public Object perform(Map<String, Object> request, Broker broker)
     {
+        ConfiguredObjectTypeRegistry typeRegistry = broker.getModel().getTypeRegistry();
         Collection<Class<? extends ConfiguredObject>> groupProviderTypes =
-                ConfiguredObjectTypeRegistry.getTypeSpecialisations(getCategoryClass());
+                typeRegistry.getTypeSpecialisations(getCategoryClass());
 
         Map<String, Object> attributes = new TreeMap<String, Object>();
 
         for (Class<? extends ConfiguredObject> groupProviderType : groupProviderTypes)
         {
             Collection<ConfiguredObjectAttribute<?, ?>> typeSpecificAttributes =
-                    ConfiguredObjectTypeRegistry.getTypeSpecificAttributes(groupProviderType);
+                    typeRegistry.getTypeSpecificAttributes(groupProviderType);
 
             Map<String, Object> data = new HashMap<String, Object>();
 

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java?rev=1615969&r1=1615968&r2=1615969&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java Tue Aug  5 18:13:55 2014
@@ -35,8 +35,8 @@ import junit.framework.TestCase;
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.server.model.Binding;
 import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.BrokerModel;
 import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.ConfiguredObjectTypeRegistry;
 import org.apache.qpid.server.model.Connection;
 import org.apache.qpid.server.model.Exchange;
 import org.apache.qpid.server.model.ExclusivityPolicy;
@@ -68,7 +68,7 @@ public class Asserts
     {
         assertNotNull("Virtualhost " + virtualHostName + " data are not found", virtualHost);
         assertAttributesPresent(virtualHost,
-                                ConfiguredObjectTypeRegistry.getAttributeNames(VirtualHost.class),
+                                BrokerModel.getInstance().getTypeRegistry().getAttributeNames(VirtualHost.class),
                                 ConfiguredObject.CREATED_BY,
                                 ConfiguredObject.CREATED_TIME,
                                 ConfiguredObject.LAST_UPDATED_BY,
@@ -117,7 +117,7 @@ public class Asserts
     {
         assertNotNull("Queue " + queueName + " is not found!", queueData);
         Asserts.assertAttributesPresent(queueData,
-                                        ConfiguredObjectTypeRegistry.getAttributeNames(Queue.class),
+                                        BrokerModel.getInstance().getTypeRegistry().getAttributeNames(Queue.class),
                                         Queue.CREATED_BY,
                                         Queue.CREATED_TIME,
                                         Queue.LAST_UPDATED_BY,
@@ -224,7 +224,7 @@ public class Asserts
     {
         assertNotNull("Unexpected connection data", connectionData);
         assertAttributesPresent(connectionData,
-                                ConfiguredObjectTypeRegistry.getAttributeNames(Connection.class),
+                                BrokerModel.getInstance().getTypeRegistry().getAttributeNames(Connection.class),
                                 Connection.STATE,
                                 Connection.DURABLE,
                                 Connection.LIFETIME_POLICY,
@@ -284,7 +284,7 @@ public class Asserts
         if ("AMQP".equals(port.get(ConfiguredObject.TYPE)))
         {
             assertAttributesPresent(port,
-                                    ConfiguredObjectTypeRegistry.getAttributeNames(Port.class),
+                                    BrokerModel.getInstance().getTypeRegistry().getAttributeNames(Port.class),
                                     ConfiguredObject.TYPE,
                                     ConfiguredObject.CREATED_BY,
                                     ConfiguredObject.CREATED_TIME,
@@ -302,7 +302,7 @@ public class Asserts
         else
         {
             assertAttributesPresent(port,
-                                    ConfiguredObjectTypeRegistry.getAttributeNames(Port.class),
+                                    BrokerModel.getInstance().getTypeRegistry().getAttributeNames(Port.class),
                                     ConfiguredObject.TYPE,
                                     ConfiguredObject.CREATED_BY,
                                     ConfiguredObject.CREATED_TIME,
@@ -340,7 +340,7 @@ public class Asserts
     public static void assertExchange(String exchangeName, String type, Map<String, Object> exchangeData)
     {
         assertNotNull("Exchange " + exchangeName + " is not found!", exchangeData);
-        assertAttributesPresent(exchangeData, ConfiguredObjectTypeRegistry.getAttributeNames(Exchange.class),
+        assertAttributesPresent(exchangeData, BrokerModel.getInstance().getTypeRegistry().getAttributeNames(Exchange.class),
                                 Exchange.ALTERNATE_EXCHANGE,
                                 ConfiguredObject.CREATED_BY,
                                 ConfiguredObject.CREATED_TIME,
@@ -376,7 +376,7 @@ public class Asserts
     {
         assertNotNull("Binding map should not be null", binding);
         assertAttributesPresent(binding,
-                                ConfiguredObjectTypeRegistry.getAttributeNames(Binding.class),
+                                BrokerModel.getInstance().getTypeRegistry().getAttributeNames(Binding.class),
                                 Binding.STATE,
                                 ConfiguredObject.TYPE,
                                 ConfiguredObject.CREATED_BY,

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AuthenticationProviderRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AuthenticationProviderRestTest.java?rev=1615969&r1=1615968&r2=1615969&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AuthenticationProviderRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AuthenticationProviderRestTest.java Tue Aug  5 18:13:55 2014
@@ -28,8 +28,8 @@ import java.util.UUID;
 
 import org.apache.qpid.server.BrokerOptions;
 import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.BrokerModel;
 import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.ConfiguredObjectTypeRegistry;
 import org.apache.qpid.server.model.ExternalFileBasedAuthenticationManager;
 import org.apache.qpid.server.model.LifetimePolicy;
 import org.apache.qpid.server.model.Port;
@@ -307,7 +307,7 @@ public class AuthenticationProviderRestT
 
     private void assertProvider(boolean managesPrincipals, String type, Map<String, Object> provider)
     {
-        Asserts.assertAttributesPresent(provider, ConfiguredObjectTypeRegistry.getAttributeNames(
+        Asserts.assertAttributesPresent(provider, BrokerModel.getInstance().getTypeRegistry().getAttributeNames(
                                                 AuthenticationProvider.class),
                 AuthenticationProvider.DESCRIPTION, ConfiguredObject.CONTEXT,
                 ConfiguredObject.DESIRED_STATE, ConfiguredObject.CREATED_BY,

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java?rev=1615969&r1=1615968&r2=1615969&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java Tue Aug  5 18:13:55 2014
@@ -29,8 +29,8 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.BrokerModel;
 import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.ConfiguredObjectTypeRegistry;
 import org.apache.qpid.server.model.Port;
 import org.apache.qpid.server.model.Protocol;
 import org.apache.qpid.server.model.Transport;
@@ -63,7 +63,7 @@ public class BrokerRestHttpsTest extends
     {
         Map<String, Object> brokerDetails = getRestTestHelper().getJsonAsSingletonList("broker");
 
-        Asserts.assertAttributesPresent(brokerDetails, ConfiguredObjectTypeRegistry.getAttributeNames(Broker.class),
+        Asserts.assertAttributesPresent(brokerDetails, BrokerModel.getInstance().getTypeRegistry().getAttributeNames(Broker.class),
                 Broker.PROCESS_PID,
                 ConfiguredObject.TYPE,
                 ConfiguredObject.CREATED_BY,

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java?rev=1615969&r1=1615968&r2=1615969&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java Tue Aug  5 18:13:55 2014
@@ -34,8 +34,8 @@ import javax.jms.TextMessage;
 
 import org.apache.qpid.common.QpidProperties;
 import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.BrokerModel;
 import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.ConfiguredObjectTypeRegistry;
 import org.apache.qpid.server.model.LifetimePolicy;
 import org.apache.qpid.server.model.Port;
 import org.apache.qpid.server.model.State;
@@ -201,7 +201,8 @@ public class BrokerRestTest extends Qpid
 
     protected void assertBrokerAttributes(Map<String, Object> brokerDetails)
     {
-        Asserts.assertAttributesPresent(brokerDetails, ConfiguredObjectTypeRegistry.getAttributeNames(Broker.class),
+        Asserts.assertAttributesPresent(brokerDetails, BrokerModel.getInstance().getTypeRegistry().getAttributeNames(
+                Broker.class),
                 Broker.PROCESS_PID,
                 ConfiguredObject.TYPE,
                 ConfiguredObject.CREATED_BY,

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java?rev=1615969&r1=1615968&r2=1615969&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java Tue Aug  5 18:13:55 2014
@@ -32,12 +32,10 @@ import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.servlet.http.HttpServletResponse;
 
-import org.junit.Assert;
-
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQSession;
+import org.apache.qpid.server.model.BrokerModel;
 import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.ConfiguredObjectTypeRegistry;
 import org.apache.qpid.server.model.Connection;
 import org.apache.qpid.server.model.Session;
 
@@ -232,7 +230,8 @@ public class ConnectionRestTest extends 
     private void assertSession(Map<String, Object> sessionData, AMQSession<?, ?> session)
     {
         assertNotNull("Session map cannot be null", sessionData);
-        Asserts.assertAttributesPresent(sessionData, ConfiguredObjectTypeRegistry.getAttributeNames(Session.class),
+        Asserts.assertAttributesPresent(sessionData, BrokerModel.getInstance().getTypeRegistry().getAttributeNames(
+                Session.class),
                                         ConfiguredObject.TYPE,
                                         ConfiguredObject.CREATED_BY,
                                         ConfiguredObject.CREATED_TIME,

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/GroupProviderRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/GroupProviderRestTest.java?rev=1615969&r1=1615968&r2=1615969&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/GroupProviderRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/GroupProviderRestTest.java Tue Aug  5 18:13:55 2014
@@ -29,8 +29,8 @@ import java.util.Properties;
 import java.util.UUID;
 
 import org.apache.qpid.server.BrokerOptions;
+import org.apache.qpid.server.model.BrokerModel;
 import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.ConfiguredObjectTypeRegistry;
 import org.apache.qpid.server.model.Group;
 import org.apache.qpid.server.model.GroupProvider;
 import org.apache.qpid.server.model.LifetimePolicy;
@@ -322,7 +322,8 @@ public class GroupProviderRestTest exten
 
     private void assertProvider(String name, String type, Map<String, Object> provider)
     {
-        Asserts.assertAttributesPresent(provider, ConfiguredObjectTypeRegistry.getAttributeNames(GroupProvider.class),
+        Asserts.assertAttributesPresent(provider, BrokerModel.getInstance().getTypeRegistry().getAttributeNames(
+                GroupProvider.class),
                 ConfiguredObject.TYPE,
                 ConfiguredObject.CREATED_BY,
                 ConfiguredObject.CREATED_TIME,

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesProviderRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesProviderRestTest.java?rev=1615969&r1=1615968&r2=1615969&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesProviderRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesProviderRestTest.java Tue Aug  5 18:13:55 2014
@@ -28,8 +28,8 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.BrokerModel;
 import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.ConfiguredObjectTypeRegistry;
 import org.apache.qpid.server.model.ExternalFileBasedAuthenticationManager;
 import org.apache.qpid.server.model.LifetimePolicy;
 import org.apache.qpid.server.model.PreferencesProvider;
@@ -163,7 +163,8 @@ public class PreferencesProviderRestTest
     public void assertProviderCommonAttributes(Map<String, Object> provider)
     {
         Asserts.assertAttributesPresent(provider,
-                                        ConfiguredObjectTypeRegistry.getAttributeNames(PreferencesProvider.class),
+                                        BrokerModel.getInstance().getTypeRegistry().getAttributeNames(
+                                                PreferencesProvider.class),
                                         ConfiguredObject.CREATED_BY,
                                         ConfiguredObject.CREATED_TIME,
                                         ConfiguredObject.LAST_UPDATED_BY,

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QueueRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QueueRestTest.java?rev=1615969&r1=1615968&r2=1615969&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QueueRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QueueRestTest.java Tue Aug  5 18:13:55 2014
@@ -34,8 +34,8 @@ import javax.jms.MessageProducer;
 import javax.jms.Session;
 
 import org.apache.qpid.server.model.Binding;
+import org.apache.qpid.server.model.BrokerModel;
 import org.apache.qpid.server.model.ConfiguredObject;
-import org.apache.qpid.server.model.ConfiguredObjectTypeRegistry;
 import org.apache.qpid.server.model.Consumer;
 import org.apache.qpid.server.model.LifetimePolicy;
 import org.apache.qpid.server.model.Queue;
@@ -206,7 +206,7 @@ public class QueueRestTest extends QpidR
     {
         assertNotNull("Consumer map should not be null", consumer);
         Asserts.assertAttributesPresent(consumer,
-                                        ConfiguredObjectTypeRegistry.getAttributeNames(Consumer.class), Consumer.STATE,
+                                        BrokerModel.getInstance().getTypeRegistry().getAttributeNames(Consumer.class), Consumer.STATE,
                 Consumer.SETTLEMENT_MODE, Consumer.EXCLUSIVE, Consumer.SELECTOR,
                 Consumer.NO_LOCAL,
                 ConfiguredObject.TYPE,



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org