qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1775781 [1/2] - in /qpid/java/trunk: bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/ bdbstore/src/test/java/org/apache/qpid/server/virtualhost/berkeleydb/ bdbstore/src/test/java/org/apache/qpid/server/virtualhostn...
Date Fri, 23 Dec 2016 00:56:58 GMT
Author: rgodfrey
Date: Fri Dec 23 00:56:57 2016
New Revision: 1775781

URL: http://svn.apache.org/viewvc?rev=1775781&view=rev
Log:
QPID-6028 : Change AbstractConfiguredObject to store only the single parent

Modified:
    qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHARemoteReplicationNodeImpl.java
    qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java
    qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBVirtualHostImplTest.java
    qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHARemoteReplicationNodeTest.java
    qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeOperationalLoggingTest.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Model.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/TrustStoreMessageSourceCreator.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ManagedUser.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/TCPandSSLTransport.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ProvidedStoreVirtualHostImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/AbstractFixedVirtualHostNodeAlias.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/AbstractVirtualHostAlias.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/DefaultVirtualHostAliasImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/SystemAddressSpaceAliasImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/VirtualHostNameAliasImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/AbstractVirtualHostNode.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostNodeImpl.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostCreationTest.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/DirectExchangeTest.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/FanoutExchangeTest.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/BrokerTestHelper.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/port/AmqpPortImplTest.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/port/HttpPortImplTest.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/transport/TCPandSSLTransportTest.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhost/AbstractVirtualHostTest.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhost/VirtualHostQueueCreationTest.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhostalias/VirtualHostAliasTest.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhostnode/AbstractStandardVirtualHostNodeTest.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostNodeTest.java
    qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/LegacyAccessControlAdapter.java
    qpid/java/trunk/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/config/LegacyAccessControlAdapterTest.java
    qpid/java/trunk/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/AMQPConnection_0_8Test.java
    qpid/java/trunk/broker-plugins/logging-logback/src/test/java/org/apache/qpid/server/logging/logback/BrokerFileLoggerTest.java
    qpid/java/trunk/broker-plugins/logging-logback/src/test/java/org/apache/qpid/server/logging/logback/BrokerNameAndLevelLogInclusionRuleTest.java
    qpid/java/trunk/broker-plugins/logging-logback/src/test/java/org/apache/qpid/server/logging/logback/VirtualHostLoggerTest.java
    qpid/java/trunk/broker-plugins/logging-logback/src/test/java/org/apache/qpid/server/logging/logback/VirtualHostNameAndLevelLogInclusionRuleImplTest.java
    qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java
    qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementOutputConverter.java
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/auth/OAuth2InteractiveAuthenticator.java
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/report/QueueReport.java
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/query/ConfiguredObjectExpressionFactory.java
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/ConfiguredObjectToMapConverter.java
    qpid/java/trunk/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/auth/OAuth2InteractiveAuthenticatorTest.java
    qpid/java/trunk/broker-plugins/websocket/src/main/java/org/apache/qpid/server/transport/websocket/WebSocketProvider.java
    qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/store/VirtualHostMessageStoreTest.java

Modified: qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHARemoteReplicationNodeImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHARemoteReplicationNodeImpl.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHARemoteReplicationNodeImpl.java (original)
+++ qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHARemoteReplicationNodeImpl.java Fri Dec 23 00:56:57 2016
@@ -74,7 +74,7 @@ public class BDBHARemoteReplicationNodeI
     public BDBHARemoteReplicationNodeImpl(BDBHAVirtualHostNode<?> virtualHostNode, Map<String, Object> attributes, ReplicatedEnvironmentFacade replicatedEnvironmentFacade)
     {
         super(parentsMap(virtualHostNode), attributes);
-        _broker = virtualHostNode.getParent(Broker.class);
+        _broker = (Broker<?>) virtualHostNode.getParent();
         _address = (String)attributes.get(ADDRESS);
         _replicatedEnvironmentFacade = replicatedEnvironmentFacade;
         setRole(NodeRole.UNREACHABLE);

Modified: qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java (original)
+++ qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java Fri Dec 23 00:56:57 2016
@@ -159,7 +159,7 @@ public class BDBHAVirtualHostNodeImpl ex
     public BDBHAVirtualHostNodeImpl(Map<String, Object> attributes, Broker<?> broker)
     {
         super(broker, attributes);
-        _systemConfig = broker.getParent(SystemConfig.class);
+        _systemConfig = (SystemConfig) broker.getParent();
         addChangeListener(new BDBCacheSizeSetter());
     }
 
@@ -1224,7 +1224,7 @@ public class BDBHAVirtualHostNodeImpl ex
             final String hostAndPort = node.getHostName() + ":" + node.getPort();
             getEventLogger().message(getGroupLogSubject(), HighAvailabilityMessages.INTRUDER_DETECTED(node.getName(), hostAndPort));
 
-            boolean inManagementMode = getParent(Broker.class).isManagementMode();
+            boolean inManagementMode = ((Broker) getParent()).isManagementMode();
             if (inManagementMode)
             {
                 BDBHARemoteReplicationNodeImpl remoteNode = getChildByName(BDBHARemoteReplicationNodeImpl.class, node.getName());

Modified: qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBVirtualHostImplTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBVirtualHostImplTest.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBVirtualHostImplTest.java (original)
+++ qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBVirtualHostImplTest.java Fri Dec 23 00:56:57 2016
@@ -59,7 +59,7 @@ public class BDBVirtualHostImplTest exte
         _storePath = TestFileUtils.createTestDirectory();
 
         _node = mock(VirtualHostNode.class);
-        when(_node.getParent(Broker.class)).thenReturn(broker);
+        when(_node.getParent()).thenReturn(broker);
         when(_node.getModel()).thenReturn(BrokerModel.getInstance());
         when(_node.getTaskExecutor()).thenReturn(taskExecutor);
         when(_node.getChildExecutor()).thenReturn(taskExecutor);

Modified: qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHARemoteReplicationNodeTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHARemoteReplicationNodeTest.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHARemoteReplicationNodeTest.java (original)
+++ qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHARemoteReplicationNodeTest.java Fri Dec 23 00:56:57 2016
@@ -88,7 +88,7 @@ public class BDBHARemoteReplicationNodeT
         when(_virtualHostNode.getConfigurationStore()).thenReturn(_configStore);
 
         // Virtualhost needs the EventLogger from the SystemContext.
-        when(_virtualHostNode.getParent(Broker.class)).thenReturn(_broker);
+        when(_virtualHostNode.getParent()).thenReturn(_broker);
         doReturn(VirtualHostNode.class).when(_virtualHostNode).getCategoryClass();
         ConfiguredObjectFactory objectFactory = _broker.getObjectFactory();
         when(_virtualHostNode.getModel()).thenReturn(objectFactory.getModel());

Modified: qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeOperationalLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeOperationalLoggingTest.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeOperationalLoggingTest.java (original)
+++ qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeOperationalLoggingTest.java Fri Dec 23 00:56:57 2016
@@ -60,7 +60,7 @@ public class BDBHAVirtualHostNodeOperati
         super.setUp();
         _helper = new BDBHAVirtualHostNodeTestHelper(getTestName());
         _eventLogger = mock(EventLogger.class);
-        SystemConfig<?> context = (SystemConfig<?>) _helper.getBroker().getParent(SystemConfig.class);
+        SystemConfig<?> context = (SystemConfig<?>) _helper.getBroker().getParent();
         when(context.getEventLogger()).thenReturn(_eventLogger);
     }
 
@@ -363,7 +363,7 @@ public class BDBHAVirtualHostNodeOperati
     private EventLogger resetEventLogger()
     {
         EventLogger eventLogger = mock(EventLogger.class);
-        SystemConfig<?> context = (SystemConfig<?>) _helper.getBroker().getParent(SystemConfig.class);
+        SystemConfig<?> context = (SystemConfig<?>) _helper.getBroker().getParent();
         when(context.getEventLogger()).thenReturn(eventLogger);
         return eventLogger;
     }

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java Fri Dec 23 00:56:57 2016
@@ -156,8 +156,7 @@ public abstract class AbstractConfigured
 
 
     private final Map<String,Object> _attributes = new HashMap<>();
-    private final Map<Class<? extends ConfiguredObject>, ConfiguredObject> _parents =
-            new HashMap<>();
+    private final ConfiguredObject<?> _parent;
     private final Collection<ConfigurationChangeListener> _changeListeners =
             new ArrayList<>();
 
@@ -277,47 +276,34 @@ public abstract class AbstractConfigured
         _automatedFields = model.getTypeRegistry().getAutomatedFields(getClass());
         _stateChangeMethods = model.getTypeRegistry().getStateChangeMethods(getClass());
 
+        final Class<? extends ConfiguredObject> parentCategory = model.getParentType(_category);
+        _parent = parents.get(parentCategory);
 
-        for(ConfiguredObject<?> parent : parents.values())
+        if(_parent instanceof AbstractConfiguredObject && ((AbstractConfiguredObject)_parent)._encrypter != null)
         {
-            if(parent instanceof AbstractConfiguredObject && ((AbstractConfiguredObject)parent)._encrypter != null)
-            {
-                _encrypter = ((AbstractConfiguredObject)parent)._encrypter;
-                break;
-            }
-            else if(parent instanceof ConfigurationSecretEncrypterSource && ((ConfigurationSecretEncrypterSource)parent).getEncrypter() != null)
-            {
-                _encrypter = ((ConfigurationSecretEncrypterSource)parent).getEncrypter();
-                break;
-            }
+            _encrypter = ((AbstractConfiguredObject)_parent)._encrypter;
+        }
+        else if(_parent instanceof ConfigurationSecretEncrypterSource && ((ConfigurationSecretEncrypterSource)_parent).getEncrypter() != null)
+        {
+            _encrypter = ((ConfigurationSecretEncrypterSource)_parent).getEncrypter();
         }
 
-        for(ConfiguredObject<?> parent : parents.values())
+        if(_parent instanceof AbstractConfiguredObject && ((AbstractConfiguredObject)_parent).getAccessControl() != null)
         {
-            if(parent instanceof AbstractConfiguredObject && ((AbstractConfiguredObject)parent).getAccessControl() != null)
-            {
-                _parentAccessControl = ((AbstractConfiguredObject)parent).getAccessControl();
-                break;
-            }
-            else if(parent instanceof AccessControlSource && ((AccessControlSource)parent).getAccessControl()!=null)
-            {
-                _parentAccessControl = ((AccessControlSource)parent).getAccessControl();
-                break;
-            }
+            _parentAccessControl = ((AbstractConfiguredObject)_parent).getAccessControl();
+        }
+        else if(_parent instanceof AccessControlSource && ((AccessControlSource)_parent).getAccessControl()!=null)
+        {
+            _parentAccessControl = ((AccessControlSource)_parent).getAccessControl();
         }
 
-        for(ConfiguredObject<?> parent : parents.values())
+        if(_parent instanceof AbstractConfiguredObject && ((AbstractConfiguredObject)_parent).getSystemPrincipal() != null)
         {
-            if(parent instanceof AbstractConfiguredObject && ((AbstractConfiguredObject)parent).getSystemPrincipal() != null)
-            {
-                _systemPrincipal = ((AbstractConfiguredObject)parent).getSystemPrincipal();
-                break;
-            }
-            else if(parent instanceof SystemPrincipalSource && ((SystemPrincipalSource)parent).getSystemPrincipal()!=null)
-            {
-                _systemPrincipal = ((SystemPrincipalSource)parent).getSystemPrincipal();
-                break;
-            }
+            _systemPrincipal = ((AbstractConfiguredObject)_parent).getSystemPrincipal();
+        }
+        else if(_parent instanceof SystemPrincipalSource && ((SystemPrincipalSource)_parent).getSystemPrincipal()!=null)
+        {
+            _systemPrincipal = ((SystemPrincipalSource)_parent).getSystemPrincipal();
         }
 
 
@@ -358,10 +344,6 @@ public abstract class AbstractConfigured
 
         populateChildTypeMaps();
 
-        for(Map.Entry<Class<? extends ConfiguredObject>, ConfiguredObject<?>> entry : parents.entrySet())
-        {
-            addParent((Class<ConfiguredObject<?>>) entry.getKey(), entry.getValue());
-        }
 
         Object durableObj = attributes.get(DURABLE);
         _durable = AttributeValueConverter.BOOLEAN_CONVERTER.convert(durableObj == null
@@ -712,17 +694,15 @@ public abstract class AbstractConfigured
 
     public void registerWithParents()
     {
-        for(ConfiguredObject<?> parent : _parents.values())
+        if(_parent instanceof AbstractConfiguredObject<?>)
         {
-            if(parent instanceof AbstractConfiguredObject<?>)
-            {
-                ((AbstractConfiguredObject<?>)parent).registerChild(this);
-            }
-            else if(parent instanceof AbstractConfiguredObjectProxy)
-            {
-                ((AbstractConfiguredObjectProxy)parent).registerChild(this);
-            }
+            ((AbstractConfiguredObject<?>)_parent).registerChild(this);
+        }
+        else if(_parent instanceof AbstractConfiguredObjectProxy)
+        {
+            ((AbstractConfiguredObjectProxy)_parent).registerChild(this);
         }
+
     }
 
     protected final ListenableFuture<Void> closeChildren()
@@ -1734,18 +1714,16 @@ public abstract class AbstractConfigured
                         // The state transition should be disallowed.
                         if (desiredState != currentDesiredState)
                         {
-                            for(ConfiguredObject<?> parent : _parents.values())
+                            if(_parent instanceof AbstractConfiguredObject)
                             {
-                                if(parent instanceof AbstractConfiguredObject)
-                                {
-                                    ((AbstractConfiguredObject<?>)parent).validateChildDelete(AbstractConfiguredObject.this);
-                                }
-                                else if (parent instanceof AbstractConfiguredObjectProxy)
-                                {
-                                    ((AbstractConfiguredObjectProxy)parent).validateChildDelete(AbstractConfiguredObject.this);
-                                }
+                                ((AbstractConfiguredObject<?>)_parent).validateChildDelete(AbstractConfiguredObject.this);
+                            }
+                            else if (_parent instanceof AbstractConfiguredObjectProxy)
+                            {
+                                ((AbstractConfiguredObjectProxy)_parent).validateChildDelete(AbstractConfiguredObject.this);
                             }
 
+
                             return doAfter(attainState(desiredState), new Runnable()
                             {
                                 @Override
@@ -1980,9 +1958,10 @@ public abstract class AbstractConfigured
         }
     }
 
-    public <T extends ConfiguredObject> T getParent(final Class<T> clazz)
+    @Override
+    public ConfiguredObject<?> getParent()
     {
-        return (T) _parents.get(clazz);
+        return _parent;
     }
 
     public final <T> T getAncestor(final Class<T> clazz)
@@ -1990,16 +1969,6 @@ public abstract class AbstractConfigured
         return getModel().getAncestor(clazz, this);
     }
 
-
-    private <T extends ConfiguredObject> void addParent(Class<T> clazz, T parent)
-    {
-        synchronized (_parents)
-        {
-            _parents.put(clazz, parent);
-        }
-
-    }
-
     public final Collection<String> getAttributeNames()
     {
         return getTypeRegistry().getAttributeNames(getClass());
@@ -2093,7 +2062,7 @@ public abstract class AbstractConfigured
                 Map<String, UUID> parents = new LinkedHashMap<>();
                 Class<? extends ConfiguredObject> parentClass = getModel().getParentType(getCategoryClass());
 
-                ConfiguredObject parent = getParent(parentClass);
+                ConfiguredObject parent = (ConfiguredObject) getParent();
                 if(parent != null)
                 {
                     parents.put(parentClass.getSimpleName(), parent.getId());
@@ -2297,27 +2266,25 @@ public abstract class AbstractConfigured
 
     private void unregister(boolean removed)
     {
-        for (ConfiguredObject<?> parent : _parents.values())
-        {
-            if (parent instanceof AbstractConfiguredObject<?>)
+            if (_parent instanceof AbstractConfiguredObject<?>)
             {
-                AbstractConfiguredObject<?> parentObj = (AbstractConfiguredObject<?>) parent;
+                AbstractConfiguredObject<?> parentObj = (AbstractConfiguredObject<?>) _parent;
                 parentObj.unregisterChild(this);
                 if(removed)
                 {
                     parentObj.childRemoved(this);
                 }
             }
-            else if (parent instanceof AbstractConfiguredObjectProxy)
+            else if (_parent instanceof AbstractConfiguredObjectProxy)
             {
-                AbstractConfiguredObjectProxy parentObj = (AbstractConfiguredObjectProxy) parent;
+                AbstractConfiguredObjectProxy parentObj = (AbstractConfiguredObjectProxy) _parent;
                 parentObj.unregisterChild(this);
                 if(removed)
                 {
                     parentObj.childRemoved(this);
                 }
             }
-        }
+
     }
 
 
@@ -3001,7 +2968,7 @@ public abstract class AbstractConfigured
                 {
                     exceptionMessage.append(" on");
                     String objectCategory = parentClass.getSimpleName();
-                    ConfiguredObject<?> parent = configuredObject.getParent(parentClass);
+                    ConfiguredObject<?> parent = configuredObject.getParent();
                     exceptionMessage.append(" ").append(objectCategory);
                     if (parent != null)
                     {
@@ -3313,19 +3280,16 @@ public abstract class AbstractConfigured
 
     private EventLogger getEventLogger()
     {
-        for(ConfiguredObject<?> parent : _parents.values())
+        if(_parent instanceof EventLoggerProvider)
         {
-            if(parent instanceof EventLoggerProvider)
-            {
-                return ((EventLoggerProvider)parent).getEventLogger();
-            }
-            else if(parent instanceof AbstractConfiguredObject)
+            return ((EventLoggerProvider)_parent).getEventLogger();
+        }
+        else if(_parent instanceof AbstractConfiguredObject)
+        {
+            final EventLogger eventLogger = ((AbstractConfiguredObject<?>) _parent).getEventLogger();
+            if(eventLogger != null)
             {
-                final EventLogger eventLogger = ((AbstractConfiguredObject<?>) parent).getEventLogger();
-                if(eventLogger != null)
-                {
-                    return eventLogger;
-                }
+                return eventLogger;
             }
         }
         return null;
@@ -3406,7 +3370,7 @@ public abstract class AbstractConfigured
                 model.getParentType(object.getCategoryClass());
         if(parentClass != null)
         {
-            ConfiguredObject parent = object.getParent(parentClass);
+            ConfiguredObject parent = object.getParent();
             if(parent != null)
             {
                 generateInheritedContext(model, parent, inheritedContext);
@@ -3583,7 +3547,6 @@ public abstract class AbstractConfigured
     private static class AuthorisationProxyInvocationHandler extends AttributeGettingHandler
     {
         private final Class<? extends ConfiguredObject> _category;
-        private final Map<Class<? extends ConfiguredObject>, ConfiguredObject<?>> _parents;
         private final ConfiguredObject<?> _parent   ;
         private Map<String, Object> _attributes;
 
@@ -3595,18 +3558,15 @@ public abstract class AbstractConfigured
             super(attributes, attributeTypes, null);
             _parent = parent;
             _category = categoryClass;
-            _parents = new HashMap<>();
             _attributes = attributes;
-            _parents.put(parent.getCategoryClass(), parent);
         }
 
         @Override
         public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable
         {
-            if(method.getName().equals("getParent") && args != null && args.length == 1 && args[0] instanceof Class)
+            if(method.getName().equals("getParent") && (args == null || args.length == 0))
             {
-                Class<ConfiguredObject> parentClass = (Class<ConfiguredObject> )args[0];
-                return _parents.get(parentClass);
+                return _parent;
             }
             else if(method.getName().equals("getCategoryClass"))
             {

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java Fri Dec 23 00:56:57 2016
@@ -213,7 +213,7 @@ public class BrokerImpl extends Abstract
     {
         super.postResolveChildren();
 
-        final SystemConfig parent = getParent(SystemConfig.class);
+        final SystemConfig parent = (SystemConfig) getParent();
         Runnable task =  parent.getOnContainerResolveTask();
         if(task != null)
         {
@@ -557,7 +557,7 @@ public class BrokerImpl extends Abstract
     {
         super.onOpen();
 
-        PreferencesRoot preferencesRoot = getParent(SystemConfig.class);
+        PreferencesRoot preferencesRoot = (SystemConfig) getParent();
         _preferenceStore = preferencesRoot.createPreferenceStore();
 
         getEventLogger().message(BrokerMessages.STARTUP(CommonProperties.getReleaseVersion(),
@@ -981,7 +981,7 @@ public class BrokerImpl extends Abstract
             @Override
             public Void run()
             {
-                final SystemConfig<?> systemConfig = getParent(SystemConfig.class);
+                final SystemConfig<?> systemConfig = (SystemConfig) getParent();
                 // This is deliberately asynchronous as the HTTP thread will be interrupted by restarting
                 doAfter(systemConfig.setAttributesAsync(Collections.<String,Object>singletonMap(ConfiguredObject.DESIRED_STATE,
                                                                                                 State.STOPPED)),

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObject.java Fri Dec 23 00:56:57 2016
@@ -150,10 +150,9 @@ public interface ConfiguredObject<X exte
     /**
      * Get the parent of the given type for this object
      *
-     * @param clazz the class of parent being asked for
      * @return the objects parent
      */
-    <T extends ConfiguredObject> T getParent(Class<T> clazz);
+    ConfiguredObject<?> getParent();
 
 
     /**

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Model.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Model.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Model.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Model.java Fri Dec 23 00:56:57 2016
@@ -94,7 +94,7 @@ public abstract class Model
             Class<? extends ConfiguredObject> parentClass = getParentType(category);
             if(parentClass != null)
             {
-                ConfiguredObject<?> parent = object.getParent(parentClass);
+                ConfiguredObject<?> parent = object.getParent();
                 C ancestor = getAncestor(ancestorClass, parentClass, parent);
                 if (ancestor != null)
                 {

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/TrustStoreMessageSourceCreator.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/TrustStoreMessageSourceCreator.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/TrustStoreMessageSourceCreator.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/TrustStoreMessageSourceCreator.java Fri Dec 23 00:56:57 2016
@@ -46,8 +46,8 @@ public class TrustStoreMessageSourceCrea
     public void register(final SystemNodeRegistry registry)
     {
         final VirtualHost<?> vhost = registry.getVirtualHost();
-        VirtualHostNode<?> virtualHostNode = vhost.getParent(VirtualHostNode.class);
-        final Broker<?> broker = virtualHostNode.getParent(Broker.class);
+        VirtualHostNode<?> virtualHostNode = (VirtualHostNode<?>) vhost.getParent();
+        final Broker<?> broker = (Broker<?>) virtualHostNode.getParent();
 
         final Collection<TrustStore> trustStores = broker.getChildren(TrustStore.class);
 

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ManagedUser.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ManagedUser.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ManagedUser.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ManagedUser.java Fri Dec 23 00:56:57 2016
@@ -109,7 +109,7 @@ class ManagedUser extends AbstractConfig
     @Override
     protected void logOperation(final String operation)
     {
-        _authenticationManager.getParent(Container.class).getEventLogger().message(AuthenticationProviderMessages.OPERATION(operation));
+        ((Container) _authenticationManager.getParent()).getEventLogger().message(AuthenticationProviderMessages.OPERATION(operation));
     }
 
 }

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/TCPandSSLTransport.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/TCPandSSLTransport.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/TCPandSSLTransport.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/TCPandSSLTransport.java Fri Dec 23 00:56:57 2016
@@ -54,11 +54,11 @@ class TCPandSSLTransport implements Acce
     {
         final MultiVersionProtocolEngineFactory protocolEngineFactory =
                 new MultiVersionProtocolEngineFactory(
-                _port.getParent(Broker.class),
-                _supported,
-                _defaultSupportedProtocolReply,
-                _port,
-                _transports.contains(Transport.TCP) ? Transport.TCP : Transport.SSL);
+                        (Broker<?>) _port.getParent(),
+                        _supported,
+                        _defaultSupportedProtocolReply,
+                        _port,
+                        _transports.contains(Transport.TCP) ? Transport.TCP : Transport.SSL);
 
         EnumSet<TransportEncryption> encryptionSet = EnumSet.noneOf(TransportEncryption.class);
         if(_transports.contains(Transport.TCP))

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java Fri Dec 23 00:56:57 2016
@@ -270,12 +270,13 @@ public abstract class AbstractVirtualHos
     public AbstractVirtualHost(final Map<String, Object> attributes, VirtualHostNode<?> virtualHostNode)
     {
         super(parentsMap(virtualHostNode), attributes);
-        _broker = virtualHostNode.getParent(Broker.class);
+        _broker = (Broker<?>) virtualHostNode.getParent();
         _virtualHostNode = virtualHostNode;
 
         _dtxRegistry = new DtxRegistry(this);
 
-        _eventLogger = _broker.getParent(SystemConfig.class).getEventLogger();
+        final SystemConfig systemConfig = (SystemConfig) _broker.getParent();
+        _eventLogger = systemConfig.getEventLogger();
 
         _eventLogger.message(VirtualHostMessages.CREATED(getName()));
 
@@ -286,7 +287,7 @@ public abstract class AbstractVirtualHos
         _dataReceived = new StatisticsCounter("bytes-received-" + getName());
         _principal = new VirtualHostPrincipal(this);
 
-        if (_broker.getParent(SystemConfig.class).isManagementMode())
+        if (systemConfig.isManagementMode())
         {
             _accessControl = AccessControl.ALWAYS_ALLOWED;
         }
@@ -310,7 +311,7 @@ public abstract class AbstractVirtualHos
 
     private void updateAccessControl()
     {
-        if(!_broker.getParent(SystemConfig.class).isManagementMode())
+        if(!((SystemConfig)_broker.getParent()).isManagementMode())
         {
             List<VirtualHostAccessControlProvider> children = new ArrayList<>(getChildren(VirtualHostAccessControlProvider.class));
             _logger.debug("Updating access control list with {} provider children", children.size());
@@ -591,7 +592,7 @@ public abstract class AbstractVirtualHos
 
         }
 
-        PreferencesRoot preferencesRoot = getParent(VirtualHostNode.class);
+        PreferencesRoot preferencesRoot = (VirtualHostNode) getParent();
         _preferenceStore = preferencesRoot.createPreferenceStore();
 
         createHousekeepingExecutor();
@@ -1816,8 +1817,7 @@ public abstract class AbstractVirtualHos
 
         public void execute()
         {
-            VirtualHostNode<?> virtualHostNode = getParent(VirtualHostNode.class);
-            Broker<?> broker = virtualHostNode.getParent(Broker.class);
+            Broker<?> broker = getAncestor(Broker.class);
             broker.assignTargetSizes();
 
             for (Queue<?> q : getChildren(Queue.class))
@@ -1869,7 +1869,7 @@ public abstract class AbstractVirtualHos
         @Override
         public VirtualHostNode<?> getVirtualHostNode()
         {
-            return AbstractVirtualHost.this.getParent(VirtualHostNode.class);
+            return (VirtualHostNode) getParent();
         }
 
         @Override

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ProvidedStoreVirtualHostImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ProvidedStoreVirtualHostImpl.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ProvidedStoreVirtualHostImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/ProvidedStoreVirtualHostImpl.java Fri Dec 23 00:56:57 2016
@@ -55,7 +55,7 @@ public class ProvidedStoreVirtualHostImp
     {
         super.onValidate();
 
-        VirtualHostNode<?> virtualHostNode = getParent(VirtualHostNode.class);
+        VirtualHostNode<?> virtualHostNode = (VirtualHostNode) getParent();
         DurableConfigurationStore configurationStore = virtualHostNode.getConfigurationStore();
         if (!(configurationStore instanceof MessageStoreProvider))
         {
@@ -69,7 +69,7 @@ public class ProvidedStoreVirtualHostImp
     @Override
     protected MessageStore createMessageStore()
     {
-        VirtualHostNode<?> virtualHostNode = getParent(VirtualHostNode.class);
+        VirtualHostNode<?> virtualHostNode = (VirtualHostNode) getParent();
         MessageStoreProvider messageStoreProvider = (MessageStoreProvider) virtualHostNode.getConfigurationStore();
         return messageStoreProvider.getMessageStore();
     }

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/AbstractFixedVirtualHostNodeAlias.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/AbstractFixedVirtualHostNodeAlias.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/AbstractFixedVirtualHostNodeAlias.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/AbstractFixedVirtualHostNodeAlias.java Fri Dec 23 00:56:57 2016
@@ -57,7 +57,7 @@ abstract class AbstractFixedVirtualHostN
             node = getVirtualHostNode();
             if (node == null)
             {
-                Broker<?> broker = getPort().getParent(Broker.class);
+                Broker<?> broker = getAncestor(Broker.class);
                 node = broker.findDefautVirtualHostNode();
             }
 

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/AbstractVirtualHostAlias.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/AbstractVirtualHostAlias.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/AbstractVirtualHostAlias.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/AbstractVirtualHostAlias.java Fri Dec 23 00:56:57 2016
@@ -48,7 +48,7 @@ abstract class AbstractVirtualHostAlias<
     @Override
     public Port<?> getPort()
     {
-        return getParent(Port.class);
+        return (Port) getParent();
     }
 
     @Override

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/DefaultVirtualHostAliasImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/DefaultVirtualHostAliasImpl.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/DefaultVirtualHostAliasImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/DefaultVirtualHostAliasImpl.java Fri Dec 23 00:56:57 2016
@@ -45,7 +45,7 @@ public class DefaultVirtualHostAliasImpl
     {
         if(name == null || name.trim().equals(""))
         {
-            Broker<?> broker = getPort().getParent(Broker.class);
+            Broker<?> broker = getAncestor(Broker.class);
             VirtualHostNode defaultVirtualHostNode = broker.findDefautVirtualHostNode();
             return defaultVirtualHostNode == null ? null : defaultVirtualHostNode.getVirtualHost();
         }

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/SystemAddressSpaceAliasImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/SystemAddressSpaceAliasImpl.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/SystemAddressSpaceAliasImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/SystemAddressSpaceAliasImpl.java Fri Dec 23 00:56:57 2016
@@ -98,6 +98,6 @@ public class SystemAddressSpaceAliasImpl
     @Override
     public NamedAddressSpace getAddressSpace(final String name)
     {
-        return matches(name) ? getParent(Broker.class).getSystemAddressSpace(getSystemAddressSpace()) : null;
+        return matches(name) ? ((Broker) getParent()).getSystemAddressSpace(getSystemAddressSpace()) : null;
     }
 }

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/VirtualHostNameAliasImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/VirtualHostNameAliasImpl.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/VirtualHostNameAliasImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostalias/VirtualHostNameAliasImpl.java Fri Dec 23 00:56:57 2016
@@ -43,7 +43,7 @@ public class VirtualHostNameAliasImpl
     @Override
     public NamedAddressSpace getAddressSpace(final String name)
     {
-        Broker<?> broker = getPort().getParent(Broker.class);
+        Broker<?> broker = getAncestor(Broker.class);
         NamedAddressSpace addressSpace = broker.getSystemAddressSpace(name);
         if(addressSpace == null)
         {

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/AbstractVirtualHostNode.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/AbstractVirtualHostNode.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/AbstractVirtualHostNode.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/AbstractVirtualHostNode.java Fri Dec 23 00:56:57 2016
@@ -128,7 +128,7 @@ public abstract class AbstractVirtualHos
         });
         _virtualHostExecutor.start();
         _broker = parent;
-        SystemConfig<?> systemConfig = _broker.getParent(SystemConfig.class);
+        SystemConfig<?> systemConfig = getAncestor(SystemConfig.class);
         _eventLogger = systemConfig.getEventLogger();
     }
 

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostImpl.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostImpl.java Fri Dec 23 00:56:57 2016
@@ -55,7 +55,8 @@ class RedirectingVirtualHostImpl
         if (changedAttributes.contains(DESIRED_STATE) && proxyForValidation.getDesiredState() == State.DELETED)
         {
             throw new IllegalConfigurationException("Directly deleting a redirecting virtualhost is not supported. "
-            + "Delete the parent virtual host node '" + getParent(VirtualHostNode.class) + "' instead.");
+                                                    + "Delete the parent virtual host node '" + (VirtualHostNode) getParent()
+                                                    + "' instead.");
         }
         else
         {
@@ -68,7 +69,7 @@ class RedirectingVirtualHostImpl
     @Override
     public String getRedirectHost(final AmqpPort<?> port)
     {
-        return ((RedirectingVirtualHostNode<?>)(getParent(VirtualHostNode.class))).getRedirects().get(port);
+        return ((RedirectingVirtualHostNode<?>)((VirtualHostNode) getParent())).getRedirects().get(port);
     }
 
 

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostNodeImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostNodeImpl.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostNodeImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostNodeImpl.java Fri Dec 23 00:56:57 2016
@@ -105,7 +105,7 @@ public class RedirectingVirtualHostNodeI
             public void onFailure(final Throwable t)
             {
                 setState(State.ERRORED);
-                if (getParent(Broker.class).isManagementMode())
+                if (((Broker) getParent()).isManagementMode())
                 {
                     LOGGER.warn("Failed to make {} active.", this, t);
                     resultFuture.set(null);

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostCreationTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostCreationTest.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostCreationTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostCreationTest.java Fri Dec 23 00:56:57 2016
@@ -69,12 +69,12 @@ public class VirtualHostCreationTest ext
         when(broker.getObjectFactory()).thenReturn(objectFactory);
         when(broker.getModel()).thenReturn(objectFactory.getModel());
         when(broker.getCategoryClass()).thenReturn(Broker.class);
-        when(broker.getParent(eq(SystemConfig.class))).thenReturn(systemConfig);
+        when(broker.getParent()).thenReturn(systemConfig);
         when(broker.getTaskExecutor()).thenReturn(executor);
         when(broker.getChildExecutor()).thenReturn(executor);
 
         _virtualHostNode = BrokerTestHelper.mockWithSystemPrincipal(VirtualHostNode.class, mock(Principal.class));
-        when(_virtualHostNode.getParent(Broker.class)).thenReturn(broker);
+        when(_virtualHostNode.getParent()).thenReturn(broker);
         when(_virtualHostNode.getObjectFactory()).thenReturn(objectFactory);
         when(_virtualHostNode.getConfigurationStore()).thenReturn(mock(DurableConfigurationStore.class));
         when(_virtualHostNode.getModel()).thenReturn(objectFactory.getModel());

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/DirectExchangeTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/DirectExchangeTest.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/DirectExchangeTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/DirectExchangeTest.java Fri Dec 23 00:56:57 2016
@@ -91,11 +91,11 @@ public class DirectExchangeTest extends
 
     public void testAmqpDirectRecreationRejected() throws Exception
     {
-        DirectExchangeImpl ampqDirect = (DirectExchangeImpl) _vhost.getChildByName(Exchange.class, ExchangeDefaults.DIRECT_EXCHANGE_NAME);
-        assertNotNull(ampqDirect);
+        DirectExchangeImpl amqpDirect = (DirectExchangeImpl) _vhost.getChildByName(Exchange.class, ExchangeDefaults.DIRECT_EXCHANGE_NAME);
+        assertNotNull(amqpDirect);
 
-        assertSame(ampqDirect, _vhost.getChildById(Exchange.class, ampqDirect.getId()));
-        assertSame(ampqDirect, _vhost.getChildByName(Exchange.class, ampqDirect.getName()));
+        assertSame(amqpDirect, _vhost.getChildById(Exchange.class, amqpDirect.getId()));
+        assertSame(amqpDirect, _vhost.getChildByName(Exchange.class, amqpDirect.getName()));
 
         Map<String, Object> attributes = new HashMap<>();
         attributes.put(Exchange.NAME, ExchangeDefaults.DIRECT_EXCHANGE_NAME);
@@ -114,8 +114,8 @@ public class DirectExchangeTest extends
         }
 
         // QPID-6599, defect would mean that the existing exchange was removed from the in memory model.
-        assertSame(ampqDirect, _vhost.getChildById(Exchange.class, ampqDirect.getId()));
-        assertSame(ampqDirect, _vhost.getChildByName(Exchange.class, ampqDirect.getName()));
+        assertSame(amqpDirect, _vhost.getChildById(Exchange.class, amqpDirect.getId()));
+        assertSame(amqpDirect, _vhost.getChildByName(Exchange.class, amqpDirect.getName()));
 
     }
 

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/FanoutExchangeTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/FanoutExchangeTest.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/FanoutExchangeTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/FanoutExchangeTest.java Fri Dec 23 00:56:57 2016
@@ -71,7 +71,7 @@ public class FanoutExchangeTest extends
 
         VirtualHostNode virtualHostNode = mock(VirtualHostNode.class);
         when(virtualHostNode.getCategoryClass()).thenReturn(VirtualHostNode.class);
-        when(virtualHostNode.getParent(Broker.class)).thenReturn(broker);
+        when(virtualHostNode.getParent()).thenReturn(broker);
         when(virtualHostNode.getModel()).thenReturn(BrokerModel.getInstance());
 
         _taskExecutor = new CurrentThreadTaskExecutor();
@@ -82,7 +82,7 @@ public class FanoutExchangeTest extends
         when(_virtualHost.getTaskExecutor()).thenReturn(_taskExecutor);
         when(_virtualHost.getChildExecutor()).thenReturn(_taskExecutor);
         when(_virtualHost.getModel()).thenReturn(BrokerModel.getInstance());
-        when(_virtualHost.getParent(VirtualHostNode.class)).thenReturn(virtualHostNode);
+        when(_virtualHost.getParent()).thenReturn(virtualHostNode);
         when(_virtualHost.getCategoryClass()).thenReturn(VirtualHost.class);
         _exchange = new FanoutExchangeImpl(attributes, _virtualHost);
         _exchange.open();
@@ -151,7 +151,7 @@ public class FanoutExchangeTest extends
         TaskExecutor taskExecutor = CurrentThreadTaskExecutor.newStartedInstance();
         when(queue.getTaskExecutor()).thenReturn(taskExecutor);
         when(queue.getChildExecutor()).thenReturn(taskExecutor);
-        when(queue.getParent(VirtualHost.class)).thenReturn(_virtualHost);
+        when(queue.getParent()).thenReturn(_virtualHost);
         when(_virtualHost.getAttainedQueue(eq(name))).thenReturn(queue);
         return queue;
     }

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java Fri Dec 23 00:56:57 2016
@@ -77,7 +77,7 @@ public class HeadersExchangeTest extends
 
         VirtualHostNode virtualHostNode = mock(VirtualHostNode.class);
         when(virtualHostNode.getCategoryClass()).thenReturn(VirtualHostNode.class);
-        when(virtualHostNode.getParent(Broker.class)).thenReturn(broker);
+        when(virtualHostNode.getParent()).thenReturn(broker);
         when(virtualHostNode.getModel()).thenReturn(BrokerModel.getInstance());
 
         when(_virtualHost.getEventLogger()).thenReturn(new EventLogger());
@@ -88,7 +88,7 @@ public class HeadersExchangeTest extends
         _factory = new ConfiguredObjectFactoryImpl(BrokerModel.getInstance());
         when(_virtualHost.getObjectFactory()).thenReturn(_factory);
         when(_virtualHost.getModel()).thenReturn(_factory.getModel());
-        when(_virtualHost.getParent(VirtualHostNode.class)).thenReturn(virtualHostNode);
+        when(_virtualHost.getParent()).thenReturn(virtualHostNode);
         Map<String,Object> attributes = new HashMap<String, Object>();
         attributes.put(Exchange.ID, UUID.randomUUID());
         attributes.put(Exchange.NAME, "test");
@@ -161,7 +161,7 @@ public class HeadersExchangeTest extends
         when(q.getName()).thenReturn(name);
         when(q.toString()).thenReturn(name);
         when(q.getVirtualHost()).thenReturn(_virtualHost);
-        when(q.getParent(VirtualHost.class)).thenReturn(_virtualHost);
+        when(q.getParent()).thenReturn(_virtualHost);
         when(q.getCategoryClass()).thenReturn(Queue.class);
         when(q.getObjectFactory()).thenReturn(_factory);
         when(q.getModel()).thenReturn(_factory.getModel());

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/BrokerTestHelper.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/BrokerTestHelper.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/BrokerTestHelper.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/BrokerTestHelper.java Fri Dec 23 00:56:57 2016
@@ -142,7 +142,7 @@ public class BrokerTestHelper
         when(broker.getModelVersion()).thenReturn(BrokerModel.MODEL_VERSION);
         when(broker.getEventLogger()).thenReturn(eventLogger);
         when(broker.getCategoryClass()).thenReturn(Broker.class);
-        when(broker.getParent(SystemConfig.class)).thenReturn(systemConfig);
+        when(broker.getParent()).thenReturn(systemConfig);
         when(broker.getContextValue(eq(Long.class), eq(Broker.CHANNEL_FLOW_CONTROL_ENFORCEMENT_TIMEOUT))).thenReturn(0l);
 
         when(broker.getTaskExecutor()).thenReturn(TASK_EXECUTOR);
@@ -180,7 +180,7 @@ public class BrokerTestHelper
         when(virtualHostNode.getChildExecutor()).thenReturn(TASK_EXECUTOR);
         when(virtualHostNode.isDefaultVirtualHostNode()).thenReturn(defaultVHN);
 
-        when(virtualHostNode.getParent(eq(Broker.class))).thenReturn(broker);
+        when(virtualHostNode.getParent()).thenReturn(broker);
 
         Collection<VirtualHostNode<?>> nodes = broker.getVirtualHostNodes();
         nodes = new ArrayList<>(nodes != null ?  nodes : Collections.<VirtualHostNode<?>>emptyList());
@@ -189,7 +189,6 @@ public class BrokerTestHelper
 
         DurableConfigurationStore dcs = mock(DurableConfigurationStore.class);
         when(virtualHostNode.getConfigurationStore()).thenReturn(dcs);
-        when(virtualHostNode.getParent(eq(VirtualHostNode.class))).thenReturn(virtualHostNode);
         when(virtualHostNode.getModel()).thenReturn(objectFactory.getModel());
         when(virtualHostNode.getObjectFactory()).thenReturn(objectFactory);
         when(virtualHostNode.getCategoryClass()).thenReturn(VirtualHostNode.class);

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java Fri Dec 23 00:56:57 2016
@@ -97,7 +97,7 @@ public class VirtualHostTest extends Qpi
 
         Principal systemPrincipal = ((SystemPrincipalSource)_broker).getSystemPrincipal();
         _virtualHostNode = BrokerTestHelper.mockWithSystemPrincipalAndAccessControl(VirtualHostNode.class, systemPrincipal, _mockAccessControl);
-        when(_virtualHostNode.getParent(Broker.class)).thenReturn(_broker);
+        when(_virtualHostNode.getParent()).thenReturn(_broker);
         when(_virtualHostNode.getCategoryClass()).thenReturn(VirtualHostNode.class);
         when(_virtualHostNode.isDurable()).thenReturn(true);
 
@@ -108,7 +108,7 @@ public class VirtualHostTest extends Qpi
 
 
         // Virtualhost needs the EventLogger from the SystemContext.
-        when(_virtualHostNode.getParent(Broker.class)).thenReturn(_broker);
+        when(_virtualHostNode.getParent()).thenReturn(_broker);
 
         ConfiguredObjectFactory objectFactory = _broker.getObjectFactory();
         when(_virtualHostNode.getModel()).thenReturn(objectFactory.getModel());

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java Fri Dec 23 00:56:57 2016
@@ -86,7 +86,7 @@ public class PortFactoryTest extends Qpi
         when(_broker.getChildren(eq(AuthenticationProvider.class))).thenReturn(Collections.singleton(_authProvider));
         when(_broker.getCategoryClass()).thenReturn(Broker.class);
         when(_broker.getEventLogger()).thenReturn(new EventLogger());
-        when(_broker.getParent(SystemConfig.class)).thenReturn(systemConfig);
+        when(_broker.getParent()).thenReturn(systemConfig);
 
         ConfiguredObjectFactory objectFactory = new ConfiguredObjectFactoryImpl(BrokerModel.getInstance());
         when(_broker.getObjectFactory()).thenReturn(objectFactory);

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/port/AmqpPortImplTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/port/AmqpPortImplTest.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/port/AmqpPortImplTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/port/AmqpPortImplTest.java Fri Dec 23 00:56:57 2016
@@ -66,7 +66,7 @@ public class AmqpPortImplTest extends Qp
         Model model = BrokerModel.getInstance();
         SystemConfig systemConfig = mock(SystemConfig.class);
         _broker = BrokerTestHelper.mockWithSystemPrincipal(Broker.class, mock(Principal.class));
-        when(_broker.getParent(SystemConfig.class)).thenReturn(systemConfig);
+        when(_broker.getParent()).thenReturn(systemConfig);
         when(_broker.getTaskExecutor()).thenReturn(_taskExecutor);
         when(_broker.getChildExecutor()).thenReturn(_taskExecutor);
         when(_broker.getModel()).thenReturn(model);
@@ -76,8 +76,8 @@ public class AmqpPortImplTest extends Qp
 
         AuthenticationProvider<?> provider = mock(AuthenticationProvider.class);
         when(provider.getName()).thenReturn(AUTHENTICATION_PROVIDER_NAME);
-        when(provider.getParent(Broker.class)).thenReturn(_broker);
-        when(provider.getParent(Container.class)).thenReturn(_broker);
+        when(provider.getParent()).thenReturn(_broker);
+        when(provider.getParent()).thenReturn(_broker);
         when(provider.getMechanisms()).thenReturn(Arrays.asList("PLAIN"));
         when(_broker.getChildren(AuthenticationProvider.class)).thenReturn(Collections.<AuthenticationProvider>singleton(provider));
         when(_broker.getChildByName(AuthenticationProvider.class, AUTHENTICATION_PROVIDER_NAME)).thenReturn(provider);

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/port/HttpPortImplTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/port/HttpPortImplTest.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/port/HttpPortImplTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/port/HttpPortImplTest.java Fri Dec 23 00:56:57 2016
@@ -54,7 +54,7 @@ public class HttpPortImplTest extends Qp
         Model model = BrokerModel.getInstance();
         SystemConfig systemConfig = mock(SystemConfig.class);
         _broker = mock(Broker.class);
-        when(_broker.getParent(SystemConfig.class)).thenReturn(systemConfig);
+        when(_broker.getParent()).thenReturn(systemConfig);
         when(_broker.getTaskExecutor()).thenReturn(_taskExecutor);
         when(_broker.getChildExecutor()).thenReturn(_taskExecutor);
         when(_broker.getModel()).thenReturn(model);
@@ -63,7 +63,7 @@ public class HttpPortImplTest extends Qp
 
         AuthenticationProvider<?> provider = mock(AuthenticationProvider.class);
         when(provider.getName()).thenReturn(AUTHENTICATION_PROVIDER_NAME);
-        when(provider.getParent(Broker.class)).thenReturn(_broker);
+        when(provider.getParent()).thenReturn(_broker);
         when(provider.getMechanisms()).thenReturn(Arrays.asList("PLAIN"));
         when(_broker.getChildren(AuthenticationProvider.class)).thenReturn(Collections.<AuthenticationProvider>singleton(
                 provider));

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/transport/TCPandSSLTransportTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/transport/TCPandSSLTransportTest.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/transport/TCPandSSLTransportTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/transport/TCPandSSLTransportTest.java Fri Dec 23 00:56:57 2016
@@ -159,7 +159,7 @@ public class TCPandSSLTransportTest exte
         when(port.getTlsProtocolWhiteList()).thenReturn(whiteList);
         final Broker broker = mock(Broker.class);
         when(broker.getEventLogger()).thenReturn(mock(EventLogger.class));
-        when(port.getParent(Broker.class)).thenReturn(broker);
+        when(port.getParent()).thenReturn(broker);
 
         TCPandSSLTransport transport = new TCPandSSLTransport(new HashSet<>(Arrays.asList(transports)),
                                                               port,

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhost/AbstractVirtualHostTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhost/AbstractVirtualHostTest.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhost/AbstractVirtualHostTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhost/AbstractVirtualHostTest.java Fri Dec 23 00:56:57 2016
@@ -81,7 +81,7 @@ public class AbstractVirtualHostTest ext
         Principal systemPrincipal = mock(Principal.class);
         Broker<?> broker = BrokerTestHelper.mockWithSystemPrincipalAndAccessControl(Broker.class, systemPrincipal,
                                                                                     accessControlMock);
-        when(broker.getParent(SystemConfig.class)).thenReturn(systemConfig);
+        when(broker.getParent()).thenReturn(systemConfig);
         when(broker.getModel()).thenReturn(BrokerModel.getInstance());
 
         _taskExecutor = new TaskExecutorImpl();
@@ -91,7 +91,7 @@ public class AbstractVirtualHostTest ext
 
         _node = BrokerTestHelper.mockWithSystemPrincipalAndAccessControl(VirtualHostNode.class,
                                                                          systemPrincipal, accessControlMock);
-        when(_node.getParent(Broker.class)).thenReturn(broker);
+        when(_node.getParent()).thenReturn(broker);
         when(_node.getModel()).thenReturn(BrokerModel.getInstance());
         when(_node.getTaskExecutor()).thenReturn(_taskExecutor);
         when(_node.getChildExecutor()).thenReturn(_taskExecutor);

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhost/VirtualHostQueueCreationTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhost/VirtualHostQueueCreationTest.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhost/VirtualHostQueueCreationTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhost/VirtualHostQueueCreationTest.java Fri Dec 23 00:56:57 2016
@@ -79,19 +79,19 @@ public class VirtualHostQueueCreationTes
         Broker broker = BrokerTestHelper.mockWithSystemPrincipalAndAccessControl(Broker.class, systemPrincipal, accessControl);
         when(broker.getObjectFactory()).thenReturn(objectFactory);
         when(broker.getCategoryClass()).thenReturn(Broker.class);
-        when(broker.getParent(SystemConfig.class)).thenReturn(context);
+        when(broker.getParent()).thenReturn(context);
         when(broker.getModel()).thenReturn(objectFactory.getModel());
         when(broker.getTaskExecutor()).thenReturn(_taskExecutor);
         when(broker.getChildExecutor()).thenReturn(_taskExecutor);
 
         _virtualHostNode = BrokerTestHelper.mockWithSystemPrincipalAndAccessControl(VirtualHostNode.class, systemPrincipal, accessControl);
-        when(_virtualHostNode.getParent(Broker.class)).thenReturn(broker);
+        when(_virtualHostNode.getParent()).thenReturn(broker);
         when(_virtualHostNode.getConfigurationStore()).thenReturn(mock(DurableConfigurationStore.class));
         when(_virtualHostNode.getObjectFactory()).thenReturn(objectFactory);
         when(_virtualHostNode.getModel()).thenReturn(objectFactory.getModel());
         when(_virtualHostNode.getTaskExecutor()).thenReturn(_taskExecutor);
         when(_virtualHostNode.getChildExecutor()).thenReturn(_taskExecutor);
-        when(((VirtualHostNode)_virtualHostNode).getCategoryClass()).thenReturn(VirtualHostNode.class);
+        when(_virtualHostNode.getCategoryClass()).thenReturn(VirtualHostNode.class);
 
         when(_virtualHostNode.createPreferenceStore()).thenReturn(mock(PreferenceStore.class));
         _virtualHost = createHost();

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhostalias/VirtualHostAliasTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhostalias/VirtualHostAliasTest.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhostalias/VirtualHostAliasTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhostalias/VirtualHostAliasTest.java Fri Dec 23 00:56:57 2016
@@ -65,7 +65,7 @@ public class VirtualHostAliasTest extend
         {
             boolean defaultVHN = "black".equals(name);
             VirtualHost<?> virtualHost = BrokerTestHelper.createVirtualHost(name, _broker, defaultVHN);
-            VirtualHostNode vhn = virtualHost.getParent(VirtualHostNode.class);
+            VirtualHostNode vhn = (VirtualHostNode) virtualHost.getParent();
             assertNotSame(vhn.getName(), virtualHost.getName());
             _vhosts.put(name, virtualHost);
 
@@ -138,7 +138,7 @@ public class VirtualHostAliasTest extend
         attributes.put(VirtualHostAlias.NAME, "matcher");
         attributes.put(VirtualHostAlias.TYPE, PatternMatchingAlias.TYPE_NAME);
         attributes.put(PatternMatchingAlias.PATTERN, "orange|pink.*");
-        attributes.put(PatternMatchingAlias.VIRTUAL_HOST_NODE, _vhosts.get("purple").getParent(VirtualHostNode.class));
+        attributes.put(PatternMatchingAlias.VIRTUAL_HOST_NODE, _vhosts.get("purple").getParent());
         _port.createChild(VirtualHostAlias.class, attributes);
 
         NamedAddressSpace addressSpace = _port.getAddressSpace("orange");
@@ -185,7 +185,7 @@ public class VirtualHostAliasTest extend
         attributes.put(VirtualHostAlias.TYPE, PatternMatchingAlias.TYPE_NAME);
         attributes.put(VirtualHostAlias.PRIORITY, 10);
         attributes.put(PatternMatchingAlias.PATTERN, "bl.*");
-        attributes.put(PatternMatchingAlias.VIRTUAL_HOST_NODE, _vhosts.get("purple").getParent(VirtualHostNode.class));
+        attributes.put(PatternMatchingAlias.VIRTUAL_HOST_NODE, _vhosts.get("purple").getParent());
         _port.createChild(VirtualHostAlias.class, attributes);
 
         addressSpace = _port.getAddressSpace("blue");
@@ -204,7 +204,7 @@ public class VirtualHostAliasTest extend
         attributes.put(VirtualHostAlias.TYPE, PatternMatchingAlias.TYPE_NAME);
         attributes.put(VirtualHostAlias.PRIORITY, 5);
         attributes.put(PatternMatchingAlias.PATTERN, ".*u.*");
-        attributes.put(PatternMatchingAlias.VIRTUAL_HOST_NODE, _vhosts.get("red").getParent(VirtualHostNode.class));
+        attributes.put(PatternMatchingAlias.VIRTUAL_HOST_NODE, _vhosts.get("red").getParent());
         _port.createChild(VirtualHostAlias.class, attributes);
 
 

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhostnode/AbstractStandardVirtualHostNodeTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhostnode/AbstractStandardVirtualHostNodeTest.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhostnode/AbstractStandardVirtualHostNodeTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhostnode/AbstractStandardVirtualHostNodeTest.java Fri Dec 23 00:56:57 2016
@@ -79,7 +79,7 @@ public class AbstractStandardVirtualHost
         super.setUp();
 
         _broker = BrokerTestHelper.createBrokerMock();
-        SystemConfig<?> systemConfig = _broker.getParent(SystemConfig.class);
+        SystemConfig<?> systemConfig = (SystemConfig<?>) _broker.getParent();
         when(systemConfig.getObjectFactory()).thenReturn(new ConfiguredObjectFactoryImpl(mock(Model.class)));
 
         _taskExecutor = new CurrentThreadTaskExecutor();

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostNodeTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostNodeTest.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostNodeTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostNodeTest.java Fri Dec 23 00:56:57 2016
@@ -60,7 +60,7 @@ public class RedirectingVirtualHostNodeT
         super.setUp();
 
         _broker = BrokerTestHelper.createBrokerMock();
-        SystemConfig<?> systemConfig = _broker.getParent(SystemConfig.class);
+        SystemConfig<?> systemConfig = (SystemConfig<?>) _broker.getParent();
         when(systemConfig.getObjectFactory()).thenReturn(new ConfiguredObjectFactoryImpl(mock(Model.class)));
 
         _taskExecutor = new CurrentThreadTaskExecutor();

Modified: qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/LegacyAccessControlAdapter.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/LegacyAccessControlAdapter.java?rev=1775781&r1=1775780&r2=1775781&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/LegacyAccessControlAdapter.java (original)
+++ qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/LegacyAccessControlAdapter.java Fri Dec 23 00:56:57 2016
@@ -230,12 +230,12 @@ class LegacyAccessControlAdapter
             properties.put(ObjectProperties.Property.TEMPORARY, lifeTimePolicy != LifetimePolicy.PERMANENT);
             properties.put(ObjectProperties.Property.DURABLE, (Boolean) exchange.getAttribute(ConfiguredObject.DURABLE));
             properties.put(ObjectProperties.Property.TYPE, (String) exchange.getAttribute(Exchange.TYPE));
-            VirtualHost virtualHost = exchange.getParent(VirtualHost.class);
+            VirtualHost virtualHost = (VirtualHost) exchange.getParent();
             properties.put(ObjectProperties.Property.VIRTUALHOST_NAME, (String)virtualHost.getAttribute(virtualHost.NAME));
         }
         else if (configuredObject instanceof QueueConsumer)
         {
-            Queue<?> queue = (Queue<?>)((QueueConsumer<?,?>)configuredObject).getParent(Queue.class);
+            Queue<?> queue = (Queue<?>)((QueueConsumer<?,?>)configuredObject).getParent();
             setQueueProperties(queue, properties);
         }
         else if (isBrokerType(configuredObjectType))
@@ -275,7 +275,7 @@ class LegacyAccessControlAdapter
         {
             properties.put(ObjectProperties.Property.OWNER, owner);
         }
-        VirtualHost virtualHost = queue.getParent(VirtualHost.class);
+        VirtualHost virtualHost = (VirtualHost) queue.getParent();
         properties.put(ObjectProperties.Property.VIRTUALHOST_NAME, (String)virtualHost.getAttribute(virtualHost.NAME));
     }
 
@@ -361,7 +361,7 @@ class LegacyAccessControlAdapter
             {
 
                 final ObjectProperties _props =
-                        new ObjectProperties(queue.getParent(VirtualHost.class).getName(), "", queue.getName(), (Boolean)arguments.get("immediate"));
+                        new ObjectProperties(queue.getParent().getName(), "", queue.getName(), (Boolean)arguments.get("immediate"));
                 return _accessControl.authorise(PUBLISH, EXCHANGE, _props);
             }
         }
@@ -398,7 +398,7 @@ class LegacyAccessControlAdapter
             {
 
                 final ObjectProperties _props =
-                        new ObjectProperties(queue.getParent(VirtualHost.class).getName(), "", queue.getName(), (Boolean)arguments.get("immediate"));
+                        new ObjectProperties(queue.getParent().getName(), "", queue.getName(), (Boolean)arguments.get("immediate"));
                 return _accessControl.authorise(PUBLISH, EXCHANGE, _props);
             }
         }
@@ -416,7 +416,7 @@ class LegacyAccessControlAdapter
             {
                 return _accessControl.authorise(ACCESS_LOGS,
                                                 ObjectType.VIRTUALHOST,
-                                                new ObjectProperties(logger.getParent(VirtualHost.class).getName()));
+                                                new ObjectProperties(logger.getParent().getName()));
             }
         }
         else if(categoryClass == AuthenticationProvider.class)
@@ -445,7 +445,7 @@ class LegacyAccessControlAdapter
         {
             if(BDB_VIRTUAL_HOST_NODE_OPERATIONS.contains(methodName))
             {
-                ObjectProperties properties = getACLObjectProperties(((ConfiguredObject)configuredObject).getParent(Broker.class), LegacyOperation.UPDATE);
+                ObjectProperties properties = getACLObjectProperties(((ConfiguredObject)configuredObject).getParent(), LegacyOperation.UPDATE);
                 return _accessControl.authorise(LegacyOperation.UPDATE, ObjectType.BROKER, properties);
             }
         }



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


Mime
View raw message