qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1678105 [2/3] - in /qpid/java/trunk: bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuple/ broker-codegen/src/main/java/org/apache/qpid/server/model/ broker-co...
Date Wed, 06 May 2015 22:28:50 GMT
Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AttributeValueConverter.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AttributeValueConverter.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AttributeValueConverter.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AttributeValueConverter.java Wed May  6 22:28:49 2015
@@ -21,13 +21,17 @@
 package org.apache.qpid.server.model;
 
 import java.io.IOException;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
 import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Proxy;
 import java.lang.reflect.Type;
 import java.lang.reflect.TypeVariable;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -445,6 +449,10 @@ abstract class AttributeValueConverter<T
         {
             return (AttributeValueConverter<X>) new ConfiguredObjectConverter(type);
         }
+        else if(ManagedAttributeValue.class.isAssignableFrom(type))
+        {
+            return (AttributeValueConverter<X>) new ManageableAttributeTypeConverter(type);
+        }
         else if(Object.class == type)
         {
             return (AttributeValueConverter<X>) OBJECT_CONVERTER;
@@ -452,6 +460,84 @@ abstract class AttributeValueConverter<T
         throw new IllegalArgumentException("Cannot create attribute converter of type " + type.getName());
     }
 
+    static Class<?> getTypeFromMethod(final Method m)
+    {
+        Class<?> type = m.getReturnType();
+        if(type.isPrimitive())
+        {
+            if(type == Boolean.TYPE)
+            {
+                type = Boolean.class;
+            }
+            else if(type == Byte.TYPE)
+            {
+                type = Byte.class;
+            }
+            else if(type == Short.TYPE)
+            {
+                type = Short.class;
+            }
+            else if(type == Integer.TYPE)
+            {
+                type = Integer.class;
+            }
+            else if(type == Long.TYPE)
+            {
+                type = Long.class;
+            }
+            else if(type == Float.TYPE)
+            {
+                type = Float.class;
+            }
+            else if(type == Double.TYPE)
+            {
+                type = Double.class;
+            }
+            else if(type == Character.TYPE)
+            {
+                type = Character.class;
+            }
+        }
+        return type;
+    }
+
+    static String getNameFromMethod(final Method m, final Class<?> type)
+    {
+        String methodName = m.getName();
+        String baseName;
+
+        if(type == Boolean.class )
+        {
+            if((methodName.startsWith("get") || methodName.startsWith("has")) && methodName.length() >= 4)
+            {
+                baseName = methodName.substring(3);
+            }
+            else if(methodName.startsWith("is") && methodName.length() >= 3)
+            {
+                baseName = methodName.substring(2);
+            }
+            else
+            {
+                throw new IllegalArgumentException("Method name " + methodName + " does not conform to the required pattern for ManagedAttributes");
+            }
+        }
+        else
+        {
+            if(methodName.startsWith("get") && methodName.length() >= 4)
+            {
+                baseName = methodName.substring(3);
+            }
+            else
+            {
+                throw new IllegalArgumentException("Method name " + methodName + " does not conform to the required pattern for ManagedAttributes");
+            }
+        }
+
+        String name = baseName.length() == 1 ? baseName.toLowerCase() : baseName.substring(0,1).toLowerCase() + baseName.substring(1);
+        name = name.replace('_','.');
+        return name;
+    }
+
     abstract T convert(Object value, final ConfiguredObject object);
 
     public static class GenericListConverter extends AttributeValueConverter<List>
@@ -776,4 +862,66 @@ abstract class AttributeValueConverter<T
         throw new ServerScopedRuntimeException("Unable to process type when constructing configuration model: " + t);
     }
 
+    static final class ManageableAttributeTypeConverter<X extends ManagedAttributeValue> extends AttributeValueConverter<X>
+    {
+        private final Class<X> _klazz;
+        private final Map<Method, AttributeValueConverter<?>> _propertyConverters = new HashMap<>();
+
+        private ManageableAttributeTypeConverter(final Class<X> klazz)
+        {
+            _klazz = klazz;
+            for(Method method : klazz.getMethods())
+            {
+                final String methodName = method.getName();
+                if(method.getParameterTypes().length == 0
+                   && !Arrays.asList(Object.class.getMethods()).contains(method)
+                   && (methodName.startsWith("get") || methodName.startsWith("is") || methodName.startsWith("has")))
+                {
+                    _propertyConverters.put(method, AttributeValueConverter.getConverter(getTypeFromMethod(method), method.getGenericReturnType()));
+                }
+            }
+
+        }
+
+        @Override
+        X convert(final Object value, final ConfiguredObject object)
+        {
+            if(value == null)
+            {
+                return null;
+            }
+            else if(_klazz.isInstance(value))
+            {
+                return (X) value;
+            }
+            else if(value instanceof Map)
+            {
+                return (X) Proxy.newProxyInstance(_klazz.getClassLoader(), new Class[]{_klazz}, new InvocationHandler()
+                {
+                    @Override
+                    public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable
+                    {
+                        AttributeValueConverter<?> converter = _propertyConverters.get(method);
+                        return converter == null ? null : converter.convert(((Map)value).get(getNameFromMethod(method, getTypeFromMethod(method))), object);
+                    }
+                });
+            }
+            else if(value instanceof String)
+            {
+                String interpolated = AbstractConfiguredObject.interpolate(object, (String) value);
+                ObjectMapper objectMapper = new ObjectMapper();
+                try
+                {
+                    return convert(objectMapper.readValue(interpolated, Map.class), object);
+                }
+                catch (IOException e)
+                {
+
+                }
+
+            }
+            throw new IllegalArgumentException("Cannot convert type " + value.getClass() + " to a " + _klazz.getName());
+        }
+    }
+
 }

Added: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerLogger.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerLogger.java?rev=1678105&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerLogger.java (added)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerLogger.java Wed May  6 22:28:49 2015
@@ -0,0 +1,31 @@
+/*
+ *
+ * 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 ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.Appender;
+
+@ManagedObject
+public interface BrokerLogger<X extends BrokerLogger<X>> extends ConfiguredObject<X>
+{
+
+    Appender<ILoggingEvent> asAppender();
+}

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

Added: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerLoggerFilter.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerLoggerFilter.java?rev=1678105&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerLoggerFilter.java (added)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerLoggerFilter.java Wed May  6 22:28:49 2015
@@ -0,0 +1,30 @@
+/*
+ *
+ * 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 ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.filter.Filter;
+
+@ManagedObject
+public interface BrokerLoggerFilter<X extends BrokerLoggerFilter<X>> extends ConfiguredObject<X>
+{
+    Filter<ILoggingEvent> asFilter();
+}

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

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerModel.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerModel.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerModel.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerModel.java Wed May  6 22:28:49 2015
@@ -46,9 +46,10 @@ public final class BrokerModel extends M
      *     Remove Broker#supportedVirtualHostNodeTypes, #supportedVirtualHostTypes, #supportedAuthenticationProviders,
      *            supportedPreferencesProviderTypes, VH#supportedExchangeTypes, VH#supportedQueueTypes
      *     Renamed FileTrustStore/FileKeyStore.path => FileTrustStore/FileKeyStore.storeUrl
+     * 3.1 Add BrokerLogger as a child of Broker
      */
     public static final int MODEL_MAJOR_VERSION = 3;
-    public static final int MODEL_MINOR_VERSION = 0;
+    public static final int MODEL_MINOR_VERSION = 1;
     public static final String MODEL_VERSION = MODEL_MAJOR_VERSION + "." + MODEL_MINOR_VERSION;
     private static final Model MODEL_INSTANCE = new BrokerModel();
     private final Map<Class<? extends ConfiguredObject>, Collection<Class<? extends ConfiguredObject>>> _parents =
@@ -78,6 +79,9 @@ public final class BrokerModel extends M
         addRelationship(Broker.class, TrustStore.class);
         addRelationship(Broker.class, KeyStore.class);
         addRelationship(Broker.class, Plugin.class);
+        addRelationship(Broker.class, BrokerLogger.class);
+
+        addRelationship(BrokerLogger.class, BrokerLoggerFilter.class);
 
         addRelationship(VirtualHostNode.class, VirtualHost.class);
         addRelationship(VirtualHostNode.class, RemoteReplicationNode.class);
@@ -88,7 +92,6 @@ public final class BrokerModel extends M
 
         addRelationship(Port.class, VirtualHostAlias.class);
 
-
         addRelationship(AuthenticationProvider.class, User.class);
         addRelationship(AuthenticationProvider.class, PreferencesProvider.class);
 

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectAttributeOrStatistic.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectAttributeOrStatistic.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectAttributeOrStatistic.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectAttributeOrStatistic.java Wed May  6 22:28:49 2015
@@ -37,90 +37,12 @@ abstract class ConfiguredObjectAttribute
     {
 
         _getter = getter;
-        _type = (Class<T>) getTypeFromMethod(getter);
-        _name = getNameFromMethod(getter, getType());
+        _type = (Class<T>) AttributeValueConverter.getTypeFromMethod(getter);
+        _name = AttributeValueConverter.getNameFromMethod(getter, getType());
         _converter = AttributeValueConverter.getConverter(getType(), getter.getGenericReturnType());
 
     }
 
-    private static String getNameFromMethod(final Method m, final Class<?> type)
-    {
-        String methodName = m.getName();
-        String baseName;
-
-        if(type == Boolean.class )
-        {
-            if((methodName.startsWith("get") || methodName.startsWith("has")) && methodName.length() >= 4)
-            {
-                baseName = methodName.substring(3);
-            }
-            else if(methodName.startsWith("is") && methodName.length() >= 3)
-            {
-                baseName = methodName.substring(2);
-            }
-            else
-            {
-                throw new IllegalArgumentException("Method name " + methodName + " does not conform to the required pattern for ManagedAttributes");
-            }
-        }
-        else
-        {
-            if(methodName.startsWith("get") && methodName.length() >= 4)
-            {
-                baseName = methodName.substring(3);
-            }
-            else
-            {
-                throw new IllegalArgumentException("Method name " + methodName + " does not conform to the required pattern for ManagedAttributes");
-            }
-        }
-
-        String name = baseName.length() == 1 ? baseName.toLowerCase() : baseName.substring(0,1).toLowerCase() + baseName.substring(1);
-        name = name.replace('_','.');
-        return name;
-    }
-
-    private static Class<?> getTypeFromMethod(final Method m)
-    {
-        Class<?> type = m.getReturnType();
-        if(type.isPrimitive())
-        {
-            if(type == Boolean.TYPE)
-            {
-                type = Boolean.class;
-            }
-            else if(type == Byte.TYPE)
-            {
-                type = Byte.class;
-            }
-            else if(type == Short.TYPE)
-            {
-                type = Short.class;
-            }
-            else if(type == Integer.TYPE)
-            {
-                type = Integer.class;
-            }
-            else if(type == Long.TYPE)
-            {
-                type = Long.class;
-            }
-            else if(type == Float.TYPE)
-            {
-                type = Float.class;
-            }
-            else if(type == Double.TYPE)
-            {
-                type = Double.class;
-            }
-            else if(type == Character.TYPE)
-            {
-                type = Character.class;
-            }
-        }
-        return type;
-    }
-
     public String getName()
     {
         return _name;

Added: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectJacksonModule.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectJacksonModule.java?rev=1678105&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectJacksonModule.java (added)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectJacksonModule.java Wed May  6 22:28:49 2015
@@ -0,0 +1,127 @@
+/*
+ *
+ * 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.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.codehaus.jackson.JsonGenerator;
+import org.codehaus.jackson.Version;
+import org.codehaus.jackson.map.JsonSerializer;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.SerializerProvider;
+import org.codehaus.jackson.map.module.SimpleModule;
+
+import org.apache.qpid.server.util.ServerScopedRuntimeException;
+
+public class ConfiguredObjectJacksonModule extends SimpleModule
+{
+    private static final ConfiguredObjectJacksonModule INSTANCE = new ConfiguredObjectJacksonModule();
+
+    private static final Set<String> OBJECT_METHOD_NAMES = Collections.synchronizedSet(new HashSet<String>());
+    static
+    {
+        for(Method method : Object.class.getMethods())
+        {
+            OBJECT_METHOD_NAMES.add(method.getName());
+        }
+    }
+
+    private  ConfiguredObjectJacksonModule()
+    {
+        super("ConfiguredObjectSerializer", new Version(1,0,0,null));
+        addConfiguredObjectSerializer();
+        addManageableAttributeTypeSerializer();
+    }
+
+    private void addManageableAttributeTypeSerializer()
+    {
+        final JsonSerializer<ManagedAttributeValue> serializer = new JsonSerializer<ManagedAttributeValue>()
+        {
+            @Override
+            public void serialize(final ManagedAttributeValue value,
+                                  final JsonGenerator jgen,
+                                  final SerializerProvider provider)
+                    throws IOException
+            {
+                Map<String,Object> valueAsMap = new LinkedHashMap<>();
+                for(Method method : value.getClass().getMethods())
+                {
+                    final String methodName = method.getName();
+                    if(method.getParameterTypes().length == 0
+                       && !OBJECT_METHOD_NAMES.contains(methodName)
+                       && (methodName.startsWith("is")
+                            || methodName.startsWith("has")
+                            || methodName.startsWith("get")))
+                    {
+                        String propertyName =
+                                methodName.startsWith("is") ? methodName.substring(2) : methodName.substring(3);
+                        propertyName = Character.toLowerCase(propertyName.charAt(0)) + propertyName.substring(1);
+                        try
+                        {
+                            final Object attrValue = method.invoke(value);
+                            if(attrValue != null)
+                            {
+                                valueAsMap.put(propertyName, attrValue);
+                            }
+                        }
+                        catch (IllegalAccessException | InvocationTargetException e)
+                        {
+                            throw new ServerScopedRuntimeException(e);
+                        }
+                    }
+                }
+                jgen.writeObject(valueAsMap);
+            }
+        };
+        addSerializer(ManagedAttributeValue.class, serializer);
+    }
+
+    private void addConfiguredObjectSerializer()
+    {
+        final JsonSerializer<ConfiguredObject> serializer = new JsonSerializer<ConfiguredObject>()
+        {
+            @Override
+            public void serialize(final ConfiguredObject value,
+                                  final JsonGenerator jgen,
+                                  final SerializerProvider provider)
+                    throws IOException
+            {
+                jgen.writeString(value.getId().toString());
+            }
+        };
+        addSerializer(ConfiguredObject.class, serializer);
+    }
+
+    public static ObjectMapper newObjectMapper()
+    {
+        final ObjectMapper objectMapper = new ObjectMapper();
+        objectMapper.registerModule(INSTANCE);
+        return objectMapper;
+    }
+
+}

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

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/JsonSystemConfigImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/JsonSystemConfigImpl.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/JsonSystemConfigImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/JsonSystemConfigImpl.java Wed May  6 22:28:49 2015
@@ -38,10 +38,9 @@ public class JsonSystemConfigImpl extend
     @SystemConfigFactoryConstructor
     public JsonSystemConfigImpl(final TaskExecutor taskExecutor,
                                 final EventLogger eventLogger,
-                                final LogRecorder logRecorder,
-                                final Map<String,Object> attributes)
+                                final Map<String, Object> attributes)
     {
-        super(taskExecutor, eventLogger, logRecorder, attributes);
+        super(taskExecutor, eventLogger, attributes);
     }
 
     public String getStorePath()

Added: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ManagedAttributeValue.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ManagedAttributeValue.java?rev=1678105&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ManagedAttributeValue.java (added)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ManagedAttributeValue.java Wed May  6 22:28:49 2015
@@ -0,0 +1,25 @@
+/*
+ *
+ * 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;
+
+public interface ManagedAttributeValue
+{
+}

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

Added: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ManagedAttributeValueType.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ManagedAttributeValueType.java?rev=1678105&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ManagedAttributeValueType.java (added)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ManagedAttributeValueType.java Wed May  6 22:28:49 2015
@@ -0,0 +1,31 @@
+package org.apache.qpid.server.model;/*
+ *
+ * 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.
+ *
+ */
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface ManagedAttributeValueType
+{
+}

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

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/SystemConfig.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/SystemConfig.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/SystemConfig.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/SystemConfig.java Wed May  6 22:28:49 2015
@@ -69,8 +69,6 @@ public interface SystemConfig<X extends
 
     Broker getBroker();
 
-    LogRecorder getLogRecorder();
-
     DurableConfigurationStore getConfigurationStore();
 
 }

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java Wed May  6 22:28:49 2015
@@ -33,6 +33,10 @@ import java.util.regex.Pattern;
 
 import javax.security.auth.Subject;
 
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.Appender;
+import ch.qos.logback.core.FileAppender;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.SettableFuture;
@@ -42,8 +46,10 @@ import org.slf4j.LoggerFactory;
 import org.apache.qpid.common.QpidProperties;
 import org.apache.qpid.server.BrokerOptions;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
+import org.apache.qpid.server.logging.BrokerMemoryLogger;
 import org.apache.qpid.server.logging.EventLogger;
 import org.apache.qpid.server.logging.LogRecorder;
+import org.apache.qpid.server.logging.RecordEventAppender;
 import org.apache.qpid.server.logging.messages.BrokerMessages;
 import org.apache.qpid.server.logging.messages.VirtualHostMessages;
 import org.apache.qpid.server.model.*;
@@ -55,6 +61,7 @@ import org.apache.qpid.server.security.S
 import org.apache.qpid.server.security.auth.manager.SimpleAuthenticationManager;
 import org.apache.qpid.server.stats.StatisticsCounter;
 import org.apache.qpid.server.stats.StatisticsGatherer;
+import org.apache.qpid.server.store.FileBasedSettings;
 import org.apache.qpid.server.virtualhost.VirtualHostImpl;
 import org.apache.qpid.server.virtualhost.VirtualHostPropertiesNodeCreator;
 import org.apache.qpid.util.SystemUtils;
@@ -74,7 +81,7 @@ public class BrokerAdapter extends Abstr
 
     private SystemConfig<?> _parent;
     private EventLogger _eventLogger;
-    private final LogRecorder _logRecorder;
+    private LogRecorder _logRecorder;
 
     private final SecurityManager _securityManager;
 
@@ -104,6 +111,7 @@ public class BrokerAdapter extends Abstr
     private String _confidentialConfigurationEncryptionProvider;
 
     private final boolean _virtualHostPropertiesNodeEnabled;
+    private FileAppender<ILoggingEvent> _logFileAppender;
 
     @ManagedObjectFactoryConstructor
     public BrokerAdapter(Map<String, Object> attributes,
@@ -111,7 +119,6 @@ public class BrokerAdapter extends Abstr
     {
         super(parentsMap(parent), attributes);
         _parent = parent;
-        _logRecorder = parent.getLogRecorder();
         _eventLogger = parent.getEventLogger();
         _securityManager = new SecurityManager(this, parent.isManagementMode());
         if (parent.isManagementMode())
@@ -153,6 +160,34 @@ public class BrokerAdapter extends Abstr
 
     }
 
+    @Override
+    protected void postResolveChildren()
+    {
+        super.postResolveChildren();
+
+
+        ch.qos.logback.classic.Logger rootLogger =
+                (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
+        rootLogger.setLevel(Level.ALL);
+        Collection<BrokerLogger> loggers = getChildren(BrokerLogger.class);
+        for(BrokerLogger<?> logger : loggers)
+        {
+            final Appender<ILoggingEvent> appender = logger.asAppender();
+            rootLogger.addAppender(appender);
+            if(_logRecorder == null && logger instanceof BrokerMemoryLogger)
+            {
+                _logRecorder = new LogRecorder((RecordEventAppender) appender);
+            }
+
+        }
+
+        final SystemConfig parent = getParent(SystemConfig.class);
+        _eventLogger.message(BrokerMessages.CONFIG(parent instanceof FileBasedSettings
+                                                           ? ((FileBasedSettings) parent).getStorePath()
+                                                           : "N/A"));
+
+    }
+
     public void onValidate()
     {
         super.onValidate();
@@ -475,26 +510,24 @@ public class BrokerAdapter extends Abstr
     protected void onOpen()
     {
         super.onOpen();
-        assignTargetSizes();
-    }
+        getEventLogger().message(BrokerMessages.STARTUP(QpidProperties.getReleaseVersion(),
+                                                        QpidProperties.getBuildVersion()));
 
-    public AuthenticationProvider<?> findAuthenticationProviderByName(String authenticationProviderName)
-    {
-        if (isManagementMode())
+        getEventLogger().message(BrokerMessages.PLATFORM(System.getProperty("java.vendor"),
+                                                         System.getProperty("java.runtime.version",
+                                                                            System.getProperty("java.version")),
+                                                         SystemUtils.getOSName(),
+                                                         SystemUtils.getOSVersion(),
+                                                         SystemUtils.getOSArch()));
+
+        getEventLogger().message(BrokerMessages.MAX_MEMORY(Runtime.getRuntime().maxMemory()));
+
+        if (SystemUtils.getProcessPid() != null)
         {
-            return _managementModeAuthenticationProvider;
+            getEventLogger().message(BrokerMessages.PROCESS(SystemUtils.getProcessPid()));
         }
-        return getChildByName(AuthenticationProvider.class, authenticationProviderName);
-    }
-
-    public KeyStore<?> findKeyStoreByName(String keyStoreName)
-    {
-        return getChildByName(KeyStore.class, keyStoreName);
-    }
 
-    public TrustStore<?> findTrustStoreByName(String trustStoreName)
-    {
-        return getChildByName(TrustStore.class, trustStoreName);
+        assignTargetSizes();
     }
 
     @Override
@@ -575,11 +608,27 @@ public class BrokerAdapter extends Abstr
     @Override
     protected void onClose()
     {
-
         if (_reportingTimer != null)
         {
             _reportingTimer.cancel();
         }
+
+        _eventLogger.message(BrokerMessages.STOPPED());
+
+        if(_logRecorder != null)
+        {
+            _logRecorder.closeLogRecorder();
+        }
+        if(_logFileAppender != null)
+        {
+
+            ch.qos.logback.classic.Logger rootLogger =
+                    (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
+            rootLogger.detachAppender(_logFileAppender);
+            _logFileAppender.stop();
+
+        }
+
     }
     @Override
     public SecurityManager getSecurityManager()

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/plugin/SystemConfigFactory.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/plugin/SystemConfigFactory.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/plugin/SystemConfigFactory.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/plugin/SystemConfigFactory.java Wed May  6 22:28:49 2015
@@ -31,6 +31,5 @@ public interface SystemConfigFactory<X e
 {
     public X newInstance(final TaskExecutor taskExecutor,
                          final EventLogger eventLogger,
-                         final LogRecorder logRecorder,
-                         final Map<String,Object> options);
+                         final Map<String, Object> options);
 }

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/stats/StatisticsCounter.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/stats/StatisticsCounter.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/stats/StatisticsCounter.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/stats/StatisticsCounter.java Wed May  6 22:28:49 2015
@@ -62,13 +62,11 @@ public class StatisticsCounter
     {
         _period = period;
         _name = name + "-" + + _counterIds.incrementAndGet();
-        reset();
+
+        _start = System.currentTimeMillis();
+        _last = _start / _period;
     }
     
-    public void registerEvent()
-    {
-        registerEvent(1L);
-    }
 
     public void registerEvent(long value)
     {

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/AbstractJDBCConfigurationStore.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/AbstractJDBCConfigurationStore.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/AbstractJDBCConfigurationStore.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/AbstractJDBCConfigurationStore.java Wed May  6 22:28:49 2015
@@ -40,19 +40,13 @@ import java.util.Set;
 import java.util.UUID;
 
 import org.codehaus.jackson.JsonGenerationException;
-import org.codehaus.jackson.JsonGenerator;
 import org.codehaus.jackson.JsonParseException;
-import org.codehaus.jackson.JsonProcessingException;
-import org.codehaus.jackson.Version;
 import org.codehaus.jackson.map.JsonMappingException;
-import org.codehaus.jackson.map.JsonSerializer;
-import org.codehaus.jackson.map.Module;
 import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jackson.map.SerializerProvider;
-import org.codehaus.jackson.map.module.SimpleModule;
 import org.slf4j.Logger;
 
 import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.ConfiguredObjectJacksonModule;
 import org.apache.qpid.server.model.UUIDGenerator;
 import org.apache.qpid.server.store.handler.ConfiguredObjectRecordHandler;
 
@@ -88,27 +82,6 @@ public abstract class AbstractJDBCConfig
                                                                           + " where child_id = ?";
     private static final String SELECT_FROM_CONFIGURED_OBJECT_HIERARCHY = "SELECT child_id, parent_type, parent_id FROM " + CONFIGURED_OBJECT_HIERARCHY_TABLE_NAME;
 
-    private static final Module _module;
-    static
-    {
-        SimpleModule module= new SimpleModule("ConfiguredObjectSerializer", new Version(1,0,0,null));
-
-        final JsonSerializer<ConfiguredObject> serializer = new JsonSerializer<ConfiguredObject>()
-        {
-            @Override
-            public void serialize(final ConfiguredObject value,
-                                  final JsonGenerator jgen,
-                                  final SerializerProvider provider)
-                    throws IOException, JsonProcessingException
-            {
-                jgen.writeString(value.getId().toString());
-            }
-        };
-        module.addSerializer(ConfiguredObject.class, serializer);
-
-        _module = module;
-    }
-
     @Override
     public void visitConfiguredObjectRecords(ConfiguredObjectRecordHandler handler)
     {
@@ -305,8 +278,7 @@ public abstract class AbstractJDBCConfig
 
             Map<UUID,Map<String,Object>> bindingsToUpdate = new HashMap<UUID, Map<String, Object>>();
             List<UUID> others = new ArrayList<UUID>();
-            final ObjectMapper objectMapper = new ObjectMapper();
-            objectMapper.registerModule(_module);
+            final ObjectMapper objectMapper = ConfiguredObjectJacksonModule.newObjectMapper();
 
             PreparedStatement stmt = connection.prepareStatement(SELECT_FROM_CONFIGURED_OBJECTS);
             try
@@ -673,8 +645,7 @@ public abstract class AbstractJDBCConfig
                         else
                         {
                             final Map<String, Object> attributes = configuredObject.getAttributes();
-                            final ObjectMapper objectMapper = new ObjectMapper();
-                            objectMapper.registerModule(_module);
+                            final ObjectMapper objectMapper = ConfiguredObjectJacksonModule.newObjectMapper();
                             byte[] attributesAsBytes = objectMapper.writeValueAsBytes(attributes);
 
                             ByteArrayInputStream bis = new ByteArrayInputStream(attributesAsBytes);
@@ -812,8 +783,8 @@ public abstract class AbstractJDBCConfig
             ResultSet rs = stmt.executeQuery();
             try
             {
-                final ObjectMapper objectMapper = new ObjectMapper();
-                objectMapper.registerModule(_module);
+
+                final ObjectMapper objectMapper = ConfiguredObjectJacksonModule.newObjectMapper();
                 if (rs.next())
                 {
                     PreparedStatement stmt2 = conn.prepareStatement(UPDATE_CONFIGURED_OBJECTS);

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecoverer.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecoverer.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecoverer.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecoverer.java Wed May  6 22:28:49 2015
@@ -31,6 +31,7 @@ import java.util.UUID;
 
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.configuration.store.StoreConfigurationChangeListener;
+import org.apache.qpid.server.logging.LogLevel;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.ConfiguredObject;
 import org.apache.qpid.server.model.Port;
@@ -55,6 +56,8 @@ public class BrokerStoreUpgraderAndRecov
         register(new Upgrader_1_2_to_1_3());
         register(new Upgrader_1_3_to_2_0());
         register(new Upgrader_2_0_to_3_0());
+
+        register(new Upgrader_3_0_to_3_1());
     }
 
     private void register(StoreUpgraderPhase upgrader)
@@ -302,6 +305,86 @@ public class BrokerStoreUpgraderAndRecov
         }
 
         @Override
+        public void complete()
+        {
+            getNextUpgrader().complete();
+        }
+
+    }
+    private class Upgrader_3_0_to_3_1 extends StoreUpgraderPhase
+    {
+        public Upgrader_3_0_to_3_1()
+        {
+            super("modelVersion", "3.0", "3.1");
+        }
+
+        @Override
+        public void configuredObject(ConfiguredObjectRecord record)
+        {
+            if (record.getType().equals("Broker"))
+            {
+                record = upgradeRootRecord(record);
+                addMemoryLogger(record);
+                addFileLogger(record);
+                getNextUpgrader().configuredObject(record);
+
+            }
+
+        }
+
+        private void addMemoryLogger(final ConfiguredObjectRecord record)
+        {
+            Map<String,Object> attributes = new HashMap<>();
+            attributes.put("name", "memory");
+            attributes.put("type", "Memory");
+            final ConfiguredObjectRecord memoryLogger = new ConfiguredObjectRecordImpl(UUID.randomUUID(),
+                                                                                 "BrokerLogger",
+                                                                                 attributes,
+                                                                                 Collections.singletonMap("Broker",
+                                                                                                          record.getId()));
+            addNameValueFilter(1, memoryLogger, LogLevel.INFO, "");
+            getUpdateMap().put(memoryLogger.getId(), memoryLogger);
+            getNextUpgrader().configuredObject(memoryLogger);
+        }
+
+        private void addFileLogger(final ConfiguredObjectRecord record)
+        {
+            Map<String,Object> attributes = new HashMap<>();
+            attributes.put("name", "file");
+            attributes.put("type", "File");
+
+            final ConfiguredObjectRecord fileLogger = new ConfiguredObjectRecordImpl(UUID.randomUUID(),
+                                                                                       "BrokerLogger",
+                                                                                       attributes,
+                                                                                       Collections.singletonMap("Broker",
+                                                                                                                record.getId()));
+            addNameValueFilter(1, fileLogger, LogLevel.INFO, "");
+            getUpdateMap().put(fileLogger.getId(), fileLogger);
+            getNextUpgrader().configuredObject(fileLogger);
+        }
+        private void addNameValueFilter(int seqNo,
+                                        final ConfiguredObjectRecord loggerRecord,
+                                        final LogLevel level,
+                                        final String loggerName)
+        {
+            Map<String,Object> attributes = new HashMap<>();
+            attributes.put("name", String.valueOf(seqNo));
+            attributes.put("logLevel", level.name());
+            attributes.put("loggerName", loggerName);
+            attributes.put("type", "NameAndLevel");
+
+
+            final ConfiguredObjectRecord filterRecord = new ConfiguredObjectRecordImpl(UUID.randomUUID(),
+                                                                                       "BrokerLoggerFilter",
+                                                                                       attributes,
+                                                                                       Collections.singletonMap("BrokerLogger",
+                                                                                                                loggerRecord.getId()));
+            getUpdateMap().put(filterRecord.getId(), filterRecord);
+            getNextUpgrader().configuredObject(filterRecord);
+
+        }
+
+        @Override
         public void complete()
         {
             getNextUpgrader().complete();

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java Wed May  6 22:28:49 2015
@@ -41,20 +41,14 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
-import org.codehaus.jackson.JsonGenerator;
-import org.codehaus.jackson.JsonProcessingException;
-import org.codehaus.jackson.Version;
-import org.codehaus.jackson.map.JsonSerializer;
-import org.codehaus.jackson.map.Module;
 import org.codehaus.jackson.map.ObjectMapper;
 import org.codehaus.jackson.map.SerializationConfig;
-import org.codehaus.jackson.map.SerializerProvider;
-import org.codehaus.jackson.map.module.SimpleModule;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.qpid.server.configuration.BrokerProperties;
 import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.ConfiguredObjectJacksonModule;
 import org.apache.qpid.server.model.Model;
 import org.apache.qpid.server.store.handler.ConfiguredObjectRecordHandler;
 import org.apache.qpid.server.util.BaseAction;
@@ -89,7 +83,7 @@ public class JsonFileConfigStore impleme
 
     private final Map<UUID, ConfiguredObjectRecord> _objectsById = new HashMap<UUID, ConfiguredObjectRecord>();
     private final Map<String, List<UUID>> _idsByType = new HashMap<String, List<UUID>>();
-    private final ObjectMapper _objectMapper = new ObjectMapper();
+    private final ObjectMapper _objectMapper;
     private final Class<? extends ConfiguredObject> _rootClass;
     private final FileHelper _fileHelper;
 
@@ -102,32 +96,12 @@ public class JsonFileConfigStore impleme
     private String _tempFileName;
     private String _lockFileName;
 
-    private static final Module _module;
-    static
-    {
-        SimpleModule module= new SimpleModule("ConfiguredObjectSerializer", new Version(1,0,0,null));
-
-        final JsonSerializer<ConfiguredObject> serializer = new JsonSerializer<ConfiguredObject>()
-        {
-            @Override
-            public void serialize(final ConfiguredObject value,
-                                  final JsonGenerator jgen,
-                                  final SerializerProvider provider)
-                    throws IOException, JsonProcessingException
-            {
-                jgen.writeString(value.getId().toString());
-            }
-        };
-        module.addSerializer(ConfiguredObject.class, serializer);
-
-        _module = module;
-    }
-
     private ConfiguredObject<?> _parent;
 
     public JsonFileConfigStore(Class<? extends ConfiguredObject> rootClass)
     {
-        _objectMapper.registerModule(_module);
+
+        _objectMapper = ConfiguredObjectJacksonModule.newObjectMapper();
         _objectMapper.enable(SerializationConfig.Feature.INDENT_OUTPUT);
         _rootClass = rootClass;
         _fileHelper = new FileHelper();

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/VirtualHostStoreUpgraderAndRecoverer.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/VirtualHostStoreUpgraderAndRecoverer.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/VirtualHostStoreUpgraderAndRecoverer.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/VirtualHostStoreUpgraderAndRecoverer.java Wed May  6 22:28:49 2015
@@ -71,6 +71,7 @@ public class VirtualHostStoreUpgraderAnd
         register(new Upgrader_0_3_to_0_4());
         register(new Upgrader_0_4_to_2_0());
         register(new Upgrader_2_0_to_3_0());
+        register(new Upgrader_3_0_to_3_1());
 
         Map<String, UUID> defaultExchangeIds = new HashMap<String, UUID>();
         for (String exchangeName : DEFAULT_EXCHANGES.keySet())
@@ -335,7 +336,7 @@ public class VirtualHostStoreUpgraderAnd
                 }
                 if(!record.getAttributes().containsKey("durable"))
                 {
-                    newAttributes.put("durable","true");
+                    newAttributes.put("durable", "true");
                 }
 
                 record = new ConfiguredObjectRecordImpl(record.getId(),record.getType(),newAttributes, record.getParents());
@@ -498,6 +499,31 @@ public class VirtualHostStoreUpgraderAnd
         }
 
         @Override
+        public void configuredObject(ConfiguredObjectRecord record)
+        {
+
+            if("VirtualHost".equals(record.getType()))
+            {
+                record = upgradeRootRecord(record);
+            }
+            getNextUpgrader().configuredObject(record);
+        }
+
+        @Override
+        public void complete()
+        {
+            getNextUpgrader().complete();
+        }
+
+    }
+    private class Upgrader_3_0_to_3_1 extends StoreUpgraderPhase
+    {
+        public Upgrader_3_0_to_3_1()
+        {
+            super("modelVersion", "3.0", "3.1");
+        }
+
+        @Override
         public void configuredObject(ConfiguredObjectRecord record)
         {
 

Modified: qpid/java/trunk/broker-core/src/main/resources/initial-config.json
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/resources/initial-config.json?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/resources/initial-config.json (original)
+++ qpid/java/trunk/broker-core/src/main/resources/initial-config.json Wed May  6 22:28:49 2015
@@ -20,7 +20,7 @@
  */
 {
   "name": "${broker.name}",
-  "modelVersion": "3.0",
+  "modelVersion": "3.1",
   "defaultVirtualHost" : "default",
   "authenticationproviders" : [ {
     "name" : "passwordFile",
@@ -32,6 +32,32 @@
         "path" : "${qpid.work_dir}${file.separator}user.preferences.json"
     }]
   } ],
+    "brokerLoggers" : [ {
+    "name" : "logfile",
+    "type" : "File",
+    "fileName" : "${qpid.work_dir}${file.separator}log${file.separator}qpid.log",
+    "rollDaily" : false,
+    "rollOnRestart" : true,
+    "compressOldFiles" : false,
+    "maxFileSize" : "200mb",
+    "maxHistory" : 1,
+    "filters" : [ {
+      "name" : "1",
+      "type" : "NameAndLevel",
+      "logLevel" : "INFO", 
+      "loggerName" : "" 
+    } ]
+  }, {
+    "name" : "memory",
+    "type" : "Memory",
+    "maxRecords" : 4096,
+    "filters" : [ {          
+      "name" : "1",
+      "type" : "NameAndLevel",
+      "logLevel" : "INFO", 
+      "loggerName" : "" 
+    } ]
+  } ],
   "ports" : [  {
     "name" : "AMQP",
     "port" : "${qpid.amqp_port}",

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandlerTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandlerTest.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandlerTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandlerTest.java Wed May  6 22:28:49 2015
@@ -43,7 +43,6 @@ import org.apache.qpid.server.configurat
 import org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor;
 import org.apache.qpid.server.configuration.updater.TaskExecutor;
 import org.apache.qpid.server.logging.EventLogger;
-import org.apache.qpid.server.logging.LogRecorder;
 import org.apache.qpid.server.model.AbstractSystemConfig;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.ConfiguredObject;
@@ -80,7 +79,7 @@ public class ManagementModeStoreHandlerT
         _taskExecutor.start();
 
         _systemConfig = new JsonSystemConfigImpl(_taskExecutor, mock(EventLogger.class),
-                                               mock(LogRecorder.class), new BrokerOptions().convertToSystemConfigAttributes());
+                                                 new BrokerOptions().convertToSystemConfigAttributes());
 
 
         ConfiguredObjectRecord systemContextRecord = _systemConfig.asObjectRecord();
@@ -125,7 +124,6 @@ public class ManagementModeStoreHandlerT
         attributes.put(ConfiguredObject.DESIRED_STATE, State.QUIESCED);
         _systemConfig = new AbstractSystemConfig(_taskExecutor,
                                                  mock(EventLogger.class),
-                                                 mock(LogRecorder.class),
                                                  attributes)
         {
             @Override

Added: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/ConfiguredObjectJacksonModuleTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/ConfiguredObjectJacksonModuleTest.java?rev=1678105&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/ConfiguredObjectJacksonModuleTest.java (added)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/ConfiguredObjectJacksonModuleTest.java Wed May  6 22:28:49 2015
@@ -0,0 +1,80 @@
+/*
+ *
+ * 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.util.Collections;
+import java.util.Map;
+
+import org.codehaus.jackson.map.ObjectMapper;
+
+import org.apache.qpid.test.utils.QpidTestCase;
+
+public class ConfiguredObjectJacksonModuleTest extends QpidTestCase
+{
+    public void testManageableAttributeType() throws IOException
+    {
+        ManagedAttributeValue testType = new TestManagedAttributeValue();
+
+        ObjectMapper encoder = ConfiguredObjectJacksonModule.newObjectMapper();
+        String encodedValue = encoder.writeValueAsString(testType);
+        ObjectMapper decoder = new ObjectMapper();
+        Map decodedMap = decoder.readValue(encodedValue, Map.class);
+        assertEquals(3, decodedMap.size());
+        assertTrue(decodedMap.containsKey("name"));
+        assertTrue(decodedMap.containsKey("map"));
+        assertTrue(decodedMap.containsKey("type"));
+        assertEquals("foo", decodedMap.get("name"));
+        assertEquals(Collections.singletonMap("key","value"), decodedMap.get("map"));
+        assertEquals(Collections.singletonMap("nested",true), decodedMap.get("type"));
+
+    }
+
+    @ManagedAttributeValueType
+    private static class TestManagedAttributeValue implements ManagedAttributeValue
+    {
+        public String getName()
+        {
+            return "foo";
+        }
+
+        public Map<String,String> getMap()
+        {
+            return Collections.singletonMap("key", "value");
+        }
+
+        public NestedManagedAttributeValue getType()
+        {
+            return new NestedManagedAttributeValue();
+        }
+
+
+    }
+
+    @ManagedAttributeValueType
+    private static class NestedManagedAttributeValue implements ManagedAttributeValue
+    {
+        public boolean isNested()
+        {
+            return true;
+        }
+    }
+}

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

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/store/BrokerRecovererTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/store/BrokerRecovererTest.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/store/BrokerRecovererTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/store/BrokerRecovererTest.java Wed May  6 22:28:49 2015
@@ -35,7 +35,6 @@ import org.apache.qpid.server.BrokerOpti
 import org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor;
 import org.apache.qpid.server.configuration.updater.TaskExecutor;
 import org.apache.qpid.server.logging.EventLogger;
-import org.apache.qpid.server.logging.LogRecorder;
 import org.apache.qpid.server.model.AuthenticationProvider;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.BrokerModel;
@@ -64,8 +63,8 @@ public class BrokerRecovererTest extends
         _taskExecutor = new CurrentThreadTaskExecutor();
         _taskExecutor.start();
         _systemConfig = new JsonSystemConfigImpl(_taskExecutor,
-                                               mock(EventLogger.class), mock(LogRecorder.class),
-                                               new BrokerOptions().convertToSystemConfigAttributes());
+                                               mock(EventLogger.class),
+                                                 new BrokerOptions().convertToSystemConfigAttributes());
 
         when(_brokerEntry.getId()).thenReturn(_brokerId);
         when(_brokerEntry.getType()).thenReturn(Broker.class.getSimpleName());

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecovererTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecovererTest.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecovererTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecovererTest.java Wed May  6 22:28:49 2015
@@ -33,7 +33,6 @@ import java.util.UUID;
 import org.apache.qpid.server.BrokerOptions;
 import org.apache.qpid.server.configuration.updater.CurrentThreadTaskExecutor;
 import org.apache.qpid.server.logging.EventLogger;
-import org.apache.qpid.server.logging.LogRecorder;
 import org.apache.qpid.server.model.BrokerModel;
 import org.apache.qpid.server.model.ConfiguredObject;
 import org.apache.qpid.server.model.JsonSystemConfigImpl;
@@ -79,8 +78,7 @@ public class BrokerStoreUpgraderAndRecov
         _taskExecutor.start();
         _systemConfig = new JsonSystemConfigImpl(_taskExecutor,
                                                mock(EventLogger.class),
-                                               mock(LogRecorder.class),
-                                               new BrokerOptions().convertToSystemConfigAttributes());
+                                                 new BrokerOptions().convertToSystemConfigAttributes());
     }
 
     public void testUpgradeVirtualHostWithJDBCStoreAndBoneCPPool()

Modified: qpid/java/trunk/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbySystemConfigImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbySystemConfigImpl.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbySystemConfigImpl.java (original)
+++ qpid/java/trunk/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbySystemConfigImpl.java Wed May  6 22:28:49 2015
@@ -47,10 +47,9 @@ public class DerbySystemConfigImpl exten
     @SystemConfigFactoryConstructor
     public DerbySystemConfigImpl(final TaskExecutor taskExecutor,
                                  final EventLogger eventLogger,
-                                 final LogRecorder logRecorder,
-                                 final Map<String,Object> attributes)
+                                 final Map<String, Object> attributes)
     {
-        super(taskExecutor, eventLogger, logRecorder, attributes);
+        super(taskExecutor, eventLogger, attributes);
     }
 
     @Override

Modified: qpid/java/trunk/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCSystemConfigImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCSystemConfigImpl.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCSystemConfigImpl.java (original)
+++ qpid/java/trunk/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCSystemConfigImpl.java Wed May  6 22:28:49 2015
@@ -49,10 +49,9 @@ public class JDBCSystemConfigImpl extend
     @SystemConfigFactoryConstructor
     public JDBCSystemConfigImpl(final TaskExecutor taskExecutor,
                                 final EventLogger eventLogger,
-                                final LogRecorder logRecorder,
-                                final Map<String,Object> attributes)
+                                final Map<String, Object> attributes)
     {
-        super(taskExecutor, eventLogger, logRecorder, attributes);
+        super(taskExecutor, eventLogger, attributes);
     }
 
     @Override

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/LogRecordsServlet.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/LogRecordsServlet.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/LogRecordsServlet.java (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/LogRecordsServlet.java Wed May  6 22:28:49 2015
@@ -30,6 +30,7 @@ import javax.servlet.http.HttpServletRes
 import org.codehaus.jackson.map.ObjectMapper;
 import org.codehaus.jackson.map.SerializationConfig;
 
+import org.apache.qpid.server.logging.LogRecord;
 import org.apache.qpid.server.logging.LogRecorder;
 
 public class LogRecordsServlet extends AbstractServlet
@@ -72,7 +73,7 @@ public class LogRecordsServlet extends A
         List<Map<String,Object>> logRecords = new ArrayList<Map<String, Object>>();
 
         LogRecorder logRecorder = getBroker().getLogRecorder();
-        for(LogRecorder.Record record : logRecorder)
+        for(LogRecord record : logRecorder)
         {
             if (record.getId() > lastLogId)
             {
@@ -89,7 +90,7 @@ public class LogRecordsServlet extends A
 
     }
 
-    private Map<String, Object> logRecordToObject(LogRecorder.Record record)
+    private Map<String, Object> logRecordToObject(LogRecord record)
     {
         Map<String, Object> recordMap = new LinkedHashMap<String, Object>();
         recordMap.put("id",record.getId());

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java Wed May  6 22:28:49 2015
@@ -38,6 +38,7 @@ import javax.servlet.http.HttpServletRes
 import javax.servlet.http.Part;
 
 import org.apache.qpid.server.model.AbstractConfiguredObject;
+import org.apache.qpid.server.model.ConfiguredObjectJacksonModule;
 import org.apache.qpid.server.model.IllegalStateTransitionException;
 import org.apache.qpid.server.model.IntegrityViolationException;
 import org.apache.qpid.server.virtualhost.ExchangeExistsException;
@@ -383,7 +384,7 @@ public class RestServlet extends Abstrac
 
 
         Writer writer = getOutputWriter(request, response);
-        ObjectMapper mapper = new ObjectMapper();
+        ObjectMapper mapper = ConfiguredObjectJacksonModule.newObjectMapper();
         mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
         mapper.writeValue(writer, extractInitialConfig && output.size() == 1 ? output.get(0) : output);
     }

Modified: qpid/java/trunk/broker-plugins/memory-store/src/main/java/org/apache/qpid/server/store/MemorySystemConfigImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/memory-store/src/main/java/org/apache/qpid/server/store/MemorySystemConfigImpl.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/memory-store/src/main/java/org/apache/qpid/server/store/MemorySystemConfigImpl.java (original)
+++ qpid/java/trunk/broker-plugins/memory-store/src/main/java/org/apache/qpid/server/store/MemorySystemConfigImpl.java Wed May  6 22:28:49 2015
@@ -39,10 +39,9 @@ public class MemorySystemConfigImpl exte
     @SystemConfigFactoryConstructor
     public MemorySystemConfigImpl(final TaskExecutor taskExecutor,
                                   final EventLogger eventLogger,
-                                  final LogRecorder logRecorder,
-                                  final Map<String,Object> attributes)
+                                  final Map<String, Object> attributes)
     {
-        super(taskExecutor, eventLogger, logRecorder, attributes);
+        super(taskExecutor, eventLogger, attributes);
     }
 
     @Override

Modified: qpid/java/trunk/broker/etc/logback.xml
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker/etc/logback.xml?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker/etc/logback.xml (original)
+++ qpid/java/trunk/broker/etc/logback.xml Wed May  6 22:28:49 2015
@@ -20,11 +20,11 @@
  -
  -->
 <configuration scan="true" scanPeriod="10 seconds">
-    <appender name="ArchivingFileAppender" class="ch.qos.logback.core.RollingFileAppender">
-        <file>${QPID_WORK}/log/${logprefix}qpid${logsuffix}.log</file>
+    <appender name="ArchivingFileAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${QPID_WORK}/log/qpid.log</file>
         <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
             <!-- rollover daily -->
-            <fileNamePattern>${QPID_WORK}/log/${logprefix}qpid${logsuffix}.log.%d{yyyy-MM-dd}.%i.gz</fileNamePattern>
+            <fileNamePattern>${QPID_WORK}/log/qpid.log.%d{yyyy-MM-dd}.%i.gz</fileNamePattern>
             <timeBasedFileNamingAndTriggeringPolicy
                     class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                 <maxFileSize>1MB</maxFileSize>
@@ -36,29 +36,14 @@
     </appender>
 
     <appender name="FileAppender" class="ch.qos.logback.core.FileAppender">
-        <file>${QPID_WORK}/log/${logprefix}qpid${logsuffix}.log</file>
+        <file>${QPID_WORK}/log/qpid.log</file>
         <append>false</append>
         <encoder>
             <pattern>%d %-5p [%t] \(%c{2}\) - %m%n</pattern>
         </encoder>
     </appender>
 
-    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
-        <encoder>
-            <pattern>%d %-5p [%t] \(%c{2}\) - %m%n</pattern>
-        </encoder>
-    </appender>
-
-    <logger name="org.apache.qpid" level="warn" additivity="true"/>
-    <logger name="qpid.message" level="info" additivity="true"/>
-    <logger name="qpid.message.subscription.state" level="off" additivity="true"/>
-    <logger name="org.apache.qpid.server.queue.NotificationCheck" level="info" additivity="true"/>
-    <logger name="org.apache.commons" level="warn"/>
-
     <root level="info">
         <appender-ref ref="FileAppender"/>
-        <!--appender-ref ref="ArchivingFileAppender"/-->
     </root>
-    <!-- General logging hierarchy --><!-- Operational logging hierarchy --><!-- Subscription state may toggle frequently for clients with low prefetch
-    so switch off this operational logging by default--><!-- Enable log messages for the queue notifications --><!-- Set the commons logging that the XML parser uses to WARN, it is very chatty at debug --><!-- Log all info events to file -->
 </configuration>

Modified: qpid/java/trunk/systests/etc/config-systests.json
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/etc/config-systests.json?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/systests/etc/config-systests.json (original)
+++ qpid/java/trunk/systests/etc/config-systests.json Wed May  6 22:28:49 2015
@@ -21,12 +21,44 @@
 {
   "name": "Broker",
   "defaultVirtualHost" : "test",
-  "modelVersion": "3.0",
+  "modelVersion": "3.1",
   "authenticationproviders" : [ {
     "name" : "plain",
     "type" : "PlainPasswordFile",
     "path" : "${QPID_HOME}${file.separator}etc${file.separator}passwd"
   } ],
+  "brokerloggers" : [ {
+    "name" : "logfile",
+    "type" : "File",
+    "fileName" : "${test.output.dir}${file.separator}TEST-${qpid.testClass}${qpid.testMethod}.txt",
+    "rollDaily" : false,
+    "rollOnRestart" : true,
+    "compressOldFiles" : false,
+    "maxFileSize" : "200mb",
+    "maxHistory" : 1,
+    "safeMode" : true,
+    "brokerloggerfilters" : [ {
+      "name" : "1",
+      "type" : "NameAndLevel",
+      "logLevel" : "INFO", 
+      "loggerName" : "" 
+    }, {
+      "name" : "2",
+      "type" : "NameAndLevel",
+      "logLevel" : "DEBUG", 
+      "loggerName" : "org.apache.qpid.*" 
+    } ]
+  }, {
+    "name" : "memory",
+    "type" : "Memory",
+    "maxRecords" : 4096,
+    "brokerloggerfilters" : [ {          
+      "name" : "1",
+      "type" : "NameAndLevel",
+      "logLevel" : "INFO", 
+      "loggerName" : "" 
+    } ]
+  } ],
   "keystores" : [ {
     "name" : "systestsKeyStore",
     "storeUrl" : "${QPID_HOME}${file.separator}..${file.separator}test-profiles${file.separator}test_resources${file.separator}ssl${file.separator}java_broker_keystore.jks",

Modified: qpid/java/trunk/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java (original)
+++ qpid/java/trunk/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java Wed May  6 22:28:49 2015
@@ -40,12 +40,10 @@ import javax.naming.InitialContext;
 import javax.naming.NamingException;
 
 import ch.qos.logback.classic.LoggerContext;
-import ch.qos.logback.classic.joran.JoranConfigurator;
 import ch.qos.logback.classic.spi.ILoggingEvent;
 import ch.qos.logback.core.Appender;
 import ch.qos.logback.core.FileAppender;
-import ch.qos.logback.core.joran.spi.JoranException;
-import ch.qos.logback.core.util.StatusPrinter;
+
 import org.apache.qpid.AMQException;
 import org.apache.qpid.client.AMQConnectionFactory;
 import org.apache.qpid.client.AMQConnectionURL;
@@ -139,17 +137,18 @@ public class QpidBrokerTestCase extends
     public static final int DEFAULT_SSL_PORT = Integer.getInteger("test.port.ssl", DEFAULT_SSL_PORT_VALUE);
 
     protected String _brokerLanguage = System.getProperty(BROKER_LANGUAGE, JAVA);
-    protected BrokerHolder.BrokerType _brokerType = BrokerHolder.BrokerType.valueOf(System.getProperty(BROKER_TYPE, "").toUpperCase());
+    protected BrokerHolder.BrokerType _brokerType = BrokerHolder.BrokerType.valueOf(System.getProperty(BROKER_TYPE, "")
+                                                                                            .toUpperCase());
 
-    private static final String BROKER_COMMAND_TEMPLATE = System.getProperty(BROKER_COMMAND_PLATFORM, System.getProperty(BROKER_COMMAND));
+    private static final String BROKER_COMMAND_TEMPLATE = System.getProperty(BROKER_COMMAND_PLATFORM,
+                                                                             System.getProperty(BROKER_COMMAND));
 
     private Boolean _brokerCleanBetweenTests = Boolean.getBoolean(BROKER_CLEAN_BETWEEN_TESTS);
-    private final Protocol _brokerProtocol = Protocol.valueOf("AMQP_" + System.getProperty(BROKER_VERSION, " ").substring(1));
+    private final Protocol _brokerProtocol = Protocol.valueOf("AMQP_" + System.getProperty(BROKER_VERSION, " ")
+            .substring(1));
     protected String _output = System.getProperty(TEST_OUTPUT, System.getProperty("java.io.tmpdir"));
     protected Boolean _brokerPersistent = Boolean.getBoolean(BROKER_PERSITENT);
 
-    protected File _outputFile;
-
     protected Map<Integer, BrokerHolder> _brokers = new HashMap<Integer, BrokerHolder>();
 
     protected InitialContext _initialContext;
@@ -171,6 +170,23 @@ public class QpidBrokerTestCase extends
     private int _messageSize = DEFAULT_MESSAGE_SIZE;
     private String _brokerCommandTemplate;
 
+    public File getOutputFile()
+    {
+
+        // get log file from file appender
+        final ch.qos.logback.classic.Logger logger = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
+        for (Iterator<Appender<ILoggingEvent>> index = logger.iteratorForAppenders(); index.hasNext(); /* do nothing */ )
+        {
+            Appender<ILoggingEvent> appender = index.next();
+            if (appender instanceof FileAppender)
+            {
+                return new File(((FileAppender)appender).getFile());
+            }
+        }
+
+        return null;
+    }
+
     /** Type of message*/
     protected enum MessageType
     {
@@ -273,32 +289,6 @@ public class QpidBrokerTestCase extends
         System.setProperty("qpid.testMethod", "-" + getName());
         System.setProperty("qpid.testClass", getClass().getName());
 
-        String logbackConfigFile = System.getProperty("log4j.configuration.file");
-
-        LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
-        try
-        {
-            JoranConfigurator configurator = new JoranConfigurator();
-            configurator.setContext(context);
-            context.reset();
-            configurator.doConfigure(logbackConfigFile);
-        }
-        catch (JoranException e)
-        {
-            StatusPrinter.printInCaseOfErrorsOrWarnings(context);
-        }
-
-        // get log file from file appender
-        ch.qos.logback.classic.Logger logger = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
-        for (Iterator<Appender<ILoggingEvent>> index = logger.iteratorForAppenders(); index.hasNext(); /* do nothing */ )
-        {
-            Appender<ILoggingEvent> appender = index.next();
-            if (appender instanceof FileAppender)
-            {
-                _outputFile = new File(((FileAppender)appender).getFile());
-                break;
-            }
-        }
 
         try
         {
@@ -325,6 +315,9 @@ public class QpidBrokerTestCase extends
 
             _logger.info("==========  stop " + getTestName() + " ==========");
 
+            final ch.qos.logback.classic.Logger logger = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
+
+            final LoggerContext context = logger.getLoggerContext();
             context.reset();
             context.stop();
         }

Modified: qpid/java/trunk/systests/src/main/java/org/apache/qpid/test/utils/TestBrokerConfiguration.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/main/java/org/apache/qpid/test/utils/TestBrokerConfiguration.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/main/java/org/apache/qpid/test/utils/TestBrokerConfiguration.java (original)
+++ qpid/java/trunk/systests/src/main/java/org/apache/qpid/test/utils/TestBrokerConfiguration.java Wed May  6 22:28:49 2015
@@ -41,7 +41,6 @@ import java.util.UUID;
 import org.apache.qpid.server.BrokerOptions;
 import org.apache.qpid.server.configuration.updater.TaskExecutor;
 import org.apache.qpid.server.logging.EventLogger;
-import org.apache.qpid.server.logging.LogRecorder;
 import org.apache.qpid.server.model.*;
 import org.apache.qpid.server.model.adapter.FileBasedGroupProvider;
 import org.apache.qpid.server.model.adapter.FileBasedGroupProviderImpl;
@@ -90,8 +89,7 @@ public class TestBrokerConfiguration
         brokerOptions.setInitialConfigurationLocation(initialStoreLocation);
         final AbstractSystemConfig parentObject = new JsonSystemConfigImpl(taskExecutor,
                                                                mock(EventLogger.class),
-                                                               mock(LogRecorder.class),
-                                                               brokerOptions.convertToSystemConfigAttributes());
+                                                                           brokerOptions.convertToSystemConfigAttributes());
 
         ConfiguredObjectRecordConverter converter = new ConfiguredObjectRecordConverter(BrokerModel.getInstance());
 
@@ -203,8 +201,7 @@ public class TestBrokerConfiguration
         attributes.put(ConfiguredObject.DESIRED_STATE, State.QUIESCED);
         final SystemConfig parentObject = configFactory.newInstance(_taskExecutor,
                                                                    mock(EventLogger.class),
-                                                                   mock(LogRecorder.class),
-                                                                   attributes);
+                                                                    attributes);
 
         parentObject.open();
         DurableConfigurationStore configurationStore = parentObject.getConfigurationStore();

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/client/AsynchMessageListenerTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/client/AsynchMessageListenerTest.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/client/AsynchMessageListenerTest.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/client/AsynchMessageListenerTest.java Wed May  6 22:28:49 2015
@@ -269,7 +269,7 @@ public class AsynchMessageListenerTest e
 
         // Check that Error has been written to the application log.
 
-        LogMonitor _monitor = new LogMonitor(_outputFile);
+        LogMonitor _monitor = new LogMonitor(getOutputFile());
         assertTrue("The expected message not written to log file.",
                 _monitor.waitForMessage(javaLangErrorMessageText, LOGMONITOR_TIMEOUT));
 

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/BrokerStartupTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/BrokerStartupTest.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/BrokerStartupTest.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/BrokerStartupTest.java Wed May  6 22:28:49 2015
@@ -43,7 +43,7 @@ public class BrokerStartupTest extends A
     {
         // We either do this here or have a null check in tearDown.
         // As when this test is run against profiles other than java it will NPE
-        _monitor = new LogMonitor(_outputFile);
+        _monitor = new LogMonitor(getOutputFile());
         //We explicitly do not call super.setUp as starting up the broker is
         //part of the test case.
     }

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/logging/AbstractTestLogging.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/logging/AbstractTestLogging.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/logging/AbstractTestLogging.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/logging/AbstractTestLogging.java Wed May  6 22:28:49 2015
@@ -50,7 +50,7 @@ public class AbstractTestLogging extends
         setLogMessagePrefix();
         
         super.setUp();
-        _monitor = new LogMonitor(_outputFile);
+        _monitor = new LogMonitor(getOutputFile());
     }
 
     protected void setLogMessagePrefix()

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/logging/AlertingTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/logging/AlertingTest.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/logging/AlertingTest.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/logging/AlertingTest.java Wed May  6 22:28:49 2015
@@ -117,8 +117,6 @@ public class AlertingTest extends Abstra
         _connection.close();
         stopBroker();
 
-        // Rest the monitoring clearing the current output file.
-        _monitor.markDiscardPoint();
         startBroker();
         wasAlertFired();
     }
@@ -148,7 +146,6 @@ public class AlertingTest extends Abstra
 
         stopBroker();
 
-        _monitor.markDiscardPoint();
 
         RestTestHelper restTestHelper = new RestTestHelper(findFreePort());
         TestBrokerConfiguration config = getBrokerConfiguration();



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


Mime
View raw message