qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1754731 [1/2] - in /qpid/java/trunk: broker-core/src/main/java/org/apache/qpid/server/configuration/store/ broker-core/src/main/java/org/apache/qpid/server/logging/ broker-core/src/main/java/org/apache/qpid/server/model/ broker-core/src/ma...
Date Mon, 01 Aug 2016 10:52:52 GMT
Author: rgodfrey
Date: Mon Aug  1 10:52:52 2016
New Revision: 1754731

URL: http://svn.apache.org/viewvc?rev=1754731&view=rev
Log:
QPID-7365 : Allow ports, authentication providers, group providers to sit under any container type - no just brokers

Added:
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractContainer.java   (with props)
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
      - copied, changed from r1754730, qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BrokerImpl.java
Removed:
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BrokerImpl.java
Modified:
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandler.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerFileLoggerImpl.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/AbstractConfiguredObjectTypeFactory.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractSystemConfig.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AuthenticationProvider.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Container.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileBasedGroupProviderImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractClientAuthCapablePortWithAuthProvider.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractPort.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractPortWithAuthProvider.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPortImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/HttpPortImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractAuthenticationManager.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManager.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ConfigModelPasswordManagingAuthenticationProvider.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManager.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManager.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/oauth2/OAuth2AuthenticationProviderImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/group/GroupProviderImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/group/cloudfoundry/CloudFoundryDashboardManagementGroupProviderImpl.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/adapter/BrokerImplTest.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-plugins/derby-store/src/test/java/org/apache/qpid/server/virtualhostnode/derby/DerbyVirtualHostNodeTest.java

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandler.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandler.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandler.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandler.java Mon Aug  1 10:52:52 2016
@@ -44,7 +44,7 @@ import org.apache.qpid.server.model.Prot
 import org.apache.qpid.server.model.State;
 import org.apache.qpid.server.model.SystemConfig;
 import org.apache.qpid.server.model.VirtualHost;
-import org.apache.qpid.server.model.adapter.BrokerImpl;
+import org.apache.qpid.server.model.BrokerImpl;
 import org.apache.qpid.server.store.ConfiguredObjectRecord;
 import org.apache.qpid.server.store.ConfiguredObjectRecordImpl;
 import org.apache.qpid.server.store.DurableConfigurationStore;

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerFileLoggerImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerFileLoggerImpl.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerFileLoggerImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerFileLoggerImpl.java Mon Aug  1 10:52:52 2016
@@ -198,7 +198,7 @@ public class BrokerFileLoggerImpl extend
     @Override
     protected Appender<ILoggingEvent> createAppenderInstance(Context loggerContext)
     {
-        SystemConfig<?> systemConfig = (SystemConfig<?>)getParent(Broker.class).getParent(SystemConfig.class);
+        SystemConfig<?> systemConfig = getAncestor(SystemConfig.class);
         _logbackStatusListener = new BrokerFileLoggerStatusListener(this, systemConfig);
         _statusManager = loggerContext.getStatusManager();
         _statusManager.add(_logbackStatusListener);

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=1754731&r1=1754730&r2=1754731&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 Mon Aug  1 10:52:52 2016
@@ -1900,6 +1900,12 @@ public abstract class AbstractConfigured
         return (T) _parents.get(clazz);
     }
 
+    public final <T extends ConfiguredObject> T getAncestor(final Class<T> clazz)
+    {
+        return getModel().getAncestor(clazz, this);
+    }
+
+
     private <T extends ConfiguredObject> void addParent(Class<T> clazz, T parent)
     {
         synchronized (_parents)

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObjectTypeFactory.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObjectTypeFactory.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObjectTypeFactory.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObjectTypeFactory.java Mon Aug  1 10:52:52 2016
@@ -96,13 +96,6 @@ abstract public class AbstractConfigured
 
     public final <C extends ConfiguredObject<?>> C getParent(Class<C> parentClass, ConfiguredObject<?>... parents)
     {
-
-        if(!parents[0].getModel().getParentTypes((Class<? extends ConfiguredObject>) getCategoryClass()).contains(
-                ConfiguredObjectTypeRegistry.getCategory(parentClass)))
-        {
-            throw new IllegalArgumentException(parentClass.getSimpleName() + " is not a parent of " + _clazz.getSimpleName());
-        }
-
         for(ConfiguredObject<?> parent : parents)
         {
             if(parentClass.isInstance(parent))

Added: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractContainer.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractContainer.java?rev=1754731&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractContainer.java (added)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractContainer.java Mon Aug  1 10:52:52 2016
@@ -0,0 +1,507 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.model;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.management.BufferPoolMXBean;
+import java.lang.management.LockInfo;
+import java.lang.management.ManagementFactory;
+import java.lang.management.MonitorInfo;
+import java.lang.management.PlatformManagedObject;
+import java.lang.management.RuntimeMXBean;
+import java.lang.management.ThreadInfo;
+import java.lang.management.ThreadMXBean;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.nio.charset.Charset;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.configuration.CommonProperties;
+import org.apache.qpid.server.configuration.IllegalConfigurationException;
+import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.messages.BrokerMessages;
+import org.apache.qpid.server.plugin.ConfigurationSecretEncrypterFactory;
+import org.apache.qpid.server.plugin.PluggableFactoryLoader;
+import org.apache.qpid.server.plugin.QpidServiceLoader;
+import org.apache.qpid.server.util.HousekeepingExecutor;
+import org.apache.qpid.server.util.ServerScopedRuntimeException;
+import org.apache.qpid.util.SystemUtils;
+
+public abstract class AbstractContainer<X extends AbstractContainer<X>> extends AbstractConfiguredObject<X> implements Container<X>
+{
+    private static final Logger LOGGER = LoggerFactory.getLogger(AbstractContainer.class);
+
+    private final BufferPoolMXBean _bufferPoolMXBean;
+    private final List<String> _jvmArguments;
+    private final long _maximumHeapSize = Runtime.getRuntime().maxMemory();
+    private final long _maximumDirectMemorySize = getMaxDirectMemorySize();
+    protected SystemConfig<?> _parent;
+    protected EventLogger _eventLogger;
+
+    @ManagedAttributeField(beforeSet = "preEncrypterProviderSet", afterSet = "postEncrypterProviderSet")
+    private String _confidentialConfigurationEncryptionProvider;
+
+    protected HousekeepingExecutor _houseKeepingTaskExecutor;
+
+    @ManagedAttributeField
+    private int _housekeepingThreadCount;
+
+    private String _preConfidentialConfigurationEncryptionProvider;
+
+    AbstractContainer(
+            final Map<Class<? extends ConfiguredObject>, ConfiguredObject<?>> parents,
+            final Map<String, Object> attributes,
+            SystemConfig parent)
+    {
+        super(parents, attributes);
+        _parent = parent;
+        _eventLogger = parent.getEventLogger();
+        _jvmArguments = ManagementFactory.getRuntimeMXBean().getInputArguments();
+        BufferPoolMXBean bufferPoolMXBean = null;
+        List<BufferPoolMXBean> bufferPoolMXBeans = ManagementFactory.getPlatformMXBeans(BufferPoolMXBean.class);
+        for(BufferPoolMXBean mBean : bufferPoolMXBeans)
+        {
+            if (mBean.getName().equals("direct"))
+            {
+                bufferPoolMXBean = mBean;
+                break;
+            }
+        }
+        _bufferPoolMXBean = bufferPoolMXBean;
+        if(attributes.get(CONFIDENTIAL_CONFIGURATION_ENCRYPTION_PROVIDER) != null )
+        {
+
+            final String encryptionProviderType = String.valueOf(attributes.get(CONFIDENTIAL_CONFIGURATION_ENCRYPTION_PROVIDER));
+            updateEncrypter(encryptionProviderType);
+            _confidentialConfigurationEncryptionProvider = encryptionProviderType;
+        }
+
+    }
+
+    @SuppressWarnings("unused")
+    public static Collection<String> getAvailableConfigurationEncrypters()
+    {
+        return (new QpidServiceLoader()).getInstancesByType(ConfigurationSecretEncrypterFactory.class).keySet();
+    }
+
+    static long getMaxDirectMemorySize()
+    {
+        long maxMemory = 0;
+        try
+        {
+            ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
+            Class<?> hotSpotDiagnosticMXBeanClass = Class.forName("com.sun.management.HotSpotDiagnosticMXBean", true, systemClassLoader);
+            Class<?> vmOptionClass = Class.forName("com.sun.management.VMOption", true, systemClassLoader);
+
+            Object hotSpotDiagnosticMXBean = ManagementFactory.getPlatformMXBean((Class<? extends PlatformManagedObject>)hotSpotDiagnosticMXBeanClass);
+            Method getVMOption = hotSpotDiagnosticMXBeanClass.getDeclaredMethod("getVMOption", String.class);
+            Object vmOption = getVMOption.invoke(hotSpotDiagnosticMXBean, "MaxDirectMemorySize");
+            Method getValue = vmOptionClass.getDeclaredMethod("getValue");
+            String maxDirectMemoryAsString = (String)getValue.invoke(vmOption);
+            maxMemory = Long.parseLong(maxDirectMemoryAsString);
+        }
+        catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException e)
+        {
+            LOGGER.debug("Cannot determine direct memory max size using com.sun.management.HotSpotDiagnosticMXBean: " + e.getMessage());
+        }
+        catch (InvocationTargetException e)
+        {
+            throw new ServerScopedRuntimeException("Unexpected exception in evaluation of MaxDirectMemorySize with HotSpotDiagnosticMXBean", e.getTargetException());
+        }
+
+        if (maxMemory == 0)
+        {
+            Pattern
+                    maxDirectMemorySizeArgumentPattern = Pattern.compile("^\\s*-XX:MaxDirectMemorySize\\s*=\\s*(\\d+)\\s*([KkMmGgTt]?)\\s*$");
+            RuntimeMXBean RuntimemxBean = ManagementFactory.getRuntimeMXBean();
+            List<String> inputArguments = RuntimemxBean.getInputArguments();
+            boolean argumentFound = false;
+            for (String argument : inputArguments)
+            {
+                Matcher matcher = maxDirectMemorySizeArgumentPattern.matcher(argument);
+                if (matcher.matches())
+                {
+                    argumentFound = true;
+                    maxMemory = Long.parseLong(matcher.group(1));
+                    String unit = matcher.group(2);
+                    char unitChar = "".equals(unit) ? 0 : unit.charAt(0);
+                    switch (unitChar)
+                    {
+                        case 'k':
+                        case 'K':
+                            maxMemory *= 1024l;
+                            break;
+                        case 'm':
+                        case 'M':
+                            maxMemory *= 1024l * 1024l;
+                            break;
+                        case 'g':
+                        case 'G':
+                            maxMemory *= 1024l * 1024l * 1024l;
+                            break;
+                        case 't':
+                        case 'T':
+                            maxMemory *= 1024l * 1024l * 1024l * 1024l;
+                            break;
+                        case 0:
+                            // noop
+                            break;
+                        default:
+                            throw new IllegalStateException("Unexpected unit character in MaxDirectMemorySize argument : " + argument);
+                    }
+                    // do not break; continue. Oracle and IBM JVMs use the last value when argument is specified multiple times
+                }
+            }
+
+            if (maxMemory == 0)
+            {
+                if (argumentFound)
+                {
+                    throw new IllegalArgumentException("Qpid Broker cannot operate with 0 direct memory. Please, set JVM argument MaxDirectMemorySize to non-zero value");
+                }
+                else
+                {
+                    maxMemory = Runtime.getRuntime().maxMemory();
+                }
+            }
+        }
+
+        return maxMemory;
+    }
+
+    private void updateEncrypter(final String encryptionProviderType)
+    {
+        if(encryptionProviderType != null && !"".equals(encryptionProviderType.trim()))
+        {
+            PluggableFactoryLoader<ConfigurationSecretEncrypterFactory> factoryLoader =
+                    new PluggableFactoryLoader<>(ConfigurationSecretEncrypterFactory.class);
+            ConfigurationSecretEncrypterFactory factory = factoryLoader.get(encryptionProviderType);
+            if (factory == null)
+            {
+                throw new IllegalConfigurationException("Unknown Configuration Secret Encryption method "
+                                                        + encryptionProviderType);
+            }
+            setEncrypter(factory.createEncrypter(this));
+        }
+        else
+        {
+            setEncrypter(null);
+        }
+    }
+
+    public String getBuildVersion()
+    {
+        return CommonProperties.getBuildVersion();
+    }
+
+    public String getOperatingSystem()
+    {
+        return SystemUtils.getOSString();
+    }
+
+    public String getPlatform()
+    {
+        return System.getProperty("java.vendor") + " "
+                      + System.getProperty("java.runtime.version", System.getProperty("java.version"));
+    }
+
+    public String getProcessPid()
+    {
+        return SystemUtils.getProcessPid();
+    }
+
+    public String getProductVersion()
+    {
+        return CommonProperties.getReleaseVersion();
+    }
+
+    public int getNumberOfCores()
+    {
+        return Runtime.getRuntime().availableProcessors();
+    }
+
+    public String getConfidentialConfigurationEncryptionProvider()
+    {
+        return _confidentialConfigurationEncryptionProvider;
+    }
+
+    public int getHousekeepingThreadCount()
+    {
+        return _housekeepingThreadCount;
+    }
+
+    public String getModelVersion()
+    {
+        return BrokerModel.MODEL_VERSION;
+    }
+
+    public EventLogger getEventLogger()
+    {
+        return _eventLogger;
+    }
+
+    public void setEventLogger(final EventLogger eventLogger)
+    {
+        _eventLogger = eventLogger;
+    }
+
+    @SuppressWarnings("unused")
+    private void preEncrypterProviderSet()
+    {
+        _preConfidentialConfigurationEncryptionProvider = _confidentialConfigurationEncryptionProvider;
+    }
+
+    @SuppressWarnings("unused")
+    private void postEncrypterProviderSet()
+    {
+        if (!Objects.equals(_preConfidentialConfigurationEncryptionProvider,
+                            _confidentialConfigurationEncryptionProvider))
+        {
+            updateEncrypter(_confidentialConfigurationEncryptionProvider);
+            forceUpdateAllSecureAttributes();
+        }
+    }
+
+    public int getNumberOfLiveThreads()
+    {
+        return ManagementFactory.getThreadMXBean().getThreadCount();
+    }
+
+    public long getMaximumHeapMemorySize()
+    {
+        return _maximumHeapSize;
+    }
+
+    public long getUsedHeapMemorySize()
+    {
+        return Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
+    }
+
+    public long getMaximumDirectMemorySize()
+    {
+        return _maximumDirectMemorySize;
+    }
+
+    public long getUsedDirectMemorySize()
+    {
+        if (_bufferPoolMXBean == null)
+        {
+            return -1;
+        }
+        return _bufferPoolMXBean.getMemoryUsed();
+    }
+
+    public long getDirectMemoryTotalCapacity()
+    {
+        if (_bufferPoolMXBean == null)
+        {
+            return -1;
+        }
+        return _bufferPoolMXBean.getTotalCapacity();
+    }
+
+    public int getNumberOfObjectsPendingFinalization()
+    {
+        return ManagementFactory.getMemoryMXBean().getObjectPendingFinalizationCount();
+    }
+
+    public List<String> getJvmArguments()
+    {
+        return _jvmArguments;
+    }
+
+    public void performGC()
+    {
+        getEventLogger().message(BrokerMessages.OPERATION("performGC"));
+        System.gc();
+    }
+
+    public Content getThreadStackTraces(boolean appendToLog)
+    {
+        getEventLogger().message(BrokerMessages.OPERATION("getThreadStackTraces"));
+        ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
+        ThreadInfo[] threadInfos = threadMXBean.dumpAllThreads(true, true);
+        StringBuilder threadDump = new StringBuilder();
+        for (ThreadInfo threadInfo : threadInfos)
+        {
+            threadDump.append(getThreadStackTraces(threadInfo));
+        }
+        long[] deadLocks = threadMXBean.findDeadlockedThreads();
+        if (deadLocks != null && deadLocks.length > 0)
+        {
+            ThreadInfo[] deadlockedThreads = threadMXBean.getThreadInfo(deadLocks);
+            threadDump.append(System.lineSeparator()).append("Deadlock is detected!").append(System.lineSeparator());
+            for (ThreadInfo threadInfo : deadlockedThreads)
+            {
+                threadDump.append(getThreadStackTraces(threadInfo));
+            }
+        }
+        String threadStackTraces = threadDump.toString();
+        if (appendToLog)
+        {
+            LOGGER.warn("Thread dump:{} {}", System.lineSeparator(), threadStackTraces);
+        }
+        return new ThreadStackContent(threadStackTraces);
+    }
+
+    public Content findThreadStackTraces(String threadNameFindExpression)
+    {
+        getEventLogger().message(BrokerMessages.OPERATION("findThreadStackTraces"));
+        ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
+        ThreadInfo[] threadInfos = threadMXBean.dumpAllThreads(true, true);
+        StringBuilder threadDump = new StringBuilder();
+        Pattern pattern = threadNameFindExpression == null || threadNameFindExpression.equals("") ? null : Pattern.compile(
+                threadNameFindExpression);
+        for (ThreadInfo threadInfo : threadInfos)
+        {
+            if (pattern== null || pattern.matcher(threadInfo.getThreadName()).find())
+            {
+                threadDump.append(getThreadStackTraces(threadInfo));
+            }
+        }
+        return new ThreadStackContent(threadDump.toString());
+    }
+
+    private String getThreadStackTraces(final ThreadInfo threadInfo)
+    {
+        String lineSeparator = System.lineSeparator();
+        StringBuilder dump = new StringBuilder();
+        dump.append("\"").append(threadInfo.getThreadName()).append("\"").append(" Id=")
+            .append(threadInfo.getThreadId()).append( " ").append(threadInfo.getThreadState());
+        if (threadInfo.getLockName() != null)
+        {
+            dump.append(" on ").append(threadInfo.getLockName());
+        }
+        if (threadInfo.getLockOwnerName() != null)
+        {
+            dump.append(" owned by \"").append(threadInfo.getLockOwnerName())
+                .append("\" Id=").append(threadInfo.getLockOwnerId());
+        }
+        if (threadInfo.isSuspended())
+        {
+            dump.append(" (suspended)");
+        }
+        if (threadInfo.isInNative())
+        {
+            dump.append(" (in native)");
+        }
+        dump.append(lineSeparator);
+        StackTraceElement[] stackTrace = threadInfo.getStackTrace();
+        for (int i = 0; i < stackTrace.length; i++)
+        {
+            StackTraceElement stackTraceElement = stackTrace[i];
+            dump.append("    at ").append(stackTraceElement.toString()).append(lineSeparator);
+
+            LockInfo lockInfo = threadInfo.getLockInfo();
+            if (i == 0 && lockInfo != null)
+            {
+                Thread.State threadState = threadInfo.getThreadState();
+                switch (threadState)
+                {
+                    case BLOCKED:
+                        dump.append("    -  blocked on ").append(lockInfo).append(lineSeparator);
+                        break;
+                    case WAITING:
+                        dump.append("    -  waiting on ").append(lockInfo).append(lineSeparator);
+                        break;
+                    case TIMED_WAITING:
+                        dump.append("    -  waiting on ").append(lockInfo).append(lineSeparator);
+                        break;
+                    default:
+                }
+            }
+
+            for (MonitorInfo mi : threadInfo.getLockedMonitors())
+            {
+                if (mi.getLockedStackDepth() == i)
+                {
+                    dump.append("    -  locked ").append(mi).append(lineSeparator);
+                }
+            }
+        }
+
+        LockInfo[] locks = threadInfo.getLockedSynchronizers();
+        if (locks.length > 0)
+        {
+            dump.append(lineSeparator).append("    Number of locked synchronizers = ").append(locks.length);
+            dump.append(lineSeparator);
+            for (LockInfo li : locks)
+            {
+                dump.append("    - " + li);
+                dump.append(lineSeparator);
+            }
+        }
+        dump.append(lineSeparator);
+        return dump.toString();
+    }
+
+    public ScheduledFuture<?> scheduleHouseKeepingTask(long period, final TimeUnit unit, Runnable task)
+    {
+        return _houseKeepingTaskExecutor.scheduleAtFixedRate(task, period / 2, period, unit);
+    }
+
+    public ScheduledFuture<?> scheduleTask(long delay, final TimeUnit unit, Runnable task)
+    {
+        return _houseKeepingTaskExecutor.schedule(task, delay, unit);
+    }
+
+    public static class ThreadStackContent implements Content, CustomRestHeaders
+    {
+        private final String _threadStackTraces;
+
+        public ThreadStackContent(final String threadStackTraces)
+        {
+            _threadStackTraces = threadStackTraces;
+        }
+
+        @Override
+        public void write(final OutputStream outputStream) throws IOException
+        {
+            if (_threadStackTraces != null)
+            {
+                outputStream.write(_threadStackTraces.getBytes(Charset.forName("UTF-8")));
+            }
+        }
+
+        @Override
+        public void release()
+        {
+            // noop; nothing to release
+        }
+
+        @RestContentHeader("Content-Type")
+        public String getContentType()
+        {
+            return "text/plain;charset=utf-8";
+        }
+    }
+}

Propchange: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractContainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractSystemConfig.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractSystemConfig.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractSystemConfig.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractSystemConfig.java Mon Aug  1 10:52:52 2016
@@ -287,7 +287,7 @@ public abstract class AbstractSystemConf
         String containerTypeName = getDefaultContainerType();
         for(ConfiguredObjectRecord record : records)
         {
-            if(record.getParents() == null || record.getParents().isEmpty())
+            if(record.getParents() != null && record.getParents().size() == 1 && getId().equals(record.getParents().get(SystemConfig.class.getSimpleName())))
             {
                 containerTypeName = record.getType();
                 break;

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AuthenticationProvider.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AuthenticationProvider.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AuthenticationProvider.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AuthenticationProvider.java Mon Aug  1 10:52:52 2016
@@ -33,8 +33,6 @@ import org.apache.qpid.server.security.a
 @ManagedObject( creatable = false )
 public interface AuthenticationProvider<X extends AuthenticationProvider<X>> extends ConfiguredObject<X>
 {
-    //children
-    Collection<VirtualHostAlias> getVirtualHostPortBindings();
 
     /**
      * A temporary method to create SubjectCreator.

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java Mon Aug  1 10:52:52 2016
@@ -30,7 +30,6 @@ import java.util.concurrent.TimeUnit;
 import org.apache.qpid.configuration.CommonProperties;
 import org.apache.qpid.server.logging.EventLogger;
 import org.apache.qpid.server.logging.EventLoggerProvider;
-import org.apache.qpid.server.model.adapter.BrokerImpl;
 import org.apache.qpid.server.stats.StatisticsGatherer;
 
 @ManagedObject( defaultType = Broker.BROKER_TYPE)
@@ -47,7 +46,6 @@ public interface Broker<X extends Broker
     String STATISTICS_REPORTING_RESET_ENABLED = "statisticsReportingResetEnabled";
     String STORE_PATH = "storePath";
     String MODEL_VERSION = "modelVersion";
-    String CONFIDENTIAL_CONFIGURATION_ENCRYPTION_PROVIDER = "confidentialConfigurationEncryptionProvider";
     String PREFERENCE_STORE_ATTRIBUTES   = "preferenceStoreAttributes";
 
     String CHANNEL_FLOW_CONTROL_ENFORCEMENT_TIMEOUT = "channel.flowControlEnforcementTimeout";

Copied: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java (from r1754730, qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BrokerImpl.java)
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java?p2=qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java&p1=qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BrokerImpl.java&r1=1754730&r2=1754731&rev=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BrokerImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java Mon Aug  1 10:52:52 2016
@@ -18,7 +18,7 @@
  * under the License.
  *
  */
-package org.apache.qpid.server.model.adapter;
+package org.apache.qpid.server.model;
 
 import java.io.IOException;
 import java.io.OutputStream;
@@ -89,7 +89,6 @@ import org.apache.qpid.server.configurat
 import org.apache.qpid.server.logging.EventLogger;
 import org.apache.qpid.server.logging.messages.BrokerMessages;
 import org.apache.qpid.server.logging.messages.VirtualHostMessages;
-import org.apache.qpid.server.model.*;
 import org.apache.qpid.server.plugin.ConfigurationSecretEncrypterFactory;
 import org.apache.qpid.server.plugin.PluggableFactoryLoader;
 import org.apache.qpid.server.plugin.QpidServiceLoader;
@@ -102,7 +101,7 @@ import org.apache.qpid.server.virtualhos
 import org.apache.qpid.util.SystemUtils;
 
 @ManagedObject( category = false, type = "Broker" )
-public class BrokerImpl extends AbstractConfiguredObject<BrokerImpl> implements Broker<BrokerImpl>, StatisticsGatherer
+public class BrokerImpl extends AbstractContainer<BrokerImpl> implements Broker<BrokerImpl>, StatisticsGatherer
 {
     private static final Logger LOGGER = LoggerFactory.getLogger(BrokerImpl.class);
 
@@ -157,9 +156,6 @@ public class BrokerImpl extends Abstract
             CONNECTION_HEART_BEAT_DELAY, STATISTICS_REPORTING_PERIOD };
 
 
-    private SystemConfig<?> _parent;
-    private EventLogger _eventLogger;
-
     private AuthenticationProvider<?> _managementModeAuthenticationProvider;
 
     private Timer _reportingTimer;
@@ -180,23 +176,12 @@ public class BrokerImpl extends Abstract
     private boolean _statisticsReportingResetEnabled;
     @ManagedAttributeField
     private boolean _messageCompressionEnabled;
-    @ManagedAttributeField
-    private int _housekeepingThreadCount;
 
     private PreferenceStore _preferenceStore;
 
-    @ManagedAttributeField(beforeSet = "preEncrypterProviderSet", afterSet = "postEncrypterProviderSet")
-    private String _confidentialConfigurationEncryptionProvider;
-    private String _preConfidentialConfigurationEncryptionProvider;
-
     private final boolean _virtualHostPropertiesNodeEnabled;
     private Collection<BrokerLogger> _brokerLoggersToClose;
     private int _networkBufferSize = DEFAULT_NETWORK_BUFFER_SIZE;
-    private final long _maximumHeapSize = Runtime.getRuntime().maxMemory();
-    private final long _maximumDirectMemorySize = getMaxDirectMemorySize();
-    private final BufferPoolMXBean _bufferPoolMXBean;
-    private final List<String> _jvmArguments;
-    private HousekeepingExecutor _houseKeepingTaskExecutor;
     private final AddressSpaceRegistry _addressSpaceRegistry = new AddressSpaceRegistry();
     private ConfigurationChangeListener _accessControlProviderListener = new AccessControlProviderListener();
     private final AccessControl _accessControl;
@@ -207,9 +192,7 @@ public class BrokerImpl extends Abstract
     public BrokerImpl(Map<String, Object> attributes,
                       SystemConfig parent)
     {
-        super(parentsMap(parent), attributes);
-        _parent = parent;
-        _eventLogger = parent.getEventLogger();
+        super(parentsMap(parent), attributes, parent);
         _principal = new BrokerPrincipal(this);
 
         if (parent.isManagementMode())
@@ -230,50 +213,12 @@ public class BrokerImpl extends Abstract
         QpidServiceLoader qpidServiceLoader = new QpidServiceLoader();
         final Set<String> systemNodeCreatorTypes = qpidServiceLoader.getInstancesByType(SystemNodeCreator.class).keySet();
         _virtualHostPropertiesNodeEnabled = systemNodeCreatorTypes.contains(VirtualHostPropertiesNodeCreator.TYPE);
-        if(attributes.get(CONFIDENTIAL_CONFIGURATION_ENCRYPTION_PROVIDER) != null )
-        {
-
-            final String encryptionProviderType = String.valueOf(attributes.get(CONFIDENTIAL_CONFIGURATION_ENCRYPTION_PROVIDER));
-            updateEncrypter(encryptionProviderType);
-            _confidentialConfigurationEncryptionProvider = encryptionProviderType;
-        }
         _messagesDelivered = new StatisticsCounter("messages-delivered");
         _dataDelivered = new StatisticsCounter("bytes-delivered");
         _messagesReceived = new StatisticsCounter("messages-received");
         _dataReceived = new StatisticsCounter("bytes-received");
 
-        BufferPoolMXBean bufferPoolMXBean = null;
-        List<BufferPoolMXBean> bufferPoolMXBeans = ManagementFactory.getPlatformMXBeans(BufferPoolMXBean.class);
-        for(BufferPoolMXBean mBean : bufferPoolMXBeans)
-        {
-            if (mBean.getName().equals("direct"))
-            {
-                bufferPoolMXBean = mBean;
-                break;
-            }
-        }
-        _bufferPoolMXBean = bufferPoolMXBean;
-        _jvmArguments = ManagementFactory.getRuntimeMXBean().getInputArguments();
-    }
 
-    private void updateEncrypter(final String encryptionProviderType)
-    {
-        if(encryptionProviderType != null && !"".equals(encryptionProviderType.trim()))
-        {
-            PluggableFactoryLoader<ConfigurationSecretEncrypterFactory> factoryLoader =
-                    new PluggableFactoryLoader<>(ConfigurationSecretEncrypterFactory.class);
-            ConfigurationSecretEncrypterFactory factory = factoryLoader.get(encryptionProviderType);
-            if (factory == null)
-            {
-                throw new IllegalConfigurationException("Unknown Configuration Secret Encryption method "
-                                                        + encryptionProviderType);
-            }
-            setEncrypter(factory.createEncrypter(this));
-        }
-        else
-        {
-            setEncrypter(null);
-        }
     }
 
     private void registerSystemAddressSpaces()
@@ -533,43 +478,6 @@ public class BrokerImpl extends Abstract
     }
 
     @Override
-    public String getBuildVersion()
-    {
-        return CommonProperties.getBuildVersion();
-    }
-
-    @Override
-    public String getOperatingSystem()
-    {
-        return SystemUtils.getOSString();
-    }
-
-    @Override
-    public String getPlatform()
-    {
-        return System.getProperty("java.vendor") + " "
-                      + System.getProperty("java.runtime.version", System.getProperty("java.version"));
-    }
-
-    @Override
-    public String getProcessPid()
-    {
-        return SystemUtils.getProcessPid();
-    }
-
-    @Override
-    public String getProductVersion()
-    {
-        return CommonProperties.getReleaseVersion();
-    }
-
-    @Override
-    public int getNumberOfCores()
-    {
-        return Runtime.getRuntime().availableProcessors();
-    }
-
-    @Override
     public int getConnection_sessionCountLimit()
     {
         return _connection_sessionCountLimit;
@@ -606,24 +514,6 @@ public class BrokerImpl extends Abstract
     }
 
     @Override
-    public String getConfidentialConfigurationEncryptionProvider()
-    {
-        return _confidentialConfigurationEncryptionProvider;
-    }
-
-    @Override
-    public int getHousekeepingThreadCount()
-    {
-        return _housekeepingThreadCount;
-    }
-
-    @Override
-    public String getModelVersion()
-    {
-        return BrokerModel.MODEL_VERSION;
-    }
-
-    @Override
     public Collection<VirtualHostNode<?>> getVirtualHostNodes()
     {
         Collection children = getChildren(VirtualHostNode.class);
@@ -940,18 +830,6 @@ public class BrokerImpl extends Abstract
     }
 
     @Override
-    public EventLogger getEventLogger()
-    {
-        return _eventLogger;
-    }
-
-    @Override
-    public void setEventLogger(final EventLogger eventLogger)
-    {
-        _eventLogger = eventLogger;
-    }
-
-    @Override
     protected void onExceptionInOpen(RuntimeException e)
     {
         _eventLogger.message(BrokerMessages.FATAL_ERROR(e.getMessage()));
@@ -1100,236 +978,18 @@ public class BrokerImpl extends Abstract
         return _managementModeAuthenticationProvider;
     }
 
-    @SuppressWarnings("unused")
-    private void preEncrypterProviderSet()
-    {
-        _preConfidentialConfigurationEncryptionProvider = _confidentialConfigurationEncryptionProvider;
-    }
-
-    @SuppressWarnings("unused")
-    private void postEncrypterProviderSet()
-    {
-        if (!Objects.equals(_preConfidentialConfigurationEncryptionProvider,
-                            _confidentialConfigurationEncryptionProvider))
-        {
-            updateEncrypter(_confidentialConfigurationEncryptionProvider);
-            forceUpdateAllSecureAttributes();
-        }
-    }
-
-    @SuppressWarnings("unused")
-    public static Collection<String> getAvailableConfigurationEncrypters()
-    {
-        return (new QpidServiceLoader()).getInstancesByType(ConfigurationSecretEncrypterFactory.class).keySet();
-    }
-
-    public static long getMaxDirectMemorySize()
-    {
-        long maxMemory = 0;
-        try
-        {
-            ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
-            Class<?> hotSpotDiagnosticMXBeanClass = Class.forName("com.sun.management.HotSpotDiagnosticMXBean", true, systemClassLoader);
-            Class<?> vmOptionClass = Class.forName("com.sun.management.VMOption", true, systemClassLoader);
-
-            Object hotSpotDiagnosticMXBean = ManagementFactory.getPlatformMXBean((Class<? extends PlatformManagedObject>)hotSpotDiagnosticMXBeanClass);
-            Method getVMOption = hotSpotDiagnosticMXBeanClass.getDeclaredMethod("getVMOption", String.class);
-            Object vmOption = getVMOption.invoke(hotSpotDiagnosticMXBean, "MaxDirectMemorySize");
-            Method getValue = vmOptionClass.getDeclaredMethod("getValue");
-            String maxDirectMemoryAsString = (String)getValue.invoke(vmOption);
-            maxMemory = Long.parseLong(maxDirectMemoryAsString);
-        }
-        catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException e)
-        {
-            LOGGER.debug("Cannot determine direct memory max size using com.sun.management.HotSpotDiagnosticMXBean: " + e.getMessage());
-        }
-        catch (InvocationTargetException e)
-        {
-            throw new ServerScopedRuntimeException("Unexpected exception in evaluation of MaxDirectMemorySize with HotSpotDiagnosticMXBean", e.getTargetException());
-        }
-
-        if (maxMemory == 0)
-        {
-            Pattern maxDirectMemorySizeArgumentPattern = Pattern.compile("^\\s*-XX:MaxDirectMemorySize\\s*=\\s*(\\d+)\\s*([KkMmGgTt]?)\\s*$");
-            RuntimeMXBean RuntimemxBean = ManagementFactory.getRuntimeMXBean();
-            List<String> inputArguments = RuntimemxBean.getInputArguments();
-            boolean argumentFound = false;
-            for (String argument : inputArguments)
-            {
-                Matcher matcher = maxDirectMemorySizeArgumentPattern.matcher(argument);
-                if (matcher.matches())
-                {
-                    argumentFound = true;
-                    maxMemory = Long.parseLong(matcher.group(1));
-                    String unit = matcher.group(2);
-                    char unitChar = "".equals(unit) ? 0 : unit.charAt(0);
-                    switch (unitChar)
-                    {
-                        case 'k':
-                        case 'K':
-                            maxMemory *= 1024l;
-                            break;
-                        case 'm':
-                        case 'M':
-                            maxMemory *= 1024l * 1024l;
-                            break;
-                        case 'g':
-                        case 'G':
-                            maxMemory *= 1024l * 1024l * 1024l;
-                            break;
-                        case 't':
-                        case 'T':
-                            maxMemory *= 1024l * 1024l * 1024l * 1024l;
-                            break;
-                        case 0:
-                            // noop
-                            break;
-                        default:
-                            throw new IllegalStateException("Unexpected unit character in MaxDirectMemorySize argument : " + argument);
-                    }
-                    // do not break; continue. Oracle and IBM JVMs use the last value when argument is specified multiple times
-                }
-            }
-
-            if (maxMemory == 0)
-            {
-                if (argumentFound)
-                {
-                    throw new IllegalArgumentException("Qpid Broker cannot operate with 0 direct memory. Please, set JVM argument MaxDirectMemorySize to non-zero value");
-                }
-                else
-                {
-                    maxMemory = Runtime.getRuntime().maxMemory();
-                }
-            }
-        }
-
-        return maxMemory;
-    }
-
     @Override
     public int getNetworkBufferSize()
     {
         return _networkBufferSize;
     }
 
-    @Override
-    public int getNumberOfLiveThreads()
-    {
-        return ManagementFactory.getThreadMXBean().getThreadCount();
-    }
-
-    @Override
-    public long getMaximumHeapMemorySize()
-    {
-        return _maximumHeapSize;
-    }
-
-    @Override
-    public long getUsedHeapMemorySize()
-    {
-        return Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
-    }
-
-    @Override
-    public long getMaximumDirectMemorySize()
-    {
-        return _maximumDirectMemorySize;
-    }
-
-    @Override
-    public long getUsedDirectMemorySize()
-    {
-        if (_bufferPoolMXBean == null)
-        {
-            return -1;
-        }
-        return _bufferPoolMXBean.getMemoryUsed();
-    }
-
-    @Override
-    public long getDirectMemoryTotalCapacity()
-    {
-        if (_bufferPoolMXBean == null)
-        {
-            return -1;
-        }
-        return _bufferPoolMXBean.getTotalCapacity();
-    }
-
-    @Override
-    public int getNumberOfObjectsPendingFinalization()
-    {
-        return ManagementFactory.getMemoryMXBean().getObjectPendingFinalizationCount();
-    }
-
-    @Override
-    public List<String> getJvmArguments()
-    {
-        return _jvmArguments;
-    }
-
     public String getDocumentationUrl()
     {
         return _documentationUrl;
     }
 
     @Override
-    public void performGC()
-    {
-        getEventLogger().message(BrokerMessages.OPERATION("performGC"));
-        System.gc();
-    }
-
-    @Override
-    public Content getThreadStackTraces(boolean appendToLog)
-    {
-        getEventLogger().message(BrokerMessages.OPERATION("getThreadStackTraces"));
-        ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
-        ThreadInfo[] threadInfos = threadMXBean.dumpAllThreads(true, true);
-        StringBuilder threadDump = new StringBuilder();
-        for (ThreadInfo threadInfo : threadInfos)
-        {
-            threadDump.append(getThreadStackTraces(threadInfo));
-        }
-        long[] deadLocks = threadMXBean.findDeadlockedThreads();
-        if (deadLocks != null && deadLocks.length > 0)
-        {
-            ThreadInfo[] deadlockedThreads = threadMXBean.getThreadInfo(deadLocks);
-            threadDump.append(System.lineSeparator()).append("Deadlock is detected!").append(System.lineSeparator());
-            for (ThreadInfo threadInfo : deadlockedThreads)
-            {
-                threadDump.append(getThreadStackTraces(threadInfo));
-            }
-        }
-        String threadStackTraces = threadDump.toString();
-        if (appendToLog)
-        {
-            LOGGER.warn("Thread dump:{} {}", System.lineSeparator(), threadStackTraces);
-        }
-        return new ThreadStackContent(threadStackTraces);
-    }
-
-    @Override
-    public Content findThreadStackTraces(String threadNameFindExpression)
-    {
-        getEventLogger().message(BrokerMessages.OPERATION("findThreadStackTraces"));
-        ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
-        ThreadInfo[] threadInfos = threadMXBean.dumpAllThreads(true, true);
-        StringBuilder threadDump = new StringBuilder();
-        Pattern pattern = threadNameFindExpression == null || threadNameFindExpression.equals("") ? null : Pattern.compile(
-                threadNameFindExpression);
-        for (ThreadInfo threadInfo : threadInfos)
-        {
-            if (pattern== null || pattern.matcher(threadInfo.getThreadName()).find())
-            {
-                threadDump.append(getThreadStackTraces(threadInfo));
-            }
-        }
-        return new ThreadStackContent(threadDump.toString());
-    }
-
-    @Override
     public Principal getUser()
     {
         return AuthenticatedPrincipal.getCurrentUser();
@@ -1348,79 +1008,6 @@ public class BrokerImpl extends Abstract
         return currentPrincipals;
     }
 
-    private String getThreadStackTraces(final ThreadInfo threadInfo)
-    {
-        String lineSeparator = System.lineSeparator();
-        StringBuilder dump = new StringBuilder();
-        dump.append("\"").append(threadInfo.getThreadName()).append("\"").append(" Id=")
-            .append(threadInfo.getThreadId()).append( " ").append(threadInfo.getThreadState());
-        if (threadInfo.getLockName() != null)
-        {
-            dump.append(" on ").append(threadInfo.getLockName());
-        }
-        if (threadInfo.getLockOwnerName() != null)
-        {
-            dump.append(" owned by \"").append(threadInfo.getLockOwnerName())
-                .append("\" Id=").append(threadInfo.getLockOwnerId());
-        }
-        if (threadInfo.isSuspended())
-        {
-            dump.append(" (suspended)");
-        }
-        if (threadInfo.isInNative())
-        {
-            dump.append(" (in native)");
-        }
-        dump.append(lineSeparator);
-        StackTraceElement[] stackTrace = threadInfo.getStackTrace();
-        for (int i = 0; i < stackTrace.length; i++)
-        {
-            StackTraceElement stackTraceElement = stackTrace[i];
-            dump.append("    at ").append(stackTraceElement.toString()).append(lineSeparator);
-
-            LockInfo lockInfo = threadInfo.getLockInfo();
-            if (i == 0 && lockInfo != null)
-            {
-                Thread.State threadState = threadInfo.getThreadState();
-                switch (threadState)
-                {
-                    case BLOCKED:
-                        dump.append("    -  blocked on ").append(lockInfo).append(lineSeparator);
-                        break;
-                    case WAITING:
-                        dump.append("    -  waiting on ").append(lockInfo).append(lineSeparator);
-                        break;
-                    case TIMED_WAITING:
-                        dump.append("    -  waiting on ").append(lockInfo).append(lineSeparator);
-                        break;
-                    default:
-                }
-            }
-
-            for (MonitorInfo mi : threadInfo.getLockedMonitors())
-            {
-                if (mi.getLockedStackDepth() == i)
-                {
-                    dump.append("    -  locked ").append(mi).append(lineSeparator);
-                }
-            }
-        }
-
-        LockInfo[] locks = threadInfo.getLockedSynchronizers();
-        if (locks.length > 0)
-        {
-            dump.append(lineSeparator).append("    Number of locked synchronizers = ").append(locks.length);
-            dump.append(lineSeparator);
-            for (LockInfo li : locks)
-            {
-                dump.append("    - " + li);
-                dump.append(lineSeparator);
-            }
-        }
-        dump.append(lineSeparator);
-        return dump.toString();
-    }
-
     protected void shutdownHouseKeeping()
     {
         if(_houseKeepingTaskExecutor != null)
@@ -1442,49 +1029,6 @@ public class BrokerImpl extends Abstract
         }
     }
 
-    @Override
-    public ScheduledFuture<?> scheduleHouseKeepingTask(long period, final TimeUnit unit, Runnable task)
-    {
-        return _houseKeepingTaskExecutor.scheduleAtFixedRate(task, period / 2, period, unit);
-    }
-
-    @Override
-    public ScheduledFuture<?> scheduleTask(long delay, final TimeUnit unit, Runnable task)
-    {
-        return _houseKeepingTaskExecutor.schedule(task, delay, unit);
-    }
-
-    public static class ThreadStackContent implements Content, CustomRestHeaders
-    {
-        private final String _threadStackTraces;
-
-        public ThreadStackContent(final String threadStackTraces)
-        {
-            _threadStackTraces = threadStackTraces;
-        }
-
-        @Override
-        public void write(final OutputStream outputStream) throws IOException
-        {
-            if (_threadStackTraces != null)
-            {
-                outputStream.write(_threadStackTraces.getBytes(Charset.forName("UTF-8")));
-            }
-        }
-
-        @Override
-        public void release()
-        {
-            // noop; nothing to release
-        }
-
-        @RestContentHeader("Content-Type")
-        public String getContentType()
-        {
-            return "text/plain;charset=utf-8";
-        }
-    }
-
     private class AddressSpaceRegistry implements SystemAddressSpaceCreator.AddressSpaceRegistry
     {
         private final ConcurrentMap<String, NamedAddressSpace> _systemAddressSpaces = new ConcurrentHashMap<>();

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Container.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Container.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Container.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Container.java Mon Aug  1 10:52:52 2016
@@ -24,5 +24,13 @@ import org.apache.qpid.server.logging.Ev
 
 public interface Container<C extends ConfiguredObject<C>> extends ConfiguredObject<C>
 {
+    String CONFIDENTIAL_CONFIGURATION_ENCRYPTION_PROVIDER = "confidentialConfigurationEncryptionProvider";
+
     void setEventLogger(EventLogger startupLogger);
+
+    EventLogger getEventLogger();
+
+    int getNetworkBufferSize();
+
+    AuthenticationProvider<?> getManagementModeAuthenticationProvider();
 }

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileBasedGroupProviderImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileBasedGroupProviderImpl.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileBasedGroupProviderImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileBasedGroupProviderImpl.java Mon Aug  1 10:52:52 2016
@@ -39,8 +39,8 @@ import org.slf4j.LoggerFactory;
 import org.apache.qpid.server.configuration.BrokerProperties;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.model.AbstractConfiguredObject;
-import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.Container;
 import org.apache.qpid.server.model.Group;
 import org.apache.qpid.server.model.GroupMember;
 import org.apache.qpid.server.model.GroupProvider;
@@ -48,6 +48,7 @@ import org.apache.qpid.server.model.Mana
 import org.apache.qpid.server.model.ManagedObjectFactoryConstructor;
 import org.apache.qpid.server.model.State;
 import org.apache.qpid.server.model.StateTransition;
+import org.apache.qpid.server.model.SystemConfig;
 import org.apache.qpid.server.security.auth.UsernamePrincipal;
 import org.apache.qpid.server.security.group.FileGroupDatabase;
 import org.apache.qpid.server.security.group.GroupPrincipal;
@@ -59,7 +60,7 @@ public class FileBasedGroupProviderImpl
     public static final String GROUP_FILE_PROVIDER_TYPE = "GroupFile";
     private static Logger LOGGER = LoggerFactory.getLogger(FileBasedGroupProviderImpl.class);
 
-    private final Broker<?> _broker;
+    private final Container<?> _container;
 
     private FileGroupDatabase _groupDatabase;
 
@@ -68,17 +69,17 @@ public class FileBasedGroupProviderImpl
 
     @ManagedObjectFactoryConstructor
     public FileBasedGroupProviderImpl(Map<String, Object> attributes,
-                                      Broker broker)
+                                      Container<?> container)
     {
-        super(parentsMap(broker), attributes);
+        super(parentsMap(container), attributes);
 
 
-        _broker = broker;
+        _container = container;
     }
 
     public void onValidate()
     {
-        Collection<GroupProvider<?>> groupProviders = _broker.getGroupProviders();
+        Collection<GroupProvider> groupProviders = _container.getChildren(GroupProvider.class);
         for(GroupProvider<?> provider : groupProviders)
         {
             if(provider instanceof FileBasedGroupProvider && provider != this)
@@ -262,7 +263,7 @@ public class FileBasedGroupProviderImpl
         }
         else
         {
-            if (_broker.isManagementMode())
+            if (getAncestor(SystemConfig.class).isManagementMode())
             {
                         LOGGER.warn("Failed to activate group provider: " + getName());
             }

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractClientAuthCapablePortWithAuthProvider.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractClientAuthCapablePortWithAuthProvider.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractClientAuthCapablePortWithAuthProvider.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractClientAuthCapablePortWithAuthProvider.java Mon Aug  1 10:52:52 2016
@@ -24,6 +24,7 @@ import java.util.Set;
 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.Container;
 import org.apache.qpid.server.model.ManagedAttributeField;
 import org.apache.qpid.server.model.TrustStore;
 import org.apache.qpid.server.security.ManagedPeerCertificateTrustStore;
@@ -44,7 +45,7 @@ abstract public class AbstractClientAuth
     private TrustStore<?> _clientCertRecorder;
 
     public AbstractClientAuthCapablePortWithAuthProvider(final Map<String, Object> attributes,
-                                                         final Broker<?> broker)
+                                                         final Container<?> broker)
     {
         super(attributes, broker);
     }

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractPort.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractPort.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractPort.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractPort.java Mon Aug  1 10:52:52 2016
@@ -34,6 +34,7 @@ import com.google.common.util.concurrent
 import org.apache.qpid.configuration.CommonProperties;
 import org.apache.qpid.server.logging.EventLogger;
 import org.apache.qpid.server.logging.messages.PortMessages;
+import org.apache.qpid.server.model.Container;
 import org.apache.qpid.server.model.IntegrityViolationException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -49,6 +50,7 @@ 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.StateTransition;
+import org.apache.qpid.server.model.SystemConfig;
 import org.apache.qpid.server.model.Transport;
 import org.apache.qpid.server.model.TrustStore;
 import org.apache.qpid.server.util.ParameterizedTypes;
@@ -57,7 +59,7 @@ public abstract class AbstractPort<X ext
 {
     private static final Logger LOGGER = LoggerFactory.getLogger(AbstractPort.class);
 
-    private final Broker<?> _broker;
+    private final Container<?> _container;
     private final EventLogger _eventLogger;
 
     @ManagedAttributeField
@@ -82,12 +84,12 @@ public abstract class AbstractPort<X ext
     private List<String> _tlsCipherSuiteBlackList;
 
     public AbstractPort(Map<String, Object> attributes,
-                        Broker<?> broker)
+                        Container<?> container)
     {
-        super(parentsMap(broker), attributes);
+        super(parentsMap(container), attributes);
 
-        _broker = broker;
-        _eventLogger = broker.getEventLogger();
+        _container = container;
+        _eventLogger = container.getEventLogger();
         _eventLogger.message(PortMessages.CREATE(getName()));
     }
 
@@ -118,7 +120,7 @@ public abstract class AbstractPort<X ext
             throw new IllegalArgumentException(getClass().getSimpleName() + " must be durable");
         }
 
-        for (Port p : _broker.getPorts())
+        for (Port p : _container.getChildren(Port.class))
         {
             if (p.getPort() == getPort() && p.getPort() != 0 && p != this)
             {
@@ -186,7 +188,7 @@ public abstract class AbstractPort<X ext
             int newPort = updated.getPort();
             if (getPort() != newPort)
             {
-                for (Port p : _broker.getPorts())
+                for (Port p : _container.getChildren(Port.class))
                 {
                     if (p.getPort() == newPort)
                     {
@@ -325,32 +327,4 @@ public abstract class AbstractPort<X ext
         return getCategoryClass().getSimpleName() + "[id=" + getId() + ", name=" + getName() + ", type=" + getType() +  ", port=" + getPort() + "]";
     }
 
-
-    protected void validateOnlyOneInstance()
-    {
-        Broker<?> broker = getParent(Broker.class);
-        if(!broker.isManagementMode())
-        {
-            //ManagementMode needs this relaxed to allow its overriding management ports to be inserted.
-
-            //Enforce only a single port of each management protocol, as the plugins will only use one.
-            Collection<Port<?>> existingPorts = new HashSet<Port<?>>(broker.getPorts());
-            existingPorts.remove(this);
-
-            for (Port<?> existingPort : existingPorts)
-            {
-                Collection<Protocol> portProtocols = existingPort.getProtocols();
-                if (portProtocols != null)
-                {
-                    final ArrayList<Protocol> intersection = new ArrayList<>(portProtocols);
-                    intersection.retainAll(getProtocols());
-                    if(!intersection.isEmpty())
-                    {
-                        throw new IntegrityViolationException("Port for protocols " + intersection + " already exists. Only one management port per protocol can be created.");
-                    }
-                }
-            }
-        }
-    }
-
 }

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractPortWithAuthProvider.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractPortWithAuthProvider.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractPortWithAuthProvider.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractPortWithAuthProvider.java Mon Aug  1 10:52:52 2016
@@ -29,27 +29,31 @@ import org.apache.qpid.server.configurat
 import org.apache.qpid.server.model.AuthenticationProvider;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.Container;
 import org.apache.qpid.server.model.ManagedAttributeField;
 import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.SystemConfig;
 import org.apache.qpid.server.model.Transport;
 
 abstract public class AbstractPortWithAuthProvider<X extends AbstractPortWithAuthProvider<X>> extends AbstractPort<X> implements PortWithAuthProvider<X>
 {
+    private final Container<?> _container;
     @ManagedAttributeField
     private AuthenticationProvider _authenticationProvider;
 
     public AbstractPortWithAuthProvider(final Map<String, Object> attributes,
-                                        final Broker<?> broker)
+                                        final Container<?> container)
     {
-        super(attributes, broker);
+        super(attributes, container);
+        _container = container;
     }
 
     public AuthenticationProvider getAuthenticationProvider()
     {
-        Broker<?> broker = getParent(Broker.class);
-        if(broker.isManagementMode())
+        SystemConfig<?> systemConfig = getAncestor(SystemConfig.class);
+        if(systemConfig.isManagementMode())
         {
-            return broker.getManagementModeAuthenticationProvider();
+            return _container.getManagementModeAuthenticationProvider();
         }
         return _authenticationProvider;
     }

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPortImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPortImpl.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPortImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPortImpl.java Mon Aug  1 10:52:52 2016
@@ -114,7 +114,7 @@ public class AmqpPortImpl extends Abstra
     private final AtomicInteger _connectionCount = new AtomicInteger();
     private final AtomicBoolean _connectionCountWarningGiven = new AtomicBoolean();
 
-    private final Broker<?> _broker;
+    private final Container<?> _container;
     private final int _connectionWarnCount;
     private final AtomicBoolean _closing = new AtomicBoolean();
     private final SettableFuture _noConnectionsRemain = SettableFuture.create();
@@ -123,10 +123,10 @@ public class AmqpPortImpl extends Abstra
     private volatile long _protocolHandshakeTimeout;
 
     @ManagedObjectFactoryConstructor
-    public AmqpPortImpl(Map<String, Object> attributes, Broker<?> broker)
+    public AmqpPortImpl(Map<String, Object> attributes, Container<?> container)
     {
-        super(attributes, broker);
-        _broker = broker;
+        super(attributes, container);
+        _container = container;
         _connectionWarnCount = getContextValue(Integer.class, OPEN_CONNECTIONS_WARN_PERCENT);
     }
 
@@ -241,7 +241,7 @@ public class AmqpPortImpl extends Abstra
     @Override
     protected State onActivate()
     {
-        if(_broker.isManagementMode())
+        if(getAncestor(SystemConfig.class).isManagementMode())
         {
             return State.QUIESCED;
         }
@@ -283,7 +283,7 @@ public class AmqpPortImpl extends Abstra
                 _transport.start();
                 for (Transport transport : getTransports())
                 {
-                    _broker.getEventLogger()
+                    _container.getEventLogger()
                             .message(BrokerMessages.LISTENING(String.valueOf(transport),
                                                               _transport.getAcceptingPort()));
                 }
@@ -291,7 +291,7 @@ public class AmqpPortImpl extends Abstra
             }
             catch (PortBindFailureException e)
             {
-                _broker.getEventLogger().message(PortMessages.BIND_FAILED(getType().toUpperCase(),getPort()));
+                _container.getEventLogger().message(PortMessages.BIND_FAILED(getType().toUpperCase(), getPort()));
                 throw e;
             }
         }
@@ -317,7 +317,7 @@ public class AmqpPortImpl extends Abstra
         {
             for(Transport transport : getTransports())
             {
-                _broker.getEventLogger().message(BrokerMessages.SHUTTING_DOWN(String.valueOf(transport), _transport.getAcceptingPort()));
+                _container.getEventLogger().message(BrokerMessages.SHUTTING_DOWN(String.valueOf(transport), _transport.getAcceptingPort()));
             }
 
 
@@ -328,7 +328,7 @@ public class AmqpPortImpl extends Abstra
     @Override
     public int getNetworkBufferSize()
     {
-        return _broker.getNetworkBufferSize();
+        return _container.getNetworkBufferSize();
     }
 
     @Override
@@ -589,8 +589,8 @@ public class AmqpPortImpl extends Abstra
            && openConnections > (maxOpenConnections * _connectionWarnCount) / 100
            && _connectionCountWarningGiven.compareAndSet(false, true))
         {
-            _broker.getEventLogger().message(new PortLogSubject(this),
-                                             PortMessages.CONNECTION_COUNT_WARN(openConnections,
+            _container.getEventLogger().message(new PortLogSubject(this),
+                                                PortMessages.CONNECTION_COUNT_WARN(openConnections,
                                                                                 _connectionWarnCount,
                                                                                 maxOpenConnections));
         }
@@ -628,14 +628,14 @@ public class AmqpPortImpl extends Abstra
         String addressString = remoteSocketAddress.toString();
         if (_closing.get())
         {
-            _broker.getEventLogger().message(new PortLogSubject(this),
-                                             PortMessages.CONNECTION_REJECTED_CLOSED(addressString));
+            _container.getEventLogger().message(new PortLogSubject(this),
+                                                PortMessages.CONNECTION_REJECTED_CLOSED(addressString));
             return false;
         }
         else if (_maxOpenConnections > 0 && _connectionCount.get() >= _maxOpenConnections)
         {
-            _broker.getEventLogger().message(new PortLogSubject(this),
-                                             PortMessages.CONNECTION_REJECTED_TOO_MANY(addressString,
+            _container.getEventLogger().message(new PortLogSubject(this),
+                                                PortMessages.CONNECTION_REJECTED_TOO_MANY(addressString,
                                                                                        _maxOpenConnections));
             return false;
         }

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/HttpPortImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/HttpPortImpl.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/HttpPortImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/HttpPortImpl.java Mon Aug  1 10:52:52 2016
@@ -26,8 +26,8 @@ import java.util.Map;
 import java.util.Set;
 
 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.Container;
 import org.apache.qpid.server.model.ManagedAttributeField;
 import org.apache.qpid.server.model.ManagedObjectFactoryConstructor;
 import org.apache.qpid.server.model.State;
@@ -49,9 +49,9 @@ public class HttpPortImpl extends Abstra
 
     @ManagedObjectFactoryConstructor
     public HttpPortImpl(final Map<String, Object> attributes,
-                        final Broker<?> broker)
+                        final Container<?> container)
     {
-        super(attributes, broker);
+        super(attributes, container);
     }
 
     public void setPortManager(PortManager manager)

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractAuthenticationManager.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractAuthenticationManager.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractAuthenticationManager.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractAuthenticationManager.java Mon Aug  1 10:52:52 2016
@@ -37,12 +37,14 @@ import org.slf4j.LoggerFactory;
 import org.apache.qpid.server.model.AbstractConfiguredObject;
 import org.apache.qpid.server.model.AuthenticationProvider;
 import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.Container;
+import org.apache.qpid.server.model.GroupProvider;
 import org.apache.qpid.server.model.IntegrityViolationException;
 import org.apache.qpid.server.model.ManagedAttributeField;
 import org.apache.qpid.server.model.Port;
 import org.apache.qpid.server.model.State;
 import org.apache.qpid.server.model.StateTransition;
-import org.apache.qpid.server.model.VirtualHostAlias;
+import org.apache.qpid.server.model.SystemConfig;
 import org.apache.qpid.server.model.port.AbstractPortWithAuthProvider;
 import org.apache.qpid.server.security.SubjectCreator;
 
@@ -52,7 +54,7 @@ public abstract class AbstractAuthentica
 {
     private static final Logger LOGGER = LoggerFactory.getLogger(AbstractAuthenticationManager.class);
 
-    private final Broker<?> _broker;
+    private final Container<?> _container;
     private final EventLogger _eventLogger;
 
     @ManagedAttributeField
@@ -62,11 +64,11 @@ public abstract class AbstractAuthentica
     private List<String> _disabledMechanisms;
 
 
-    protected AbstractAuthenticationManager(final Map<String, Object> attributes, final Broker<?> broker)
+    protected AbstractAuthenticationManager(final Map<String, Object> attributes, final Container<?> container)
     {
-        super(parentsMap(broker), attributes);
-        _broker = broker;
-        _eventLogger = _broker.getEventLogger();
+        super(parentsMap(container), attributes);
+        _container = container;
+        _eventLogger = _container.getEventLogger();
         _eventLogger.message(AuthenticationProviderMessages.CREATE(getName()));
     }
 
@@ -81,21 +83,11 @@ public abstract class AbstractAuthentica
         }
     }
 
-    protected final Broker getBroker()
-    {
-        return _broker;
-    }
-
-    @Override
-    public Collection<VirtualHostAlias> getVirtualHostPortBindings()
-    {
-        return null;
-    }
-
     @Override
     public SubjectCreator getSubjectCreator(final boolean secure)
     {
-        return new SubjectCreator(this, _broker.getGroupProviders(), secure);
+        Collection children = _container.getChildren(GroupProvider.class);
+        return new SubjectCreator(this, children, secure);
     }
 
     @StateTransition( currentState = State.UNINITIALIZED, desiredState = State.QUIESCED )
@@ -115,7 +107,7 @@ public abstract class AbstractAuthentica
         catch(RuntimeException e)
         {
             setState(State.ERRORED);
-            if (_broker.isManagementMode())
+            if (getAncestor(SystemConfig.class).isManagementMode())
             {
                 LOGGER.warn("Failed to activate authentication provider: " + getName(), e);
             }
@@ -134,7 +126,7 @@ public abstract class AbstractAuthentica
         String providerName = getName();
 
         // verify that provider is not in use
-        Collection<Port<?>> ports = new ArrayList<>(_broker.getPorts());
+        Collection<Port> ports = new ArrayList<>(_container.getChildren(Port.class));
         for (Port<?> port : ports)
         {
             if(port instanceof AbstractPortWithAuthProvider

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManager.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManager.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManager.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManager.java Mon Aug  1 10:52:52 2016
@@ -29,7 +29,7 @@ import javax.security.auth.Subject;
 import javax.security.sasl.SaslException;
 import javax.security.sasl.SaslServer;
 
-import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.Container;
 import org.apache.qpid.server.model.ManagedObject;
 import org.apache.qpid.server.model.ManagedObjectFactoryConstructor;
 import org.apache.qpid.server.security.auth.AuthenticationResult;
@@ -55,9 +55,9 @@ public class AnonymousAuthenticationMana
     public static final AuthenticationResult ANONYMOUS_AUTHENTICATION = new AuthenticationResult(ANONYMOUS_PRINCIPAL);
 
     @ManagedObjectFactoryConstructor
-    protected AnonymousAuthenticationManager(final Map<String, Object> attributes, final Broker broker)
+    protected AnonymousAuthenticationManager(final Map<String, Object> attributes, final Container<?> container)
     {
-        super(attributes, broker);
+        super(attributes, container);
     }
 
     @Override

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ConfigModelPasswordManagingAuthenticationProvider.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ConfigModelPasswordManagingAuthenticationProvider.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ConfigModelPasswordManagingAuthenticationProvider.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ConfigModelPasswordManagingAuthenticationProvider.java Mon Aug  1 10:52:52 2016
@@ -36,8 +36,8 @@ import com.google.common.util.concurrent
 import com.google.common.util.concurrent.ListenableFuture;
 
 import org.apache.qpid.server.configuration.updater.Task;
-import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.Container;
 import org.apache.qpid.server.model.PasswordCredentialManagingAuthenticationProvider;
 import org.apache.qpid.server.model.User;
 import org.apache.qpid.server.security.auth.AuthenticationResult;
@@ -51,9 +51,9 @@ public abstract class ConfigModelPasswor
     protected Map<String, ManagedUser> _users = new ConcurrentHashMap<>();
 
     protected ConfigModelPasswordManagingAuthenticationProvider(final Map<String, Object> attributes,
-                                                                final Broker broker)
+                                                                final Container<?> container)
     {
-        super(attributes, broker);
+        super(attributes, container);
     }
 
     ManagedUser getUser(final String username)

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerImpl.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerImpl.java Mon Aug  1 10:52:52 2016
@@ -26,7 +26,7 @@ import java.util.Map;
 import javax.security.sasl.SaslException;
 import javax.security.sasl.SaslServer;
 
-import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.Container;
 import org.apache.qpid.server.model.ManagedAttributeField;
 import org.apache.qpid.server.model.ManagedObjectFactoryConstructor;
 import org.apache.qpid.server.security.auth.AuthenticationResult;
@@ -42,9 +42,9 @@ public class ExternalAuthenticationManag
     private boolean _useFullDN;
 
     @ManagedObjectFactoryConstructor
-    protected ExternalAuthenticationManagerImpl(final Map<String, Object> attributes, final Broker broker)
+    protected ExternalAuthenticationManagerImpl(final Map<String, Object> attributes, final Container<?> container)
     {
-        super(attributes, broker);
+        super(attributes, container);
     }
 
     @Override

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManager.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManager.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManager.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/KerberosAuthenticationManager.java Mon Aug  1 10:52:52 2016
@@ -33,7 +33,7 @@ import javax.security.sasl.Sasl;
 import javax.security.sasl.SaslException;
 import javax.security.sasl.SaslServer;
 
-import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.Container;
 import org.apache.qpid.server.model.ManagedObject;
 import org.apache.qpid.server.model.ManagedObjectFactoryConstructor;
 import org.apache.qpid.server.security.auth.AuthenticationResult;
@@ -47,9 +47,9 @@ public class KerberosAuthenticationManag
     private final CallbackHandler _callbackHandler = new GssApiCallbackHandler();
 
     @ManagedObjectFactoryConstructor
-    protected KerberosAuthenticationManager(final Map<String, Object> attributes, final Broker broker)
+    protected KerberosAuthenticationManager(final Map<String, Object> attributes, final Container<?> container)
     {
-        super(attributes, broker);
+        super(attributes, container);
     }
 
     @Override

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java Mon Aug  1 10:52:52 2016
@@ -48,8 +48,8 @@ import org.slf4j.LoggerFactory;
 import org.apache.qpid.server.configuration.BrokerProperties;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.model.AbstractConfiguredObject;
-import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.Container;
 import org.apache.qpid.server.model.ExternalFileBasedAuthenticationManager;
 import org.apache.qpid.server.model.ManagedAttributeField;
 import org.apache.qpid.server.model.State;
@@ -75,7 +75,7 @@ public abstract class PrincipalDatabaseA
     @ManagedAttributeField
     private String _path;
 
-    protected PrincipalDatabaseAuthenticationManager(final Map<String, Object> attributes, final Broker broker)
+    protected PrincipalDatabaseAuthenticationManager(final Map<String, Object> attributes, final Container<?> broker)
     {
         super(attributes, broker);
     }

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManager.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManager.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManager.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManager.java Mon Aug  1 10:52:52 2016
@@ -40,7 +40,7 @@ import javax.security.sasl.SaslServer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.Container;
 import org.apache.qpid.server.model.ManagedObject;
 import org.apache.qpid.server.security.auth.AuthenticationResult;
 import org.apache.qpid.server.security.auth.UsernamePrincipal;
@@ -64,9 +64,9 @@ public class SimpleAuthenticationManager
     private final ScramSaslServerSourceAdapter _scramSha1Adapter;
     private final ScramSaslServerSourceAdapter _scramSha256Adapter;
 
-    public SimpleAuthenticationManager(final Map<String, Object> attributes, final Broker broker)
+    public SimpleAuthenticationManager(final Map<String, Object> attributes, final Container<?> container)
     {
-        super(attributes, broker);
+        super(attributes, container);
         ScramSaslServerSourceAdapter.PasswordSource passwordSource =
                 new ScramSaslServerSourceAdapter.PasswordSource()
                 {

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerImpl.java?rev=1754731&r1=1754730&r2=1754731&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleLDAPAuthenticationManagerImpl.java Mon Aug  1 10:52:52 2016
@@ -62,8 +62,8 @@ import org.slf4j.LoggerFactory;
 
 import org.apache.qpid.configuration.CommonProperties;
 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.Container;
 import org.apache.qpid.server.model.ManagedAttributeField;
 import org.apache.qpid.server.model.ManagedObjectFactoryConstructor;
 import org.apache.qpid.server.model.TrustStore;
@@ -151,9 +151,9 @@ public class SimpleLDAPAuthenticationMan
     private Class<? extends SocketFactory> _sslSocketFactoryOverrideClass;
 
     @ManagedObjectFactoryConstructor
-    protected SimpleLDAPAuthenticationManagerImpl(final Map<String, Object> attributes, final Broker broker)
+    protected SimpleLDAPAuthenticationManagerImpl(final Map<String, Object> attributes, final Container<?> container)
     {
-        super(attributes, broker);
+        super(attributes, container);
     }
 
     @Override




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


Mime
View raw message