Mercurial > hg > thermostat-ng > agent
changeset 2758:3f1f63227847
Remove Ordered interface from agent
Reviewed-by: jerboaa, neugens
Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-September/024844.html
line wrap: on
line diff
--- a/agent/core/src/main/java/com/redhat/thermostat/agent/AgentHelper.java Fri Jul 21 16:27:18 2017 +0200 +++ b/agent/core/src/main/java/com/redhat/thermostat/agent/AgentHelper.java Wed Sep 06 14:05:05 2017 +0200 @@ -48,7 +48,6 @@ backendInfo.setObserveNewJvm(backend.getObserveNewJvm()); backendInfo.setActive(backend.isActive()); backendInfo.setPids(new int[0]); - backendInfo.setOrderValue(backend.getOrderValue()); return backendInfo; }
--- a/agent/core/src/main/java/com/redhat/thermostat/agent/internal/BackendInformationTypeAdapter.java Fri Jul 21 16:27:18 2017 +0200 +++ b/agent/core/src/main/java/com/redhat/thermostat/agent/internal/BackendInformationTypeAdapter.java Wed Sep 06 14:05:05 2017 +0200 @@ -82,8 +82,6 @@ writePidArray(out, info.getPids()); out.name(ACTIVE); out.value(info.isActive()); - out.name(ORDER_VALUE); - out.value(info.getOrderValue()); out.endObject(); }
--- a/agent/core/src/main/java/com/redhat/thermostat/backend/Backend.java Fri Jul 21 16:27:18 2017 +0200 +++ b/agent/core/src/main/java/com/redhat/thermostat/backend/Backend.java Wed Sep 06 14:05:05 2017 +0200 @@ -37,7 +37,6 @@ package com.redhat.thermostat.backend; import com.redhat.thermostat.annotations.ExtensionPoint; -import com.redhat.thermostat.common.Ordered; /** * Represents a plugin that runs on the agent and performs monitoring of host @@ -53,7 +52,7 @@ * @see VmListenerBackend */ @ExtensionPoint -public interface Backend extends Ordered { +public interface Backend { /** * @return the name of the {@link Backend}
--- a/agent/core/src/test/java/com/redhat/thermostat/agent/AgentHelperTest.java Fri Jul 21 16:27:18 2017 +0200 +++ b/agent/core/src/test/java/com/redhat/thermostat/agent/AgentHelperTest.java Wed Sep 06 14:05:05 2017 +0200 @@ -59,7 +59,6 @@ when(backend.getDescription()).thenReturn(DESCRIPTION); when(backend.getObserveNewJvm()).thenReturn(true); when(backend.isActive()).thenReturn(true); - when(backend.getOrderValue()).thenReturn(ORDER_VALUE); BackendInformation information = AgentHelper.createBackendInformation(backend, WRITER_ID); @@ -68,7 +67,6 @@ assertEquals(DESCRIPTION, information.getDescription()); assertEquals(true, information.isObserveNewJvm()); assertEquals(true, information.isActive()); - assertEquals(ORDER_VALUE, information.getOrderValue()); assertEquals(WRITER_ID, information.getAgentId()); } @@ -80,7 +78,6 @@ when(backend.getDescription()).thenReturn(DESCRIPTION); when(backend.getObserveNewJvm()).thenReturn(false); when(backend.isActive()).thenReturn(false); - when(backend.getOrderValue()).thenReturn(ORDER_VALUE); BackendInformation information = AgentHelper.createBackendInformation(backend, WRITER_ID); @@ -89,7 +86,6 @@ assertEquals(DESCRIPTION, information.getDescription()); assertEquals(false, information.isObserveNewJvm()); assertEquals(false, information.isActive()); - assertEquals(ORDER_VALUE, information.getOrderValue()); assertEquals(WRITER_ID, information.getAgentId()); } }
--- a/agent/core/src/test/java/com/redhat/thermostat/agent/internal/BackendInfoDAOTest.java Fri Jul 21 16:27:18 2017 +0200 +++ b/agent/core/src/test/java/com/redhat/thermostat/agent/internal/BackendInfoDAOTest.java Wed Sep 06 14:05:05 2017 +0200 @@ -81,7 +81,6 @@ backendInfo1.setActive(true); backendInfo1.setObserveNewJvm(true); backendInfo1.setPids(new int[] { -1, 0, 1}); - backendInfo1.setOrderValue(100); httpHelper = mock(HttpHelper.class); contentProvider = mock(StringContentProvider.class);
--- a/agent/core/src/test/java/com/redhat/thermostat/agent/internal/BackendInformationTypeAdapterTest.java Fri Jul 21 16:27:18 2017 +0200 +++ b/agent/core/src/test/java/com/redhat/thermostat/agent/internal/BackendInformationTypeAdapterTest.java Wed Sep 06 14:05:05 2017 +0200 @@ -58,9 +58,9 @@ @Test public void testWrite() throws Exception { final String expected = "[{\"agentId\":\"agent1\",\"name\":\"First Backend\",\"description\":\"Gathers something\"," - + "\"observeNewJvm\":true,\"pids\":[8000,9000],\"active\":true,\"orderValue\":280}," + + "\"observeNewJvm\":true,\"pids\":[8000,9000],\"active\":true}," + "{\"agentId\":\"agent2\",\"name\":\"Second Backend\",\"description\":\"Gathers something else\"," - + "\"observeNewJvm\":false,\"pids\":[],\"active\":false,\"orderValue\":200}]"; + + "\"observeNewJvm\":false,\"pids\":[],\"active\":false}]"; BackendInformation first = createBackendInformation("agent1", "First Backend", "Gathers something", true, new int[] { 8000, 9000 }, true, 280); @@ -80,7 +80,6 @@ info.setObserveNewJvm(observeNewJvm); info.setPids(pids); info.setActive(active); - info.setOrderValue(orderValue); return info; }
--- a/agent/core/src/test/java/com/redhat/thermostat/backend/BaseBackendTest.java Fri Jul 21 16:27:18 2017 +0200 +++ b/agent/core/src/test/java/com/redhat/thermostat/backend/BaseBackendTest.java Wed Sep 06 14:05:05 2017 +0200 @@ -158,11 +158,6 @@ public boolean isActive() { return false; } - - @Override - public int getOrderValue() { - return 0; - } } }
--- a/agent/core/src/test/java/com/redhat/thermostat/backend/HostPollingBackendTest.java Fri Jul 21 16:27:18 2017 +0200 +++ b/agent/core/src/test/java/com/redhat/thermostat/backend/HostPollingBackendTest.java Wed Sep 06 14:05:05 2017 +0200 @@ -63,11 +63,7 @@ Version mockVersion = mock(Version.class); when(mockVersion.getVersionNumber()).thenReturn("backend-version"); backend = new HostPollingBackend("backend-name", "backend-description", - "backend-vendor", mockVersion, mockExecutor) { - @Override - public int getOrderValue() { - return 0; // Doesn't matter, not being tested. - } + "backend-vendor", mockVersion, mockExecutor) { }; if (!backend.getObserveNewJvm()) { /* At time of writing, default is true. This is @@ -77,14 +73,14 @@ backend.setObserveNewJvm(true); } } - + /** * If an action throws exceptions repeatedly, that action shall get * disabled/unregistered. */ @Bug(id = "3242", - summary = "Adverse Backend breaks other Backends badly ", - url = "http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=3242") + summary = "Adverse Backend breaks other Backends badly ", + url = "http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=3242") @Test public void testDoScheduledActionsWithExceptions() { final int beyondExceptionThreshold = 13; // Anything beyond 10 will do @@ -133,9 +129,9 @@ backend.doScheduledActions(); verify(action, never()).run(); } - + private static class BadHostPollingAction implements HostPollingAction { - + private int callCount; @Override @@ -143,7 +139,7 @@ callCount++; throw new RuntimeException("HostPollingBackend.doScheduledActions() testing!"); } - + } }
--- a/agent/core/src/test/java/com/redhat/thermostat/backend/PollingBackendTest.java Fri Jul 21 16:27:18 2017 +0200 +++ b/agent/core/src/test/java/com/redhat/thermostat/backend/PollingBackendTest.java Wed Sep 06 14:05:05 2017 +0200 @@ -69,11 +69,6 @@ "backend-vendor", mockVersion, mockExecutor) { @Override - public int getOrderValue() { - return 0; // Doesn't matter, not being tested. - } - - @Override protected void doScheduledActions() { // Won't be called because mock executor. } @@ -135,11 +130,6 @@ "backend-vendor", mockVersion, mockExecutor) { @Override - public int getOrderValue() { - return 0; - } - - @Override protected void doScheduledActions() { mockAction.doAction(); }};
--- a/common/core/src/main/java/com/redhat/thermostat/common/Ordered.java Fri Jul 21 16:27:18 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -/* - * 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.common; - -/** - * This interface defines a standard way for Thermostat plug-ins to specify - * an ordering for their services in relation to others of the same type. - */ -public interface Ordered { - - /** - * Order group for services that provide generic overview information - * about a Host or VM. - */ - public static final int ORDER_DEFAULT_GROUP = 0; - /** - * Order group for services that provide information about a Host - * or VM's CPU usage. - */ - public static final int ORDER_CPU_GROUP = 100; - /** - * Order group for services that provide information about a Host - * or VM's memory usage. - */ - public static final int ORDER_MEMORY_GROUP = 200; - /** - * Order group for services that provide information about a Host - * or VM's network usage. - */ - public static final int ORDER_NETWORK_GROUP = 300; - /** - * Order group for services that provide information about a Host - * or VM's I/O usage. - */ - public static final int ORDER_IO_GROUP = 400; - /** - * Order group for services that provide information about a Host - * or VM's threads. - */ - public static final int ORDER_THREAD_GROUP = 500; - - /** - * Order group for services that provide information about code running in a - * Host or a VM. - */ - public static final int ORDER_CODE_GROUP = 600; - - /** - * Order group for user-defined services. This should always be - * the last order group. - */ - public static final int ORDER_USER_GROUP = 5000; - - /** - * Order group for services that should be executed first. - */ - public static final int ORDER_FIRST = ORDER_DEFAULT_GROUP; - - /** - * Order group for services that should be executed last. - */ - public static final int ORDER_LAST = Integer.MAX_VALUE; - - /** - * Defines a value to be used for assigning an order to - * services. A service with a lower order value will - * be processed before a service of a higher order value. This - * ordering is used, for example, to sort views in a client's UI. - * Please take care to ensure the value returned by this - * implementation does not collide with other implementations. - * - * The order value should be offset from one of the provided - * constants in this class. Such as {@link #ORDER_DEFAULT_GROUP}. - * @return the order value - */ - public int getOrderValue(); - -} -
--- a/common/core/src/main/java/com/redhat/thermostat/common/OrderedComparator.java Fri Jul 21 16:27:18 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -/* - * 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.common; - -import java.util.Comparator; - - -public class OrderedComparator<T extends Ordered> implements Comparator<T> { - - @Override - public int compare(T o1, T o2) { - int result = o1.getOrderValue() - o2.getOrderValue(); - // Break ties using class name - if (result == 0) { - result = getName(o1).compareTo(getName(o2)); - } - return result; - } - - /* - * Extracted for testing purposes. - */ - protected String getName(T object) { - return object.getClass().getName(); - } - -} -
--- a/common/core/src/test/java/com/redhat/thermostat/common/OrderedComparatorTest.java Fri Jul 21 16:27:18 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -/* - * 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.common; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.junit.Test; - -public class OrderedComparatorTest { - - @Test - public void testServiceOrderTie() { - int[] orderValues = { 45, 20, 0, 90, 20 }; - - final List<Ordered> services = mockServices(orderValues); - - // Override the getName method to give predetermined class names to - // the services with equal order value - OrderedComparator<Ordered> comparator = new OrderedComparator<Ordered>() { - @Override - protected String getName(Ordered object) { - String result; - if (object.equals(services.get(1))) { - result = "TheirService"; - } - else if (object.equals(services.get(4))) { - result = "MyService"; - } - else { - result = super.getName(object); - } - return result; - } - }; - - List<Ordered> sorted = new ArrayList<>(services); - Collections.sort(sorted, comparator); - - // Ensure MyService comes before TheirService - assertEquals(services.get(2), sorted.get(0)); - assertEquals(services.get(4), sorted.get(1)); - assertEquals(services.get(1), sorted.get(2)); - assertEquals(services.get(0), sorted.get(3)); - assertEquals(services.get(3), sorted.get(4)); - } - - private List<Ordered> mockServices(int[] orderValues) { - List<Ordered> services = new ArrayList<>(); - for (int value : orderValues) { - Ordered service = mock(Ordered.class); - when(service.getOrderValue()).thenReturn(value); - services.add(service); - } - return services; - } - -} -
--- a/plugins/commands/agent/src/main/java/com/redhat/thermostat/commands/agent/internal/CommandsBackend.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/commands/agent/src/main/java/com/redhat/thermostat/commands/agent/internal/CommandsBackend.java Wed Sep 06 14:05:05 2017 +0200 @@ -61,7 +61,6 @@ import com.redhat.thermostat.commands.agent.internal.socket.AgentSocketOnMessageCallback; import com.redhat.thermostat.commands.agent.internal.socket.CmdChannelAgentSocket; import com.redhat.thermostat.commands.agent.receiver.ReceiverRegistry; -import com.redhat.thermostat.common.Ordered; import com.redhat.thermostat.common.Version; import com.redhat.thermostat.common.config.experimental.ConfigurationInfoSource; import com.redhat.thermostat.common.plugin.PluginConfiguration; @@ -158,12 +157,7 @@ public boolean isActive() { return isActive; } - - @Override - public int getOrderValue() { - return Ordered.ORDER_FIRST + 32; - } - + @Activate protected void componentActivated(BundleContext ctx) { Version version = new Version(ctx.getBundle());
--- a/plugins/host-cpu/agent/src/main/java/com/redhat/thermostat/host/cpu/agent/internal/HostCpuBackend.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/host-cpu/agent/src/main/java/com/redhat/thermostat/host/cpu/agent/internal/HostCpuBackend.java Wed Sep 06 14:05:05 2017 +0200 @@ -118,10 +118,5 @@ this.writerID = id; } - @Override - public int getOrderValue() { - return ORDER_CPU_GROUP; - } - }
--- a/plugins/host-memory/agent/src/main/java/com/redhat/thermostat/host/memory/agent/internal/HostMemoryBackend.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/host-memory/agent/src/main/java/com/redhat/thermostat/host/memory/agent/internal/HostMemoryBackend.java Wed Sep 06 14:05:05 2017 +0200 @@ -116,10 +116,5 @@ this.writerID = id; } - @Override - public int getOrderValue() { - return ORDER_MEMORY_GROUP; - } - }
--- a/plugins/host-network/agent/src/main/java/com/redhat/thermostat/host/network/internal/HostNetworkBackend.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/host-network/agent/src/main/java/com/redhat/thermostat/host/network/internal/HostNetworkBackend.java Wed Sep 06 14:05:05 2017 +0200 @@ -126,10 +126,5 @@ } } - - @Override - public int getOrderValue() { - return ORDER_DEFAULT_GROUP; - } }
--- a/plugins/host-overview/agent/src/main/java/com/redhat/thermostat/host/overview/internal/HostOverviewBackend.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/host-overview/agent/src/main/java/com/redhat/thermostat/host/overview/internal/HostOverviewBackend.java Wed Sep 06 14:05:05 2017 +0200 @@ -93,11 +93,6 @@ public boolean isActive() { return started; } - - @Override - public int getOrderValue() { - return ORDER_DEFAULT_GROUP; - } // For testing purposes static class HostInfoBuilderCreator {
--- a/plugins/jvm-overview/agent/src/main/java/com/redhat/thermostat/jvm/overview/agent/internal/VMMonitorBackend.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/jvm-overview/agent/src/main/java/com/redhat/thermostat/jvm/overview/agent/internal/VMMonitorBackend.java Wed Sep 06 14:05:05 2017 +0200 @@ -50,7 +50,6 @@ import org.apache.felix.scr.annotations.Reference; import org.apache.felix.scr.annotations.Service; import org.osgi.framework.BundleContext; -import org.osgi.framework.FrameworkUtil; import sun.jvmstat.monitor.HostIdentifier; import sun.jvmstat.monitor.MonitorException; import sun.jvmstat.monitor.MonitoredHost; @@ -134,9 +133,4 @@ public synchronized boolean isActive() { return active; } - - @Override - public int getOrderValue() { - return ORDER_DEFAULT_GROUP; - } }
--- a/plugins/jvm-overview/agent/src/main/java/com/redhat/thermostat/jvm/overview/agent/internal/model/VmNativeLibrariesBackend.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/jvm-overview/agent/src/main/java/com/redhat/thermostat/jvm/overview/agent/internal/model/VmNativeLibrariesBackend.java Wed Sep 06 14:05:05 2017 +0200 @@ -37,7 +37,6 @@ package com.redhat.thermostat.jvm.overview.agent.internal.model; import com.redhat.thermostat.backend.Backend; -import com.redhat.thermostat.common.Ordered; import com.redhat.thermostat.jvm.overview.agent.VmListenerBackend; import com.redhat.thermostat.jvm.overview.agent.VmUpdateListener; import com.redhat.thermostat.storage.core.WriterID; @@ -48,9 +47,8 @@ @Component @Service(value = Backend.class) public class VmNativeLibrariesBackend extends VmListenerBackend { - + private final ListenerCreator listenerCreator; - public static final int ORDER = Ordered.ORDER_MEMORY_GROUP + 60; public VmNativeLibrariesBackend() { this(new ListenerCreator()); @@ -71,11 +69,6 @@ return listenerCreator.create(vmInfoDao, vmId, pid); } - @Override - public int getOrderValue() { - return ORDER; - } - // DS bind method protected void bindVmGcStats(VmInfoDAO dao) { this.vmInfoDao = dao;
--- a/plugins/jvm-overview/agent/src/test/java/com/redhat/thermostat/jvm/overview/agent/VmListenerBackendTest.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/jvm-overview/agent/src/test/java/com/redhat/thermostat/jvm/overview/agent/VmListenerBackendTest.java Wed Sep 06 14:05:05 2017 +0200 @@ -201,11 +201,6 @@ } @Override - public int getOrderValue() { - return 0; - } - - @Override protected VmUpdateListener createVmListener(String writerId, String vmId, int pid) { return listener; }
--- a/plugins/jvm-overview/agent/src/test/java/com/redhat/thermostat/jvm/overview/agent/VmPollingBackendTest.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/jvm-overview/agent/src/test/java/com/redhat/thermostat/jvm/overview/agent/VmPollingBackendTest.java Wed Sep 06 14:05:05 2017 +0200 @@ -69,10 +69,6 @@ mockRegistrar = mock(VmStatusListenerRegistrar.class); backend = new VmPollingBackend("backend-name", "backend-description", "backend-vendor", mockVersion, mockExecutor, mockRegistrar) { - @Override - public int getOrderValue() { - return 0; // Doesn't matter, not being tested. - } }; if (!backend.getObserveNewJvm()) { /* At time of writing, default is true. This is
--- a/plugins/numa/agent/src/main/java/com/redhat/thermostat/numa/agent/internal/NumaBackend.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/numa/agent/src/main/java/com/redhat/thermostat/numa/agent/internal/NumaBackend.java Wed Sep 06 14:05:05 2017 +0200 @@ -132,10 +132,5 @@ return started; } - @Override - public int getOrderValue() { - return ORDER_MEMORY_GROUP + 80; - } - }
--- a/plugins/numa/agent/src/test/java/com/redhat/thermostat/numa/agent/internal/NumaBackendTest.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/numa/agent/src/test/java/com/redhat/thermostat/numa/agent/internal/NumaBackendTest.java Wed Sep 06 14:05:05 2017 +0200 @@ -163,10 +163,5 @@ assertTrue(deactivated); verify(timer).stop(); } - - @Test - public void testOrderValue() { - assertEquals(Ordered.ORDER_MEMORY_GROUP + 80, backend.getOrderValue()); - } }
--- a/plugins/thread/harvester/src/main/java/com/redhat/thermostat/thread/harvester/internal/LockInfoBackend.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/thread/harvester/src/main/java/com/redhat/thermostat/thread/harvester/internal/LockInfoBackend.java Wed Sep 06 14:05:05 2017 +0200 @@ -58,11 +58,6 @@ } @Override - public int getOrderValue() { - return ORDER_THREAD_GROUP + 10; - } - - @Override protected VmUpdateListener createVmListener(String writerId, String vmId, int pid) { Objects.requireNonNull(lockDao); return new LockInfoUpdater(lockDao, writerId, vmId);
--- a/plugins/thread/harvester/src/main/java/com/redhat/thermostat/thread/harvester/internal/ThreadBackend.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/thread/harvester/src/main/java/com/redhat/thermostat/thread/harvester/internal/ThreadBackend.java Wed Sep 06 14:05:05 2017 +0200 @@ -69,11 +69,6 @@ } @Override - public int getOrderValue() { - return ORDER_THREAD_GROUP; - } - - @Override public boolean activate() { if (active) { return true;
--- a/plugins/thread/harvester/src/main/java/com/redhat/thermostat/thread/harvester/internal/ThreadCountBackend.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/thread/harvester/src/main/java/com/redhat/thermostat/thread/harvester/internal/ThreadCountBackend.java Wed Sep 06 14:05:05 2017 +0200 @@ -58,11 +58,6 @@ } @Override - public int getOrderValue() { - return ORDER_THREAD_GROUP; - } - - @Override protected VmUpdateListener createVmListener(String writerId, String vmId, int pid) { Objects.requireNonNull(threadDao); return new ThreadCountUpdater(threadDao, writerId, vmId);
--- a/plugins/thread/harvester/src/test/java/com/redhat/thermostat/thread/harvester/internal/LockInfoBackendTest.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/thread/harvester/src/test/java/com/redhat/thermostat/thread/harvester/internal/LockInfoBackendTest.java Wed Sep 06 14:05:05 2017 +0200 @@ -44,7 +44,6 @@ import org.junit.Test; import com.redhat.thermostat.agent.VmStatusListenerRegistrar; -import com.redhat.thermostat.common.Ordered; import com.redhat.thermostat.common.Version; import com.redhat.thermostat.storage.core.WriterID; import com.redhat.thermostat.thread.dao.LockInfoDao; @@ -66,11 +65,4 @@ backend = new LockInfoBackend(lockInfoDao, version, registrar, id); } - @Test - public void testOrderValue() { - int order = backend.getOrderValue(); - assertTrue(order >= Ordered.ORDER_THREAD_GROUP); - assertTrue(order < Ordered.ORDER_USER_GROUP); - } - }
--- a/plugins/vm-classstat/agent/src/main/java/com/redhat/thermostat/vm/classstat/agent/internal/VmClassStatBackend.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/vm-classstat/agent/src/main/java/com/redhat/thermostat/vm/classstat/agent/internal/VmClassStatBackend.java Wed Sep 06 14:05:05 2017 +0200 @@ -41,7 +41,6 @@ import com.redhat.thermostat.backend.VmUpdateListener; import com.redhat.thermostat.common.Version; import com.redhat.thermostat.storage.core.WriterID; -import com.redhat.thermostat.vm.classstat.common.Constants; import com.redhat.thermostat.vm.classstat.common.VmClassStatDAO; public class VmClassStatBackend extends VmListenerBackend { @@ -57,11 +56,6 @@ } @Override - public int getOrderValue() { - return Constants.ORDER; - } - - @Override protected VmUpdateListener createVmListener(String writerId, String vmId, int pid) { return new VmClassStatVmListener(writerId, vmClassStats, vmId); }
--- a/plugins/vm-classstat/agent/src/test/java/com/redhat/thermostat/vm/classstat/agent/internal/VmClassStatBackendTest.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/vm-classstat/agent/src/test/java/com/redhat/thermostat/vm/classstat/agent/internal/VmClassStatBackendTest.java Wed Sep 06 14:05:05 2017 +0200 @@ -65,12 +65,5 @@ WriterID id = mock(WriterID.class); backend = new VmClassStatBackend(vmClassStatDao, version, registrar, id); } - - @Test - public void testOrderValue() { - int orderValue = backend.getOrderValue(); - assertTrue(orderValue >= Ordered.ORDER_CODE_GROUP); - assertTrue(orderValue < Ordered.ORDER_USER_GROUP); - } }
--- a/plugins/vm-classstat/common/src/main/java/com/redhat/thermostat/vm/classstat/common/Constants.java Fri Jul 21 16:27:18 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* - * 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.classstat.common; - -import com.redhat.thermostat.common.Ordered; - -public class Constants { - - public static final int ORDER = Ordered.ORDER_CODE_GROUP + 20; - - private Constants() { - throw new AssertionError("Do not instantiate this"); - } - -}
--- a/plugins/vm-compiler/agent/src/main/java/com/redhat/thermostat/vm/compiler/agent/internal/VmCompilerStatBackend.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/vm-compiler/agent/src/main/java/com/redhat/thermostat/vm/compiler/agent/internal/VmCompilerStatBackend.java Wed Sep 06 14:05:05 2017 +0200 @@ -55,12 +55,7 @@ "Red Hat, Inc.", version.getVersionNumber(), true, registrar, writerId); this.vmCompilerStats = vmCompilerStatDao; } - - @Override - public int getOrderValue() { - return Constants.ORDER; - } - + @Override protected VmUpdateListener createVmListener(String writerId, String vmId, int pid) { return new VmCompilerStatVmListener(writerId, vmCompilerStats, vmId);
--- a/plugins/vm-compiler/agent/src/test/java/com/redhat/thermostat/vm/compiler/agent/internal/VmClassStatBackendTest.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/vm-compiler/agent/src/test/java/com/redhat/thermostat/vm/compiler/agent/internal/VmClassStatBackendTest.java Wed Sep 06 14:05:05 2017 +0200 @@ -44,10 +44,8 @@ import org.junit.Test; import com.redhat.thermostat.agent.VmStatusListenerRegistrar; -import com.redhat.thermostat.common.Ordered; import com.redhat.thermostat.common.Version; import com.redhat.thermostat.storage.core.WriterID; -import com.redhat.thermostat.vm.compiler.agent.internal.VmCompilerStatBackend; import com.redhat.thermostat.vm.compiler.common.VmCompilerStatDao; public class VmClassStatBackendTest { @@ -67,12 +65,5 @@ backend = new VmCompilerStatBackend(vmCompilerStatDao, version, registrar, id); } - @Test - public void testOrderValue() { - int orderValue = backend.getOrderValue(); - assertTrue(orderValue >= Ordered.ORDER_CODE_GROUP); - assertTrue(orderValue < Ordered.ORDER_USER_GROUP); - } - }
--- a/plugins/vm-compiler/common/src/main/java/com/redhat/thermostat/vm/compiler/common/Constants.java Fri Jul 21 16:27:18 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* - * 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/plugins/vm-cpu/agent/src/main/java/com/redhat/thermostat/vm/cpu/agent/internal/VmCpuBackend.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/vm-cpu/agent/src/main/java/com/redhat/thermostat/vm/cpu/agent/internal/VmCpuBackend.java Wed Sep 06 14:05:05 2017 +0200 @@ -74,12 +74,7 @@ this.action = action; registerAction(action); } - - @Override - public int getOrderValue() { - return Constants.ORDER; - } - + private static class VmCpuBackendAction implements VmPollingAction { private VmCpuStatBuilder builder;
--- a/plugins/vm-cpu/agent/src/test/java/com/redhat/thermostat/vm/cpu/agent/internal/VmCpuBackendTest.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/vm-cpu/agent/src/test/java/com/redhat/thermostat/vm/cpu/agent/internal/VmCpuBackendTest.java Wed Sep 06 14:05:05 2017 +0200 @@ -59,10 +59,8 @@ import com.redhat.thermostat.agent.VmStatusListener.Status; import com.redhat.thermostat.agent.VmStatusListenerRegistrar; -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; @@ -173,14 +171,5 @@ verifyNoMoreInteractions(vmCpuStatDao); } - - @Test - public void testOrderValue() { - int orderValue = backend.getOrderValue(); - - assertTrue(orderValue > Ordered.ORDER_CPU_GROUP); - assertTrue(orderValue < Ordered.ORDER_MEMORY_GROUP); - assertEquals(orderValue, Constants.ORDER); - } }
--- a/plugins/vm-cpu/common/src/main/java/com/redhat/thermostat/vm/cpu/common/Constants.java Fri Jul 21 16:27:18 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* - * 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/plugins/vm-gc/agent/src/main/java/com/redhat/thermostat/vm/gc/agent/Constants.java Fri Jul 21 16:27:18 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* - * 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.agent; - -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/plugins/vm-gc/agent/src/main/java/com/redhat/thermostat/vm/gc/agent/internal/VmGcBackend.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/vm-gc/agent/src/main/java/com/redhat/thermostat/vm/gc/agent/internal/VmGcBackend.java Wed Sep 06 14:05:05 2017 +0200 @@ -48,13 +48,12 @@ import com.redhat.thermostat.backend.Backend; import com.redhat.thermostat.common.Version; import com.redhat.thermostat.storage.core.WriterID; -import com.redhat.thermostat.vm.gc.agent.Constants; import com.redhat.thermostat.vm.gc.agent.internal.models.VmGcStatDAO; @Component @Service(value = Backend.class) public class VmGcBackend extends VmListenerBackend { - + private final ListenerCreator listenerCreator; @Reference @@ -72,11 +71,6 @@ } @Override - public int getOrderValue() { - return Constants.ORDER; - } - - @Override protected VmUpdateListener createVmListener(String writerId, String vmId, int pid) { return listenerCreator.create(writerId, vmGcStats, vmId); }
--- a/plugins/vm-gc/agent/src/test/java/com/redhat/thermostat/vm/gc/agent/internal/VmGcBackendTest.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/vm-gc/agent/src/test/java/com/redhat/thermostat/vm/gc/agent/internal/VmGcBackendTest.java Wed Sep 06 14:05:05 2017 +0200 @@ -51,7 +51,6 @@ import org.osgi.framework.BundleContext; import org.osgi.framework.Version; -import com.redhat.thermostat.common.Ordered; import com.redhat.thermostat.storage.core.WriterID; import com.redhat.thermostat.vm.gc.agent.internal.VmGcBackend.ListenerCreator; import com.redhat.thermostat.vm.gc.agent.internal.models.VmGcStatDAO; @@ -107,13 +106,6 @@ verify(listenerCreator).create(writerId, dao, vmId); } - @Test - public void testOrderValue() { - int order = backend.getOrderValue(); - assertTrue(order >= Ordered.ORDER_MEMORY_GROUP); - assertTrue(order < Ordered.ORDER_NETWORK_GROUP); - } - static class TestVmGcBackend extends VmGcBackend { WriterID writerId; VmStatusListenerRegistrar registrar;
--- a/plugins/vm-io/agent/src/main/java/com/redhat/thermostat/vm/io/agent/internal/Constants.java Fri Jul 21 16:27:18 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* - * 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.io.agent.internal; - -import com.redhat.thermostat.common.Ordered; - -public class Constants { - - public static final int ORDER_VALUE = Ordered.ORDER_IO_GROUP + 50; -}
--- a/plugins/vm-io/agent/src/main/java/com/redhat/thermostat/vm/io/agent/internal/VmIoBackend.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/vm-io/agent/src/main/java/com/redhat/thermostat/vm/io/agent/internal/VmIoBackend.java Wed Sep 06 14:05:05 2017 +0200 @@ -55,7 +55,7 @@ @Component @Service(value = Backend.class) public class VmIoBackend extends VmListenerBackend { - + private final ListenerCreator listenerCreator; @Reference @@ -130,12 +130,7 @@ } } } - - @Override - public int getOrderValue() { - return Constants.ORDER_VALUE; - } - + // For testing purposes static class ListenerCreator { VmIoBackendListener create(VmIoStatDAO dao, VmIoStatBuilder builder, String jvmId, int pid) {
--- a/plugins/vm-io/agent/src/test/java/com/redhat/thermostat/vm/io/agent/internal/VmIoBackendTest.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/vm-io/agent/src/test/java/com/redhat/thermostat/vm/io/agent/internal/VmIoBackendTest.java Wed Sep 06 14:05:05 2017 +0200 @@ -53,7 +53,6 @@ import org.osgi.framework.BundleContext; import org.osgi.framework.Version; -import com.redhat.thermostat.common.Ordered; import com.redhat.thermostat.storage.core.WriterID; import com.redhat.thermostat.vm.io.agent.internal.VmIoBackend.ListenerCreator; @@ -108,12 +107,6 @@ verify(listenerCreator).create(eq(dao), any(VmIoStatBuilder.class), eq(vmId), eq(pid)); } - @Test - public void testOrderValue() { - int order = backend.getOrderValue(); - assertTrue(order >= Ordered.ORDER_IO_GROUP); - } - static class TestVmIoBackend extends VmIoBackend { WriterID writerId; VmStatusListenerRegistrar registrar;
--- a/plugins/vm-jmx/agent/src/main/java/com/redhat/thermostat/vm/jmx/agent/internal/JmxBackend.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/vm-jmx/agent/src/main/java/com/redhat/thermostat/vm/jmx/agent/internal/JmxBackend.java Wed Sep 06 14:05:05 2017 +0200 @@ -121,11 +121,6 @@ } @Override - public int getOrderValue() { - return ORDER_USER_GROUP + 99; - } - - @Override public boolean activate() { if (isActive) { return true;
--- a/plugins/vm-jmx/agent/src/test/java/com/redhat/thermostat/vm/jmx/agent/internal/JmxBackendTest.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/vm-jmx/agent/src/test/java/com/redhat/thermostat/vm/jmx/agent/internal/JmxBackendTest.java Wed Sep 06 14:05:05 2017 +0200 @@ -67,7 +67,6 @@ import com.redhat.thermostat.agent.command.RequestReceiver; import com.redhat.thermostat.agent.utils.management.MXBeanConnection; import com.redhat.thermostat.agent.utils.management.MXBeanConnectionPool; -import com.redhat.thermostat.common.Ordered; import com.redhat.thermostat.common.Version; import com.redhat.thermostat.storage.core.WriterID; import com.redhat.thermostat.vm.jmx.common.JmxNotification; @@ -97,11 +96,6 @@ } @Test - public void testOrderValue() { - assertTrue(backend.getOrderValue() > Ordered.ORDER_USER_GROUP); - } - - @Test public void testActivation() { assertFalse(backend.isActive()); assertTrue(backend.activate());
--- a/plugins/vm-memory/agent/src/main/java/com/redhat/thermostat/vm/memory/agent/internal/Constants.java Fri Jul 21 16:27:18 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* - * 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.agent.internal; - -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/plugins/vm-memory/agent/src/main/java/com/redhat/thermostat/vm/memory/agent/internal/VmMemoryBackend.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/vm-memory/agent/src/main/java/com/redhat/thermostat/vm/memory/agent/internal/VmMemoryBackend.java Wed Sep 06 14:05:05 2017 +0200 @@ -55,7 +55,7 @@ @Component @Service(value = Backend.class) public class VmMemoryBackend extends VmListenerBackend { - + private final ListenerCreator listenerCreator; @Reference @@ -106,11 +106,6 @@ } @Override - public int getOrderValue() { - return Constants.ORDER; - } - - @Override protected VmUpdateListener createVmListener(String writerId, String vmId, int pid) { return listenerCreator.create(writerId, vmMemoryStatDAO, vmTlabStatDAO, vmId); }
--- a/plugins/vm-memory/agent/src/test/java/com/redhat/thermostat/vm/memory/agent/internal/VmMemoryBackendTest.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/vm-memory/agent/src/test/java/com/redhat/thermostat/vm/memory/agent/internal/VmMemoryBackendTest.java Wed Sep 06 14:05:05 2017 +0200 @@ -45,7 +45,6 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import com.redhat.thermostat.common.Ordered; import com.redhat.thermostat.jvm.overview.agent.VmStatusListenerRegistrar; import com.redhat.thermostat.storage.core.WriterID; import com.redhat.thermostat.vm.memory.agent.internal.VmMemoryBackend.ListenerCreator; @@ -127,14 +126,6 @@ verify(listenerCreator).create(writerId, dao, tlabDao, vmId); } - @Test - public void testOrderValue() { - TestVmMemoryBackend backend = new TestVmMemoryBackend(listenerCreator); - int orderValue = backend.getOrderValue(); - assertTrue(orderValue >= Ordered.ORDER_MEMORY_GROUP); - assertTrue(orderValue < Ordered.ORDER_NETWORK_GROUP); - } - static class TestVmMemoryBackend extends VmMemoryBackend { VmStatusListenerRegistrar registrar;
--- a/plugins/vm-numa/agent/src/main/java/com/redhat/thermostat/vm/numa/agent/internal/VmNumaBackend.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/vm-numa/agent/src/main/java/com/redhat/thermostat/vm/numa/agent/internal/VmNumaBackend.java Wed Sep 06 14:05:05 2017 +0200 @@ -50,7 +50,6 @@ 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; @@ -69,11 +68,6 @@ registerAction(action); } - @Override - public int getOrderValue() { - return Constants.ORDER; - } - private static class VmNumaBackendAction implements VmPollingAction { private WriterID writerID; private Clock clock;
--- a/plugins/vm-numa/agent/src/test/java/com/redhat/thermostat/vm/numa/agent/internal/VmNumaBackendTest.java Fri Jul 21 16:27:18 2017 +0200 +++ b/plugins/vm-numa/agent/src/test/java/com/redhat/thermostat/vm/numa/agent/internal/VmNumaBackendTest.java Wed Sep 06 14:05:05 2017 +0200 @@ -172,11 +172,4 @@ when(collector.collect()).thenReturn(mock(VmNumaStat.class)); backend.setVmNumaBackendCollector(pid, collector); } - - @Test - public void testOrderValue() { - int orderValue = backend.getOrderValue(); - - assertTrue(orderValue == Ordered.ORDER_MEMORY_GROUP); - } }
--- a/plugins/vm-numa/common/src/main/java/com/redhat/thermostat/vm/numa/common/Constants.java Fri Jul 21 16:27:18 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* - * 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"); - } - -}
--- a/storage/core/src/main/java/com/redhat/thermostat/storage/model/BackendInformation.java Fri Jul 21 16:27:18 2017 +0200 +++ b/storage/core/src/main/java/com/redhat/thermostat/storage/model/BackendInformation.java Wed Sep 06 14:05:05 2017 +0200 @@ -41,19 +41,17 @@ import java.util.Map; import java.util.Objects; -import com.redhat.thermostat.common.Ordered; import com.redhat.thermostat.storage.core.Entity; import com.redhat.thermostat.storage.core.Persist; @Entity -public class BackendInformation extends BasePojo implements Ordered { +public class BackendInformation extends BasePojo { private String name; private String description; private boolean isActive; private boolean observeNewJvm; private int[] pids; - private int orderValue; private Map<String, String> configuration = new HashMap<String,String>(); public BackendInformation() { @@ -117,17 +115,6 @@ public void setActive(boolean active) { this.isActive = active; } - - @Override - @Persist - public int getOrderValue() { - return orderValue; - } - - @Persist - public void setOrderValue(int orderValue) { - this.orderValue = orderValue; - } @Override public boolean equals(Object obj) { @@ -146,13 +133,12 @@ Objects.equals(this.configuration, other.configuration) && Objects.equals(this.isActive, other.isActive) && Objects.equals(this.observeNewJvm, other.observeNewJvm) && - Arrays.equals(this.pids, other.pids) && - Objects.equals(this.orderValue, other.orderValue); + Arrays.equals(this.pids, other.pids); } @Override public int hashCode() { - return Objects.hash(name, description, configuration, isActive, observeNewJvm, pids, orderValue); + return Objects.hash(name, description, configuration, isActive, observeNewJvm, pids); } }