qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1584365 [4/15] - in /qpid/branches/java-broker-config-store-changes/qpid/java: ./ bdbstore/jmx/src/main/java/org/apache/qpid/server/store/berkeleydb/jmx/ bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ bdbstore/src/main/jav...
Date Thu, 03 Apr 2014 19:59:01 GMT
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandler.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandler.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandler.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandler.java Thu Apr  3 19:58:53 2014
@@ -20,24 +20,27 @@
  */
 package org.apache.qpid.server.configuration.store;
 
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-
 import org.apache.log4j.Logger;
 import org.apache.qpid.server.BrokerOptions;
 import org.apache.qpid.server.configuration.ConfigurationEntry;
+import org.apache.qpid.server.configuration.ConfigurationEntryImpl;
 import org.apache.qpid.server.configuration.ConfigurationEntryStore;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
+import org.apache.qpid.server.model.ConfiguredObject;
 import org.apache.qpid.server.model.Port;
 import org.apache.qpid.server.model.Protocol;
 import org.apache.qpid.server.model.State;
+import org.apache.qpid.server.model.SystemContext;
 import org.apache.qpid.server.model.VirtualHost;
+import org.apache.qpid.server.store.ConfigurationRecoveryHandler;
+import org.apache.qpid.server.store.ConfiguredObjectRecord;
+import org.apache.qpid.server.store.ConfiguredObjectRecordImpl;
+import org.apache.qpid.server.store.DurableConfigurationStore;
+import org.apache.qpid.server.store.StoreException;
 import org.apache.qpid.server.util.MapValueConverter;
 
+import java.util.*;
+
 public class ManagementModeStoreHandler implements ConfigurationEntryStore
 {
     private static final Logger LOGGER = Logger.getLogger(ManagementModeStoreHandler.class);
@@ -51,16 +54,19 @@ public class ManagementModeStoreHandler 
 
     private final ConfigurationEntryStore _store;
     private final Map<UUID, ConfigurationEntry> _cliEntries;
-    private final Map<UUID, Object> _quiescedEntries;
+    private final Map<UUID, Object> _quiescedEntriesOriginalState;
     private final UUID _rootId;
+    private final BrokerOptions _options;
+    private ConfiguredObject<?> _parent;
 
     public ManagementModeStoreHandler(ConfigurationEntryStore store, BrokerOptions options)
     {
         ConfigurationEntry storeRoot = store.getRootEntry();
+        _options = options;
         _store = store;
         _rootId = storeRoot.getId();
         _cliEntries = createPortsFromCommandLineOptions(options);
-        _quiescedEntries = quiesceEntries(storeRoot, options);
+        _quiescedEntriesOriginalState = quiesceEntries(storeRoot, options);
     }
 
     @Override
@@ -80,7 +86,7 @@ public class ManagementModeStoreHandler 
             }
 
             ConfigurationEntry entry = _store.getEntry(id);
-            if (_quiescedEntries.containsKey(id))
+            if (_quiescedEntriesOriginalState.containsKey(id))
             {
                 entry = createEntryWithState(entry, State.QUIESCED);
             }
@@ -93,6 +99,236 @@ public class ManagementModeStoreHandler 
     }
 
     @Override
+    public void openConfigurationStore(final ConfiguredObject<?> parent, final Map<String, Object> storeSettings)
+            throws StoreException
+    {
+        _parent = parent;
+        _store.openConfigurationStore(parent,storeSettings);
+    }
+
+    @Override
+    public void recoverConfigurationStore(final ConfigurationRecoveryHandler recoveryHandler) throws StoreException
+    {
+
+        final Map<UUID,ConfiguredObjectRecord> records = new HashMap<UUID, ConfiguredObjectRecord>();
+        final ConfigurationRecoveryHandler localRecoveryHandler = new ConfigurationRecoveryHandler()
+        {
+            private int _version;
+            private boolean _quiesceRmiPort = _options.getManagementModeRmiPortOverride() > 0;
+            private boolean _quiesceJmxPort = _options.getManagementModeJmxPortOverride() > 0;
+            private boolean _quiesceHttpPort = _options.getManagementModeHttpPortOverride() > 0;
+            @Override
+            public void beginConfigurationRecovery(final DurableConfigurationStore store, final int configVersion)
+            {
+                _version = configVersion;
+            }
+
+            @Override
+            public void configuredObject(final ConfiguredObjectRecord object)
+            {
+                String entryType = object.getType();
+                Map<String, Object> attributes = object.getAttributes();
+                boolean quiesce = false;
+                if (VIRTUAL_HOST_TYPE.equals(entryType) && _options.isManagementModeQuiesceVirtualHosts())
+                {
+                    quiesce = true;
+                }
+                else if (PORT_TYPE.equals(entryType))
+                {
+                    if (attributes == null)
+                    {
+                        throw new IllegalConfigurationException("Port attributes are not set in " + object);
+                    }
+                    Set<Protocol> protocols = getPortProtocolsAttribute(attributes);
+                    if (protocols == null)
+                    {
+                        quiesce = true;
+                    }
+                    else
+                    {
+                        for (Protocol protocol : protocols)
+                        {
+                            switch (protocol)
+                            {
+                                case JMX_RMI:
+                                    quiesce = _quiesceJmxPort || _quiesceRmiPort ;
+                                    break;
+                                case RMI:
+                                    quiesce = _quiesceRmiPort;
+                                    break;
+                                case HTTP:
+                                    quiesce = _quiesceHttpPort;
+                                    break;
+                                default:
+                                    quiesce = true;
+                            }
+                        }
+                    }
+                }
+                if (quiesce)
+                {
+                    if (LOGGER.isDebugEnabled())
+                    {
+                        LOGGER.debug("Management mode quiescing entry " + object);
+                    }
+
+                    // save original state
+                    _quiescedEntriesOriginalState.put(object.getId(), attributes.get(ATTRIBUTE_STATE));
+                    Map<String,Object> modifiedAttributes = new HashMap<String, Object>(attributes);
+                    modifiedAttributes.put(ATTRIBUTE_STATE, State.QUIESCED);
+                    ConfiguredObjectRecord record = new ConfiguredObjectRecordImpl(object.getId(), object.getType(), modifiedAttributes, object.getParents());
+                    records.put(record.getId(), record);
+
+                }
+                else
+                {
+                    records.put(object.getId(), object);
+                }
+            }
+
+
+            @Override
+            public int completeConfigurationRecovery()
+            {
+                return _version;
+            }
+        };
+
+        ConfiguredObjectRecord parent = records.get(_parent.getId());
+        if(parent == null)
+        {
+            parent = _parent.asObjectRecord();
+        }
+        for(ConfigurationEntry entry : _cliEntries.values())
+        {
+            records.put(entry.getId(),new ConfiguredObjectRecordImpl(entry.getId(), entry.getType(), entry.getAttributes(), Collections.singletonMap(parent.getType(), parent)));
+        }
+
+
+        _store.recoverConfigurationStore(localRecoveryHandler);
+
+        recoveryHandler.beginConfigurationRecovery(this,0);
+
+        for(ConfiguredObjectRecord record : records.values())
+        {
+            recoveryHandler.configuredObject(record);
+        }
+        recoveryHandler.completeConfigurationRecovery();
+    }
+
+
+    @Override
+    public void create(final ConfiguredObjectRecord object)
+    {
+        synchronized (_store)
+        {
+            Collection<ConfigurationEntry> entriesToSave = new ArrayList<ConfigurationEntry>();
+            entriesToSave.add(new ConfigurationEntryImpl(object.getId(),
+                                                         object.getType(),
+                                                         object.getAttributes(),
+                                                         Collections.<UUID>emptySet(),
+                                                         this));
+            for (ConfiguredObjectRecord parent : object.getParents().values())
+            {
+                ConfigurationEntry parentEntry = getEntry(parent.getId());
+                Set<UUID> children = new HashSet<UUID>(parentEntry.getChildrenIds());
+                children.add(object.getId());
+                ConfigurationEntry replacementEntry = new ConfigurationEntryImpl(parentEntry.getId(),
+                                                                                 parent.getType(),
+                                                                                 parent.getAttributes(),
+                                                                                 children,
+                                                                                 this);
+                entriesToSave.add(replacementEntry);
+            }
+            save(entriesToSave.toArray(new ConfigurationEntry[entriesToSave.size()]));
+        }
+    }
+
+    @Override
+    public void update(final boolean createIfNecessary, final ConfiguredObjectRecord... records) throws StoreException
+    {
+        synchronized (_store)
+        {
+            Map<UUID, ConfigurationEntry> updates = new HashMap<UUID, ConfigurationEntry>();
+
+
+            for (ConfiguredObjectRecord record : records)
+            {
+                Set<UUID> currentChildren;
+
+                final ConfigurationEntry entry = getEntry(record.getId());
+
+                if (entry == null)
+                {
+                    if (createIfNecessary)
+                    {
+                        currentChildren = new HashSet<UUID>();
+                    }
+                    else
+                    {
+                        throw new StoreException("Cannot update record with id "
+                                                 + record.getId()
+                                                 + " as it does not exist");
+                    }
+                }
+                else
+                {
+                    currentChildren = new HashSet<UUID>(entry.getChildrenIds());
+                }
+
+                updates.put(record.getId(),
+                            new ConfigurationEntryImpl(record.getId(),
+                                                       record.getType(),
+                                                       record.getAttributes(),
+                                                       currentChildren,
+                                                       this)
+                           );
+            }
+
+            for (ConfiguredObjectRecord record : records)
+            {
+                for (ConfiguredObjectRecord parent : record.getParents().values())
+                {
+                    ConfigurationEntry existingParentEntry = updates.get(parent.getId());
+                    if (existingParentEntry == null)
+                    {
+                        existingParentEntry = getEntry(parent.getId());
+                        if (existingParentEntry == null)
+                        {
+                            if(parent.getType().equals(SystemContext.class.getSimpleName()))
+                            {
+                                continue;
+                            }
+                            throw new StoreException("Unknown parent of type " + parent.getType() + " with id " + parent
+                                    .getId());
+                        }
+
+                        Set<UUID> children = new HashSet<UUID>(existingParentEntry.getChildrenIds());
+                        if (!children.contains(record.getId()))
+                        {
+                            children.add(record.getId());
+                            ConfigurationEntry newParentEntry = new ConfigurationEntryImpl(existingParentEntry.getId(),
+                                                                                           existingParentEntry.getType(),
+                                                                                           existingParentEntry.getAttributes(),
+                                                                                           children,
+                                                                                           this);
+                            updates.put(newParentEntry.getId(), newParentEntry);
+                        }
+                    }
+                }
+
+            }
+
+            save(updates.values().toArray(new ConfigurationEntry[updates.size()]));
+        }
+    }
+
+    @Override
+    public void closeConfigurationStore() throws StoreException
+    {
+    }
+
+    @Override
     public void save(ConfigurationEntry... entries)
     {
         synchronized (_store)
@@ -108,10 +344,10 @@ public class ManagementModeStoreHandler 
                     throw new IllegalConfigurationException("Cannot save configuration provided as command line argument:"
                             + entry);
                 }
-                else if (_quiescedEntries.containsKey(id))
+                else if (_quiescedEntriesOriginalState.containsKey(id))
                 {
                     // save entry with the original state
-                    entry = createEntryWithState(entry, _quiescedEntries.get(id));
+                    entry = createEntryWithState(entry, _quiescedEntriesOriginalState.get(id));
                 }
                 else if (_rootId.equals(id))
                 {
@@ -122,7 +358,7 @@ public class ManagementModeStoreHandler 
                         childrenIds.removeAll(_cliEntries.keySet());
                     }
                     HashMap<String, Object> attributes = new HashMap<String, Object>(entry.getAttributes());
-                    entry = new ConfigurationEntry(entry.getId(), entry.getType(), attributes, childrenIds, this);
+                    entry = new ConfigurationEntryImpl(entry.getId(), entry.getType(), attributes, childrenIds, this);
                 }
                 entriesToSave[i] = entry;
             }
@@ -132,24 +368,30 @@ public class ManagementModeStoreHandler 
     }
 
     @Override
-    public UUID[] remove(UUID... entryIds)
+    public synchronized UUID[] remove(final ConfiguredObjectRecord... records)
     {
         synchronized (_store)
         {
-            for (UUID id : entryIds)
+            UUID[] idsToRemove = new UUID[records.length];
+            for(int i = 0; i < records.length; i++)
+            {
+                idsToRemove[i] = records[i].getId();
+            }
+
+            for (UUID id : idsToRemove)
             {
                 if (_cliEntries.containsKey(id))
                 {
                     throw new IllegalConfigurationException("Cannot change configuration for command line entry:"
-                            + _cliEntries.get(id));
+                                                            + _cliEntries.get(id));
                 }
             }
-            UUID[] result = _store.remove(entryIds);
-            for (UUID id : entryIds)
+            UUID[] result = _store.remove(records);
+            for (UUID id : idsToRemove)
             {
-                if (_quiescedEntries.containsKey(id))
+                if (_quiescedEntriesOriginalState.containsKey(id))
                 {
-                    _quiescedEntries.remove(id);
+                    _quiescedEntriesOriginalState.remove(id);
                 }
             }
             return result;
@@ -234,7 +476,7 @@ public class ManagementModeStoreHandler 
         {
             attributes.put(Port.AUTHENTICATION_PROVIDER, MANAGEMENT_MODE_AUTH_PROVIDER);
         }
-        ConfigurationEntry portEntry = new ConfigurationEntry(UUID.randomUUID(), PORT_TYPE, attributes,
+        ConfigurationEntry portEntry = new ConfigurationEntryImpl(UUID.randomUUID(), PORT_TYPE, attributes,
                 Collections.<UUID> emptySet(), this);
         if (LOGGER.isDebugEnabled())
         {
@@ -251,7 +493,7 @@ public class ManagementModeStoreHandler 
         {
             childrenIds.addAll(_cliEntries.keySet());
         }
-        ConfigurationEntry root = new ConfigurationEntry(storeRoot.getId(), storeRoot.getType(), new HashMap<String, Object>(
+        ConfigurationEntry root = new ConfigurationEntryImpl(storeRoot.getId(), storeRoot.getType(), new HashMap<String, Object>(
                 storeRoot.getAttributes()), childrenIds, this);
         return root;
     }
@@ -347,7 +589,7 @@ public class ManagementModeStoreHandler 
         {
             children = new HashSet<UUID>(originalChildren);
         }
-        return new ConfigurationEntry(entry.getId(), entry.getType(), attributes, children, entry.getStore());
+        return new ConfigurationEntryImpl(entry.getId(), entry.getType(), attributes, children, entry.getStore());
     }
 
 }

Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStore.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStore.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStore.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStore.java Thu Apr  3 19:58:53 2014
@@ -20,33 +20,18 @@
  */
 package org.apache.qpid.server.configuration.store;
 
-import static org.apache.qpid.server.configuration.ConfigurationEntry.ATTRIBUTE_NAME;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
-import java.util.UUID;
-
 import org.apache.qpid.server.configuration.ConfigurationEntry;
+import org.apache.qpid.server.configuration.ConfigurationEntryImpl;
 import org.apache.qpid.server.configuration.ConfigurationEntryStore;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.ConfiguredObject;
 import org.apache.qpid.server.model.Model;
+import org.apache.qpid.server.model.SystemContext;
 import org.apache.qpid.server.model.UUIDGenerator;
+import org.apache.qpid.server.store.ConfigurationRecoveryHandler;
+import org.apache.qpid.server.store.ConfiguredObjectRecord;
+import org.apache.qpid.server.store.StoreException;
 import org.apache.qpid.util.Strings;
 import org.apache.qpid.util.Strings.ChainedResolver;
 import org.codehaus.jackson.JsonGenerationException;
@@ -58,8 +43,18 @@ import org.codehaus.jackson.map.ObjectMa
 import org.codehaus.jackson.map.SerializationConfig;
 import org.codehaus.jackson.node.ArrayNode;
 
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.*;
+
+import static org.apache.qpid.server.configuration.ConfigurationEntry.ATTRIBUTE_NAME;
+
 public class MemoryConfigurationEntryStore implements ConfigurationEntryStore
 {
+
     public static final String STORE_TYPE = "memory";
 
     private static final String DEFAULT_BROKER_NAME = "Broker";
@@ -79,6 +74,7 @@ public class MemoryConfigurationEntrySto
     private boolean _generatedObjectIdDuringLoad;
 
     private ChainedResolver _resolver;
+    private ConfiguredObject<?> _parent;
 
     protected MemoryConfigurationEntryStore(Map<String, String> configProperties)
     {
@@ -128,9 +124,16 @@ public class MemoryConfigurationEntrySto
         }
     }
 
+
     @Override
-    public synchronized UUID[] remove(UUID... entryIds)
+    public synchronized UUID[] remove(final ConfiguredObjectRecord... records)
     {
+        UUID[] entryIds = new UUID[records.length];
+        for(int i = 0; i < records.length; i++)
+        {
+            entryIds[i] = records[i].getId();
+        }
+
         List<UUID> removedIds = new ArrayList<UUID>();
         for (UUID uuid : entryIds)
         {
@@ -150,7 +153,7 @@ public class MemoryConfigurationEntrySto
                     {
                         Set<UUID> children = new HashSet<UUID>(entry.getChildrenIds());
                         children.remove(uuid);
-                        ConfigurationEntry referral = new ConfigurationEntry(entry.getId(), entry.getType(),
+                        ConfigurationEntry referral = new ConfigurationEntryImpl(entry.getId(), entry.getType(),
                                 entry.getAttributes(), children, this);
                         _entries.put(entry.getId(), referral);
                     }
@@ -183,7 +186,7 @@ public class MemoryConfigurationEntrySto
     /**
      * Copies the store into the given location
      *
-     * @param target location to copy store into
+     * @param copyLocation location to copy store into
      * @throws IllegalConfigurationException if store cannot be copied into given location
      */
     public void copyTo(String copyLocation)
@@ -220,6 +223,188 @@ public class MemoryConfigurationEntrySto
         return "MemoryConfigurationEntryStore [_rootId=" + _rootId + "]";
     }
 
+    @Override
+    public synchronized void create(final ConfiguredObjectRecord object)
+    {
+        Collection<ConfigurationEntry> entriesToSave = new ArrayList<ConfigurationEntry>();
+        entriesToSave.add(new ConfigurationEntryImpl(object.getId(), object.getType(), object.getAttributes(), Collections.<UUID>emptySet(), this));
+        for(ConfiguredObjectRecord parent : object.getParents().values())
+        {
+            ConfigurationEntry parentEntry = getEntry(parent.getId());
+            Set<UUID> children = new HashSet<UUID>(parentEntry.getChildrenIds());
+            children.add(object.getId());
+            ConfigurationEntry replacementEntry = new ConfigurationEntryImpl(parentEntry.getId(), parent.getType(), parent.getAttributes(), children, this);
+            entriesToSave.add(replacementEntry);
+        }
+        save(entriesToSave.toArray(new ConfigurationEntry[entriesToSave.size()]));
+    }
+
+    @Override
+    public synchronized void update(final boolean createIfNecessary, final ConfiguredObjectRecord... records) throws StoreException
+    {
+
+        Map<UUID, ConfigurationEntry> updates = new HashMap<UUID, ConfigurationEntry>();
+
+
+        for (ConfiguredObjectRecord record : records)
+        {
+            Set<UUID> currentChildren;
+
+            final ConfigurationEntry entry = getEntry(record.getId());
+
+            if (entry == null)
+            {
+                if (createIfNecessary)
+                {
+                    currentChildren = new HashSet<UUID>();
+                }
+                else
+                {
+                    throw new StoreException("Cannot update record with id "
+                                             + record.getId()
+                                             + " as it does not exist");
+                }
+            }
+            else
+            {
+                currentChildren = new HashSet<UUID>(entry.getChildrenIds());
+            }
+
+            updates.put(record.getId(),
+                        new ConfigurationEntryImpl(record.getId(),
+                                                   record.getType(),
+                                                   record.getAttributes(),
+                                                   currentChildren,
+                                                   this));
+        }
+
+        for (ConfiguredObjectRecord record : records)
+        {
+            for (ConfiguredObjectRecord parent : record.getParents().values())
+            {
+                ConfigurationEntry existingParentEntry = updates.get(parent.getId());
+                if(existingParentEntry == null)
+                {
+                    existingParentEntry = getEntry(parent.getId());
+                    if (existingParentEntry == null)
+                    {
+                        if (parent.getType().equals(SystemContext.class.getSimpleName()))
+                        {
+                            if(_rootId == null)
+                            {
+                                _rootId = record.getId();
+                            }
+                            continue;
+                        }
+                        throw new StoreException("Unknown parent of type "
+                                                 + parent.getType()
+                                                 + " with id "
+                                                 + parent.getId());
+                    }
+                }
+                Set<UUID> children = new HashSet<UUID>(existingParentEntry.getChildrenIds());
+                if(!children.contains(record.getId()))
+                {
+                    children.add(record.getId());
+                    ConfigurationEntry newParentEntry = new ConfigurationEntryImpl(existingParentEntry.getId(), existingParentEntry.getType(), existingParentEntry.getAttributes(), children, this);
+                    updates.put(newParentEntry.getId(), newParentEntry);
+                }
+
+            }
+
+        }
+        save(updates.values().toArray(new ConfigurationEntry[updates.size()]));
+    }
+
+    @Override
+    public void closeConfigurationStore() throws StoreException
+    {
+    }
+
+    @Override
+    public void openConfigurationStore(final ConfiguredObject<?> parent, final Map<String, Object> storeSettings)
+            throws StoreException
+    {
+        _parent = parent;
+    }
+
+    @Override
+    public void recoverConfigurationStore(final ConfigurationRecoveryHandler recoveryHandler) throws StoreException
+    {
+
+        recoveryHandler.beginConfigurationRecovery(this,0);
+
+        final Map<UUID,Map<String,UUID>> parentMap = new HashMap<UUID, Map<String, UUID>>();
+
+        for(ConfigurationEntry entry : _entries.values())
+        {
+            if(entry.getChildrenIds() != null)
+            {
+                for(UUID childId : entry.getChildrenIds())
+                {
+                    Map<String, UUID> parents = parentMap.get(childId);
+                    if(parents == null)
+                    {
+                        parents = new HashMap<String, UUID>();
+                        parentMap.put(childId, parents);
+                    }
+                    parents.put(entry.getType(), entry.getId());
+                }
+            }
+        }
+
+        final Map<UUID, ConfiguredObjectRecord> records = new HashMap<UUID, ConfiguredObjectRecord>();
+        for(final ConfigurationEntry entry : _entries.values())
+        {
+            records.put(entry.getId(), new ConfiguredObjectRecord()
+            {
+                @Override
+                public UUID getId()
+                {
+                    return entry.getId();
+                }
+
+                @Override
+                public String getType()
+                {
+                    return entry.getType();
+                }
+
+                @Override
+                public Map<String, Object> getAttributes()
+                {
+                    return entry.getAttributes();
+                }
+
+                @Override
+                public Map<String, ConfiguredObjectRecord> getParents()
+                {
+                    Map<String,ConfiguredObjectRecord> parents = new HashMap<String, ConfiguredObjectRecord>();
+                    Map<String, UUID> calculatedParents = parentMap.get(getId());
+                    if(calculatedParents != null)
+                    {
+                        for(Map.Entry<String,UUID> entry : calculatedParents.entrySet())
+                        {
+                            parents.put(entry.getKey(), records.get(entry.getValue()));
+                        }
+                    }
+                    else
+                    {
+                        ConfiguredObjectRecord parent = _parent.asObjectRecord();
+                        parents.put(parent.getType(),parent);
+                    }
+                    return parents;
+                }
+            });
+        }
+        for(ConfiguredObjectRecord record : records.values())
+        {
+            recoveryHandler.configuredObject(record);
+        }
+        recoveryHandler.completeConfigurationRecovery();
+
+    }
+
     protected boolean replaceEntries(ConfigurationEntry... entries)
     {
         boolean anySaved = false;
@@ -348,7 +533,7 @@ public class MemoryConfigurationEntrySto
 
             Set<UUID> children = entry.getChildrenIds();
             Set<UUID> childrenCopy = children == null? null : new HashSet<UUID>(children);
-            ConfigurationEntry copy = new ConfigurationEntry(entryId, entry.getType(), new HashMap<String, Object>(entry.getAttributes()), childrenCopy, this);
+            ConfigurationEntry copy = new ConfigurationEntryImpl(entryId, entry.getType(), new HashMap<String, Object>(entry.getAttributes()), childrenCopy, this);
             entries.put(entryId, copy);
             if (children != null)
             {
@@ -393,7 +578,7 @@ public class MemoryConfigurationEntrySto
 
     private void createRootEntry()
     {
-        ConfigurationEntry brokerEntry = new ConfigurationEntry(UUIDGenerator.generateRandomUUID(),
+        ConfigurationEntry brokerEntry = new ConfigurationEntryImpl(UUIDGenerator.generateRandomUUID(),
                 Broker.class.getSimpleName(), Collections.<String, Object> emptyMap(), Collections.<UUID> emptySet(), this);
         _rootId = brokerEntry.getId();
         _entries.put(_rootId, brokerEntry);
@@ -545,7 +730,11 @@ public class MemoryConfigurationEntrySto
             }
             else if (fieldNode.isObject())
             {
-                // ignore, in-line objects are not supported yet
+                if (attributes == null)
+                {
+                    attributes = new HashMap<String, Object>();
+                }
+                attributes.put(fieldName, toObject(fieldNode) );
             }
             else
             {
@@ -605,7 +794,7 @@ public class MemoryConfigurationEntrySto
                         "ID attribute value does not conform to UUID format for configuration entry " + parent);
             }
         }
-        ConfigurationEntry entry = new ConfigurationEntry(id, type, attributes, childrenIds, this);
+        ConfigurationEntry entry = new ConfigurationEntryImpl(id, type, attributes, childrenIds, this);
         if (entries.containsKey(id))
         {
             throw new IllegalConfigurationException("Duplicate id is found: " + id

Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListener.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListener.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListener.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListener.java Thu Apr  3 19:58:53 2014
@@ -22,28 +22,25 @@ package org.apache.qpid.server.configura
 
 import java.util.Collection;
 import java.util.Collections;
-import java.util.HashSet;
 import java.util.Set;
 import java.util.TreeSet;
 import java.util.UUID;
 
 import org.apache.qpid.server.configuration.ConfigurationEntry;
+import org.apache.qpid.server.configuration.ConfigurationEntryImpl;
 import org.apache.qpid.server.configuration.ConfigurationEntryStore;
-import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.ConfigurationChangeListener;
 import org.apache.qpid.server.model.ConfiguredObject;
 import org.apache.qpid.server.model.Model;
-import org.apache.qpid.server.model.Port;
 import org.apache.qpid.server.model.State;
 import org.apache.qpid.server.model.VirtualHost;
-import org.apache.qpid.server.store.StoreException;
+import org.apache.qpid.server.store.DurableConfigurationStore;
 
 public class StoreConfigurationChangeListener implements ConfigurationChangeListener
 {
-    private ConfigurationEntryStore _store;
+    private DurableConfigurationStore _store;
 
-    public StoreConfigurationChangeListener(ConfigurationEntryStore store)
+    public StoreConfigurationChangeListener(DurableConfigurationStore store)
     {
         super();
         _store = store;
@@ -54,7 +51,7 @@ public class StoreConfigurationChangeLis
     {
         if (newState == State.DELETED)
         {
-            _store.remove(object.getId());
+            _store.remove(object.asObjectRecord());
             object.removeChangeListener(this);
         }
     }
@@ -66,9 +63,7 @@ public class StoreConfigurationChangeLis
         if (!(object instanceof VirtualHost))
         {
             child.addChangeListener(this);
-            ConfigurationEntry parentEntry = toConfigurationEntry(object);
-            ConfigurationEntry childEntry = toConfigurationEntry(child);
-            _store.save(parentEntry, childEntry);
+            _store.update(true,child.asObjectRecord());
         }
 
     }
@@ -76,48 +71,13 @@ public class StoreConfigurationChangeLis
     @Override
     public void childRemoved(ConfiguredObject object, ConfiguredObject child)
     {
-        _store.save(toConfigurationEntry(object));
+        _store.remove(child.asObjectRecord());
     }
 
     @Override
     public void attributeSet(ConfiguredObject object, String attributeName, Object oldAttributeValue, Object newAttributeValue)
     {
-        _store.save(toConfigurationEntry(object));
-    }
-
-    private ConfigurationEntry toConfigurationEntry(ConfiguredObject object)
-    {
-        Class<? extends ConfiguredObject> objectType = object.getCategoryClass();
-        Set<UUID> childrenIds = getChildrenIds(object, objectType);
-        ConfigurationEntry entry = new ConfigurationEntry(object.getId(), objectType.getSimpleName(),
-                object.getActualAttributes(), childrenIds, _store);
-        return entry;
-    }
-
-    private Set<UUID> getChildrenIds(ConfiguredObject object, Class<? extends ConfiguredObject> objectType)
-    {
-        // Virtual Host children's IDs should not be stored in broker store
-        if (object instanceof VirtualHost)
-        {
-            return Collections.emptySet();
-        }
-        Set<UUID> childrenIds = new TreeSet<UUID>();
-        Collection<Class<? extends ConfiguredObject>> childClasses = Model.getInstance().getChildTypes(objectType);
-        if (childClasses != null)
-        {
-            for (Class<? extends ConfiguredObject> childClass : childClasses)
-            {
-                Collection<? extends ConfiguredObject> children = object.getChildren(childClass);
-                if (children != null)
-                {
-                    for (ConfiguredObject childObject : children)
-                    {
-                        childrenIds.add(childObject.getId());
-                    }
-                }
-            }
-        }
-        return childrenIds;
+        _store.update(false, object.asObjectRecord());
     }
 
     @Override

Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/factory/JsonConfigurationStoreFactory.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/factory/JsonConfigurationStoreFactory.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/factory/JsonConfigurationStoreFactory.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/factory/JsonConfigurationStoreFactory.java Thu Apr  3 19:58:53 2014
@@ -24,14 +24,15 @@ import java.util.Map;
 
 import org.apache.qpid.server.configuration.ConfigurationEntryStore;
 import org.apache.qpid.server.configuration.store.JsonConfigurationEntryStore;
+import org.apache.qpid.server.model.SystemContext;
 import org.apache.qpid.server.plugin.ConfigurationStoreFactory;
 
 public class JsonConfigurationStoreFactory implements ConfigurationStoreFactory
 {
     @Override
-    public ConfigurationEntryStore createStore(String storeLocation, ConfigurationEntryStore initialStore, boolean overwrite, Map<String, String> configProperties)
+    public ConfigurationEntryStore createStore(SystemContext systemContext, ConfigurationEntryStore initialStore, boolean overwrite, Map<String, String> configProperties)
     {
-        return new JsonConfigurationEntryStore(storeLocation, initialStore, overwrite, configProperties);
+        return new JsonConfigurationEntryStore(systemContext, initialStore, overwrite, configProperties);
     }
 
     @Override

Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/factory/MemoryConfigurationStoreFactory.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/factory/MemoryConfigurationStoreFactory.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/factory/MemoryConfigurationStoreFactory.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/factory/MemoryConfigurationStoreFactory.java Thu Apr  3 19:58:53 2014
@@ -24,12 +24,13 @@ import java.util.Map;
 
 import org.apache.qpid.server.configuration.ConfigurationEntryStore;
 import org.apache.qpid.server.configuration.store.MemoryConfigurationEntryStore;
+import org.apache.qpid.server.model.SystemContext;
 import org.apache.qpid.server.plugin.ConfigurationStoreFactory;
 
 public class MemoryConfigurationStoreFactory  implements ConfigurationStoreFactory
 {
     @Override
-    public ConfigurationEntryStore createStore(String storeLocation, ConfigurationEntryStore initialStore, boolean overwrite, Map<String, String> configProperties)
+    public ConfigurationEntryStore createStore(SystemContext systemContext, ConfigurationEntryStore initialStore, boolean overwrite, Map<String, String> configProperties)
     {
         return new MemoryConfigurationEntryStore(null, initialStore, configProperties);
     }

Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java Thu Apr  3 19:58:53 2014
@@ -38,7 +38,7 @@ import org.apache.qpid.server.model.Publ
 import org.apache.qpid.server.model.Queue;
 import org.apache.qpid.server.model.State;
 import org.apache.qpid.server.model.UUIDGenerator;
-import org.apache.qpid.server.model.adapter.AbstractConfiguredObject;
+import org.apache.qpid.server.model.AbstractConfiguredObject;
 import org.apache.qpid.server.plugin.ExchangeType;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.queue.BaseQueue;

Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubject.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubject.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubject.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubject.java Thu Apr  3 19:58:53 2014
@@ -20,8 +20,6 @@
  */
 package org.apache.qpid.server.logging.subjects;
 
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
 import static org.apache.qpid.server.logging.subjects.LogSubjectFormat.STORE_FORMAT;
 
 public class MessageStoreLogSubject extends AbstractLogSubject

Copied: qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java (from r1582544, qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AbstractConfiguredObject.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java?p2=qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java&p1=qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AbstractConfiguredObject.java&r1=1582544&r2=1584365&rev=1584365&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AbstractConfiguredObject.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java Thu Apr  3 19:58:53 2014
@@ -18,18 +18,8 @@
  * under the License.
  *
  */
-package org.apache.qpid.server.model.adapter;
+package org.apache.qpid.server.model;
 
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.security.AccessControlException;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.*;
-
-import org.apache.qpid.server.model.*;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.configuration.updater.ChangeAttributesTask;
 import org.apache.qpid.server.configuration.updater.ChangeStateTask;
@@ -39,10 +29,17 @@ import org.apache.qpid.server.configurat
 import org.apache.qpid.server.security.SecurityManager;
 import org.apache.qpid.server.security.auth.AuthenticatedPrincipal;
 import org.apache.qpid.server.store.ConfiguredObjectRecord;
-import org.apache.qpid.server.util.MapValueConverter;
 import org.apache.qpid.server.util.ServerScopedRuntimeException;
 
 import javax.security.auth.Subject;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.security.AccessControlException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.*;
 
 public abstract class AbstractConfiguredObject<X extends ConfiguredObject<X>> implements ConfiguredObject<X>
 {
@@ -152,9 +149,12 @@ public abstract class AbstractConfigured
                                        boolean filterAttributes)
     {
         _taskExecutor = taskExecutor;
-        _id = (UUID)attributes.get(ID);
+        final UUID uuid = (UUID) attributes.get(ID);
+        _id = uuid == null ? UUID.randomUUID() : uuid;
         _attributeTypes = getAttributeTypes(getClass());
         _automatedFields = getAutomatedFields(getClass());
+
+
         for(Map.Entry<Class<? extends ConfiguredObject>, ConfiguredObject<?>> entry : parents.entrySet())
         {
             addParent((Class<ConfiguredObject>) entry.getKey(), entry.getValue());
@@ -228,6 +228,15 @@ public abstract class AbstractConfigured
                 throw new IllegalArgumentException("Mandatory attribute " + attr.getName() + " not supplied for instance of " + getClass().getName());
             }
         }
+
+        for(ConfiguredObject<?> parent : parents.values())
+        {
+            if(parent instanceof AbstractConfiguredObject<?>)
+            {
+                ((AbstractConfiguredObject<?>)parent).instantiateChild(this);
+            }
+        }
+
     }
 
     private void automatedSetValue(final String name, final Object value)
@@ -415,6 +424,29 @@ public abstract class AbstractConfigured
         }
     }
 
+    protected void create()
+    {
+    }
+
+    protected <T extends ConfiguredObject<?>> Object getAttribute(String name, T parent, String parentAttributeName)
+    {
+        Object value = getActualAttribute(name);
+        if (value != null )
+        {
+            return value;
+        }
+        if (parent != null)
+        {
+            value = parent.getAttribute(parentAttributeName);
+            if (value != null)
+            {
+                return value;
+            }
+        }
+        return getDefaultAttribute(name);
+    }
+
+
     @Override
     public String getDescription()
     {
@@ -516,15 +548,16 @@ public abstract class AbstractConfigured
         }
     }
 
-    protected <T extends ConfiguredObject> void addParent(Class<T> clazz, T parent)
+    private <T extends ConfiguredObject> void addParent(Class<T> clazz, T parent)
     {
         synchronized (_parents)
         {
             _parents.put(clazz, parent);
         }
+
     }
 
-    protected  <T extends ConfiguredObject> void removeParent(Class<T> clazz)
+    protected <T extends ConfiguredObject> void removeParent(Class<T> clazz)
     {
         synchronized (this)
         {
@@ -598,6 +631,13 @@ public abstract class AbstractConfigured
                 }
                 return parents;
             }
+
+            @Override
+            public String toString()
+            {
+                return getClass().getSimpleName() + "[name=" + getName() + ", categoryClass=" + getCategoryClass() + ", type="
+                        + getType() + ", id=" + getId() + "]";
+            }
         };
     }
 
@@ -626,8 +666,40 @@ public abstract class AbstractConfigured
         throw new UnsupportedOperationException();
     }
 
+    protected <C extends ConfiguredObject> void instantiateChild(final C child)
+    {
+
+        Class<? extends ConfiguredObject> childCategory = child.getCategoryClass();
+        if(!Model.getInstance().getChildTypes(getCategoryClass()).contains(childCategory))
+        {
+            throw new IllegalArgumentException("Cannot instantiate a child of category " + childCategory.getSimpleName()
+                + " to a parent of category " + getCategoryClass().getSimpleName());
+        }
 
-    protected TaskExecutor getTaskExecutor()
+        try
+        {
+            final String methodName = "instantiate" + childCategory.getSimpleName();
+            Method recoveryMethod = getClass().getMethod(methodName, childCategory);
+            recoveryMethod.setAccessible(true);
+            recoveryMethod.invoke(this, child);
+        }
+        catch (NoSuchMethodException e)
+        {
+            throw new IllegalArgumentException("Cannot instantiate a child of category " + childCategory.getSimpleName()
+                                               + " to a parent of category " + getCategoryClass().getSimpleName()
+                                               + ". No instatiation method defined. ");
+        }
+        catch (InvocationTargetException e)
+        {
+            throw new IllegalArgumentException("Error recovering child", e.getTargetException());
+        }
+        catch (IllegalAccessException e)
+        {
+            throw new ServerScopedRuntimeException("Error recovering child, method for recovery cannot be called", e);
+        }
+    }
+
+    public TaskExecutor getTaskExecutor()
     {
         return _taskExecutor;
     }
@@ -807,6 +879,20 @@ public abstract class AbstractConfigured
         return map;
     }
 
+
+    public <Y extends ConfiguredObject<Y>> Y findConfiguredObject(Class<Y> clazz, String name)
+    {
+        Collection<Y> reachable = getReachableObjects(this,clazz);
+        for(Y candidate : reachable)
+        {
+            if(candidate.getName().equals(name))
+            {
+                return candidate;
+            }
+        }
+        return null;
+    }
+
     //=========================================================================================
 
     private static abstract class AttributeOrStatistic<C extends ConfiguredObject, T>
@@ -856,6 +942,10 @@ public abstract class AbstractConfigured
 
         }
 
+        public Method getGetter()
+        {
+            return _getter;
+        }
     }
 
     private static final class Statistic<C extends ConfiguredObject, T extends Number> extends AttributeOrStatistic<C,T>
@@ -1137,6 +1227,7 @@ public abstract class AbstractConfigured
         }
     }
 
+
     private static final class ConfiguredObjectConverter<X extends ConfiguredObject<X>> implements Converter<X>
     {
         private final Class<X> _klazz;
@@ -1669,6 +1760,10 @@ public abstract class AbstractConfigured
             for(Class<? extends ConfiguredObject> parentClass : Model.getInstance().getParentTypes(category))
             {
                 ConfiguredObject parent = object.getParent(parentClass);
+                if(parent == null)
+                {
+                    System.err.println(parentClass.getSimpleName());
+                }
                 ConfiguredObject ancestor = getAncestor(ancestorClass, parentClass, parent);
                 if(ancestor != null)
                 {
@@ -1724,7 +1819,7 @@ public abstract class AbstractConfigured
         return allDescendants.contains(descendantClass);
     }
 
-    private static Class<? extends ConfiguredObject> getCategory(final Class<?> clazz)
+    static Class<? extends ConfiguredObject> getCategory(final Class<?> clazz)
     {
         ManagedObject annotation = clazz.getAnnotation(ManagedObject.class);
         if(annotation != null && annotation.category())
@@ -1747,4 +1842,51 @@ public abstract class AbstractConfigured
     }
 
 
+    protected static String getType(final Class<? extends ConfiguredObject> clazz)
+    {
+        ManagedObject annotation = clazz.getAnnotation(ManagedObject.class);
+        if(annotation != null)
+        {
+            if(!"".equals(annotation.type()))
+            {
+                return annotation.type();
+            }
+        }
+
+        if(clazz.getSuperclass() != null && ConfiguredObject.class.isAssignableFrom(clazz.getSuperclass()))
+        {
+            String type = getType((Class<? extends ConfiguredObject>) clazz.getSuperclass());
+            if(!"".equals(type))
+            {
+                return type;
+            }
+        }
+
+        for(Class<?> iface : clazz.getInterfaces() )
+        {
+            if(ConfiguredObject.class.isAssignableFrom(iface))
+            {
+                String type = getType((Class<? extends ConfiguredObject>) iface);
+                if(!"".equals(type))
+                {
+                    return type;
+                }
+            }
+        }
+        Class<? extends ConfiguredObject> category = getCategory(clazz);
+        if(category == null)
+        {
+            return "";
+        }
+        annotation = category.getAnnotation(ManagedObject.class);
+        if(annotation == null)
+        {
+            throw new NullPointerException("No definition found for category " + category.getSimpleName());
+        }
+        if(!"".equals(annotation.defaultType()))
+        {
+            return annotation.defaultType();
+        }
+        return category.getSimpleName();
+    }
 }

Added: qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObjectTypeFactory.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObjectTypeFactory.java?rev=1584365&view=auto
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObjectTypeFactory.java (added)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObjectTypeFactory.java Thu Apr  3 19:58:53 2014
@@ -0,0 +1,111 @@
+/*
+ *
+ * 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 org.apache.qpid.server.plugin.ConfiguredObjectTypeFactory;
+import org.apache.qpid.server.store.ConfiguredObjectDependency;
+import org.apache.qpid.server.store.ConfiguredObjectRecord;
+import org.apache.qpid.server.store.UnresolvedConfiguredObject;
+
+import java.util.HashMap;
+import java.util.Map;
+
+abstract public class AbstractConfiguredObjectTypeFactory<X extends AbstractConfiguredObject<X>> implements ConfiguredObjectTypeFactory<X>
+{
+    private final Class<X> _clazz;
+
+    protected AbstractConfiguredObjectTypeFactory(final Class<X> clazz)
+    {
+        _clazz = clazz;
+    }
+
+    @Override
+    public final String getType()
+    {
+        return AbstractConfiguredObject.getType(_clazz);
+    }
+
+    @Override
+    public final Class<? super X> getCategoryClass()
+    {
+        return (Class<? super X>) AbstractConfiguredObject.getCategory(_clazz);
+    }
+
+    @Override
+    public X create(final Map<String, Object> attributes, final ConfiguredObject<?>... parents)
+    {
+        X instance = createInstance(attributes, parents);
+        instance.create();
+        return instance;
+    }
+
+    protected abstract X createInstance(Map<String, Object> attributes, ConfiguredObject<?>... parents);
+
+    public final <C extends ConfiguredObject<C>> C getParent(Class<C> parentClass, ConfiguredObject<?>... parents)
+    {
+        if(!Model.getInstance().getParentTypes((Class<? extends ConfiguredObject>) getCategoryClass()).contains(
+                parentClass))
+        {
+            throw new IllegalArgumentException(parentClass.getSimpleName() + " is not a parent of " + _clazz.getSimpleName());
+        }
+
+        for(ConfiguredObject<?> parent : parents)
+        {
+            if(parentClass.isInstance(parent))
+            {
+                return (C) parent;
+            }
+        }
+        throw new IllegalArgumentException("No parent of class " + parentClass.getSimpleName() + " found.");
+    }
+
+    @Override
+    public UnresolvedConfiguredObject<X> recover(final ConfiguredObjectRecord record,
+                                                 final ConfiguredObject<?>... parents)
+    {
+        return new GenericUnresolvedConfiguredObject( record, parents );
+    }
+
+
+    private class GenericUnresolvedConfiguredObject extends AbstractUnresolvedObject<X>
+    {
+        public GenericUnresolvedConfiguredObject(
+                final ConfiguredObjectRecord record, final ConfiguredObject<?>[] parents)
+        {
+            super(_clazz, record, parents);
+        }
+
+        @Override
+        protected <C extends ConfiguredObject<C>> void resolved(final ConfiguredObjectDependency<C> dependency,
+                                                                 final C value)
+        {
+
+        }
+
+        @Override
+        public X resolve()
+        {
+            Map<String,Object> attributesWithId = new HashMap<String, Object>(getRecord().getAttributes());
+            attributesWithId.put(ConfiguredObject.ID, getRecord().getId());
+            return createInstance(attributesWithId, getParents());
+        }
+    }
+}

Added: qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractUnresolvedObject.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractUnresolvedObject.java?rev=1584365&view=auto
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractUnresolvedObject.java (added)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractUnresolvedObject.java Thu Apr  3 19:58:53 2014
@@ -0,0 +1,241 @@
+/*
+ *
+ * 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 org.apache.qpid.server.configuration.IllegalConfigurationException;
+import org.apache.qpid.server.store.ConfiguredObjectDependency;
+import org.apache.qpid.server.store.ConfiguredObjectIdDependency;
+import org.apache.qpid.server.store.ConfiguredObjectNameDependency;
+import org.apache.qpid.server.store.ConfiguredObjectRecord;
+import org.apache.qpid.server.store.UnresolvedConfiguredObject;
+
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.UUID;
+
+public abstract class AbstractUnresolvedObject<C extends ConfiguredObject<C>> implements UnresolvedConfiguredObject<C>
+{
+    private final Class<C> _clazz;
+    private final Collection<ConfiguredObjectDependency<?>> _unresolvedObjects = new ArrayList<ConfiguredObjectDependency<?>>();
+    private final ConfiguredObjectRecord _record;
+    private final ConfiguredObject<?>[] _parents;
+
+    protected AbstractUnresolvedObject(Class<C> clazz,
+                                       ConfiguredObjectRecord record,
+                                       ConfiguredObject<?>... parents)
+    {
+        _clazz = clazz;
+        _record = record;
+        _parents = parents;
+
+        Collection<AbstractConfiguredObject.Attribute<? super C, ?>> attributes =
+                AbstractConfiguredObject.getAttributes(clazz);
+        for(AbstractConfiguredObject.Attribute<? super C, ?> attribute : attributes)
+        {
+            final Class<?> attributeType = attribute.getType();
+            if(ConfiguredObject.class.isAssignableFrom(attributeType))
+            {
+                addUnresolvedObject((Class<? extends ConfiguredObject>) attributeType, attribute.getName(), attribute.getAnnotation().mandatory());
+            }
+            else if(Collection.class.isAssignableFrom(attributeType))
+            {
+                Type returnType = attribute.getGetter().getGenericReturnType();
+                if (returnType instanceof ParameterizedType)
+                {
+                    Type type = ((ParameterizedType) returnType).getActualTypeArguments()[0];
+                    if(ConfiguredObject.class.isAssignableFrom((Class)type))
+                    {
+                        Class<? extends ConfiguredObject> attrClass = (Class<? extends ConfiguredObject>) type;
+                        Object attrValue = _record.getAttributes().get(attribute.getName());
+                        if(attrValue != null)
+                        {
+                            if (attrValue instanceof Collection)
+                            {
+                                for (Object val : (Collection) attrValue)
+                                {
+                                    addUnresolvedObject(attrClass, attribute.getName(), val);
+                                }
+                            }
+                            else if(attrValue instanceof Object[])
+                            {
+                                for (Object val : (Object[]) attrValue)
+                                {
+                                    addUnresolvedObject(attrClass, attribute.getName(), val);
+                                }
+                            }
+                            else
+                            {
+                                addUnresolvedObject(attrClass, attribute.getName(), attrValue);
+                            }
+                        }
+                    }
+                }
+
+            }
+        }
+    }
+
+    public ConfiguredObjectRecord getRecord()
+    {
+        return _record;
+    }
+
+    public ConfiguredObject<?>[] getParents()
+    {
+        return _parents;
+    }
+
+    private void addUnresolvedObject(final Class<? extends ConfiguredObject> clazz,
+                                     final String attributeName,
+                                     boolean mandatory)
+    {
+        Object attrValue = _record.getAttributes().get(attributeName);
+        if(attrValue != null)
+        {
+            addUnresolvedObject(clazz, attributeName, attrValue);
+        }
+        else if(mandatory)
+        {
+            throw new IllegalConfigurationException("Missing attribute " + attributeName + " has no value");
+        }
+    }
+
+    private void addUnresolvedObject(final Class<? extends ConfiguredObject> clazz,
+                                     final String attributeName,
+                                     final Object attrValue)
+    {
+        if(attrValue instanceof UUID)
+        {
+            _unresolvedObjects.add(new IdDependency(clazz, attributeName,(UUID)attrValue));
+        }
+        else if(attrValue instanceof String)
+        {
+            try
+            {
+                _unresolvedObjects.add(new IdDependency(clazz, attributeName, UUID.fromString((String) attrValue)));
+            }
+            catch(IllegalArgumentException e)
+            {
+                _unresolvedObjects.add(new NameDependency(clazz, attributeName, (String) attrValue));
+            }
+        }
+        else if(!clazz.isInstance(attrValue))
+        {
+            throw new IllegalArgumentException("Cannot convert from type " + attrValue.getClass() + " to a configured object dependency");
+        }
+    }
+
+
+    protected abstract  <X extends ConfiguredObject<X>>  void resolved(ConfiguredObjectDependency<X> dependency, X value);
+
+    @Override
+    public Collection<ConfiguredObjectDependency<?>> getUnresolvedDependencies()
+    {
+        return _unresolvedObjects;
+    }
+
+    private abstract class Dependency<X extends ConfiguredObject<X>> implements ConfiguredObjectDependency<X>
+    {
+        private final Class<X> _clazz;
+        private final String _attributeName;
+
+        public Dependency(final Class<X> clazz,
+                          final String attributeName)
+        {
+            _clazz = clazz;
+            _attributeName = attributeName;
+        }
+
+        @Override
+        public final Class<X> getCategoryClass()
+        {
+            return _clazz;
+        }
+
+        @Override
+        public final void resolve(final X object)
+        {
+            _unresolvedObjects.remove(this);
+            resolved(this, object);
+        }
+
+        public final String getAttributeName()
+        {
+            return _attributeName;
+        }
+
+    }
+
+    private class IdDependency<X extends ConfiguredObject<X>> extends Dependency<X> implements ConfiguredObjectIdDependency<X>
+    {
+        private final UUID _id;
+
+        public IdDependency(final Class<X> clazz,
+                            final String attributeName,
+                            final UUID id)
+        {
+            super(clazz, attributeName);
+            _id = id;
+        }
+
+        @Override
+        public UUID getId()
+        {
+            return _id;
+        }
+
+        @Override
+        public String toString()
+        {
+            return "IdDependency{" + getCategoryClass().getSimpleName() + ", " + _id + " }";
+        }
+    }
+
+    private class NameDependency<X extends ConfiguredObject<X>> extends Dependency<X> implements ConfiguredObjectNameDependency<X>
+    {
+
+        private final String _name;
+
+        public NameDependency(final Class<X> clazz,
+                              final String attributeName,
+                              final String attrValue)
+        {
+            super(clazz, attributeName);
+            _name = attrValue;
+        }
+
+        @Override
+        public String getName()
+        {
+            return _name;
+        }
+
+        @Override
+        public String toString()
+        {
+            return "NameDependency{" + getCategoryClass().getSimpleName() + ", \"" + _name + "\" }";
+        }
+    }
+}
+
+

Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java Thu Apr  3 19:58:53 2014
@@ -20,20 +20,20 @@
  */
 package org.apache.qpid.server.model;
 
-import java.net.SocketAddress;
-import java.util.Collection;
-
+import org.apache.qpid.server.configuration.updater.TaskExecutor;
 import org.apache.qpid.server.logging.EventLogger;
 import org.apache.qpid.server.logging.EventLoggerProvider;
 import org.apache.qpid.server.logging.LogRecorder;
-import org.apache.qpid.server.logging.MessageLogger;
-import org.apache.qpid.server.configuration.updater.TaskExecutor;
 import org.apache.qpid.server.security.SecurityManager;
 import org.apache.qpid.server.security.SubjectCreator;
+import org.apache.qpid.server.stats.StatisticsGatherer;
 import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
 
-@ManagedObject
-public interface Broker<X extends Broker<X>> extends ConfiguredObject<X>, EventLoggerProvider
+import java.net.SocketAddress;
+import java.util.Collection;
+
+@ManagedObject( defaultType = "adapter" )
+public interface Broker<X extends Broker<X>> extends ConfiguredObject<X>, EventLoggerProvider, StatisticsGatherer
 {
 
     String BUILD_VERSION = "buildVersion";
@@ -41,7 +41,6 @@ public interface Broker<X extends Broker
     String PLATFORM = "platform";
     String PROCESS_PID = "processPid";
     String PRODUCT_VERSION = "productVersion";
-    String SUPPORTED_BROKER_STORE_TYPES = "supportedBrokerStoreTypes";
     String SUPPORTED_VIRTUALHOST_TYPES = "supportedVirtualHostTypes";
     String SUPPORTED_VIRTUALHOST_STORE_TYPES = "supportedVirtualHostStoreTypes";
     String SUPPORTED_AUTHENTICATION_PROVIDERS = "supportedAuthenticationProviders";
@@ -92,9 +91,6 @@ public interface Broker<X extends Broker
     String getProductVersion();
 
     @ManagedAttribute
-    Collection<String> getSupportedBrokerStoreTypes();
-
-    @ManagedAttribute
     Collection<String> getSupportedVirtualHostStoreTypes();
 
     @ManagedAttribute
@@ -152,15 +148,6 @@ public interface Broker<X extends Broker
     boolean getStatisticsReportingResetEnabled();
 
     @ManagedAttribute
-    String getStoreType();
-
-    @ManagedAttribute
-    int getStoreVersion();
-
-    @ManagedAttribute
-    String getStorePath();
-
-    @ManagedAttribute
     String getModelVersion();
 
     @ManagedAttribute

Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java Thu Apr  3 19:58:53 2014
@@ -20,7 +20,6 @@
  */
 package org.apache.qpid.server.model;
 
-import org.apache.qpid.server.model.adapter.AbstractConfiguredObject;
 import org.apache.qpid.server.store.ConfiguredObjectRecord;
 
 import java.security.AccessControlException;
@@ -280,6 +279,8 @@ public interface ConfiguredObject<X exte
 
     Class<? extends ConfiguredObject> getCategoryClass();
 
+    <C extends ConfiguredObject<C>> C findConfiguredObject(Class<C> clazz, String name);
+
     // TODO - remove this when objects become responsible for their own storage
     ConfiguredObjectRecord asObjectRecord();
 

Added: qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectFactory.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectFactory.java?rev=1584365&view=auto
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectFactory.java (added)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectFactory.java Thu Apr  3 19:58:53 2014
@@ -0,0 +1,141 @@
+/*
+ *
+ * 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 org.apache.qpid.server.plugin.ConfiguredObjectTypeFactory;
+import org.apache.qpid.server.plugin.QpidServiceLoader;
+import org.apache.qpid.server.store.ConfiguredObjectRecord;
+import org.apache.qpid.server.store.UnresolvedConfiguredObject;
+import org.apache.qpid.server.util.ServerScopedRuntimeException;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+public class ConfiguredObjectFactory
+{
+    private final Map<String, String> _defaultTypes = new HashMap<String, String>();
+    private final Map<String, Map<String, ConfiguredObjectTypeFactory>> _allFactories =
+            new HashMap<String, Map<String, ConfiguredObjectTypeFactory>>();
+    private final Map<String, Collection<String>> _supportedTypes = new HashMap<String, Collection<String>>();
+
+    public ConfiguredObjectFactory()
+    {
+        QpidServiceLoader<ConfiguredObjectTypeFactory> serviceLoader = new QpidServiceLoader<ConfiguredObjectTypeFactory>();
+        Iterable<ConfiguredObjectTypeFactory> allFactories = serviceLoader.instancesOf(ConfiguredObjectTypeFactory.class);
+        for(ConfiguredObjectTypeFactory factory : allFactories)
+        {
+            final Class<? extends ConfiguredObject> categoryClass = factory.getCategoryClass();
+            final String categoryName = categoryClass.getSimpleName();
+
+            Map<String, ConfiguredObjectTypeFactory> categoryFactories = _allFactories.get(categoryName);
+            if(categoryFactories == null)
+            {
+                categoryFactories = new HashMap<String, ConfiguredObjectTypeFactory>();
+                _allFactories.put(categoryName, categoryFactories);
+                _supportedTypes.put(categoryName, new ArrayList<String>());
+                ManagedObject annotation = categoryClass.getAnnotation(ManagedObject.class);
+                if(annotation != null && !"".equals(annotation.defaultType()))
+                {
+                    _defaultTypes.put(categoryName, annotation.defaultType());
+                }
+
+            }
+            if(categoryFactories.put(factory.getType(),factory) != null)
+            {
+                throw new ServerScopedRuntimeException("Misconfiguration - there is more than one factory defined for class " + categoryName
+                                                       + " with type " + factory.getType());
+            }
+            if(factory.getType() != null)
+            {
+                _supportedTypes.get(categoryName).add(factory.getType());
+            }
+        }
+    }
+
+    public <X extends ConfiguredObject<X>> UnresolvedConfiguredObject<X> recover(ConfiguredObjectRecord record,
+                                                                                 ConfiguredObject<?>... parents)
+    {
+        String category = record.getType();
+
+
+        String type = (String) record.getAttributes().get(ConfiguredObject.TYPE);
+
+        ConfiguredObjectTypeFactory factory = getConfiguredObjectTypeFactory(category, type);
+
+        if(factory == null)
+        {
+            throw new ServerScopedRuntimeException("No factory defined for ConfiguredObject of category " + category + " and type " + type);
+        }
+
+        return factory.recover(record, parents);
+    }
+
+    public <X extends ConfiguredObject<X>> ConfiguredObjectTypeFactory<X> getConfiguredObjectTypeFactory(final Class<X> categoryClass, Map<String,Object> attributes)
+    {
+        final String category = categoryClass.getSimpleName();
+        Map<String, ConfiguredObjectTypeFactory> categoryFactories = _allFactories.get(category);
+        if(categoryFactories == null)
+        {
+            throw new ServerScopedRuntimeException("No factory defined for ConfiguredObject of category " + category);
+        }
+        String type = (String) attributes.get(ConfiguredObject.TYPE);
+
+        ConfiguredObjectTypeFactory factory;
+
+        if(type != null)
+        {
+            factory = getConfiguredObjectTypeFactory(category, type);
+        }
+        else
+        {
+            factory = getConfiguredObjectTypeFactory(category, null);
+            if(factory == null)
+            {
+                ManagedObject annotation = categoryClass.getAnnotation(ManagedObject.class);
+                factory = getConfiguredObjectTypeFactory(category, annotation.defaultType());
+            }
+        }
+        return factory;
+    }
+
+    public ConfiguredObjectTypeFactory getConfiguredObjectTypeFactory(final String category, final String type)
+    {
+        Map<String, ConfiguredObjectTypeFactory> categoryFactories = _allFactories.get(category);
+        if(categoryFactories == null)
+        {
+            throw new ServerScopedRuntimeException("No factory defined for ConfiguredObject of category " + category);
+        }
+        ConfiguredObjectTypeFactory factory = categoryFactories.get(type);
+        if(factory == null)
+        {
+            factory = categoryFactories.get(_defaultTypes.get(category));
+        }
+        return factory;
+    }
+
+    public Collection<String> getSupportedTypes(Class<? extends ConfiguredObject> category)
+    {
+        return Collections.unmodifiableCollection(_supportedTypes.get(category.getSimpleName()));
+    }
+}

Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/KeyStore.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/KeyStore.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/KeyStore.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/KeyStore.java Thu Apr  3 19:58:53 2014
@@ -21,12 +21,9 @@
 package org.apache.qpid.server.model;
 
 import java.security.GeneralSecurityException;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
 import javax.net.ssl.KeyManager;
 
-@ManagedObject
+@ManagedObject( defaultType = "FileKeyStore" )
 public interface KeyStore<X extends KeyStore<X>> extends ConfiguredObject<X>
 {
     String DURABLE = "durable";

Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ManagedObject.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ManagedObject.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ManagedObject.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ManagedObject.java Thu Apr  3 19:58:53 2014
@@ -31,5 +31,6 @@ public @interface ManagedObject
     String[] operations() default {};
     boolean managesChildren() default false; // for objects that manage children, a management node needs to be created
     boolean creatable() default true;
-    String defaultImplementation() default ""; // in this case the class/interface itself is to be used
+    String defaultType() default ""; // in this case the class/interface itself is to be used
+    String type() default "";
 }

Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Model.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Model.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Model.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Model.java Thu Apr  3 19:58:53 2014
@@ -34,10 +34,11 @@ public class Model
      *
      * 1.0 Initial version
      * 1.1 Addition of mandatory virtual host type / different types of virtual host
-     *
+     * 1.3 Truststore/Keystore type => trustStoreType / type => keyStoreType
+     * 1.4 Separate messageStoreSettings from virtualhost
      */
     public static final int MODEL_MAJOR_VERSION = 1;
-    public static final int MODEL_MINOR_VERSION = 3;
+    public static final int MODEL_MINOR_VERSION = 4;
     public static final String MODEL_VERSION = MODEL_MAJOR_VERSION + "." + MODEL_MINOR_VERSION;
 
     private static final Model MODEL_INSTANCE = new Model();
@@ -55,6 +56,8 @@ public class Model
 
     private Model()
     {
+        addRelationship(SystemContext.class, Broker.class);
+
         addRelationship(Broker.class, VirtualHost.class);
         addRelationship(Broker.class, Port.class);
         addRelationship(Broker.class, AccessControlProvider.class);

Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Port.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Port.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Port.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Port.java Thu Apr  3 19:58:53 2014
@@ -71,9 +71,6 @@ public interface Port<X extends Port<X>>
     boolean getWantClientAuth();
 
     @ManagedAttribute
-    AuthenticationProvider getAuthenticationProvider();
-
-    @ManagedAttribute
     KeyStore getKeyStore();
 
     @ManagedAttribute

Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Queue.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Queue.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Queue.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Queue.java Thu Apr  3 19:58:53 2014
@@ -22,8 +22,6 @@ package org.apache.qpid.server.model;
 
 import java.util.Collection;
 
-import org.apache.qpid.server.message.MessageInstance;
-import org.apache.qpid.server.queue.QueueEntry;
 import org.apache.qpid.server.queue.QueueEntryVisitor;
 
 @ManagedObject



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


Mime
View raw message