# HG changeset patch # User Alex Macdonald # Date 1488469938 18000 # Node ID 4d7312c27c6c59909d75bdaaca8ca2f135dca288 # Parent 648dc28c87ed819901627621712626610fdab005 Fix ordering of vm plugins PR3332 Reviewed-by: neugens Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-February/022266.html diff -r 648dc28c87ed -r 4d7312c27c6c client/core/src/main/java/com/redhat/thermostat/client/ui/HostInformationController.java --- 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()); + Collections.sort(plugins, new PluginInfoComparator()); view.addChildViews(plugins); } diff -r 648dc28c87ed -r 4d7312c27c6c client/core/src/main/java/com/redhat/thermostat/client/ui/PluginInfoComparator.java --- /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 + * . + * + * 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 extends OrderedComparator { + + @Override + protected String getName(T object) { + return object.getLocalizedName().getContents(); + } + +} diff -r 648dc28c87ed -r 4d7312c27c6c client/core/src/main/java/com/redhat/thermostat/client/ui/VmInformationController.java --- 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()); + Collections.sort(plugins, new PluginInfoComparator()); view.addChildViews(plugins); diff -r 648dc28c87ed -r 4d7312c27c6c client/core/src/test/java/com/redhat/thermostat/client/ui/PluginInfoComparatorTest.java --- /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 + * . + * + * 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 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()); + 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 diff -r 648dc28c87ed -r 4d7312c27c6c common/core/src/main/java/com/redhat/thermostat/common/OrderedComparator.java --- 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(); } diff -r 648dc28c87ed -r 4d7312c27c6c common/core/src/test/java/com/redhat/thermostat/common/OrderedComparatorTest.java --- 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 comparator = new OrderedComparator() { @Override - String getName(Ordered object) { + protected String getName(Ordered object) { String result; if (object.equals(services.get(1))) { result = "TheirService"; diff -r 648dc28c87ed -r 4d7312c27c6c vm-compiler/agent/src/main/java/com/redhat/thermostat/vm/compiler/agent/internal/VmCompilerStatBackend.java --- 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 diff -r 648dc28c87ed -r 4d7312c27c6c vm-compiler/client-core/src/main/java/com/redhat/thermostat/vm/compiler/client/core/internal/VmCompilerStatServiceImpl.java --- 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 filter = new NameMatchingRefFilter<>(); private ApplicationService appSvc; @@ -80,7 +80,7 @@ @Override public int getOrderValue() { - return ORDER; + return Constants.ORDER; } } diff -r 648dc28c87ed -r 4d7312c27c6c vm-compiler/common/src/main/java/com/redhat/thermostat/vm/compiler/common/Constants.java --- /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 + * . + * + * 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"); + } + +} diff -r 648dc28c87ed -r 4d7312c27c6c vm-cpu/agent/src/main/java/com/redhat/thermostat/vm/cpu/agent/internal/VmCpuBackend.java --- 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 { diff -r 648dc28c87ed -r 4d7312c27c6c vm-cpu/agent/src/test/java/com/redhat/thermostat/vm/cpu/agent/internal/VmCpuBackendTest.java --- 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); } } diff -r 648dc28c87ed -r 4d7312c27c6c vm-cpu/client-core/src/main/java/com/redhat/thermostat/vm/cpu/client/core/internal/VmCpuServiceImpl.java --- 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 FILTER = new NameMatchingRefFilter<>(); private ApplicationService appSvc; @@ -81,7 +81,7 @@ @Override public int getOrderValue() { - return ORDER; + return Constants.ORDER; } } diff -r 648dc28c87ed -r 4d7312c27c6c vm-cpu/common/src/main/java/com/redhat/thermostat/vm/cpu/common/Constants.java --- /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 + * . + * + * 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"); + } + +} diff -r 648dc28c87ed -r 4d7312c27c6c vm-gc/agent/src/main/java/com/redhat/thermostat/vm/gc/agent/internal/VmGcBackend.java --- 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 diff -r 648dc28c87ed -r 4d7312c27c6c vm-gc/client-core/src/main/java/com/redhat/thermostat/vm/gc/client/core/internal/VmGcServiceImpl.java --- 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 FILTER = new NameMatchingRefFilter<>(); private ApplicationService appSvc; @@ -94,7 +94,7 @@ @Override public int getOrderValue() { - return ORDER; + return Constants.ORDER; } } diff -r 648dc28c87ed -r 4d7312c27c6c vm-gc/common/src/main/java/com/redhat/thermostat/vm/gc/common/Constants.java --- /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 + * . + * + * 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 diff -r 648dc28c87ed -r 4d7312c27c6c vm-memory/agent/src/main/java/com/redhat/thermostat/vm/memory/agent/internal/VmMemoryBackend.java --- 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 diff -r 648dc28c87ed -r 4d7312c27c6c vm-memory/client-core/src/main/java/com/redhat/thermostat/vm/memory/client/core/internal/MemoryStatsServiceImpl.java --- 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 filter = new NameMatchingRefFilter<>(); private ApplicationService appSvc; @@ -93,7 +93,7 @@ @Override public int getOrderValue() { - return ORDER; + return Constants.ORDER; } } diff -r 648dc28c87ed -r 4d7312c27c6c vm-memory/common/src/main/java/com/redhat/thermostat/vm/memory/common/Constants.java --- /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 + * . + * + * 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 diff -r 648dc28c87ed -r 4d7312c27c6c vm-numa/agent/src/main/java/com/redhat/thermostat/vm/numa/agent/internal/VmNumaBackend.java --- 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 { diff -r 648dc28c87ed -r 4d7312c27c6c vm-numa/client-core/src/main/java/com/redhat/thermostat/vm/numa/client/core/VmNumaServiceImpl.java --- 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 FILTER = new NameMatchingRefFilter<>(); private ApplicationService appSvc; @@ -85,6 +85,6 @@ @Override public int getOrderValue() { - return ORDER; + return Constants.ORDER; } } diff -r 648dc28c87ed -r 4d7312c27c6c vm-numa/common/src/main/java/com/redhat/thermostat/vm/numa/common/Constants.java --- /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 + * . + * + * 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"); + } + +}