changeset 2602:4d7312c27c6c

Fix ordering of vm plugins PR3332 Reviewed-by: neugens Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-February/022266.html
author Alex Macdonald <almacdon@redhat.com>
date Thu, 02 Mar 2017 10:52:18 -0500
parents 648dc28c87ed
children 02f866dff054
files client/core/src/main/java/com/redhat/thermostat/client/ui/HostInformationController.java client/core/src/main/java/com/redhat/thermostat/client/ui/PluginInfoComparator.java client/core/src/main/java/com/redhat/thermostat/client/ui/VmInformationController.java client/core/src/test/java/com/redhat/thermostat/client/ui/PluginInfoComparatorTest.java common/core/src/main/java/com/redhat/thermostat/common/OrderedComparator.java common/core/src/test/java/com/redhat/thermostat/common/OrderedComparatorTest.java vm-compiler/agent/src/main/java/com/redhat/thermostat/vm/compiler/agent/internal/VmCompilerStatBackend.java vm-compiler/client-core/src/main/java/com/redhat/thermostat/vm/compiler/client/core/internal/VmCompilerStatServiceImpl.java vm-compiler/common/src/main/java/com/redhat/thermostat/vm/compiler/common/Constants.java vm-cpu/agent/src/main/java/com/redhat/thermostat/vm/cpu/agent/internal/VmCpuBackend.java vm-cpu/agent/src/test/java/com/redhat/thermostat/vm/cpu/agent/internal/VmCpuBackendTest.java vm-cpu/client-core/src/main/java/com/redhat/thermostat/vm/cpu/client/core/internal/VmCpuServiceImpl.java vm-cpu/common/src/main/java/com/redhat/thermostat/vm/cpu/common/Constants.java vm-gc/agent/src/main/java/com/redhat/thermostat/vm/gc/agent/internal/VmGcBackend.java vm-gc/client-core/src/main/java/com/redhat/thermostat/vm/gc/client/core/internal/VmGcServiceImpl.java vm-gc/common/src/main/java/com/redhat/thermostat/vm/gc/common/Constants.java vm-memory/agent/src/main/java/com/redhat/thermostat/vm/memory/agent/internal/VmMemoryBackend.java vm-memory/client-core/src/main/java/com/redhat/thermostat/vm/memory/client/core/internal/MemoryStatsServiceImpl.java vm-memory/common/src/main/java/com/redhat/thermostat/vm/memory/common/Constants.java vm-numa/agent/src/main/java/com/redhat/thermostat/vm/numa/agent/internal/VmNumaBackend.java vm-numa/client-core/src/main/java/com/redhat/thermostat/vm/numa/client/core/VmNumaServiceImpl.java vm-numa/common/src/main/java/com/redhat/thermostat/vm/numa/common/Constants.java
diffstat 22 files changed, 409 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/client/core/src/main/java/com/redhat/thermostat/client/ui/HostInformationController.java	Tue Feb 28 14:33:51 2017 -0500
+++ b/client/core/src/main/java/com/redhat/thermostat/client/ui/HostInformationController.java	Thu Mar 02 10:52:18 2017 -0500
@@ -48,8 +48,6 @@
 import com.redhat.thermostat.client.core.views.HostInformationView;
 import com.redhat.thermostat.client.core.views.HostInformationViewProvider;
 import com.redhat.thermostat.client.core.views.UIPluginInfo;
-import com.redhat.thermostat.common.OrderedComparator;
-import com.redhat.thermostat.shared.locale.LocalizedString;
 import com.redhat.thermostat.storage.core.HostRef;
 
 public class HostInformationController implements ContentProvider {
@@ -100,7 +98,7 @@
             dynamicProvider.forEach(ref, action);
         }
 
-        Collections.sort(plugins, new OrderedComparator<UIPluginInfo>());
+        Collections.sort(plugins, new PluginInfoComparator<UIPluginInfo>());
 
         view.addChildViews(plugins);
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/core/src/main/java/com/redhat/thermostat/client/ui/PluginInfoComparator.java	Thu Mar 02 10:52:18 2017 -0500
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2012-2017 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.client.ui;
+
+import com.redhat.thermostat.client.core.views.UIPluginInfo;
+import com.redhat.thermostat.common.OrderedComparator;
+
+class PluginInfoComparator<T extends UIPluginInfo> extends OrderedComparator<T> {
+
+    @Override
+    protected String getName(T object) {
+        return object.getLocalizedName().getContents();
+    }
+
+}
--- a/client/core/src/main/java/com/redhat/thermostat/client/ui/VmInformationController.java	Tue Feb 28 14:33:51 2017 -0500
+++ b/client/core/src/main/java/com/redhat/thermostat/client/ui/VmInformationController.java	Thu Mar 02 10:52:18 2017 -0500
@@ -48,7 +48,6 @@
 import com.redhat.thermostat.client.core.views.UIPluginInfo;
 import com.redhat.thermostat.client.core.views.VmInformationView;
 import com.redhat.thermostat.client.core.views.VmInformationViewProvider;
-import com.redhat.thermostat.common.OrderedComparator;
 import com.redhat.thermostat.storage.core.VmRef;
 
 public class VmInformationController implements ContentProvider {
@@ -104,7 +103,7 @@
             dynamicProvider.forEach(vmRef, action);
         }
 
-        Collections.sort(plugins, new OrderedComparator<UIPluginInfo>());
+        Collections.sort(plugins, new PluginInfoComparator<UIPluginInfo>());
 
         view.addChildViews(plugins);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/core/src/test/java/com/redhat/thermostat/client/ui/PluginInfoComparatorTest.java	Thu Mar 02 10:52:18 2017 -0500
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2012-2017 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.client.ui;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.redhat.thermostat.client.core.views.UIComponent;
+import com.redhat.thermostat.client.core.views.UIPluginInfo;
+import com.redhat.thermostat.client.ui.PluginInfo;
+import com.redhat.thermostat.client.ui.PluginInfoComparator;
+import com.redhat.thermostat.shared.locale.LocalizedString;
+
+public class PluginInfoComparatorTest {
+
+    private List<UIPluginInfo> plugins;
+    private int[] orderValues = {240, 200, 200, 120, 100, 0};
+    private String[] pluginNames = {"Memory", "NUMA", "GC", "Profiler", "CPU", "Overview"};
+
+    @Before
+    public void setUp() {
+        createPluginInfos();
+    }
+
+    @Test
+    public void testPluginOrder() {
+        Collections.sort(plugins, new PluginInfoComparator<UIPluginInfo>());
+        assertEquals(plugins.get(0).getLocalizedName().getContents(), "Overview");
+        assertEquals(plugins.get(1).getLocalizedName().getContents(), "CPU");
+        assertEquals(plugins.get(2).getLocalizedName().getContents(), "Profiler");
+        assertEquals(plugins.get(3).getOrderValue(), plugins.get(4).getOrderValue());
+        assertEquals(plugins.get(3).getLocalizedName().getContents(), "GC");
+        assertEquals(plugins.get(4).getLocalizedName().getContents(), "NUMA");
+        assertEquals(plugins.get(5).getLocalizedName().getContents(), "Memory");
+    }
+
+    private void createPluginInfos() {
+        plugins = new ArrayList<>();
+        for (int i = 0; i < pluginNames.length; i++) {
+            plugins.add(new PluginInfo(new LocalizedString(pluginNames[i]), mock(UIComponent.class), orderValues[i]));
+        }
+    }
+
+}
\ No newline at end of file
--- a/common/core/src/main/java/com/redhat/thermostat/common/OrderedComparator.java	Tue Feb 28 14:33:51 2017 -0500
+++ b/common/core/src/main/java/com/redhat/thermostat/common/OrderedComparator.java	Thu Mar 02 10:52:18 2017 -0500
@@ -54,7 +54,7 @@
     /*
      * Extracted for testing purposes.
      */
-    String getName(T object) {
+    protected String getName(T object) {
         return object.getClass().getName();
     }
 
--- a/common/core/src/test/java/com/redhat/thermostat/common/OrderedComparatorTest.java	Tue Feb 28 14:33:51 2017 -0500
+++ b/common/core/src/test/java/com/redhat/thermostat/common/OrderedComparatorTest.java	Thu Mar 02 10:52:18 2017 -0500
@@ -58,7 +58,7 @@
         // the services with equal order value
         OrderedComparator<Ordered> comparator = new OrderedComparator<Ordered>() {
             @Override
-            String getName(Ordered object) {
+            protected String getName(Ordered object) {
                 String result;
                 if (object.equals(services.get(1))) {
                     result = "TheirService";
--- a/vm-compiler/agent/src/main/java/com/redhat/thermostat/vm/compiler/agent/internal/VmCompilerStatBackend.java	Tue Feb 28 14:33:51 2017 -0500
+++ b/vm-compiler/agent/src/main/java/com/redhat/thermostat/vm/compiler/agent/internal/VmCompilerStatBackend.java	Thu Mar 02 10:52:18 2017 -0500
@@ -41,6 +41,7 @@
 import com.redhat.thermostat.backend.VmUpdateListener;
 import com.redhat.thermostat.common.Version;
 import com.redhat.thermostat.storage.core.WriterID;
+import com.redhat.thermostat.vm.compiler.common.Constants;
 import com.redhat.thermostat.vm.compiler.common.VmCompilerStatDao;
 
 public class VmCompilerStatBackend extends VmListenerBackend {
@@ -57,7 +58,7 @@
 
     @Override
     public int getOrderValue() {
-        return ORDER_CODE_GROUP;
+        return Constants.ORDER;
     }
 
     @Override
--- a/vm-compiler/client-core/src/main/java/com/redhat/thermostat/vm/compiler/client/core/internal/VmCompilerStatServiceImpl.java	Tue Feb 28 14:33:51 2017 -0500
+++ b/vm-compiler/client-core/src/main/java/com/redhat/thermostat/vm/compiler/client/core/internal/VmCompilerStatServiceImpl.java	Thu Mar 02 10:52:18 2017 -0500
@@ -46,11 +46,11 @@
 import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.vm.compiler.client.core.VmCompilerStatService;
 import com.redhat.thermostat.vm.compiler.client.core.VmCompilerStatViewProvider;
+import com.redhat.thermostat.vm.compiler.common.Constants;
 import com.redhat.thermostat.vm.compiler.common.VmCompilerStatDao;
 
 public class VmCompilerStatServiceImpl implements VmCompilerStatService {
 
-    private static final int ORDER = ORDER_CODE_GROUP;
     private Filter<VmRef> filter = new NameMatchingRefFilter<>();
 
     private ApplicationService appSvc;
@@ -80,7 +80,7 @@
 
     @Override
     public int getOrderValue() {
-        return ORDER;
+        return Constants.ORDER;
     }
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vm-compiler/common/src/main/java/com/redhat/thermostat/vm/compiler/common/Constants.java	Thu Mar 02 10:52:18 2017 -0500
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2012-2017 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.vm.compiler.common;
+
+import com.redhat.thermostat.common.Ordered;
+
+public class Constants {
+
+    public static final int ORDER = Ordered.ORDER_CODE_GROUP;
+
+    private Constants() {
+        throw new AssertionError("Do not instantiate this");
+    }
+
+}
--- a/vm-cpu/agent/src/main/java/com/redhat/thermostat/vm/cpu/agent/internal/VmCpuBackend.java	Tue Feb 28 14:33:51 2017 -0500
+++ b/vm-cpu/agent/src/main/java/com/redhat/thermostat/vm/cpu/agent/internal/VmCpuBackend.java	Thu Mar 02 10:52:18 2017 -0500
@@ -54,6 +54,7 @@
 import com.redhat.thermostat.common.utils.LoggingUtils;
 import com.redhat.thermostat.shared.config.OS;
 import com.redhat.thermostat.storage.core.WriterID;
+import com.redhat.thermostat.vm.cpu.common.Constants;
 import com.redhat.thermostat.vm.cpu.common.VmCpuStatDAO;
 import com.redhat.thermostat.vm.cpu.common.model.VmCpuStat;
 
@@ -76,7 +77,7 @@
 
     @Override
     public int getOrderValue() {
-        return ORDER_CPU_GROUP + 50;
+        return Constants.ORDER;
     }
 
     private static class VmCpuBackendAction implements VmPollingAction {
--- a/vm-cpu/agent/src/test/java/com/redhat/thermostat/vm/cpu/agent/internal/VmCpuBackendTest.java	Tue Feb 28 14:33:51 2017 -0500
+++ b/vm-cpu/agent/src/test/java/com/redhat/thermostat/vm/cpu/agent/internal/VmCpuBackendTest.java	Thu Mar 02 10:52:18 2017 -0500
@@ -36,6 +36,7 @@
 
 package com.redhat.thermostat.vm.cpu.agent.internal;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.any;
@@ -61,6 +62,7 @@
 import com.redhat.thermostat.common.Ordered;
 import com.redhat.thermostat.common.Version;
 import com.redhat.thermostat.storage.core.WriterID;
+import com.redhat.thermostat.vm.cpu.common.Constants;
 import com.redhat.thermostat.vm.cpu.common.VmCpuStatDAO;
 import com.redhat.thermostat.vm.cpu.common.model.VmCpuStat;
 
@@ -178,6 +180,7 @@
 
         assertTrue(orderValue > Ordered.ORDER_CPU_GROUP);
         assertTrue(orderValue < Ordered.ORDER_MEMORY_GROUP);
+        assertEquals(orderValue, Constants.ORDER);
     }
 }
 
--- a/vm-cpu/client-core/src/main/java/com/redhat/thermostat/vm/cpu/client/core/internal/VmCpuServiceImpl.java	Tue Feb 28 14:33:51 2017 -0500
+++ b/vm-cpu/client-core/src/main/java/com/redhat/thermostat/vm/cpu/client/core/internal/VmCpuServiceImpl.java	Thu Mar 02 10:52:18 2017 -0500
@@ -46,11 +46,11 @@
 import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.vm.cpu.client.core.VmCpuService;
 import com.redhat.thermostat.vm.cpu.client.core.VmCpuViewProvider;
+import com.redhat.thermostat.vm.cpu.common.Constants;
 import com.redhat.thermostat.vm.cpu.common.VmCpuStatDAO;
 
 public class VmCpuServiceImpl implements VmCpuService {
-    
-    private static final int ORDER = ORDER_CPU_GROUP;
+
     private static final Filter<VmRef> FILTER = new NameMatchingRefFilter<>();
 
     private ApplicationService appSvc;
@@ -81,7 +81,7 @@
 
     @Override
     public int getOrderValue() {
-        return ORDER;
+        return Constants.ORDER;
     }
 
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vm-cpu/common/src/main/java/com/redhat/thermostat/vm/cpu/common/Constants.java	Thu Mar 02 10:52:18 2017 -0500
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2012-2017 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.vm.cpu.common;
+
+import com.redhat.thermostat.common.Ordered;
+
+public class Constants {
+
+    public static final int ORDER = Ordered.ORDER_CPU_GROUP + 10;
+
+    private Constants() {
+        throw new AssertionError("Do not instantiate this");
+    }
+
+}
--- a/vm-gc/agent/src/main/java/com/redhat/thermostat/vm/gc/agent/internal/VmGcBackend.java	Tue Feb 28 14:33:51 2017 -0500
+++ b/vm-gc/agent/src/main/java/com/redhat/thermostat/vm/gc/agent/internal/VmGcBackend.java	Thu Mar 02 10:52:18 2017 -0500
@@ -41,6 +41,7 @@
 import com.redhat.thermostat.backend.VmUpdateListener;
 import com.redhat.thermostat.common.Version;
 import com.redhat.thermostat.storage.core.WriterID;
+import com.redhat.thermostat.vm.gc.common.Constants;
 import com.redhat.thermostat.vm.gc.common.VmGcStatDAO;
 
 public class VmGcBackend extends VmListenerBackend {
@@ -57,7 +58,7 @@
 
     @Override
     public int getOrderValue() {
-        return ORDER_MEMORY_GROUP + 20;
+        return Constants.ORDER;
     }
 
     @Override
--- a/vm-gc/client-core/src/main/java/com/redhat/thermostat/vm/gc/client/core/internal/VmGcServiceImpl.java	Tue Feb 28 14:33:51 2017 -0500
+++ b/vm-gc/client-core/src/main/java/com/redhat/thermostat/vm/gc/client/core/internal/VmGcServiceImpl.java	Thu Mar 02 10:52:18 2017 -0500
@@ -49,12 +49,12 @@
 import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.vm.gc.client.core.VmGcService;
 import com.redhat.thermostat.vm.gc.client.core.VmGcViewProvider;
+import com.redhat.thermostat.vm.gc.common.Constants;
 import com.redhat.thermostat.vm.gc.common.VmGcStatDAO;
 import com.redhat.thermostat.vm.memory.common.VmMemoryStatDAO;
 
 public class VmGcServiceImpl implements VmGcService {
-    
-    private static final int ORDER = ORDER_MEMORY_GROUP;
+
     private static final Filter<VmRef> FILTER = new NameMatchingRefFilter<>();
 
     private ApplicationService appSvc;
@@ -94,7 +94,7 @@
 
     @Override
     public int getOrderValue() {
-        return ORDER;
+        return Constants.ORDER;
     }
 
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vm-gc/common/src/main/java/com/redhat/thermostat/vm/gc/common/Constants.java	Thu Mar 02 10:52:18 2017 -0500
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2012-2017 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.vm.gc.common;
+
+import com.redhat.thermostat.common.Ordered;
+
+public class Constants {
+
+    public static final int ORDER = Ordered.ORDER_MEMORY_GROUP + 20;
+
+    private Constants() {
+        throw new AssertionError("Do not instantiate this");
+    }
+
+}
\ No newline at end of file
--- a/vm-memory/agent/src/main/java/com/redhat/thermostat/vm/memory/agent/internal/VmMemoryBackend.java	Tue Feb 28 14:33:51 2017 -0500
+++ b/vm-memory/agent/src/main/java/com/redhat/thermostat/vm/memory/agent/internal/VmMemoryBackend.java	Thu Mar 02 10:52:18 2017 -0500
@@ -41,6 +41,7 @@
 import com.redhat.thermostat.backend.VmUpdateListener;
 import com.redhat.thermostat.common.Version;
 import com.redhat.thermostat.storage.core.WriterID;
+import com.redhat.thermostat.vm.memory.common.Constants;
 import com.redhat.thermostat.vm.memory.common.VmMemoryStatDAO;
 import com.redhat.thermostat.vm.memory.common.VmTlabStatDAO;
 
@@ -62,7 +63,7 @@
 
     @Override
     public int getOrderValue() {
-        return ORDER_MEMORY_GROUP + 40;
+        return Constants.ORDER;
     }
 
     @Override
--- a/vm-memory/client-core/src/main/java/com/redhat/thermostat/vm/memory/client/core/internal/MemoryStatsServiceImpl.java	Tue Feb 28 14:33:51 2017 -0500
+++ b/vm-memory/client-core/src/main/java/com/redhat/thermostat/vm/memory/client/core/internal/MemoryStatsServiceImpl.java	Thu Mar 02 10:52:18 2017 -0500
@@ -49,12 +49,12 @@
 import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.vm.memory.client.core.MemoryStatsService;
 import com.redhat.thermostat.vm.memory.client.core.MemoryStatsViewProvider;
+import com.redhat.thermostat.vm.memory.common.Constants;
 import com.redhat.thermostat.vm.memory.common.VmMemoryStatDAO;
 import com.redhat.thermostat.vm.memory.common.VmTlabStatDAO;
 
 public class MemoryStatsServiceImpl implements MemoryStatsService {
-    
-    private static final int ORDER = ORDER_MEMORY_GROUP + 40;
+
     private Filter<VmRef> filter = new NameMatchingRefFilter<>();
 
     private ApplicationService appSvc;
@@ -93,7 +93,7 @@
 
     @Override
     public int getOrderValue() {
-        return ORDER;
+        return Constants.ORDER;
     }
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vm-memory/common/src/main/java/com/redhat/thermostat/vm/memory/common/Constants.java	Thu Mar 02 10:52:18 2017 -0500
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2012-2017 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.vm.memory.common;
+
+import com.redhat.thermostat.common.Ordered;
+
+public class Constants {
+
+    public static final int ORDER = Ordered.ORDER_MEMORY_GROUP + 40;
+
+    private Constants() {
+        throw new AssertionError("Do not instantiate this");
+    }
+
+}
\ No newline at end of file
--- a/vm-numa/agent/src/main/java/com/redhat/thermostat/vm/numa/agent/internal/VmNumaBackend.java	Tue Feb 28 14:33:51 2017 -0500
+++ b/vm-numa/agent/src/main/java/com/redhat/thermostat/vm/numa/agent/internal/VmNumaBackend.java	Thu Mar 02 10:52:18 2017 -0500
@@ -50,6 +50,7 @@
 import com.redhat.thermostat.common.Version;
 import com.redhat.thermostat.common.utils.LoggingUtils;
 import com.redhat.thermostat.storage.core.WriterID;
+import com.redhat.thermostat.vm.numa.common.Constants;
 import com.redhat.thermostat.vm.numa.common.VmNumaDAO;
 import com.redhat.thermostat.vm.numa.common.VmNumaStat;
 
@@ -70,7 +71,7 @@
 
     @Override
     public int getOrderValue() {
-        return ORDER_MEMORY_GROUP;
+        return Constants.ORDER;
     }
 
     private static class VmNumaBackendAction implements VmPollingAction {
--- a/vm-numa/client-core/src/main/java/com/redhat/thermostat/vm/numa/client/core/VmNumaServiceImpl.java	Tue Feb 28 14:33:51 2017 -0500
+++ b/vm-numa/client-core/src/main/java/com/redhat/thermostat/vm/numa/client/core/VmNumaServiceImpl.java	Thu Mar 02 10:52:18 2017 -0500
@@ -48,11 +48,11 @@
 import com.redhat.thermostat.storage.core.VmId;
 import com.redhat.thermostat.storage.core.VmRef;
 import com.redhat.thermostat.vm.numa.client.core.internal.VmNumaController;
+import com.redhat.thermostat.vm.numa.common.Constants;
 import com.redhat.thermostat.vm.numa.common.VmNumaDAO;
 
 public class VmNumaServiceImpl implements VmNumaService {
 
-    private static final int ORDER = ORDER_MEMORY_GROUP;
     private static final Filter<VmRef> FILTER = new NameMatchingRefFilter<>();
 
     private ApplicationService appSvc;
@@ -85,6 +85,6 @@
 
     @Override
     public int getOrderValue() {
-        return ORDER;
+        return Constants.ORDER;
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vm-numa/common/src/main/java/com/redhat/thermostat/vm/numa/common/Constants.java	Thu Mar 02 10:52:18 2017 -0500
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2012-2017 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.vm.numa.common;
+
+import com.redhat.thermostat.common.Ordered;
+
+public class Constants {
+
+    public static final int ORDER = Ordered.ORDER_MEMORY_GROUP;
+
+    private Constants() {
+        throw new AssertionError("Do not instantiate this");
+    }
+
+}