You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2014/04/03 21:59:01 UTC
svn commit: r1584365 [13/15] - in
/qpid/branches/java-broker-config-store-changes/qpid/java: ./
bdbstore/jmx/src/main/java/org/apache/qpid/server/store/berkeleydb/jmx/
bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/
bdbstore/src/main/ja...
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementFactory.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementFactory.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementFactory.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementFactory.java Thu Apr 3 19:58:53 2014
@@ -18,30 +18,29 @@
*/
package org.apache.qpid.server.management.plugin;
+import org.apache.qpid.server.model.AbstractConfiguredObjectTypeFactory;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.ConfiguredObject;
+
+import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.Plugin;
-import org.apache.qpid.server.plugin.PluginFactory;
-
-public class HttpManagementFactory implements PluginFactory
+public class HttpManagementFactory extends AbstractConfiguredObjectTypeFactory<HttpManagement>
{
- @Override
- public Plugin createInstance(UUID id, Map<String, Object> attributes, Broker broker)
+ public HttpManagementFactory()
{
- if (!HttpManagement.PLUGIN_TYPE.equals(attributes.get(PLUGIN_TYPE)))
- {
- return null;
- }
-
- return new HttpManagement(id, broker, attributes);
+ super(HttpManagement.class);
}
@Override
- public String getType()
+ public HttpManagement createInstance(final Map<String, Object> attributes, final ConfiguredObject<?>... parents)
{
- return "HTTP Management";
+ Map<String,Object> attributesWithoutId = new HashMap<String, Object>(attributes);
+ Object idObj = attributesWithoutId.remove(ConfiguredObject.ID);
+ UUID id = idObj == null ? UUID.randomUUID() : idObj instanceof UUID ? (UUID) idObj : UUID.fromString(idObj.toString());
+ return new HttpManagement(id, getParent(Broker.class,parents), attributes);
}
+
}
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java Thu Apr 3 19:58:53 2014
@@ -458,6 +458,7 @@ public class RestServlet extends Abstrac
catch (RuntimeException e)
{
setResponseStatus(response, e);
+ e.printStackTrace();
}
}
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/ListAccessControlProviderAttributes.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/ListAccessControlProviderAttributes.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/ListAccessControlProviderAttributes.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/action/ListAccessControlProviderAttributes.java Thu Apr 3 19:58:53 2014
@@ -26,21 +26,21 @@ import java.util.TreeMap;
import org.apache.qpid.server.management.plugin.servlet.rest.Action;
import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.plugin.AccessControlFactory;
+import org.apache.qpid.server.plugin.AccessControlProviderFactory;
import org.apache.qpid.server.plugin.QpidServiceLoader;
public class ListAccessControlProviderAttributes implements Action
{
private static final String ATTRIBUTES = "attributes";
private static final String DESCRIPTIONS = "descriptions";
- private Map<String, AccessControlFactory> _factories;
+ private Map<String, AccessControlProviderFactory> _factories;
public ListAccessControlProviderAttributes()
{
- _factories = new TreeMap<String, AccessControlFactory>();
- Iterable<AccessControlFactory> factories = new QpidServiceLoader<AccessControlFactory>()
- .instancesOf(AccessControlFactory.class);
- for (AccessControlFactory factory : factories)
+ _factories = new TreeMap<String, AccessControlProviderFactory>();
+ Iterable<AccessControlProviderFactory> factories = new QpidServiceLoader<AccessControlProviderFactory>()
+ .instancesOf(AccessControlProviderFactory.class);
+ for (AccessControlProviderFactory factory : factories)
{
_factories.put(factory.getType(), factory);
}
@@ -58,10 +58,11 @@ public class ListAccessControlProviderAt
Map<String, Object> attributes = new TreeMap<String, Object>();
for (String providerType : _factories.keySet())
{
- AccessControlFactory factory = _factories.get(providerType);
+ AccessControlProviderFactory<?> factory = _factories.get(providerType);
Map<String, Object> data = new HashMap<String, Object>();
- data.put(ATTRIBUTES, factory.getAttributeNames());
+ // TODO RG - fix
+ // data.put(ATTRIBUTES, factory.getAttributeNames());
Map<String, String> resources = factory.getAttributeDescriptions();
if (resources != null)
{
Added: qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-http/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ConfiguredObjectTypeFactory
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-http/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ConfiguredObjectTypeFactory?rev=1584365&view=auto
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-http/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ConfiguredObjectTypeFactory (added)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-http/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ConfiguredObjectTypeFactory Thu Apr 3 19:58:53 2014
@@ -0,0 +1,21 @@
+#
+# 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.
+#
+org.apache.qpid.server.management.plugin.HttpManagementFactory
+
+
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/HttpManagementFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/HttpManagementFactoryTest.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/HttpManagementFactoryTest.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/HttpManagementFactoryTest.java Thu Apr 3 19:58:53 2014
@@ -18,41 +18,33 @@
*/
package org.apache.qpid.server.management.plugin;
-import static org.mockito.Mockito.mock;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.test.utils.QpidTestCase;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.plugin.PluginFactory;
-import org.apache.qpid.test.utils.QpidTestCase;
+import static org.mockito.Mockito.mock;
public class HttpManagementFactoryTest extends QpidTestCase
{
private static final int SESSION_TIMEOUT = 3600;
- private PluginFactory _pluginFactory = new HttpManagementFactory();
+ private HttpManagementFactory _pluginFactory = new HttpManagementFactory();
private Map<String, Object> _attributes = new HashMap<String, Object>();
private Broker _broker = mock(Broker.class);
private UUID _id = UUID.randomUUID();
- public void testCreateInstanceReturnsNullWhenPluginTypeMissing() throws Exception
- {
- assertNull(_pluginFactory.createInstance(_id, _attributes, _broker));
- }
- public void testCreateInstanceReturnsNullWhenPluginTypeNotHttp()
- {
- _attributes.put(PluginFactory.PLUGIN_TYPE, "notHttp");
- assertNull(_pluginFactory.createInstance(_id, _attributes, _broker));
- }
public void testCreateInstance() throws Exception
{
- _attributes.put(PluginFactory.PLUGIN_TYPE, HttpManagement.PLUGIN_TYPE);
+ _attributes.put(ConfiguredObject.TYPE, HttpManagement.PLUGIN_TYPE);
_attributes.put(HttpManagement.TIME_OUT, SESSION_TIMEOUT);
+ _attributes.put(ConfiguredObject.ID, _id);
- HttpManagement management = (HttpManagement) _pluginFactory.createInstance(_id, _attributes, _broker);
+ HttpManagement management = _pluginFactory.createInstance(_attributes, _broker);
assertEquals(_broker, management.getParent(Broker.class));
assertEquals(SESSION_TIMEOUT, management.getSessionTimeout());
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/pom.xml
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/pom.xml?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/pom.xml (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/pom.xml Thu Apr 3 19:58:53 2014
@@ -55,6 +55,13 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
<build>
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagement.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagement.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagement.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagement.java Thu Apr 3 19:58:53 2014
@@ -21,30 +21,30 @@
package org.apache.qpid.server.jmx;
-import java.io.IOException;
-import java.lang.reflect.Type;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import javax.management.JMException;
-
import org.apache.log4j.Logger;
import org.apache.qpid.server.configuration.IllegalConfigurationException;
import org.apache.qpid.server.jmx.mbeans.LoggingManagementMBean;
-import org.apache.qpid.server.jmx.mbeans.UserManagementMBean;
import org.apache.qpid.server.jmx.mbeans.ServerInformationMBean;
import org.apache.qpid.server.jmx.mbeans.Shutdown;
+import org.apache.qpid.server.jmx.mbeans.UserManagementMBean;
import org.apache.qpid.server.jmx.mbeans.VirtualHostMBean;
import org.apache.qpid.server.logging.log4j.LoggingManagementFacade;
import org.apache.qpid.server.model.*;
+import org.apache.qpid.server.model.ManagedObject;
import org.apache.qpid.server.model.adapter.AbstractPluginAdapter;
-import org.apache.qpid.server.plugin.PluginFactory;
import org.apache.qpid.server.plugin.QpidServiceLoader;
import org.apache.qpid.server.util.MapValueConverter;
import org.apache.qpid.server.util.ServerScopedRuntimeException;
+import javax.management.JMException;
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+@ManagedObject( category = false , type = "MANAGEMENT-JMX" )
public class JMXManagement extends AbstractPluginAdapter<JMXManagement> implements ConfigurationChangeListener
{
private static final Logger LOGGER = Logger.getLogger(JMXManagement.class);
@@ -63,14 +63,15 @@ public class JMXManagement extends Abstr
private static final Map<String, Object> DEFAULTS = new HashMap<String, Object>(){{
put(USE_PLATFORM_MBEAN_SERVER, DEFAULT_USE_PLATFORM_MBEAN_SERVER);
put(NAME, DEFAULT_NAME);
- put(PluginFactory.PLUGIN_TYPE, PLUGIN_TYPE);
+ put(TYPE, PLUGIN_TYPE);
}};
@SuppressWarnings("serial")
private static final Map<String, Type> ATTRIBUTE_TYPES = new HashMap<String, Type>(){{
put(USE_PLATFORM_MBEAN_SERVER, Boolean.class);
put(NAME, String.class);
- put(PluginFactory.PLUGIN_TYPE, String.class);
+ put(TYPE, String.class);
+ put(TYPE, String.class);
}};
private JMXManagedObjectRegistry _objectRegistry;
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagementFactory.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagementFactory.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagementFactory.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagementFactory.java Thu Apr 3 19:58:53 2014
@@ -18,31 +18,27 @@
*/
package org.apache.qpid.server.jmx;
+import org.apache.qpid.server.model.AbstractConfiguredObjectTypeFactory;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.ConfiguredObject;
+
+import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.Plugin;
-import org.apache.qpid.server.plugin.PluginFactory;
-
-public class JMXManagementFactory implements PluginFactory
+public class JMXManagementFactory extends AbstractConfiguredObjectTypeFactory<JMXManagement>
{
- @Override
- public Plugin createInstance(UUID id, Map<String, Object> attributes, Broker broker)
+ public JMXManagementFactory()
{
- if (JMXManagement.PLUGIN_TYPE.equals(attributes.get(PLUGIN_TYPE)))
- {
- return new JMXManagement(id, broker, attributes);
- }
- else
- {
- return null;
- }
+ super(JMXManagement.class);
}
@Override
- public String getType()
+ public JMXManagement createInstance(final Map<String, Object> attributes, final ConfiguredObject<?>... parents)
{
- return "JMX Management";
+ Map<String,Object> attributesWithoutId = new HashMap<String, Object>(attributes);
+ Object idObj = attributesWithoutId.remove(ConfiguredObject.ID);
+ UUID id = idObj == null ? UUID.randomUUID() : idObj instanceof UUID ? (UUID) idObj : UUID.fromString(idObj.toString());
+ return new JMXManagement(id, getParent(Broker.class,parents),attributes);
}
}
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/ManagedObjectRegistry.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/ManagedObjectRegistry.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/ManagedObjectRegistry.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/ManagedObjectRegistry.java Thu Apr 3 19:58:53 2014
@@ -20,10 +20,10 @@
*/
package org.apache.qpid.server.jmx;
-import org.apache.commons.configuration.ConfigurationException;
import org.apache.qpid.common.Closeable;
import javax.management.JMException;
+
import java.io.IOException;
/**
@@ -40,7 +40,7 @@ import java.io.IOException;
*/
public interface ManagedObjectRegistry extends Closeable
{
- void start() throws IOException, ConfigurationException;
+ void start() throws IOException;
void registerObject(ManagedObject managedObject) throws JMException;
Added: qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ConfiguredObjectTypeFactory
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ConfiguredObjectTypeFactory?rev=1584365&view=auto
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ConfiguredObjectTypeFactory (added)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ConfiguredObjectTypeFactory Thu Apr 3 19:58:53 2014
@@ -0,0 +1,21 @@
+#
+# 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.
+#
+org.apache.qpid.server.jmx.JMXManagementFactory
+
+
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/JMXManagementFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/JMXManagementFactoryTest.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/JMXManagementFactoryTest.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/JMXManagementFactoryTest.java Thu Apr 3 19:58:53 2014
@@ -18,15 +18,15 @@
*/
package org.apache.qpid.server.jmx;
-import static org.mockito.Mockito.mock;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.test.utils.QpidTestCase;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.plugin.PluginFactory;
-import org.apache.qpid.test.utils.QpidTestCase;
+import static org.mockito.Mockito.mock;
public class JMXManagementFactoryTest extends QpidTestCase
{
@@ -37,24 +37,16 @@ public class JMXManagementFactoryTest ex
public void testJMXConfigured() throws Exception
{
- _attributes.put(PluginFactory.PLUGIN_TYPE, JMXManagement.PLUGIN_TYPE);
+ _attributes.put(ConfiguredObject.ID,UUID.randomUUID());
+ _attributes.put(ConfiguredObject.TYPE, JMXManagement.PLUGIN_TYPE);
- JMXManagement jmxManagement = (JMXManagement) _jmxManagementFactory.createInstance(_id, _attributes, _broker);
+ JMXManagement jmxManagement = _jmxManagementFactory.createInstance( _attributes, _broker);
assertNotNull(jmxManagement);
- assertEquals("Unexpected plugin type", JMXManagement.PLUGIN_TYPE, jmxManagement.getAttribute(JMXManagementFactory.PLUGIN_TYPE));
+ assertEquals("Unexpected plugin type", JMXManagement.PLUGIN_TYPE, jmxManagement.getType());
assertEquals("Unexpected default mbean platform", JMXManagement.DEFAULT_USE_PLATFORM_MBEAN_SERVER, jmxManagement.getAttribute(JMXManagement.USE_PLATFORM_MBEAN_SERVER));
assertEquals("Unexpected default name", JMXManagement.DEFAULT_NAME, jmxManagement.getAttribute(JMXManagement.NAME));
}
- public void testCreateInstanceReturnsNullWhenPluginTypeMissing()
- {
- assertNull(_jmxManagementFactory.createInstance(_id, _attributes, _broker));
- }
- public void testCreateInstanceReturnsNullWhenPluginTypeNotJmx()
- {
- _attributes.put(PluginFactory.PLUGIN_TYPE, "notJmx");
- assertNull(_jmxManagementFactory.createInstance(_id, _attributes, _broker));
- }
}
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/memory-store/src/main/java/org/apache/qpid/server/store/MemoryMessageStoreFactory.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/memory-store/src/main/java/org/apache/qpid/server/store/MemoryMessageStoreFactory.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/memory-store/src/main/java/org/apache/qpid/server/store/MemoryMessageStoreFactory.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/broker-plugins/memory-store/src/main/java/org/apache/qpid/server/store/MemoryMessageStoreFactory.java Thu Apr 3 19:58:53 2014
@@ -20,9 +20,8 @@
*/
package org.apache.qpid.server.store;
-import java.util.Collections;
import java.util.Map;
-import org.apache.commons.configuration.Configuration;
+
import org.apache.qpid.server.plugin.MessageStoreFactory;
public class MemoryMessageStoreFactory implements MessageStoreFactory
@@ -41,12 +40,6 @@ public class MemoryMessageStoreFactory i
}
@Override
- public Map<String, Object> convertStoreConfiguration(Configuration configuration)
- {
- return Collections.emptyMap();
- }
-
- @Override
public void validateAttributes(Map<String, Object> attributes)
{
}
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/build.deps
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/build.deps?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/build.deps (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/build.deps Thu Apr 3 19:58:53 2014
@@ -21,8 +21,6 @@ commons-beanutils-core=lib/required/comm
commons-cli=lib/required/commons-cli-1.2.jar
commons-codec=lib/required/commons-codec-1.6.jar
commons-collections=lib/required/commons-collections-3.2.1.jar
-commons-configuration=lib/required/commons-configuration-1.8.jar
-commons-digester=lib/required/commons-digester-1.8.1.jar
commons-lang=lib/required/commons-lang-2.6.jar
commons-logging=lib/required/commons-logging-1.1.1.jar
@@ -67,8 +65,7 @@ dojo=lib/required/dojo-${dojo-version}.z
jackson-core=lib/required/jackson-core-asl-1.9.0.jar
jackson-mapper=lib/required/jackson-mapper-asl-1.9.0.jar
-commons-configuration.libs = ${commons-beanutils-core} ${commons-digester} \
- ${commons-codec} ${commons-lang} ${commons-collections} ${commons-configuration}
+commons.libs = ${commons-codec} ${commons-lang}
common.libs=${slf4j-api}
client.libs=${geronimo-jms}
@@ -77,20 +74,20 @@ amqp-1-0-client.libs=
amqp-1-0-client-example.libs=${commons-cli}
amqp-1-0-client-jms.libs=${geronimo-jms}
amqp-1-0-client-websocket.libs = ${jetty} ${jetty-continuation} ${jetty-security} ${jetty-http} ${jetty-io} ${jetty-servlet} ${jetty-util} ${servlet-api} ${jetty-websocket}
-tools.libs=${commons-configuration.libs} ${log4j}
+tools.libs=${commons.libs} ${log4j}
broker-core.libs=${commons-cli} ${commons-logging} ${log4j} ${slf4j-log4j} \
- ${xalan} ${derby-db} ${commons-configuration.libs} \
+ ${xalan} ${derby-db} ${commons.libs} \
${jackson-core} ${jackson-mapper} ${jetty} ${jetty-continuation} ${jetty-security} ${jetty-http} ${jetty-io} ${jetty-servlet} ${jetty-util} ${servlet-api} ${jetty-websocket} ${bcel}
#Borrow the broker-core libs, hack for release binary generation
broker.libs=${broker-core.libs}
broker-plugins-management-http.libs=${dojo} ${cryptojs}
-broker-plugins.libs=${log4j} ${commons-configuration.libs}
+broker-plugins.libs=${log4j} ${commons.libs}
test.libs=${slf4j-log4j} ${log4j} ${junit} ${slf4j-api} ${mockito-all}
-perftests.libs=${geronimo-jms} ${slf4j-api} ${log4j} ${slf4j-log4j} ${commons-logging} ${commons-collections} ${commons-beanutils-core} ${commons-lang} ${gson-all} ${derby-db}
+perftests.libs=${geronimo-jms} ${slf4j-api} ${log4j} ${slf4j-log4j} ${commons-logging} ${commons-beanutils-core} ${commons-lang} ${commons-collections} ${gson-all} ${derby-db}
management-common.libs=
@@ -107,7 +104,7 @@ qpid-test-utils.libs = ${test.libs} ${ge
broker-plugins-access-control.test.libs=${test.libs}
broker-plugins-management-amqp.test.libs=${test.libs}
broker-plugins-management-http.test.libs=${test.libs}
-broker-plugins-management-jmx.test.libs=${test.libs}
+broker-plugins-management-jmx.test.libs=${commons-beanutils-core} ${test.libs}
broker-plugins-jdbc-store.test.libs=${test.libs}
broker-plugins-derby-store.test.libs=${test.libs}
broker-plugins-memory-store.test.libs=${test.libs}
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/ivy.retrieve.xml
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/ivy.retrieve.xml?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/ivy.retrieve.xml (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/ivy.retrieve.xml Thu Apr 3 19:58:53 2014
@@ -38,8 +38,6 @@
<dependency org="commons-cli" name="commons-cli" rev="1.2" transitive="false"/>
<dependency org="commons-codec" name="commons-codec" rev="1.6" transitive="false"/>
<dependency org="commons-collections" name="commons-collections" rev="3.2.1" transitive="false"/>
- <dependency org="commons-configuration" name="commons-configuration" rev="1.8" transitive="false"/>
- <dependency org="commons-digester" name="commons-digester" rev="1.8.1" transitive="false"/>
<dependency org="commons-lang" name="commons-lang" rev="2.6" transitive="false"/>
<dependency org="commons-logging" name="commons-logging" rev="1.1.1" transitive="false"/>
<dependency org="org.apache.bcel" name="bcel" rev="5.2" transitive="false"/>
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/module.xml
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/module.xml?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/module.xml (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/module.xml Thu Apr 3 19:58:53 2014
@@ -418,6 +418,7 @@
<propertyref name="java.naming.factory.initial"/>
<propertyref name="java.naming.provider.url"/>
<propertyref name="messagestore.class.name" />
+ <propertyref name="messagestore.type" />
<propertyref name="max_prefetch"/>
<propertyref name="QPID_HOME"/>
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/perftests/example/config-stress-testing-manyp-c1-with-psfc.json
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/perftests/example/config-stress-testing-manyp-c1-with-psfc.json?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/perftests/example/config-stress-testing-manyp-c1-with-psfc.json (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/perftests/example/config-stress-testing-manyp-c1-with-psfc.json Thu Apr 3 19:58:53 2014
@@ -7,7 +7,6 @@
"_name": "direct://amq.direct//testQueue",
"_attributes":
{
- "comment": "does not work yet - configure in virtualhost.xml",
"x-qpid-capacity": 10485760,
"x-qpid-flow-resume-capacity": 8388608
}
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/pom.xml
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/pom.xml?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/pom.xml (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/pom.xml Thu Apr 3 19:58:53 2014
@@ -53,7 +53,7 @@
<readme.text>Documentation for the Qpid components can be accessed on our website at:${line.separator}http://qpid.apache.org/documentation.html</readme.text>
<!-- enforcer plugin config properties -->
- <supported-test-profiles-regex>(java-mms.0-9|java-mms.0-9-1|java-mms.0-10|java-bdb.0-9|java-bdb.0-9-1|java-bdb.0-10|java-dby.0-9|java-dby.0-9-1|java-dby.0-10|java-dby-mem.0-9|java-dby-mem.0-9-1|java-dby-mem.0-10)</supported-test-profiles-regex>
+ <supported-test-profiles-regex>(java-mms.0-9|java-mms.0-9-1|java-mms.0-10|java-bdb.0-9|java-bdb.0-9-1|java-bdb.0-10|java-dby.0-9|java-dby.0-9-1|java-dby.0-10|java-dby-mem.0-9|java-dby-mem.0-9-1|java-dby-mem.0-10|cpp)</supported-test-profiles-regex>
<!-- plugin properties-->
<license-maven-plugin-output-dir>${project.build.directory}/license-maven-plugin</license-maven-plugin-output-dir>
@@ -75,9 +75,8 @@
<profile.specific.excludes>JavaTransientExcludes Java010Excludes</profile.specific.excludes>
<profile.broker.version>v0_10</profile.broker.version>
<profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0</profile.qpid.broker_default_amqp_protocol_excludes>
- <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests.xml</profile.broker.virtualhosts-config>
<profile.broker.persistent>false</profile.broker.persistent>
- <profile.messagestore.class.name>org.apache.qpid.server.store.MemoryMessageStore</profile.messagestore.class.name>
+ <profile.messagestore.type>Memory</profile.messagestore.type>
<profile.broker.clean.between.tests>true</profile.broker.clean.between.tests>
</properties>
@@ -163,9 +162,8 @@
<echo>[profile.test.excludes] ${profile.test.excludes}</echo>
<echo>[profile.broker.version] ${profile.broker.version}</echo>
<echo>[profile.qpid.broker_default_amqp_protocol_excludes] ${profile.qpid.broker_default_amqp_protocol_excludes}</echo>
- <echo>[profile.broker.virtualhosts-config] ${profile.broker.virtualhosts-config}</echo>
<echo>[profile.broker.persistent] ${profile.broker.persistent}</echo>
- <echo>[profile.messagestore.class.name] ${profile.messagestore.class.name}</echo>
+ <echo>[profile.messagestore.type] ${profile.messagestore.type}</echo>
</tasks>
</configuration>
</execution>
@@ -256,13 +254,13 @@
<test.excludes>${profile.test.excludes}</test.excludes>
<broker.version>${profile.broker.version}</broker.version>
<qpid.broker_default_amqp_protocol_excludes>${profile.qpid.broker_default_amqp_protocol_excludes}</qpid.broker_default_amqp_protocol_excludes>
- <broker.virtualhosts-config>${profile.broker.virtualhosts-config}</broker.virtualhosts-config>
<broker.persistent>${profile.broker.persistent}</broker.persistent>
- <messagestore.class.name>${profile.messagestore.class.name}</messagestore.class.name>
+ <messagestore.type>${profile.messagestore.type}</messagestore.type>
<broker.clean.between.tests>${profile.broker.clean.between.tests}</broker.clean.between.tests>
<!-- This must be a child of qpid home currently due to the horrible mechanics of QBTC -->
<test.output>${qpid.home.qbtc.output}</test.output>
+ <broker.clean.between.tests>true</broker.clean.between.tests>
</systemPropertyVariables>
</configuration>
</plugin>
@@ -440,9 +438,8 @@
<profile.specific.excludes>JavaTransientExcludes Java010Excludes</profile.specific.excludes>
<profile.broker.version>v0_10</profile.broker.version>
<profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0</profile.qpid.broker_default_amqp_protocol_excludes>
- <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests.xml</profile.broker.virtualhosts-config>
<profile.broker.persistent>false</profile.broker.persistent>
- <profile.messagestore.class.name>org.apache.qpid.server.store.MemoryMessageStore</profile.messagestore.class.name>
+ <profile.messagestore.type>Memory</profile.messagestore.type>
</properties>
</profile>
@@ -459,9 +456,8 @@
<profile.specific.excludes>JavaTransientExcludes XAExcludes JavaPre010Excludes</profile.specific.excludes>
<profile.broker.version>v0_9_1</profile.broker.version>
<profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0,AMQP_0_10</profile.qpid.broker_default_amqp_protocol_excludes>
- <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests.xml</profile.broker.virtualhosts-config>
<profile.broker.persistent>false</profile.broker.persistent>
- <profile.messagestore.class.name>org.apache.qpid.server.store.MemoryMessageStore</profile.messagestore.class.name>
+ <profile.messagestore.type>Memory</profile.messagestore.type>
</properties>
</profile>
@@ -478,9 +474,8 @@
<profile.specific.excludes>JavaTransientExcludes XAExcludes JavaPre010Excludes</profile.specific.excludes>
<profile.broker.version>v0_9</profile.broker.version>
<profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0,AMQP_0_10,AMQP_0_9_1</profile.qpid.broker_default_amqp_protocol_excludes>
- <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests.xml</profile.broker.virtualhosts-config>
<profile.broker.persistent>false</profile.broker.persistent>
- <profile.messagestore.class.name>org.apache.qpid.server.store.MemoryMessageStore</profile.messagestore.class.name>
+ <profile.messagestore.type>Memory</profile.messagestore.type>
</properties>
</profile>
@@ -497,9 +492,8 @@
<profile.specific.excludes>JavaPersistentExcludes Java010Excludes JavaBDBExcludes</profile.specific.excludes>
<profile.broker.version>v0_10</profile.broker.version>
<profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0</profile.qpid.broker_default_amqp_protocol_excludes>
- <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests-bdb.xml</profile.broker.virtualhosts-config>
<profile.broker.persistent>true</profile.broker.persistent>
- <profile.messagestore.class.name>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</profile.messagestore.class.name>
+ <profile.messagestore.type>BDB</profile.messagestore.type>
</properties>
</profile>
@@ -516,9 +510,8 @@
<profile.specific.excludes>JavaPersistentExcludes XAExcludes JavaPre010Excludes JavaBDBExcludes</profile.specific.excludes>
<profile.broker.version>v0_9_1</profile.broker.version>
<profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0,AMQP_0_10</profile.qpid.broker_default_amqp_protocol_excludes>
- <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests-bdb.xml</profile.broker.virtualhosts-config>
<profile.broker.persistent>true</profile.broker.persistent>
- <profile.messagestore.class.name>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</profile.messagestore.class.name>
+ <profile.messagestore.type>BDB</profile.messagestore.type>
</properties>
</profile>
@@ -535,9 +528,8 @@
<profile.specific.excludes>JavaPersistentExcludes XAExcludes JavaPre010Excludes JavaBDBExcludes</profile.specific.excludes>
<profile.broker.version>v0_9</profile.broker.version>
<profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0,AMQP_0_10,AMQP_0_9_1</profile.qpid.broker_default_amqp_protocol_excludes>
- <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests-bdb.xml</profile.broker.virtualhosts-config>
<profile.broker.persistent>true</profile.broker.persistent>
- <profile.messagestore.class.name>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</profile.messagestore.class.name>
+ <profile.messagestore.type>BDB</profile.messagestore.type>
</properties>
</profile>
@@ -554,9 +546,8 @@
<profile.specific.excludes>JavaPersistentExcludes JavaDerbyExcludes Java010Excludes</profile.specific.excludes>
<profile.broker.version>v0_10</profile.broker.version>
<profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0</profile.qpid.broker_default_amqp_protocol_excludes>
- <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests-derby-mem.xml</profile.broker.virtualhosts-config>
<profile.broker.persistent>true</profile.broker.persistent>
- <profile.messagestore.class.name>org.apache.qpid.server.store.derby.DerbyMessageStore</profile.messagestore.class.name>
+ <profile.messagestore.type>DERBY</profile.messagestore.type>
</properties>
</profile>
@@ -573,9 +564,8 @@
<profile.specific.excludes>JavaPersistentExcludes JavaDerbyExcludes XAExcludes JavaPre010Excludes</profile.specific.excludes>
<profile.broker.version>v0_9_1</profile.broker.version>
<profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0,AMQP_0_10</profile.qpid.broker_default_amqp_protocol_excludes>
- <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests-derby-mem.xml</profile.broker.virtualhosts-config>
<profile.broker.persistent>true</profile.broker.persistent>
- <profile.messagestore.class.name>org.apache.qpid.server.store.derby.DerbyMessageStore</profile.messagestore.class.name>
+ <profile.messagestore.type>DERBY</profile.messagestore.type>
</properties>
</profile>
@@ -592,9 +582,8 @@
<profile.specific.excludes>JavaPersistentExcludes JavaDerbyExcludes XAExcludes JavaPre010Excludes</profile.specific.excludes>
<profile.broker.version>v0_9</profile.broker.version>
<profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0,AMQP_0_10,AMQP_0_9_1</profile.qpid.broker_default_amqp_protocol_excludes>
- <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests-derby-mem.xml</profile.broker.virtualhosts-config>
<profile.broker.persistent>true</profile.broker.persistent>
- <profile.messagestore.class.name>org.apache.qpid.server.store.derby.DerbyMessageStore</profile.messagestore.class.name>
+ <profile.messagestore.type>DERBY</profile.messagestore.type>
</properties>
</profile>
@@ -613,7 +602,7 @@
<profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0</profile.qpid.broker_default_amqp_protocol_excludes>
<profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests-derby.xml</profile.broker.virtualhosts-config>
<profile.broker.persistent>true</profile.broker.persistent>
- <profile.messagestore.class.name>org.apache.qpid.server.store.derby.DerbyMessageStore</profile.messagestore.class.name>
+ <profile.messagestore.type>DERBY</profile.messagestore.type>
</properties>
</profile>
@@ -632,7 +621,7 @@
<profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0,AMQP_0_10</profile.qpid.broker_default_amqp_protocol_excludes>
<profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests-derby.xml</profile.broker.virtualhosts-config>
<profile.broker.persistent>true</profile.broker.persistent>
- <profile.messagestore.class.name>org.apache.qpid.server.store.derby.DerbyMessageStore</profile.messagestore.class.name>
+ <profile.messagestore.type>DERBY</profile.messagestore.type>
</properties>
</profile>
@@ -651,10 +640,58 @@
<profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0,AMQP_0_10,AMQP_0_9_1</profile.qpid.broker_default_amqp_protocol_excludes>
<profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests-derby.xml</profile.broker.virtualhosts-config>
<profile.broker.persistent>true</profile.broker.persistent>
- <profile.messagestore.class.name>org.apache.qpid.server.store.derby.DerbyMessageStore</profile.messagestore.class.name>
+ <profile.messagestore.type>DERBY</profile.messagestore.type>
</properties>
</profile>
+ <profile>
+ <id>cpp</id>
+ <activation>
+ <property>
+ <name>profile</name>
+ <value>cpp</value>
+ </property>
+ </activation>
+ <properties>
+ <profile>cpp</profile>
+ <profile.broker.language>cpp</profile.broker.language>
+ <profile.broker.type>spawned</profile.broker.type>
+ <profile.broker.stopped>Exception constructed</profile.broker.stopped>
+ <profile.broker.ready>Listening on TCP</profile.broker.ready>
+ <profile.broker.command>${cpp-broker-dir}/qpidd -p @PORT --data-dir ${qpid.work}/@PORT -t --auth no --no-module-dir</profile.broker.command>
+ <profile.broker.command.windows></profile.broker.command.windows>
+ <profile.test.excludes>Excludes CPPExcludes ${profile}.excludes ${profile.specific.excludes} cpp.excludes</profile.test.excludes>
+ <profile.specific.excludes>CPPPrefetchExcludes CPPTransientExcludes</profile.specific.excludes>
+ <profile.broker.version>v0_10</profile.broker.version>
+ <profile.broker.persistent>true</profile.broker.persistent>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>enforce-cpp-broker-dir-defined</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireProperty>
+ <property>cpp-broker-dir</property>
+ <message>You must set a the CPP broker directory property for this profile. (e.g. -Dcpp-broker-dir=/somedir/cpp/src)</message>
+ </requireProperty>
+ </rules>
+ <fail>true</fail>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
</profiles>
</project>
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/qpid-perftests-systests/pom.xml
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/qpid-perftests-systests/pom.xml?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/qpid-perftests-systests/pom.xml (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/qpid-perftests-systests/pom.xml Thu Apr 3 19:58:53 2014
@@ -115,16 +115,5 @@
</testResource>
</testResources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <!--version specified in parent pluginManagement -->
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
-
</build>
</project>
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/qpid-systests-parent/pom.xml
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/qpid-systests-parent/pom.xml?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/qpid-systests-parent/pom.xml (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/qpid-systests-parent/pom.xml Thu Apr 3 19:58:53 2014
@@ -216,6 +216,16 @@
<skip>true</skip>
</configuration>
</plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <!--version specified in parent pluginManagement -->
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+
</plugins>
</build>
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java Thu Apr 3 19:58:53 2014
@@ -22,6 +22,7 @@ package org.apache.qpid.test.utils;
import junit.framework.TestCase;
import junit.framework.TestResult;
+
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
@@ -124,10 +125,7 @@ public class QpidTestCase extends TestCa
}
}
- protected static final String MESSAGE_STORE_CLASS_NAME_KEY = "messagestore.class.name";
- protected static final String CONFIGURATION_STORE_CLASS_NAME_KEY = "configurationstore.class.name";
-
- protected static final String MEMORY_STORE_CLASS_NAME = "org.apache.qpid.server.store.MemoryMessageStore";
+ protected static final String MESSAGE_STORE_TYPE = "messagestore.type";
private static List<String> _exclusionList;
@@ -151,12 +149,12 @@ public class QpidTestCase extends TestCa
}
}
- public String getTestProfileMessageStoreClassName()
+ public String getTestProfileMessageStoreType()
{
- final String storeClass = System.getProperty(MESSAGE_STORE_CLASS_NAME_KEY);
- _logger.debug("MESSAGE_STORE_CLASS_NAME_KEY " + storeClass);
+ final String storeType = System.getProperty(MESSAGE_STORE_TYPE);
+ _logger.debug(MESSAGE_STORE_TYPE + "=" + storeType);
- return storeClass != null ? storeClass : MEMORY_STORE_CLASS_NAME ;
+ return storeType != null ? storeType : "TestableMemory";
}
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/systests/etc/config-systests.json
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/systests/etc/config-systests.json?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/systests/etc/config-systests.json (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/systests/etc/config-systests.json Thu Apr 3 19:58:53 2014
@@ -22,7 +22,7 @@
"name": "Broker",
"defaultVirtualHost" : "test",
"storeVersion": 1,
- "modelVersion": "1.0",
+ "modelVersion": "1.4",
"authenticationproviders" : [ {
"name" : "plain",
"type" : "PlainPasswordFile",
@@ -59,6 +59,10 @@
}],
"virtualhosts" : [ {
"name" : "test",
- "configPath" : "${broker.virtualhosts-config}"
+ "type" : "STANDARD",
+ "messageStoreSettings": {
+ "storeType": "${messagestore.type}",
+ "storePath" : "${QPID_WORK}/test/${test.port}"
+ }
} ]
}
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java Thu Apr 3 19:58:53 2014
@@ -25,9 +25,17 @@ import static org.apache.qpid.test.utils
import static org.apache.qpid.test.utils.TestSSLConstants.TRUSTSTORE;
import static org.apache.qpid.test.utils.TestSSLConstants.TRUSTSTORE_PASSWORD;
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
import java.util.Arrays;
-import javax.net.ssl.SSLSocket;
-import org.apache.commons.configuration.ConfigurationException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jms.Connection;
+import javax.jms.JMSException;
+import javax.jms.Session;
+
import org.apache.qpid.client.AMQConnectionURL;
import org.apache.qpid.client.AMQTestConnection_0_10;
import org.apache.qpid.jms.ConnectionURL;
@@ -36,15 +44,6 @@ import org.apache.qpid.server.model.Tran
import org.apache.qpid.test.utils.QpidBrokerTestCase;
import org.apache.qpid.test.utils.TestBrokerConfiguration;
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Session;
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
public class SSLTest extends QpidBrokerTestCase
{
private static final String CERT_ALIAS_APP1 = "app1";
@@ -402,7 +401,7 @@ public class SSLTest extends QpidBrokerT
boolean sslOnly,
boolean needClientAuth,
boolean wantClientAuth,
- boolean samePort) throws ConfigurationException
+ boolean samePort) throws Exception
{
if(isJavaBroker())
{
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java Thu Apr 3 19:58:53 2014
@@ -20,8 +20,19 @@
*/
package org.apache.qpid.server.logging;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
import org.apache.qpid.client.AMQDestination;
import org.apache.qpid.client.AMQSession;
+import org.apache.qpid.server.management.plugin.HttpManagement;
+import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManagerFactory;
+import org.apache.qpid.systest.rest.RestTestHelper;
+import org.apache.qpid.test.utils.TestBrokerConfiguration;
import javax.jms.Connection;
import javax.jms.Queue;
@@ -29,7 +40,7 @@ import javax.jms.Session;
public class AlertingTest extends AbstractTestLogging
{
- private String VIRTUALHOST = "test";
+
private Session _session;
private Connection _connection;
private Queue _destination;
@@ -41,9 +52,9 @@ public class AlertingTest extends Abstra
public void setUp() throws Exception
{
_numMessages = 50;
-
- setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".housekeeping.checkPeriod", String.valueOf(ALERT_LOG_WAIT_PERIOD));
- setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".queues.maximumMessageCount", String.valueOf(_numMessages));
+ TestBrokerConfiguration brokerConfiguration = getBrokerConfiguration();
+ brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, String.valueOf(ALERT_LOG_WAIT_PERIOD));
+ brokerConfiguration.setBrokerAttribute(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, _numMessages);
// Then we do the normal setup stuff like starting the broker, getting a connection etc.
super.setUp();
@@ -140,8 +151,24 @@ public class AlertingTest extends Abstra
_monitor.markDiscardPoint();
- // Change max message count to 5, start broker and make sure that that's triggered at the right time
- setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".queues.maximumMessageCount", "5");
+ RestTestHelper restTestHelper = new RestTestHelper(findFreePort());
+ TestBrokerConfiguration config = getBrokerConfiguration();
+ config.addHttpManagementConfiguration();
+ config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_HTTP_PORT, Port.PORT, restTestHelper.getHttpPort());
+ config.removeObjectConfiguration(TestBrokerConfiguration.ENTRY_NAME_JMX_PORT);
+ config.removeObjectConfiguration(TestBrokerConfiguration.ENTRY_NAME_RMI_PORT);
+
+ Map<String, Object> anonymousProviderAttributes = new HashMap<String, Object>();
+ anonymousProviderAttributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManagerFactory.PROVIDER_TYPE);
+ anonymousProviderAttributes.put(AuthenticationProvider.NAME, "testAnonymous");
+ config.addAuthenticationProviderConfiguration(anonymousProviderAttributes);
+
+ // set password authentication provider on http port for the tests
+ config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_HTTP_PORT, Port.AUTHENTICATION_PROVIDER,
+ TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER);
+ config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_HTTP_MANAGEMENT, HttpManagement.HTTP_BASIC_AUTHENTICATION_ENABLED, true);
+ config.setSaved(false);
+ restTestHelper.setUsernameAndPassword("webadmin", "webadmin");
startBroker();
@@ -154,6 +181,12 @@ public class AlertingTest extends Abstra
// Ensure the alert has not occurred yet
assertLoggingNotYetOccured(MESSAGE_COUNT_ALERT);
+ // Change max message count to 5, start broker and make sure that that's triggered at the right time
+ TestBrokerConfiguration brokerConfiguration = getBrokerConfiguration();
+ brokerConfiguration.setBrokerAttribute(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 5);
+ brokerConfiguration.setSaved(false);
+
+ restTestHelper.submitRequest("/rest/queue/test/" + getTestQueueName(), "PUT", Collections.<String, Object>singletonMap(org.apache.qpid.server.model.Queue.ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 5));
// Trigger the new value
sendMessage(_session, _destination, 3);
_session.commit();
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java Thu Apr 3 19:58:53 2014
@@ -18,9 +18,7 @@
*/
package org.apache.qpid.server.security.acl;
-import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.lang.StringUtils;
-
import org.apache.qpid.AMQException;
import org.apache.qpid.client.AMQConnection;
import org.apache.qpid.client.AMQConnectionURL;
@@ -33,6 +31,7 @@ import javax.jms.Connection;
import javax.jms.ExceptionListener;
import javax.jms.JMSException;
import javax.naming.NamingException;
+
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
@@ -95,12 +94,12 @@ public abstract class AbstractACLTestCas
}
}
- public void writeACLFile(final String...rules) throws ConfigurationException, IOException
+ public void writeACLFile(final String...rules) throws IOException
{
writeACLFileUtil(this, rules);
}
- public static void writeACLFileUtil(QpidBrokerTestCase testcase, String...rules) throws ConfigurationException, IOException
+ public static void writeACLFileUtil(QpidBrokerTestCase testcase, String...rules) throws IOException
{
File aclFile = File.createTempFile(testcase.getClass().getSimpleName(), testcase.getName());
aclFile.deleteOnExit();
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java Thu Apr 3 19:58:53 2014
@@ -38,7 +38,6 @@ import java.util.Map;
import javax.jms.Connection;
import javax.jms.JMSException;
-import org.apache.commons.configuration.ConfigurationException;
import org.apache.qpid.client.AMQConnectionURL;
import org.apache.qpid.management.common.mbeans.ManagedConnection;
import org.apache.qpid.server.model.AuthenticationProvider;
@@ -328,12 +327,12 @@ public class ExternalAuthenticationTest
return getConnection(new AMQConnectionURL(url));
}
- private void setCommonBrokerSSLProperties(boolean needClientAuth) throws ConfigurationException
+ private void setCommonBrokerSSLProperties(boolean needClientAuth)
{
setCommonBrokerSSLProperties(needClientAuth, Collections.singleton(TestBrokerConfiguration.ENTRY_NAME_SSL_TRUSTSTORE));
}
- private void setCommonBrokerSSLProperties(boolean needClientAuth, Collection<String> trustStoreNames) throws ConfigurationException
+ private void setCommonBrokerSSLProperties(boolean needClientAuth, Collection<String> trustStoreNames)
{
TestBrokerConfiguration config = getBrokerConfiguration();
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/store/MessageStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/store/MessageStoreTest.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/store/MessageStoreTest.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/store/MessageStoreTest.java Thu Apr 3 19:58:53 2014
@@ -21,10 +21,15 @@
package org.apache.qpid.server.store;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
-
-import org.apache.commons.configuration.PropertiesConfiguration;
+import java.util.HashMap;
+import java.util.Map;
import org.apache.log4j.Logger;
import org.apache.qpid.common.AMQPFilterTypes;
@@ -34,41 +39,34 @@ import org.apache.qpid.framing.ContentHe
import org.apache.qpid.framing.FieldTable;
import org.apache.qpid.framing.abstraction.MessagePublishInfo;
import org.apache.qpid.framing.amqp_8_0.BasicConsumeBodyImpl;
-import org.apache.qpid.server.configuration.VirtualHostConfiguration;
import org.apache.qpid.server.exchange.DirectExchange;
import org.apache.qpid.server.exchange.ExchangeImpl;
import org.apache.qpid.server.exchange.TopicExchange;
+import org.apache.qpid.server.logging.EventLogger;
import org.apache.qpid.server.message.InstanceProperties;
import org.apache.qpid.server.message.MessageSource;
import org.apache.qpid.server.model.Binding;
+import org.apache.qpid.server.model.Broker;
import org.apache.qpid.server.model.ExclusivityPolicy;
import org.apache.qpid.server.model.LifetimePolicy;
import org.apache.qpid.server.model.Queue;
-import org.apache.qpid.server.protocol.v0_8.AMQMessage;
-import org.apache.qpid.server.protocol.v0_8.MessageMetaData;
-import org.apache.qpid.server.model.Broker;
import org.apache.qpid.server.model.UUIDGenerator;
import org.apache.qpid.server.plugin.ExchangeType;
-import org.apache.qpid.server.queue.PriorityQueue;
+import org.apache.qpid.server.protocol.v0_8.AMQMessage;
+import org.apache.qpid.server.protocol.v0_8.MessageMetaData;
import org.apache.qpid.server.queue.AMQQueue;
import org.apache.qpid.server.queue.ConflationQueue;
+import org.apache.qpid.server.queue.PriorityQueue;
import org.apache.qpid.server.queue.StandardQueue;
import org.apache.qpid.server.txn.AutoCommitTransaction;
import org.apache.qpid.server.txn.ServerTransaction;
import org.apache.qpid.server.util.BrokerTestHelper;
+import org.apache.qpid.server.virtualhost.StandardVirtualHostFactory;
import org.apache.qpid.server.virtualhost.VirtualHost;
import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
import org.apache.qpid.test.utils.QpidTestCase;
import org.apache.qpid.util.FileUtils;
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
/**
* This tests the MessageStores by using the available interfaces.
*
@@ -104,8 +102,6 @@ public class MessageStoreTest extends Qp
private String queueOwner = "MST";
- private PropertiesConfiguration _config;
-
private VirtualHost _virtualHost;
private org.apache.qpid.server.model.VirtualHost _virtualHostModel;
private Broker _broker;
@@ -116,15 +112,19 @@ public class MessageStoreTest extends Qp
super.setUp();
BrokerTestHelper.setUp();
- _storePath = System.getProperty("QPID_WORK") + File.separator + getName();
-
- _config = new PropertiesConfiguration();
- _config.addProperty("store.class", getTestProfileMessageStoreClassName());
- _config.addProperty("store.environment-path", _storePath);
- _virtualHostModel = mock(org.apache.qpid.server.model.VirtualHost.class);
- when(_virtualHostModel.getAttribute(eq(org.apache.qpid.server.model.VirtualHost.STORE_PATH))).thenReturn(_storePath);
+ String hostName = getName();
+ _storePath = System.getProperty("QPID_WORK", TMP_FOLDER + File.separator + getTestName()) + File.separator + hostName;
+ Map<String, Object> messageStoreSettings = new HashMap<String, Object>();
+ messageStoreSettings.put(MessageStore.STORE_PATH, _storePath);
+ messageStoreSettings.put(MessageStore.STORE_TYPE, getTestProfileMessageStoreType());
+ _virtualHostModel = mock(org.apache.qpid.server.model.VirtualHost.class);
+ when(_virtualHostModel.getMessageStoreSettings()).thenReturn(messageStoreSettings);
+ when(_virtualHostModel.getAttribute(eq(org.apache.qpid.server.model.VirtualHost.TYPE))).thenReturn(StandardVirtualHostFactory.TYPE);
+ when(_virtualHostModel.getAttribute(eq(org.apache.qpid.server.model.VirtualHost.NAME))).thenReturn(hostName);
+ when(_virtualHostModel.getType()).thenReturn(StandardVirtualHostFactory.TYPE);
+ when(_virtualHostModel.getName()).thenReturn(hostName);
cleanup(new File(_storePath));
@@ -138,7 +138,7 @@ public class MessageStoreTest extends Qp
return _storePath;
}
- protected org.apache.qpid.server.model.VirtualHost getVirtualHostModel()
+ protected org.apache.qpid.server.model.VirtualHost<?> getVirtualHostModel()
{
return _virtualHostModel;
}
@@ -165,11 +165,6 @@ public class MessageStoreTest extends Qp
return _virtualHost;
}
- public PropertiesConfiguration getConfig()
- {
- return _config;
- }
-
protected void reloadVirtualHost()
{
VirtualHost original = getVirtualHost();
@@ -189,7 +184,7 @@ public class MessageStoreTest extends Qp
try
{
- _virtualHost = BrokerTestHelper.createVirtualHost(new VirtualHostConfiguration(getClass().getName(), _config, _broker),new VirtualHostRegistry(_broker.getEventLogger()),getVirtualHostModel());
+ _virtualHost = BrokerTestHelper.createVirtualHost(new VirtualHostRegistry(new EventLogger()), getVirtualHostModel());
when(_virtualHostModel.getId()).thenReturn(_virtualHost.getId());
ConfiguredObjectRecord objectRecord = mock(ConfiguredObjectRecord.class);
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/store/QuotaMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/store/QuotaMessageStore.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/store/QuotaMessageStore.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/store/QuotaMessageStore.java Thu Apr 3 19:58:53 2014
@@ -20,43 +20,37 @@
*/
package org.apache.qpid.server.store;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;
import org.apache.qpid.server.message.EnqueueableMessage;
import org.apache.qpid.server.message.MessageContentSource;
-import org.apache.qpid.server.model.VirtualHost;
+import org.apache.qpid.server.model.ConfiguredObject;
-public class
- QuotaMessageStore extends NullMessageStore
+public class QuotaMessageStore extends NullMessageStore
{
+ public static final String TYPE = "QuotaMessageStore";
private final AtomicLong _messageId = new AtomicLong(1);
- private final AtomicBoolean _closed = new AtomicBoolean(false);
private long _totalStoreSize;;
private boolean _limitBusted;
private long _persistentSizeLowThreshold;
private long _persistentSizeHighThreshold;
- private final StateManager _stateManager;
private final EventManager _eventManager = new EventManager();
- public QuotaMessageStore()
- {
- _stateManager = new StateManager(_eventManager);
- }
@Override
- public void configureConfigStore(VirtualHost virtualHost, ConfigurationRecoveryHandler recoveryHandler)
+ public void openMessageStore(ConfiguredObject<?> parent, Map<String, Object> messageStoreSettings)
{
- Object overfullAttr = virtualHost.getAttribute(MessageStoreConstants.OVERFULL_SIZE_ATTRIBUTE);
+ Object overfullAttr = messageStoreSettings.get(MessageStore.OVERFULL_SIZE);
_persistentSizeHighThreshold = overfullAttr == null
? Long.MAX_VALUE
: overfullAttr instanceof Number
? ((Number)overfullAttr).longValue()
: Long.parseLong(overfullAttr.toString());
- Object underfullAttr = virtualHost.getAttribute(MessageStoreConstants.UNDERFULL_SIZE_ATTRIBUTE);
+ Object underfullAttr = messageStoreSettings.get(MessageStore.UNDERFULL_SIZE);
_persistentSizeLowThreshold = overfullAttr == null
? _persistentSizeHighThreshold
@@ -69,22 +63,8 @@ public class
{
_persistentSizeLowThreshold = _persistentSizeHighThreshold;
}
- _stateManager.attainState(State.INITIALISING);
}
- @Override
- public void configureMessageStore(VirtualHost virtualHost, MessageStoreRecoveryHandler recoveryHandler,
- TransactionLogRecoveryHandler tlogRecoveryHandler)
- {
- _stateManager.attainState(State.INITIALISED);
- }
-
- @Override
- public void activate()
- {
- _stateManager.attainState(State.ACTIVATING);
- _stateManager.attainState(State.ACTIVE);
- }
@SuppressWarnings("unchecked")
@Override
@@ -150,16 +130,6 @@ public class
}
@Override
- public void close()
- {
- if (_closed.compareAndSet(false, true))
- {
- _stateManager.attainState(State.CLOSING);
- _stateManager.attainState(State.CLOSED);
- }
- }
-
- @Override
public void addEventListener(EventListener eventListener, Event... events)
{
_eventManager.addEventListener(eventListener, events);
@@ -189,6 +159,6 @@ public class
@Override
public String getStoreType()
{
- return "QUOTA";
+ return TYPE;
}
}
Modified: qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java?rev=1584365&r1=1584364&r2=1584365&view=diff
==============================================================================
--- qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java (original)
+++ qpid/branches/java-broker-config-store-changes/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java Thu Apr 3 19:58:53 2014
@@ -21,92 +21,60 @@
package org.apache.qpid.server.store;
import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.Map;
import java.util.UUID;
-import org.apache.log4j.Logger;
+import java.util.concurrent.ConcurrentHashMap;
+import org.apache.log4j.Logger;
import org.apache.qpid.server.message.EnqueueableMessage;
-import org.apache.qpid.server.message.ServerMessage;
-import org.apache.qpid.server.model.VirtualHost;
-import org.apache.qpid.server.util.ServerScopedRuntimeException;
-
-import java.nio.ByteBuffer;
-import java.util.HashMap;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.plugin.MessageStoreFactory;
public class SlowMessageStore implements MessageStore, DurableConfigurationStore
{
private static final Logger _logger = Logger.getLogger(SlowMessageStore.class);
- private static final String DELAYS = "delays";
+
+ public static final String TYPE = "SLOW";
+ public static final String DELAYS = "delays";
+ public static final String REAL_STORE = "realStore";
+
+ private static final String DEFAULT_DELAY = "default";
+ private static final String PRE = "pre";
+ private static final String POST = "post";
+
private HashMap<String, Long> _preDelays = new HashMap<String, Long>();
private HashMap<String, Long> _postDelays = new HashMap<String, Long>();
private long _defaultDelay = 0L;
- private MessageStore _realStore = new MessageStoreCreator().createMessageStore("Memory");
- private DurableConfigurationStore _durableConfigurationStore = (DurableConfigurationStore) _realStore;
- private static final String PRE = "pre";
- private static final String POST = "post";
- private String DEFAULT_DELAY = "default";
+ private MessageStore _realMessageStore = null;
+ private DurableConfigurationStore _realDurableConfigurationStore = null;
- // ***** MessageStore Interface.
+ private Map<EventListener, Event[]> _eventListeners = new ConcurrentHashMap<EventListener, Event[]>();
- public void configureConfigStore(VirtualHost virtualHost, ConfigurationRecoveryHandler recoveryHandler)
+ @Override
+ public void openConfigurationStore(ConfiguredObject<?> parent, Map<String, Object> storeSettings)
{
- _logger.info("Starting SlowMessageStore on Virtualhost:" + virtualHost.getName());
-
- Object delaysAttr = virtualHost.getAttribute("slowMessageStoreDelays");
-
- Map delays = (delaysAttr instanceof Map) ? (Map) delaysAttr : Collections.emptyMap();
- configureDelays(delays);
-
- final Object realStoreAttr = virtualHost.getAttribute("realStore");
- String messageStoreClass = realStoreAttr == null ? null : realStoreAttr.toString();
-
- if (delays.containsKey(DEFAULT_DELAY))
+ if (storeSettings != null && storeSettings.get(REAL_STORE) != null)
{
- _defaultDelay = Long.parseLong(String.valueOf(delays.get(DEFAULT_DELAY)));
+ final String realStore = (String) storeSettings.get(REAL_STORE);
+ _realDurableConfigurationStore = new DurableConfigurationStoreCreator().createMessageStore(realStore);
+ _realDurableConfigurationStore.openConfigurationStore(parent, storeSettings);
}
+ }
- if (messageStoreClass != null)
- {
- try
- {
- Class<?> clazz = Class.forName(messageStoreClass);
-
- Object o = clazz.newInstance();
-
- if (!(o instanceof MessageStore))
- {
- throw new ClassCastException("Message store class must implement " + MessageStore.class + ". Class " + clazz +
- " does not.");
- }
- _realStore = (MessageStore) o;
- if(o instanceof DurableConfigurationStore)
- {
- _durableConfigurationStore = (DurableConfigurationStore)o;
- }
- }
- catch (ClassNotFoundException e)
- {
- throw new ServerScopedRuntimeException("Unable to find message store class", e);
- }
- catch (InstantiationException e)
- {
- throw new ServerScopedRuntimeException("Unable to initialise message store class", e);
- }
- catch (IllegalAccessException e)
- {
- throw new ServerScopedRuntimeException("Unable to access message store class", e);
- }
- }
- _durableConfigurationStore.configureConfigStore(virtualHost, recoveryHandler);
-
+ @Override
+ public void recoverConfigurationStore(ConfigurationRecoveryHandler recoveryHandler)
+ {
+ _realDurableConfigurationStore.recoverConfigurationStore(recoveryHandler);
}
- private void configureDelays(Map<Object, Object> config)
+ private void configureDelays(Map<String, Object> delays)
{
- for(Map.Entry<Object, Object> entry : config.entrySet())
+ for(Map.Entry<String, Object> entry : delays.entrySet())
{
- String key = String.valueOf(entry.getKey());
+ String key = entry.getKey();
if (key.startsWith(PRE))
{
_preDelays.put(key.substring(PRE.length()), Long.parseLong(String.valueOf(entry.getValue())));
@@ -165,30 +133,67 @@ public class SlowMessageStore implements
}
}
-
- public void configureMessageStore(VirtualHost virtualHost, MessageStoreRecoveryHandler messageRecoveryHandler,
- TransactionLogRecoveryHandler tlogRecoveryHandler)
+ @Override
+ public void openMessageStore(ConfiguredObject<?> parent, Map<String, Object> messageStoreSettings)
{
- _realStore.configureMessageStore(virtualHost, messageRecoveryHandler, tlogRecoveryHandler);
+ Object delaysAttr = messageStoreSettings.get(DELAYS);
+
+ @SuppressWarnings({ "unchecked" })
+ Map<String,Object> delays = (delaysAttr instanceof Map) ? (Map<String,Object>) delaysAttr : Collections.<String,Object>emptyMap();
+ configureDelays(delays);
+
+ if (delays.containsKey(DEFAULT_DELAY))
+ {
+ _defaultDelay = Long.parseLong(String.valueOf(delays.get(DEFAULT_DELAY)));
+ }
+
+ final Object realStoreAttr = messageStoreSettings.get(REAL_STORE) == null ? MemoryMessageStore.TYPE : messageStoreSettings.get(REAL_STORE);
+ final String realStore = (String) realStoreAttr;
+ _realMessageStore = MessageStoreFactory.FACTORY_LOADER.get(realStore).createMessageStore();
+
+ if (!_eventListeners.isEmpty())
+ {
+ for (Iterator<Map.Entry<EventListener, Event[]>> it = _eventListeners.entrySet().iterator(); it.hasNext();)
+ {
+ Map.Entry<EventListener, Event[]> entry = it.next();
+ _realMessageStore.addEventListener(entry.getKey(), entry.getValue());
+ it.remove();
+ }
+ }
+ _realMessageStore.openMessageStore(parent, messageStoreSettings);
+
+ if (_realDurableConfigurationStore == null)
+ {
+ _realDurableConfigurationStore = (DurableConfigurationStore) _realMessageStore;
+ }
+
}
- public void close()
+ @Override
+ public void closeMessageStore()
{
doPreDelay("close");
- _realStore.close();
+ _realMessageStore.closeMessageStore();
doPostDelay("close");
}
+ @Override
+ public void closeConfigurationStore()
+ {
+ _realDurableConfigurationStore.closeConfigurationStore();
+ }
+
+ @Override
public <M extends StorableMessageMetaData> StoredMessage<M> addMessage(M metaData)
{
- return _realStore.addMessage(metaData);
+ return _realMessageStore.addMessage(metaData);
}
@Override
public void create(ConfiguredObjectRecord record) throws StoreException
{
doPreDelay("create");
- _durableConfigurationStore.create(record);
+ _realDurableConfigurationStore.create(record);
doPostDelay("create");
}
@@ -197,7 +202,7 @@ public class SlowMessageStore implements
public UUID[] remove(final ConfiguredObjectRecord... objects) throws StoreException
{
doPreDelay("remove");
- UUID[] removed = _durableConfigurationStore.remove(objects);
+ UUID[] removed = _realDurableConfigurationStore.remove(objects);
doPostDelay("remove");
return removed;
}
@@ -206,37 +211,23 @@ public class SlowMessageStore implements
public void update(boolean createIfNecessary, ConfiguredObjectRecord... records) throws StoreException
{
doPreDelay("update");
- _durableConfigurationStore.update(createIfNecessary, records);
+ _realDurableConfigurationStore.update(createIfNecessary, records);
doPostDelay("update");
}
+ @Override
public Transaction newTransaction()
{
doPreDelay("beginTran");
- Transaction txn = new SlowTransaction(_realStore.newTransaction());
+ Transaction txn = new SlowTransaction(_realMessageStore.newTransaction());
doPostDelay("beginTran");
return txn;
}
-
+ @Override
public boolean isPersistent()
{
- return _realStore.isPersistent();
- }
-
- public void storeMessageHeader(Long messageNumber, ServerMessage message)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void storeContent(Long messageNumber, long offset, ByteBuffer body)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public ServerMessage getMessage(Long messageNumber)
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ return _realMessageStore.isPersistent();
}
private class SlowTransaction implements Transaction
@@ -248,6 +239,7 @@ public class SlowMessageStore implements
_underlying = underlying;
}
+ @Override
public void enqueueMessage(TransactionLogResource queue, EnqueueableMessage message)
{
doPreDelay("enqueueMessage");
@@ -255,6 +247,7 @@ public class SlowMessageStore implements
doPostDelay("enqueueMessage");
}
+ @Override
public void dequeueMessage(TransactionLogResource queue, EnqueueableMessage message)
{
doPreDelay("dequeueMessage");
@@ -262,6 +255,7 @@ public class SlowMessageStore implements
doPostDelay("dequeueMessage");
}
+ @Override
public void commitTran()
{
doPreDelay("commitTran");
@@ -269,6 +263,7 @@ public class SlowMessageStore implements
doPostDelay("commitTran");
}
+ @Override
public StoreFuture commitTranAsync()
{
doPreDelay("commitTran");
@@ -277,6 +272,7 @@ public class SlowMessageStore implements
return future;
}
+ @Override
public void abortTran()
{
doPreDelay("abortTran");
@@ -284,11 +280,13 @@ public class SlowMessageStore implements
doPostDelay("abortTran");
}
+ @Override
public void removeXid(long format, byte[] globalId, byte[] branchId)
{
_underlying.removeXid(format, globalId, branchId);
}
+ @Override
public void recordXid(long format, byte[] globalId, byte[] branchId, Record[] enqueues, Record[] dequeues)
{
_underlying.recordXid(format, globalId, branchId, enqueues, dequeues);
@@ -296,33 +294,40 @@ public class SlowMessageStore implements
}
@Override
- public void activate()
+ public void recoverMessageStore(MessageStoreRecoveryHandler messageRecoveryHandler, TransactionLogRecoveryHandler transactionLogRecoveryHandler)
{
- _realStore.activate();
+ _realMessageStore.recoverMessageStore(messageRecoveryHandler, transactionLogRecoveryHandler);
}
@Override
public void addEventListener(EventListener eventListener, Event... events)
{
- _realStore.addEventListener(eventListener, events);
+ if (_realMessageStore == null)
+ {
+ _eventListeners .put(eventListener, events);
+ }
+ else
+ {
+ _realMessageStore.addEventListener(eventListener, events);
+ }
}
@Override
public String getStoreLocation()
{
- return _realStore.getStoreLocation();
+ return _realMessageStore.getStoreLocation();
}
@Override
public String getStoreType()
{
- return "SLOW";
+ return TYPE;
}
@Override
public void onDelete()
{
- _realStore.onDelete();
+ _realMessageStore.onDelete();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org