diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Configurable.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Configurable.java index 5767d57b75..c1aa3d2988 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Configurable.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Configurable.java @@ -36,13 +36,14 @@ import org.apache.activemq.artemis.dto.ManagementContextDTO; import org.apache.activemq.artemis.jms.server.config.impl.FileJMSConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Abstract class where we can replace the configuration in various places * */ public abstract class Configurable extends ActionAbstract { - private static final Logger logger = LoggerFactory.getLogger(Configurable.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Arguments(description = "Broker Configuration URI, default 'xml:${ARTEMIS_INSTANCE}/etc/bootstrap.xml'") String configuration; diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XMLMessageImporter.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XMLMessageImporter.java index c9383b9b6a..f7e250ca34 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XMLMessageImporter.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XMLMessageImporter.java @@ -42,11 +42,12 @@ import org.apache.activemq.artemis.utils.Base64; import org.apache.activemq.artemis.utils.UUIDGenerator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** This is an Utility class that will import the outputs in XML format. */ public class XMLMessageImporter { - private static final Logger logger = LoggerFactory.getLogger(XMLMessageImporter.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private XMLStreamReader reader; diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XmlDataExporter.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XmlDataExporter.java index 7a64dc06f4..bb928873e6 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XmlDataExporter.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XmlDataExporter.java @@ -66,11 +66,12 @@ import org.apache.activemq.artemis.core.server.JournalType; import org.apache.activemq.artemis.utils.collections.LinkedListIterator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; @Command(name = "exp", description = "Export all message-data using an XML that could be interpreted by any system.") public final class XmlDataExporter extends DBOption { - private static final Logger logger = LoggerFactory.getLogger(XmlDataExporter.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private XMLStreamWriter xmlWriter; diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XmlDataImporter.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XmlDataImporter.java index 1dffe66f43..8abf94be39 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XmlDataImporter.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XmlDataImporter.java @@ -65,6 +65,7 @@ import org.apache.activemq.artemis.utils.ClassloadingUtil; import org.apache.activemq.artemis.utils.ListUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Read XML output from org.apache.activemq.artemis.core.persistence.impl.journal.XmlDataExporter, create a core session, and @@ -74,7 +75,7 @@ import org.slf4j.LoggerFactory; @Command(name = "imp", description = "Import all message-data using an XML that could be interpreted by any system.") public final class XmlDataImporter extends ActionAbstract { - private static final Logger logger = LoggerFactory.getLogger(XmlDataImporter.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private XMLStreamReader reader; diff --git a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java index c223619451..94a28c04ba 100644 --- a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java +++ b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java @@ -103,6 +103,7 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -118,7 +119,7 @@ import static org.junit.Assert.fail; * Test to validate that the CLI doesn't throw improper exceptions when invoked. */ public class ArtemisTest extends CliTestBase { - private static final Logger log = LoggerFactory.getLogger(ArtemisTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); // some tests will set this, as some security methods will need to know the server the CLI started private ActiveMQServer server; diff --git a/artemis-cli/src/test/java/org/apache/activemq/cli/test/HashUtilTest.java b/artemis-cli/src/test/java/org/apache/activemq/cli/test/HashUtilTest.java index 7d7c26cd53..f63d1561f5 100644 --- a/artemis-cli/src/test/java/org/apache/activemq/cli/test/HashUtilTest.java +++ b/artemis-cli/src/test/java/org/apache/activemq/cli/test/HashUtilTest.java @@ -21,12 +21,13 @@ import org.apache.activemq.artemis.utils.PasswordMaskingUtil; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; public class HashUtilTest { - private static final Logger log = LoggerFactory.getLogger(HashUtilTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testDefaultHashFormat() throws Exception { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQScheduledComponent.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQScheduledComponent.java index 09226f1410..dd053107b5 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQScheduledComponent.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQScheduledComponent.java @@ -30,13 +30,14 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.apache.activemq.artemis.utils.ActiveMQThreadFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This is for components with a scheduled at a fixed rate. */ public abstract class ActiveMQScheduledComponent implements ActiveMQComponent, Runnable { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQScheduledComponent.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected ScheduledExecutorService scheduledExecutorService; private boolean startedOwnScheduler; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/NetworkHealthCheck.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/NetworkHealthCheck.java index 5e06d7e173..4cfe11636f 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/NetworkHealthCheck.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/NetworkHealthCheck.java @@ -37,6 +37,7 @@ import org.apache.activemq.artemis.utils.Env; import org.apache.activemq.artemis.utils.collections.ConcurrentHashSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This will use {@link InetAddress#isReachable(int)} to determine if the network is alive. @@ -44,7 +45,7 @@ import org.slf4j.LoggerFactory; */ public class NetworkHealthCheck extends ActiveMQScheduledComponent { - private static final Logger logger = LoggerFactory.getLogger(NetworkHealthCheck.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Set componentList = new ConcurrentHashSet<>(); private final Set addresses = new ConcurrentHashSet<>(); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ClassloadingUtil.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ClassloadingUtil.java index b848ed7a38..2a26c413a7 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ClassloadingUtil.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ClassloadingUtil.java @@ -21,6 +21,7 @@ import java.util.Properties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This class will be used to perform generic class-loader operations, @@ -31,7 +32,7 @@ import org.slf4j.LoggerFactory; public final class ClassloadingUtil { - private static final Logger logger = LoggerFactory.getLogger(ClassloadingUtil.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String INSTANTIATION_EXCEPTION_MESSAGE = "Your class must have a constructor without arguments. If it is an inner class, it must be static!"; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/DefaultSensitiveStringCodec.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/DefaultSensitiveStringCodec.java index 16ac0b04de..8b7d106765 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/DefaultSensitiveStringCodec.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/DefaultSensitiveStringCodec.java @@ -34,6 +34,7 @@ import java.util.Properties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A DefaultSensitiveDataCodec @@ -49,7 +50,7 @@ import org.slf4j.LoggerFactory; */ public class DefaultSensitiveStringCodec implements SensitiveDataCodec { - private static final Logger logger = LoggerFactory.getLogger(DefaultSensitiveStringCodec.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String ALGORITHM = "algorithm"; public static final String BLOWFISH_KEY = "key"; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SizeAwareMetric.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SizeAwareMetric.java index f98ef35c6d..c3c1aed38c 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SizeAwareMetric.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SizeAwareMetric.java @@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicLongFieldUpdater; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class SizeAwareMetric { @@ -29,7 +30,7 @@ public class SizeAwareMetric { void add(int delta, boolean sizeOnly); } - private static final Logger logger = LoggerFactory.getLogger(SizeAwareMetric.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int PENDING_FREE = 0, FREE = 1, PENDING_OVER_SIZE = 2, OVER_SIZE = 3, PENDING_OVER_ELEMENTS = 4, OVER_ELEMENTS = 5, NOT_USED = -1; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ThreadDumpUtil.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ThreadDumpUtil.java index 69d762bcc4..b3aff5e4fa 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ThreadDumpUtil.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ThreadDumpUtil.java @@ -21,6 +21,7 @@ package org.apache.activemq.artemis.utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import java.io.IOException; import java.io.PrintWriter; @@ -32,7 +33,7 @@ import java.lang.management.ThreadInfo; import java.lang.management.ThreadMXBean; public final class ThreadDumpUtil { - private static final Logger logger = LoggerFactory.getLogger(ThreadDumpUtil.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static String threadDump(final String msg) { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/UTF8Util.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/UTF8Util.java index f57fff54ca..2a3feb380b 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/UTF8Util.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/UTF8Util.java @@ -25,6 +25,7 @@ import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.logs.ActiveMQUtilBundle; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A UTF8Util @@ -33,7 +34,7 @@ import org.slf4j.LoggerFactory; */ public final class UTF8Util { - private static final Logger logger = LoggerFactory.getLogger(UTF8Util.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final ThreadLocal> currentBuffer = new ThreadLocal<>(); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/UUIDGenerator.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/UUIDGenerator.java index 70b7eb5b7c..951253921e 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/UUIDGenerator.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/UUIDGenerator.java @@ -34,10 +34,11 @@ import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.api.core.SimpleString; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public final class UUIDGenerator { - private static final Logger logger = LoggerFactory.getLogger(UUIDGenerator.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final UUIDGenerator sSingleton = new UUIDGenerator(); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/OrderedExecutor.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/OrderedExecutor.java index 25af8332df..c2f0d3bd7b 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/OrderedExecutor.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/OrderedExecutor.java @@ -22,6 +22,7 @@ import java.util.concurrent.Executor; import org.apache.activemq.artemis.api.core.ActiveMQInterruptedException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * An executor that always runs all tasks in order, using a delegate executor to run the tasks. @@ -35,7 +36,7 @@ public class OrderedExecutor extends ProcessorBase implements ArtemisE super(delegate); } - private static final Logger logger = LoggerFactory.getLogger(OrderedExecutor.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private boolean fair; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/ProcessorBase.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/ProcessorBase.java index 237e9ea172..d4772ba56b 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/ProcessorBase.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/ProcessorBase.java @@ -26,10 +26,11 @@ import java.util.function.Consumer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public abstract class ProcessorBase extends HandlerBase { - private static final Logger logger = LoggerFactory.getLogger(ProcessorBase.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final int STATE_NOT_RUNNING = 0; public static final int STATE_RUNNING = 1; public static final int STATE_FORCED_SHUTDOWN = 2; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/ThresholdActor.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/ThresholdActor.java index 21e1e33b94..84b2026e5d 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/ThresholdActor.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/ThresholdActor.java @@ -23,10 +23,11 @@ import java.util.function.ToIntFunction; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ThresholdActor extends ProcessorBase { - private static final Logger logger = LoggerFactory.getLogger(ThresholdActor.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final AtomicIntegerFieldUpdater SIZE_UPDATER = AtomicIntegerFieldUpdater.newUpdater(ThresholdActor.class, "size"); private volatile int size = 0; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentLongHashSet.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentLongHashSet.java index cf1fb60edb..ec26b7437b 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentLongHashSet.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentLongHashSet.java @@ -28,6 +28,7 @@ import java.util.concurrent.locks.StampedLock; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.utils.Preconditions.checkArgument; @@ -41,7 +42,7 @@ import static org.apache.activemq.artemis.utils.Preconditions.checkArgument; */ public class ConcurrentLongHashSet { - private static final Logger logger = LoggerFactory.getLogger(ConcurrentLongHashSet.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final long EmptyItem = -1L; private static final long DeletedItem = -2L; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalAnalyzerImpl.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalAnalyzerImpl.java index e7363bd771..5d98642ed7 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalAnalyzerImpl.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalAnalyzerImpl.java @@ -26,10 +26,11 @@ import org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent; import org.apache.activemq.artemis.utils.collections.ConcurrentHashSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class CriticalAnalyzerImpl implements CriticalAnalyzer { - private final Logger logger = LoggerFactory.getLogger(CriticalAnalyzer.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private volatile long timeoutNanoSeconds; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalMeasure.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalMeasure.java index 292808db1d..209f1d9d9f 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalMeasure.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalMeasure.java @@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; import org.apache.activemq.artemis.utils.ArtemisCloseable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class CriticalMeasure { @@ -29,7 +30,7 @@ public class CriticalMeasure { return closeable == dummyCloseable; } - private static final Logger logger = LoggerFactory.getLogger(CriticalMeasure.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); // this is used on enterCritical, if the logger is in trace mode private volatile Exception traceEnter; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/FluentPropertyBeanIntrospectorWithIgnores.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/FluentPropertyBeanIntrospectorWithIgnores.java index cd88b7aa26..105bfff1b4 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/FluentPropertyBeanIntrospectorWithIgnores.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/FluentPropertyBeanIntrospectorWithIgnores.java @@ -28,10 +28,11 @@ import org.apache.commons.beanutils.FluentPropertyBeanIntrospector; import org.apache.commons.beanutils.IntrospectionContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class FluentPropertyBeanIntrospectorWithIgnores extends FluentPropertyBeanIntrospector { - static Logger logger = LoggerFactory.getLogger(FluentPropertyBeanIntrospectorWithIgnores.class); + static Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static ConcurrentHashSet> ignores = new ConcurrentHashSet<>(); diff --git a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/ByteUtilTest.java b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/ByteUtilTest.java index efa686c174..2754994b8c 100644 --- a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/ByteUtilTest.java +++ b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/ByteUtilTest.java @@ -29,6 +29,7 @@ import io.netty.buffer.Unpooled; import io.netty.util.internal.PlatformDependent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.Assert; import org.junit.Assume; import org.junit.Test; @@ -40,7 +41,7 @@ import static org.junit.Assert.fail; public class ByteUtilTest { - private static final Logger log = LoggerFactory.getLogger(ByteUtilTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testBytesToString() { diff --git a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/DefaultSensitiveStringCodecTest.java b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/DefaultSensitiveStringCodecTest.java index e9993c15f2..6eadadd9cb 100644 --- a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/DefaultSensitiveStringCodecTest.java +++ b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/DefaultSensitiveStringCodecTest.java @@ -18,6 +18,7 @@ package org.apache.activemq.artemis.utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.Test; import java.util.HashMap; @@ -30,7 +31,7 @@ import static org.junit.Assert.fail; public class DefaultSensitiveStringCodecTest { - private static final Logger log = LoggerFactory.getLogger(DefaultSensitiveStringCodecTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testDefaultAlgorithm() throws Exception { diff --git a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/actors/OrderedExecutorSanityTest.java b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/actors/OrderedExecutorSanityTest.java index 7d7826956a..c269298426 100644 --- a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/actors/OrderedExecutorSanityTest.java +++ b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/actors/OrderedExecutorSanityTest.java @@ -28,11 +28,12 @@ import java.util.concurrent.atomic.AtomicInteger; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.Assert; import org.junit.Test; public class OrderedExecutorSanityTest { - private static final Logger log = LoggerFactory.getLogger(OrderedExecutorSanityTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void shouldExecuteTasksInOrder() throws InterruptedException { diff --git a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/critical/MultiThreadCriticalMeasureTest.java b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/critical/MultiThreadCriticalMeasureTest.java index 591afd494f..6603f581e7 100644 --- a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/critical/MultiThreadCriticalMeasureTest.java +++ b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/critical/MultiThreadCriticalMeasureTest.java @@ -29,12 +29,13 @@ import org.apache.activemq.artemis.utils.ReusableLatch; import org.apache.activemq.artemis.utils.Wait; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.Assert; import org.junit.Test; public class MultiThreadCriticalMeasureTest { - private static final Logger logger = LoggerFactory.getLogger(MultiThreadCriticalMeasureTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testMultiThread() throws Throwable { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java index dc9b20427d..41eedc73a2 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java @@ -25,13 +25,14 @@ import org.apache.activemq.artemis.core.server.ComponentConfigurationRoutingType import org.apache.activemq.artemis.utils.critical.CriticalAnalyzerPolicy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Default values of ActiveMQ Artemis configuration parameters. */ public final class ActiveMQDefaultConfiguration { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQDefaultConfiguration.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /* *

In order to avoid compile time in-lining of constants, all access is done through methods diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/ChannelBroadcastEndpointFactory.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/ChannelBroadcastEndpointFactory.java index 15acbcee55..56e3ddfe6f 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/ChannelBroadcastEndpointFactory.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/ChannelBroadcastEndpointFactory.java @@ -19,6 +19,7 @@ package org.apache.activemq.artemis.api.core; import org.apache.activemq.artemis.api.core.jgroups.JChannelManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.jgroups.JChannel; /** @@ -28,7 +29,7 @@ import org.jgroups.JChannel; */ public class ChannelBroadcastEndpointFactory implements BroadcastEndpointFactory { - private static final Logger logger = LoggerFactory.getLogger(ChannelBroadcastEndpointFactory.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final JChannel channel; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/JGroupsBroadcastEndpoint.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/JGroupsBroadcastEndpoint.java index 68b549c41f..af9c9747de 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/JGroupsBroadcastEndpoint.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/JGroupsBroadcastEndpoint.java @@ -23,6 +23,7 @@ import org.apache.activemq.artemis.api.core.jgroups.JChannelWrapper; import org.apache.activemq.artemis.api.core.jgroups.JGroupsReceiver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.jgroups.JChannel; /** @@ -30,7 +31,7 @@ import org.jgroups.JChannel; */ public abstract class JGroupsBroadcastEndpoint implements BroadcastEndpoint { - private static final Logger logger = LoggerFactory.getLogger(JGroupsBroadcastEndpoint.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final String channelName; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/jgroups/JChannelManager.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/jgroups/JChannelManager.java index 4e72dda303..9d4195fb1b 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/jgroups/JChannelManager.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/jgroups/JChannelManager.java @@ -23,6 +23,7 @@ import java.util.Map; import org.apache.activemq.artemis.api.core.JGroupsBroadcastEndpoint; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This class maintain a global Map of JChannels wrapped in JChannelWrapper for @@ -33,6 +34,8 @@ import org.slf4j.LoggerFactory; */ public class JChannelManager { + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + private static final JChannelManager theInstance = new JChannelManager(); public static JChannelManager getInstance() { @@ -55,8 +58,6 @@ public class JChannelManager { // this is useful for testcases using a single channel. private boolean loopbackMessages = false; - private final Logger logger = LoggerFactory.getLogger(JChannelManager.class); - private static final Map channels = new HashMap<>(); public boolean isLoopbackMessages() { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/jgroups/JChannelWrapper.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/jgroups/JChannelWrapper.java index d57bfd306f..e93dbe7da0 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/jgroups/JChannelWrapper.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/jgroups/JChannelWrapper.java @@ -25,6 +25,7 @@ import org.jgroups.Message; import org.jgroups.Receiver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This class wraps a JChannel with a reference counter. The reference counter @@ -33,7 +34,7 @@ import org.slf4j.LoggerFactory; */ public class JChannelWrapper { - private static final Logger logger = LoggerFactory.getLogger(JChannelWrapper.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private boolean connected = false; int refCount = 1; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/jgroups/JGroupsReceiver.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/jgroups/JGroupsReceiver.java index 5f5d608ce5..3c1a22a0b3 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/jgroups/JGroupsReceiver.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/jgroups/JGroupsReceiver.java @@ -23,6 +23,7 @@ import java.util.concurrent.TimeUnit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.jgroups.Receiver; /** @@ -31,7 +32,7 @@ import org.jgroups.Receiver; */ public class JGroupsReceiver implements Receiver { - private static final Logger logger = LoggerFactory.getLogger(JGroupsReceiver.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final BlockingQueue dequeue = new LinkedBlockingDeque<>(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/AbstractProducerCreditsImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/AbstractProducerCreditsImpl.java index bb89361763..12d3e3ebdc 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/AbstractProducerCreditsImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/AbstractProducerCreditsImpl.java @@ -23,10 +23,11 @@ import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.spi.core.remoting.SessionContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public abstract class AbstractProducerCreditsImpl implements ClientProducerCredits { - private static final Logger logger = LoggerFactory.getLogger(AbstractProducerCreditsImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected int pendingCredits; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/AsynchronousProducerCreditsImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/AsynchronousProducerCreditsImpl.java index d62d892b49..a6a61d38a1 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/AsynchronousProducerCreditsImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/AsynchronousProducerCreditsImpl.java @@ -20,10 +20,11 @@ package org.apache.activemq.artemis.core.client.impl; import org.apache.activemq.artemis.api.core.SimpleString; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class AsynchronousProducerCreditsImpl extends AbstractProducerCreditsImpl { - private static final Logger logger = LoggerFactory.getLogger(AsynchronousProducerCreditsImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); int balance; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerImpl.java index 87c8281322..f27ce80390 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerImpl.java @@ -47,11 +47,12 @@ import org.apache.activemq.artemis.utils.collections.PriorityLinkedList; import org.apache.activemq.artemis.utils.collections.PriorityLinkedListImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public final class ClientConsumerImpl implements ClientConsumerInternal { - private static final Logger logger = LoggerFactory.getLogger(ClientConsumerImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final long CLOSE_TIMEOUT_MILLISECONDS = 10000; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerImpl.java index 9d746fc19c..d18c0916e8 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerImpl.java @@ -35,13 +35,14 @@ import org.apache.activemq.artemis.utils.TokenBucketLimiter; import org.apache.activemq.artemis.utils.UUIDGenerator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * The client-side Producer. */ public class ClientProducerImpl implements ClientProducerInternal { - private static final Logger logger = LoggerFactory.getLogger(ClientProducerImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final SimpleString address; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java index b12e51d198..35484b7bb5 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java @@ -72,10 +72,11 @@ import org.apache.activemq.artemis.utils.actors.OrderedExecutorFactory; import org.apache.activemq.artemis.utils.collections.ConcurrentHashSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, ClientConnectionLifeCycleListener { - private static final Logger logger = LoggerFactory.getLogger(ClientSessionFactoryImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final ServerLocatorInternal serverLocator; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java index fa65b2e003..09c0fa75dc 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java @@ -60,10 +60,11 @@ import org.apache.activemq.artemis.utils.UUIDGenerator; import org.apache.activemq.artemis.utils.XidCodecSupport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public final class ClientSessionImpl implements ClientSessionInternal, FailureListener { - private static final Logger logger = LoggerFactory.getLogger(ClientSessionImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Map metadata = new HashMap<>(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorImpl.java index 4554357252..03e6b533fe 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorImpl.java @@ -75,6 +75,7 @@ import org.apache.activemq.artemis.utils.actors.OrderedExecutor; import org.apache.activemq.artemis.utils.uri.FluentPropertyBeanIntrospectorWithIgnores; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This is the implementation of {@link org.apache.activemq.artemis.api.core.client.ServerLocator} and all @@ -82,7 +83,7 @@ import org.slf4j.LoggerFactory; */ public final class ServerLocatorImpl implements ServerLocatorInternal, DiscoveryListener { - private static final Logger logger = LoggerFactory.getLogger(ServerLocatorImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private enum STATE { INITIALIZED, CLOSED, CLOSING diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/Topology.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/Topology.java index 1255b4b07c..032704db9d 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/Topology.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/Topology.java @@ -33,10 +33,11 @@ import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; import org.apache.activemq.artemis.spi.core.remoting.Connector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public final class Topology { - private static final Logger logger = LoggerFactory.getLogger(Topology.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Set topologyListeners; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/cluster/DiscoveryGroup.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/cluster/DiscoveryGroup.java index 45d3f97b01..e0342a4b4b 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/cluster/DiscoveryGroup.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/cluster/DiscoveryGroup.java @@ -42,6 +42,7 @@ import org.apache.activemq.artemis.utils.ActiveMQThreadFactory; import org.apache.activemq.artemis.utils.collections.TypedProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This class is used to search for members on the cluster through the opaque interface {@link BroadcastEndpoint}. @@ -53,7 +54,7 @@ import org.slf4j.LoggerFactory; */ public final class DiscoveryGroup implements ActiveMQComponent { - private static final Logger logger = LoggerFactory.getLogger(DiscoveryGroup.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final List listeners = new ArrayList<>(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java index f4b35526fd..9a7c8c5008 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java @@ -60,6 +60,7 @@ import org.apache.activemq.artemis.utils.UUID; import org.apache.activemq.artemis.utils.collections.TypedProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.utils.ByteUtil.ensureExactWritable; @@ -71,7 +72,7 @@ public class CoreMessage extends RefCountMessage implements ICoreMessage { protected volatile int memoryEstimate = -1; - private static final Logger logger = LoggerFactory.getLogger(CoreMessage.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); // There's an integer with the number of bytes for the body public static final int BODY_OFFSET = DataConstants.SIZE_INT; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/openmbean/MessageOpenTypeFactory.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/openmbean/MessageOpenTypeFactory.java index 33a9efb17f..41bd83b7fb 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/openmbean/MessageOpenTypeFactory.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/openmbean/MessageOpenTypeFactory.java @@ -36,10 +36,11 @@ import org.apache.activemq.artemis.api.core.Message; import org.apache.activemq.artemis.api.core.SimpleString; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MessageOpenTypeFactory { - private static final Logger logger = LoggerFactory.getLogger(MessageOpenTypeFactory.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public MessageOpenTypeFactory() { try { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQClientProtocolManager.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQClientProtocolManager.java index 0f503f95b2..0e375d4c6e 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQClientProtocolManager.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQClientProtocolManager.java @@ -65,6 +65,7 @@ import org.apache.activemq.artemis.spi.core.remoting.TopologyResponseHandler; import org.apache.activemq.artemis.utils.VersionLoader; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This class will return specific packets for different types of actions happening on a messaging protocol. @@ -80,7 +81,7 @@ import org.slf4j.LoggerFactory; public class ActiveMQClientProtocolManager implements ClientProtocolManager { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQClientProtocolManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String handshake = "ARTEMIS"; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQSessionContext.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQSessionContext.java index fa20909ab1..f5bf232a96 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQSessionContext.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQSessionContext.java @@ -131,10 +131,11 @@ import org.apache.activemq.artemis.spi.core.remoting.SessionContext; import org.apache.activemq.artemis.utils.TokenBucketLimiterImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ActiveMQSessionContext extends SessionContext { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQSessionContext.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Channel sessionChannel; private final int serverVersion; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java index 3edd9beee6..d89d3f6b1c 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java @@ -44,10 +44,11 @@ import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; import org.apache.activemq.artemis.utils.ConcurrentUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public final class ChannelImpl implements Channel { - private static final Logger logger = LoggerFactory.getLogger(ChannelImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public enum CHANNEL_ID { /** diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/RemotingConnectionImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/RemotingConnectionImpl.java index c5ebe6733f..6065dd561f 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/RemotingConnectionImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/RemotingConnectionImpl.java @@ -48,10 +48,11 @@ import org.apache.activemq.artemis.spi.core.remoting.Connection; import org.apache.activemq.artemis.utils.SimpleIDGenerator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class RemotingConnectionImpl extends AbstractRemotingConnection implements CoreRemotingConnection { - private static final Logger logger = LoggerFactory.getLogger(RemotingConnectionImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final PacketDecoder packetDecoder; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/CertificateUtil.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/CertificateUtil.java index a066b06658..db90c409ff 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/CertificateUtil.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/CertificateUtil.java @@ -32,10 +32,11 @@ import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; import org.apache.activemq.artemis.spi.core.remoting.Connection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class CertificateUtil { - private static final Logger logger = LoggerFactory.getLogger(CertificateUtil.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String SSL_HANDLER_NAME = "ssl"; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/CheckDependencies.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/CheckDependencies.java index 682af3c89b..2bbcd1883e 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/CheckDependencies.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/CheckDependencies.java @@ -23,6 +23,7 @@ import org.apache.activemq.artemis.core.client.ActiveMQClientLogger; import org.apache.activemq.artemis.utils.Env; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This class will check for Epoll or KQueue is available, and return false in case of NoClassDefFoundError @@ -30,7 +31,7 @@ import org.slf4j.LoggerFactory; */ public class CheckDependencies { - private static final Logger logger = LoggerFactory.getLogger(CheckDependencies.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final boolean isEpollAvailable() { try { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java index 65ac5bdabd..b1ce0a4203 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java @@ -45,12 +45,13 @@ import org.apache.activemq.artemis.utils.Env; import org.apache.activemq.artemis.utils.IPV6Util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.utils.Preconditions.checkNotNull; public class NettyConnection implements Connection { - private static final Logger logger = LoggerFactory.getLogger(NettyConnection.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int DEFAULT_WAIT_MILLIS = 10_000; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java index 45276bb767..130066a9de 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java @@ -125,6 +125,7 @@ import org.apache.activemq.artemis.utils.FutureLatch; import org.apache.activemq.artemis.utils.IPV6Util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.utils.Base64.encodeBytes; @@ -134,7 +135,7 @@ public class NettyConnector extends AbstractConnector { public static String EPOLL_CONNECTOR_TYPE = "EPOLL"; public static String KQUEUE_CONNECTOR_TYPE = "KQUEUE"; - private static final Logger logger = LoggerFactory.getLogger(NettyConnector.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String JAVAX_KEYSTORE_PATH_PROP_NAME = "javax.net.ssl.keyStore"; public static final String JAVAX_KEYSTORE_PASSWORD_PROP_NAME = "javax.net.ssl.keyStorePassword"; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/TransportConstants.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/TransportConstants.java index 1fa5d512eb..9f6b590357 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/TransportConstants.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/TransportConstants.java @@ -25,10 +25,11 @@ import io.netty.util.Version; import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class TransportConstants { - private static final Logger logger = LoggerFactory.getLogger(TransportConstants.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String SSL_CONTEXT_PROP_NAME = "sslContext"; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/DefaultOpenSSLContextFactory.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/DefaultOpenSSLContextFactory.java index d5dd76fcb5..b40d43120f 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/DefaultOpenSSLContextFactory.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/DefaultOpenSSLContextFactory.java @@ -16,6 +16,7 @@ */ package org.apache.activemq.artemis.core.remoting.impl.ssl; +import java.lang.invoke.MethodHandles; import java.util.Map; import io.netty.handler.ssl.SslContext; @@ -23,12 +24,16 @@ import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnector; import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; import org.apache.activemq.artemis.spi.core.remoting.ssl.OpenSSLContextFactory; import org.apache.activemq.artemis.spi.core.remoting.ssl.SSLContextConfig; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Default {@link OpenSSLContextFactory} for use in {@link NettyConnector} and NettyAcceptor. */ public class DefaultOpenSSLContextFactory implements OpenSSLContextFactory { + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + /** * @param additionalOpts not used by this implementation * @@ -36,7 +41,7 @@ public class DefaultOpenSSLContextFactory implements OpenSSLContextFactory { */ @Override public SslContext getClientSslContext(final SSLContextConfig config, final Map additionalOpts) throws Exception { - log.debug("Creating Client OpenSSL Context with {}", config); + logger.debug("Creating Client OpenSSL Context with {}", config); return new SSLSupport(config) .setSslProvider(TransportConstants.OPENSSL_PROVIDER) .createNettyClientContext(); @@ -49,7 +54,7 @@ public class DefaultOpenSSLContextFactory implements OpenSSLContextFactory { */ @Override public SslContext getServerSslContext(final SSLContextConfig config, final Map additionalOpts) throws Exception { - log.debug("Creating Server OpenSSL Context with {}", config); + logger.debug("Creating Server OpenSSL Context with {}", config); return new SSLSupport(config) .setSslProvider(TransportConstants.OPENSSL_PROVIDER) .createNettyContext(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/DefaultSSLContextFactory.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/DefaultSSLContextFactory.java index ab1a71f91e..c17b34d139 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/DefaultSSLContextFactory.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/DefaultSSLContextFactory.java @@ -15,18 +15,23 @@ */ package org.apache.activemq.artemis.core.remoting.impl.ssl; +import java.lang.invoke.MethodHandles; import java.util.Map; import javax.net.ssl.SSLContext; import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; import org.apache.activemq.artemis.spi.core.remoting.ssl.SSLContextConfig; import org.apache.activemq.artemis.spi.core.remoting.ssl.SSLContextFactory; import org.apache.activemq.artemis.utils.ConfigurationHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Simple SSLContextFactory for use in NettyConnector and NettyAcceptor. */ public class DefaultSSLContextFactory implements SSLContextFactory { + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + @Override public SSLContext getSSLContext(final SSLContextConfig config, final Map additionalOpts) throws Exception { final boolean useDefaultSslContext = ConfigurationHelper.getBooleanProperty( @@ -36,11 +41,11 @@ public class DefaultSSLContextFactory implements SSLContextFactory { ); if (useDefaultSslContext) { - log.debug("Using the Default JDK SSLContext."); + logger.debug("Using the Default JDK SSLContext."); return SSLContext.getDefault(); } - log.debug("Creating JDK SSLContext with {}", config); + logger.debug("Creating JDK SSLContext with {}", config); return new SSLSupport(config).createContext(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/protocol/AbstractRemotingConnection.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/protocol/AbstractRemotingConnection.java index 91b2a3a82b..4351f77b05 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/protocol/AbstractRemotingConnection.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/protocol/AbstractRemotingConnection.java @@ -35,12 +35,13 @@ import org.apache.activemq.artemis.spi.core.remoting.Connection; import org.apache.activemq.artemis.spi.core.remoting.ReadyListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import javax.security.auth.Subject; public abstract class AbstractRemotingConnection implements RemotingConnection { - private static final Logger logger = LoggerFactory.getLogger(AbstractRemotingConnection.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected final List failureListeners = new CopyOnWriteArrayList<>(); protected final List closeListeners = new CopyOnWriteArrayList<>(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ssl/OpenSSLContextFactory.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ssl/OpenSSLContextFactory.java index a6bb2e1284..867619350b 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ssl/OpenSSLContextFactory.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ssl/OpenSSLContextFactory.java @@ -19,8 +19,6 @@ package org.apache.activemq.artemis.spi.core.remoting.ssl; import java.util.Map; import io.netty.handler.ssl.SslContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * Service interface to create an {@link SslContext} for a configuration. @@ -31,8 +29,6 @@ import org.slf4j.LoggerFactory; */ public interface OpenSSLContextFactory extends Comparable { - Logger log = LoggerFactory.getLogger(OpenSSLContextFactory.class); - /** * Release any cached {@link SslContext} instances. */ diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ssl/SSLContextFactory.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ssl/SSLContextFactory.java index 3334a4fd2c..8d737d02af 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ssl/SSLContextFactory.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ssl/SSLContextFactory.java @@ -17,8 +17,6 @@ package org.apache.activemq.artemis.spi.core.remoting.ssl; import java.util.Map; import javax.net.ssl.SSLContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * Service interface to create a SSLContext for a configuration. @@ -28,7 +26,6 @@ import org.slf4j.LoggerFactory; * in your jar and fill it with the full qualified name of your implementation. */ public interface SSLContextFactory extends Comparable { - Logger log = LoggerFactory.getLogger(SSLContextFactory.class); /** * @return an {@link SSLContext} for the given configuration. diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/AutoCreateUtil.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/AutoCreateUtil.java index d0d8bde191..7e9375e81b 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/AutoCreateUtil.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/AutoCreateUtil.java @@ -27,13 +27,14 @@ import org.apache.activemq.artemis.api.core.client.ClientSession.AddressQuery; import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Utility class to create queues 'automatically'. */ public class AutoCreateUtil { - private static final Logger logger = LoggerFactory.getLogger(AutoCreateUtil.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static void autoCreateQueue(ClientSession session, SimpleString destAddress, SimpleString selectorString) throws ActiveMQException { AddressQuery response = session.addressQuery(destAddress); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/XMLUtil.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/XMLUtil.java index e14dced4d6..707ee88127 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/XMLUtil.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/XMLUtil.java @@ -37,6 +37,7 @@ import org.apache.activemq.artemis.core.client.ActiveMQClientLogger; import org.apache.activemq.artemis.core.client.ActiveMQClientMessageBundle; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; @@ -47,7 +48,7 @@ import org.xml.sax.SAXException; public final class XMLUtil { - private static final Logger logger = LoggerFactory.getLogger(XMLUtil.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private XMLUtil() { // Utility class diff --git a/artemis-core-client/src/test/java/org/apache/activemq/artemis/tests/uri/ConnectorTransportConfigurationParserURITest.java b/artemis-core-client/src/test/java/org/apache/activemq/artemis/tests/uri/ConnectorTransportConfigurationParserURITest.java index 991667fa80..15826a3f2c 100644 --- a/artemis-core-client/src/test/java/org/apache/activemq/artemis/tests/uri/ConnectorTransportConfigurationParserURITest.java +++ b/artemis-core-client/src/test/java/org/apache/activemq/artemis/tests/uri/ConnectorTransportConfigurationParserURITest.java @@ -23,12 +23,13 @@ import org.apache.activemq.artemis.api.core.TransportConfiguration; import org.apache.activemq.artemis.uri.ConnectorTransportConfigurationParser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.Assert; import org.junit.Test; public class ConnectorTransportConfigurationParserURITest { - private static final Logger logger = LoggerFactory.getLogger(ConnectorTransportConfigurationParserURITest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testParse() throws Exception { diff --git a/artemis-hawtio/activemq-branding/src/main/java/org/apache/activemq/hawtio/branding/PluginContextListener.java b/artemis-hawtio/activemq-branding/src/main/java/org/apache/activemq/hawtio/branding/PluginContextListener.java index 59b1dd791a..574f1015b8 100644 --- a/artemis-hawtio/activemq-branding/src/main/java/org/apache/activemq/hawtio/branding/PluginContextListener.java +++ b/artemis-hawtio/activemq-branding/src/main/java/org/apache/activemq/hawtio/branding/PluginContextListener.java @@ -19,6 +19,7 @@ package org.apache.activemq.hawtio.branding; import io.hawt.web.plugin.HawtioPlugin; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; @@ -29,7 +30,7 @@ import javax.servlet.ServletContextListener; **/ public class PluginContextListener implements ServletContextListener { - private static final Logger LOG = LoggerFactory.getLogger(PluginContextListener.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); HawtioPlugin plugin = null; diff --git a/artemis-hawtio/artemis-plugin/src/main/java/org/apache/activemq/hawtio/plugin/PluginContextListener.java b/artemis-hawtio/artemis-plugin/src/main/java/org/apache/activemq/hawtio/plugin/PluginContextListener.java index a49b716fad..3c82c568cd 100644 --- a/artemis-hawtio/artemis-plugin/src/main/java/org/apache/activemq/hawtio/plugin/PluginContextListener.java +++ b/artemis-hawtio/artemis-plugin/src/main/java/org/apache/activemq/hawtio/plugin/PluginContextListener.java @@ -19,6 +19,7 @@ package org.apache.activemq.hawtio.plugin; import io.hawt.web.plugin.HawtioPlugin; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; @@ -29,7 +30,7 @@ import javax.servlet.ServletContextListener; **/ public class PluginContextListener implements ServletContextListener { - private static final Logger LOG = LoggerFactory.getLogger(PluginContextListener.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); HawtioPlugin plugin = null; diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/AbstractJDBCDriver.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/AbstractJDBCDriver.java index 522fe36995..cd1600e1a2 100644 --- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/AbstractJDBCDriver.java +++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/AbstractJDBCDriver.java @@ -27,6 +27,7 @@ import java.util.stream.Stream; import org.apache.activemq.artemis.jdbc.store.sql.SQLProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Class to hold common database functionality such as drivers and connections @@ -34,7 +35,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings("SynchronizeOnNonFinalField") public abstract class AbstractJDBCDriver { - private static final Logger logger = LoggerFactory.getLogger(AbstractJDBCDriver.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected SQLProvider sqlProvider; diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCConnectionProvider.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCConnectionProvider.java index a5237c1da7..afea96af49 100644 --- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCConnectionProvider.java +++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCConnectionProvider.java @@ -27,10 +27,11 @@ import org.apache.activemq.artemis.jdbc.store.logging.LoggingConnection; import org.apache.activemq.artemis.jdbc.store.sql.PropertySQLProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class JDBCConnectionProvider { - private static final Logger logger = LoggerFactory.getLogger(JDBCConnectionProvider.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private DataSource dataSource; private Executor networkTimeoutExecutor; private int networkTimeoutMillis; diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCUtils.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCUtils.java index 9eeb13e72c..ff42e2b131 100644 --- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCUtils.java +++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCUtils.java @@ -23,10 +23,11 @@ import org.apache.activemq.artemis.jdbc.store.sql.PropertySQLProvider; import org.apache.activemq.artemis.jdbc.store.sql.SQLProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class JDBCUtils { - private static final Logger logger = LoggerFactory.getLogger(JDBCUtils.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static SQLProvider.Factory getSQLProviderFactory(String url) { PropertySQLProvider.Factory.SQLDialect dialect = PropertySQLProvider.Factory.identifyDialect(url); diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFile.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFile.java index 54255cf88e..ac0ca98fd6 100644 --- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFile.java +++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFile.java @@ -36,10 +36,11 @@ import org.apache.activemq.artemis.core.journal.EncodingSupport; import org.apache.activemq.artemis.core.journal.impl.SimpleWaitIOCallback; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class JDBCSequentialFile implements SequentialFile { - private static final Logger logger = LoggerFactory.getLogger(JDBCSequentialFile.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final String filename; diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactory.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactory.java index 0848e9b05b..8ac525f30d 100644 --- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactory.java +++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactory.java @@ -35,10 +35,11 @@ import org.apache.activemq.artemis.jdbc.store.sql.SQLProvider; import org.apache.activemq.artemis.utils.collections.ConcurrentHashSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class JDBCSequentialFileFactory implements SequentialFileFactory, ActiveMQComponent { - private static final Logger logger = LoggerFactory.getLogger(JDBCSequentialFileFactory.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private boolean started; diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactoryDriver.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactoryDriver.java index 5f3f81d2a7..f1b9c2accd 100644 --- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactoryDriver.java +++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactoryDriver.java @@ -31,11 +31,12 @@ import org.apache.activemq.artemis.jdbc.store.drivers.JDBCConnectionProvider; import org.apache.activemq.artemis.jdbc.store.sql.SQLProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; @SuppressWarnings("SynchronizeOnNonFinalField") public class JDBCSequentialFileFactoryDriver extends AbstractJDBCDriver { - private static final Logger logger = LoggerFactory.getLogger(JDBCSequentialFileFactoryDriver.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected String deleteFile; protected String createFile; diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalImpl.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalImpl.java index 90d7967e3f..6e9927141c 100644 --- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalImpl.java +++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalImpl.java @@ -56,10 +56,11 @@ import org.apache.activemq.artemis.jdbc.store.sql.SQLProvider; import org.apache.activemq.artemis.utils.collections.SparseArrayLinkedList; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class JDBCJournalImpl extends AbstractJDBCDriver implements Journal { - private static final Logger logger = LoggerFactory.getLogger(JDBCJournalImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); // Sync Delay in ms //private static final int SYNC_DELAY = 5; diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalRecord.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalRecord.java index 37814f002f..167a967b30 100644 --- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalRecord.java +++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalRecord.java @@ -34,10 +34,11 @@ import org.apache.activemq.artemis.core.journal.RecordInfo; import org.apache.activemq.artemis.utils.ActiveMQBufferInputStream; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; class JDBCJournalRecord { - private static final Logger logger = LoggerFactory.getLogger(JDBCJournalRecord.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /* Database Table Schema: diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/sql/PropertySQLProvider.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/sql/PropertySQLProvider.java index 183b68ceff..8b5d1e8763 100644 --- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/sql/PropertySQLProvider.java +++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/sql/PropertySQLProvider.java @@ -30,6 +30,7 @@ import java.util.stream.Stream; import org.apache.activemq.artemis.jdbc.store.drivers.JDBCConnectionProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static java.lang.String.format; @@ -42,7 +43,7 @@ import static java.lang.String.format; */ public class PropertySQLProvider implements SQLProvider { - private static final Logger logger = LoggerFactory.getLogger(PropertySQLProvider.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private enum LetterCase implements Function { upper(String::toUpperCase), diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/ActiveMQJMSClient.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/ActiveMQJMSClient.java index 10586ec2cb..f6093acd9d 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/ActiveMQJMSClient.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/ActiveMQJMSClient.java @@ -28,12 +28,13 @@ import org.apache.activemq.artemis.uri.ConnectionFactoryParser; import org.apache.activemq.artemis.utils.ClassloadingUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A utility class for creating ActiveMQ Artemis client-side JMS managed resources. */ public class ActiveMQJMSClient { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQJMSClient.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final boolean DEFAULT_ENABLE_1X_PREFIXES; diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageProducer.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageProducer.java index 6637317dec..a9e761b1df 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageProducer.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageProducer.java @@ -46,13 +46,14 @@ import org.apache.activemq.artemis.utils.UUID; import org.apache.activemq.artemis.utils.UUIDGenerator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * ActiveMQ Artemis implementation of a JMS MessageProducer. */ public class ActiveMQMessageProducer implements MessageProducer, QueueSender, TopicPublisher { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQMessageProducer.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final ConnectionFactoryOptions options; diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/TCPSchema.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/TCPSchema.java index d682b59bee..affab7a97d 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/TCPSchema.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/TCPSchema.java @@ -32,10 +32,11 @@ import org.apache.activemq.artemis.utils.uri.BeanSupport; import org.apache.activemq.artemis.utils.uri.SchemaConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class TCPSchema extends AbstractCFSchema { - private static final Logger logger = LoggerFactory.getLogger(TCPSchema.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override public String getSchemaName() { diff --git a/artemis-jms-client/src/test/java/org/apache/activemq/artemis/uri/ConnectionFactoryURITest.java b/artemis-jms-client/src/test/java/org/apache/activemq/artemis/uri/ConnectionFactoryURITest.java index 71e9e575a8..be0ffb8cfd 100644 --- a/artemis-jms-client/src/test/java/org/apache/activemq/artemis/uri/ConnectionFactoryURITest.java +++ b/artemis-jms-client/src/test/java/org/apache/activemq/artemis/uri/ConnectionFactoryURITest.java @@ -53,10 +53,11 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ConnectionFactoryURITest { - private static final Logger log = LoggerFactory.getLogger(ConnectionFactoryURITest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); ConnectionFactoryParser parser = new ConnectionFactoryParser(); diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/bridge/impl/JMSBridgeImpl.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/bridge/impl/JMSBridgeImpl.java index aff9967368..bda6521506 100644 --- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/bridge/impl/JMSBridgeImpl.java +++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/bridge/impl/JMSBridgeImpl.java @@ -75,10 +75,11 @@ import org.apache.activemq.artemis.service.extensions.xa.recovery.XARecoveryConf import org.apache.activemq.artemis.utils.PasswordMaskingUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public final class JMSBridgeImpl implements JMSBridge { - private static final Logger logger = LoggerFactory.getLogger(JMSBridgeImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String[] RESOURCE_RECOVERY_CLASS_NAMES = new String[]{"org.jboss.as.messaging.jms.AS7RecoveryRegistry"}; diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFile.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFile.java index 4cd59ecae8..ba970de2a6 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFile.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFile.java @@ -39,11 +39,12 @@ import org.apache.activemq.artemis.journal.ActiveMQJournalBundle; import org.apache.activemq.artemis.journal.ActiveMQJournalLogger; import org.apache.activemq.artemis.utils.ByteUtil; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.slf4j.Logger; public abstract class AbstractSequentialFile implements SequentialFile { - private static final Logger logger = LoggerFactory.getLogger(AbstractSequentialFile.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected File file; diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFileFactory.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFileFactory.java index 3359240235..3781bbee99 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFileFactory.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFileFactory.java @@ -36,6 +36,7 @@ import org.apache.activemq.artemis.utils.ActiveMQThreadFactory; import org.apache.activemq.artemis.utils.critical.CriticalAnalyzer; import org.apache.activemq.artemis.utils.critical.EmptyCriticalAnalyzer; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.slf4j.Logger; /** @@ -43,7 +44,7 @@ import org.slf4j.Logger; */ public abstract class AbstractSequentialFileFactory implements SequentialFileFactory { - private static final Logger logger = LoggerFactory.getLogger(AbstractSequentialFileFactory.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); // Timeout used to wait executors to shutdown protected static final int EXECUTOR_TIMEOUT = 60; diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/RunnableCallback.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/RunnableCallback.java index e753a3fb48..e704bb4697 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/RunnableCallback.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/RunnableCallback.java @@ -19,9 +19,10 @@ package org.apache.activemq.artemis.core.io; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class RunnableCallback implements IOCallback { - private static final Logger logger = LoggerFactory.getLogger(RunnableCallback.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); Runnable okCallback; Runnable errorCallback; diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFile.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFile.java index e304aa4ba1..33f92c6d99 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFile.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFile.java @@ -32,12 +32,13 @@ import org.apache.activemq.artemis.core.io.SequentialFile; import org.apache.activemq.artemis.core.journal.impl.SimpleWaitIOCallback; import org.apache.activemq.artemis.nativo.jlibaio.LibaioFile; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.slf4j.Logger; /** This class is implementing Runnable to reuse a callback to close it. */ public class AIOSequentialFile extends AbstractSequentialFile { - private static final Logger logger = LoggerFactory.getLogger(AIOSequentialFileFactory.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private boolean opened = false; diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFileFactory.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFileFactory.java index 9dbf2fe059..3395505c3d 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFileFactory.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFileFactory.java @@ -40,13 +40,14 @@ import org.apache.activemq.artemis.utils.ByteUtil; import org.apache.activemq.artemis.utils.PowerOf2Util; import org.apache.activemq.artemis.utils.critical.CriticalAnalyzer; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.slf4j.Logger; import org.jctools.queues.MpmcArrayQueue; import org.jctools.queues.atomic.MpmcAtomicArrayQueue; public final class AIOSequentialFileFactory extends AbstractSequentialFileFactory { - private static final Logger logger = LoggerFactory.getLogger(AIOSequentialFileFactory.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); // This is useful in cases where you want to disable loading the native library. (e.g. testsuite) private static final boolean DISABLED = System.getProperty(AIOSequentialFileFactory.class.getName() + ".DISABLED") != null; diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBuffer.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBuffer.java index 6182927a03..2f6c676fba 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBuffer.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBuffer.java @@ -36,6 +36,7 @@ import org.apache.activemq.artemis.utils.ArtemisCloseable; import org.apache.activemq.artemis.utils.critical.CriticalAnalyzer; import org.apache.activemq.artemis.utils.critical.CriticalComponentImpl; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.slf4j.Logger; public final class TimedBuffer extends CriticalComponentImpl { @@ -48,7 +49,7 @@ public final class TimedBuffer extends CriticalComponentImpl { protected static final int CRITICAL_PATH_ADD_BYTES = 4; protected static final int CRITICAL_PATH_SET_OBSERVER = 5; - private static final Logger logger = LoggerFactory.getLogger(TimedBuffer.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final double MAX_TIMEOUT_ERROR_FACTOR = 1.5; diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/mapped/MappedFile.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/mapped/MappedFile.java index 0d5e34f2be..3873078f1b 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/mapped/MappedFile.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/mapped/MappedFile.java @@ -31,11 +31,12 @@ import org.apache.activemq.artemis.core.journal.EncodingSupport; import org.apache.activemq.artemis.utils.PowerOf2Util; import org.apache.activemq.artemis.utils.Env; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.slf4j.Logger; final class MappedFile implements AutoCloseable { - private static final Logger logger = LoggerFactory.getLogger(MappedFile.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int OS_PAGE_SIZE = Env.osPageSize(); private final MappedByteBuffer buffer; diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/nio/NIOSequentialFile.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/nio/NIOSequentialFile.java index 6c00295a12..b45f0e13d4 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/nio/NIOSequentialFile.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/nio/NIOSequentialFile.java @@ -45,10 +45,11 @@ import org.apache.activemq.artemis.journal.ActiveMQJournalBundle; import org.apache.activemq.artemis.utils.Env; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class NIOSequentialFile extends AbstractSequentialFile { - private static final Logger logger = LoggerFactory.getLogger(NIOSequentialFile.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final boolean DEBUG_OPENS = false; diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/util/FileIOUtil.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/util/FileIOUtil.java index 90595fec27..c703d10867 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/util/FileIOUtil.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/util/FileIOUtil.java @@ -21,11 +21,12 @@ import java.nio.ByteBuffer; import org.apache.activemq.artemis.core.io.SequentialFile; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.slf4j.Logger; public class FileIOUtil { - private static final Logger logger = LoggerFactory.getLogger(FileIOUtil.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static void copyData(SequentialFile from, SequentialFile to, ByteBuffer buffer) throws Exception { diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalCompactor.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalCompactor.java index d7f14b0191..605f5d0f8b 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalCompactor.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalCompactor.java @@ -39,11 +39,12 @@ import org.apache.activemq.artemis.utils.RunnableEx; import org.apache.activemq.artemis.utils.collections.ConcurrentLongHashMap; import org.apache.activemq.artemis.utils.collections.ConcurrentLongHashSet; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.slf4j.Logger; public class JournalCompactor extends AbstractJournalUpdateTask implements JournalRecordProvider { - private static final Logger logger = LoggerFactory.getLogger(JournalCompactor.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); LongObjectHashMap> pendingWritesOnTX = new LongObjectHashMap<>(); IntObjectHashMap> pendingUpdates = new IntObjectHashMap<>(); diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFileImpl.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFileImpl.java index 04ca0f27b0..56cc85385b 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFileImpl.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFileImpl.java @@ -24,6 +24,7 @@ import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; import org.apache.activemq.artemis.core.io.SequentialFile; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.slf4j.Logger; import static org.apache.activemq.artemis.utils.Preconditions.checkNotNull; @@ -65,7 +66,7 @@ public class JournalFileImpl implements JournalFile { private final ConcurrentMap negCounts = new ConcurrentHashMap<>(); - private static final Logger logger = LoggerFactory.getLogger(JournalFileImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public JournalFileImpl(final SequentialFile file, final long fileID, final int version) { checkNotNull(file); diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFilesRepository.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFilesRepository.java index 97e9b58458..50da09c5a3 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFilesRepository.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFilesRepository.java @@ -42,6 +42,7 @@ import org.apache.activemq.artemis.core.io.SequentialFileFactory; import org.apache.activemq.artemis.journal.ActiveMQJournalBundle; import org.apache.activemq.artemis.journal.ActiveMQJournalLogger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.slf4j.Logger; /** @@ -50,7 +51,7 @@ import org.slf4j.Logger; */ public class JournalFilesRepository { - private static final Logger logger = LoggerFactory.getLogger(JournalFilesRepository.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * Used to debug the consistency of the journal ordering. diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalImpl.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalImpl.java index 20940392ed..d56041ad66 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalImpl.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalImpl.java @@ -92,6 +92,7 @@ import org.apache.activemq.artemis.utils.collections.ConcurrentLongHashMap; import org.apache.activemq.artemis.utils.collections.LongHashSet; import org.apache.activemq.artemis.utils.collections.SparseArrayLinkedList; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.slf4j.Logger; import static org.apache.activemq.artemis.core.journal.impl.Reclaimer.scan; @@ -101,7 +102,7 @@ import static org.apache.activemq.artemis.core.journal.impl.Reclaimer.scan; *

Look at {@link JournalImpl#load(LoaderCallback)} for the file layout */ public class JournalImpl extends JournalBase implements TestableJournal, JournalRecordProvider { - private static final Logger logger = LoggerFactory.getLogger(JournalImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalTransaction.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalTransaction.java index df53d1e4ae..c8a74defd4 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalTransaction.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalTransaction.java @@ -29,11 +29,12 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.activemq.artemis.api.core.ActiveMQExceptionType; import org.apache.activemq.artemis.core.journal.impl.dataformat.JournalInternalRecord; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.slf4j.Logger; public class JournalTransaction { - private static final Logger logger = LoggerFactory.getLogger(JournalTransaction.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private JournalRecordProvider journal; diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/Reclaimer.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/Reclaimer.java index 254a4694d5..bb3df9ecc8 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/Reclaimer.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/Reclaimer.java @@ -17,6 +17,7 @@ package org.apache.activemq.artemis.core.journal.impl; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.slf4j.Logger; /** @@ -35,7 +36,7 @@ import org.slf4j.Logger; */ public final class Reclaimer { - private static final Logger logger = LoggerFactory.getLogger(Reclaimer.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private Reclaimer() { } diff --git a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResource.java b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResource.java index 093dd36409..461173e4ff 100644 --- a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResource.java +++ b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResource.java @@ -46,6 +46,7 @@ import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.junit.rules.ExternalResource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A JUnit Rule that embeds an ActiveMQ Artemis server into a test. @@ -66,11 +67,10 @@ import org.slf4j.LoggerFactory; * */ public class EmbeddedActiveMQResource extends ExternalResource { + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); static final String SERVER_NAME = "embedded-server"; - Logger log = LoggerFactory.getLogger(this.getClass()); - boolean useDurableMessage = true; boolean useDurableQueue = true; long defaultReceiveTimeout = 50; @@ -185,7 +185,7 @@ public class EmbeddedActiveMQResource extends ExternalResource { try { server.stop(); } catch (Exception ex) { - log.warn(String.format("Exception encountered stopping %s: %s", server.getClass().getSimpleName(), this.getServerName()), ex); + logger.warn(String.format("Exception encountered stopping %s: %s", server.getClass().getSimpleName(), this.getServerName()), ex); } } } @@ -195,7 +195,7 @@ public class EmbeddedActiveMQResource extends ExternalResource { */ @Override protected void before() throws Throwable { - log.info("Starting {}: {}", this.getClass().getSimpleName(), getServerName()); + logger.info("Starting {}: {}", this.getClass().getSimpleName(), getServerName()); this.start(); @@ -207,7 +207,7 @@ public class EmbeddedActiveMQResource extends ExternalResource { */ @Override protected void after() { - log.info("Stopping {}: {}", this.getClass().getSimpleName(), getServerName()); + logger.info("Stopping {}: {}", this.getClass().getSimpleName(), getServerName()); this.stop(); @@ -311,7 +311,7 @@ public class EmbeddedActiveMQResource extends ExternalResource { public long getMessageCount(SimpleString queueName) { Queue queue = locateQueue(queueName); if (queue == null) { - log.warn("getMessageCount(queueName) - queue {} not found; returning -1", queueName.toString()); + logger.warn("getMessageCount(queueName) - queue {} not found; returning -1", queueName.toString()); return -1; } @@ -728,7 +728,7 @@ public class EmbeddedActiveMQResource extends ExternalResource { private InternalClient getInternalClient() { if (internalClient == null) { - log.info("Creating Internal Client"); + logger.info("Creating Internal Client"); internalClient = new InternalClient(); internalClient.start(); } @@ -758,7 +758,7 @@ public class EmbeddedActiveMQResource extends ExternalResource { } void start() { - log.info("Starting {}", this.getClass().getSimpleName()); + logger.info("Starting {}", this.getClass().getSimpleName()); try { serverLocator = ActiveMQClient.createServerLocator(getVmURL()); sessionFactory = serverLocator.createSessionFactory(); @@ -782,7 +782,7 @@ public class EmbeddedActiveMQResource extends ExternalResource { try { producer.close(); } catch (ActiveMQException amqEx) { - log.warn("ActiveMQException encountered closing InternalClient ClientProducer - ignoring", amqEx); + logger.warn("ActiveMQException encountered closing InternalClient ClientProducer - ignoring", amqEx); } finally { producer = null; } @@ -791,7 +791,7 @@ public class EmbeddedActiveMQResource extends ExternalResource { try { session.close(); } catch (ActiveMQException amqEx) { - log.warn("ActiveMQException encountered closing InternalClient ClientSession - ignoring", amqEx); + logger.warn("ActiveMQException encountered closing InternalClient ClientSession - ignoring", amqEx); } finally { session = null; } diff --git a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSResource.java b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSResource.java index acd98b87f4..7b4324b55d 100644 --- a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSResource.java +++ b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSResource.java @@ -54,6 +54,7 @@ import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS; import org.junit.rules.ExternalResource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Deprecated in favor of EmbeddedActiveMQResource. Since Artemis 2.0 all JMS specific broker management classes, @@ -78,6 +79,7 @@ import org.slf4j.LoggerFactory; */ @Deprecated public class EmbeddedJMSResource extends ExternalResource { + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); static final String SERVER_NAME = "embedded-jms-server"; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPConnectionCallback.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPConnectionCallback.java index c795e990f0..4b660d355d 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPConnectionCallback.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPConnectionCallback.java @@ -54,12 +54,13 @@ import org.apache.qpid.proton.amqp.Symbol; import org.apache.qpid.proton.amqp.transport.AmqpError; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import io.netty.buffer.ByteBuf; public class AMQPConnectionCallback implements FailureListener, CloseListener { - private static final Logger logger = LoggerFactory.getLogger(AMQPConnectionCallback.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final ConcurrentMap transactions = new ConcurrentHashMap<>(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java index b322e6f9d9..bad9749b82 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java @@ -80,6 +80,7 @@ import org.apache.qpid.proton.message.Message; import org.apache.qpid.proton.message.impl.MessageImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.protocol.amqp.converter.AMQPMessageSupport.getCharsetForTextualContent; @@ -119,7 +120,7 @@ public abstract class AMQPMessage extends RefCountMessage implements org.apache. private static final SimpleString ANNOTATION_AREA_PREFIX = SimpleString.toSimpleString("m."); - protected static final Logger logger = LoggerFactory.getLogger(AMQPMessage.class); + protected static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final SimpleString ADDRESS_PROPERTY = SimpleString.toSimpleString("_AMQ_AD"); // used to perform quick search diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java index eecf88c24a..972ec58763 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java @@ -79,10 +79,11 @@ import org.apache.qpid.proton.engine.EndpointState; import org.apache.qpid.proton.engine.Receiver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class AMQPSessionCallback implements SessionCallback { - private static final Logger logger = LoggerFactory.getLogger(AMQPSessionCallback.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final Symbol PRIORITY = Symbol.getSymbol("priority"); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ProtonProtocolManager.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ProtonProtocolManager.java index eca2f4a2e9..a34184ae6b 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ProtonProtocolManager.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ProtonProtocolManager.java @@ -51,13 +51,14 @@ import io.netty.channel.ChannelPipeline; import org.apache.activemq.artemis.utils.DestinationUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A proton protocol manager, basically reads the Proton Input and maps proton resources to ActiveMQ Artemis resources */ public class ProtonProtocolManager extends AbstractProtocolManager implements NotificationListener { - private static final Logger logger = LoggerFactory.getLogger(ProtonProtocolManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final List websocketRegistryNames = Arrays.asList("amqp"); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/client/ProtonClientConnectionManager.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/client/ProtonClientConnectionManager.java index 48e69eeb15..cd80501235 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/client/ProtonClientConnectionManager.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/client/ProtonClientConnectionManager.java @@ -30,6 +30,7 @@ import org.apache.activemq.artemis.spi.core.remoting.BufferHandler; import org.apache.activemq.artemis.spi.core.remoting.Connection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import java.util.Map; import java.util.Optional; @@ -40,7 +41,7 @@ import java.util.concurrent.ConcurrentHashMap; */ public class ProtonClientConnectionManager implements BaseConnectionLifeCycleListener, BufferHandler { private final Map connectionMap = new ConcurrentHashMap<>(); - private static final Logger log = LoggerFactory.getLogger(ProtonClientConnectionManager.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final AMQPClientConnectionFactory connectionFactory; private final Optional eventHandler; private final ClientSASLFactory clientSASLFactory; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPBrokerConnection.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPBrokerConnection.java index c839ee1cd0..e8551f0699 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPBrokerConnection.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPBrokerConnection.java @@ -87,10 +87,11 @@ import org.apache.qpid.proton.engine.Sender; import org.apache.qpid.proton.engine.Session; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class AMQPBrokerConnection implements ClientConnectionLifeCycleListener, ActiveMQServerQueuePlugin, BrokerConnection { - private static final Logger logger = LoggerFactory.getLogger(AMQPBrokerConnection.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final AMQPBrokerConnectConfiguration brokerConnectConfiguration; private final ProtonProtocolManager protonProtocolManager; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPBrokerConnectionManager.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPBrokerConnectionManager.java index 98060f5df7..7e3206a0ec 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPBrokerConnectionManager.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPBrokerConnectionManager.java @@ -42,9 +42,10 @@ import org.apache.activemq.artemis.spi.core.remoting.SessionContext; import org.apache.activemq.artemis.spi.core.remoting.TopologyResponseHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class AMQPBrokerConnectionManager implements ActiveMQComponent, ClientConnectionLifeCycleListener { - private static final Logger logger = LoggerFactory.getLogger(AMQPBrokerConnectionManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final ProtonProtocolManagerFactory protonProtocolManagerFactory; private final ActiveMQServer server; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorControllerSource.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorControllerSource.java index 5470e160b0..ca0ca97949 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorControllerSource.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorControllerSource.java @@ -44,12 +44,13 @@ import org.apache.qpid.proton.amqp.messaging.Properties; import org.apache.qpid.proton.engine.Sender; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.protocol.amqp.connect.mirror.AMQPMirrorControllerTarget.getControllerInUse; public class AMQPMirrorControllerSource extends BasicMirrorController implements MirrorController, ActiveMQComponent { - private static final Logger logger = LoggerFactory.getLogger(AMQPMirrorControllerSource.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final Symbol EVENT_TYPE = Symbol.getSymbol("x-opt-amq-mr-ev-type"); public static final Symbol ACK_REASON = Symbol.getSymbol("x-opt-amq-mr-ack-reason"); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorControllerTarget.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorControllerTarget.java index 1f11cd9802..a17aa355a2 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorControllerTarget.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorControllerTarget.java @@ -59,6 +59,7 @@ import org.apache.qpid.proton.engine.Delivery; import org.apache.qpid.proton.engine.Receiver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.protocol.amqp.connect.mirror.AMQPMirrorControllerSource.ADDRESS; import static org.apache.activemq.artemis.protocol.amqp.connect.mirror.AMQPMirrorControllerSource.ADD_ADDRESS; @@ -76,7 +77,7 @@ import static org.apache.activemq.artemis.protocol.amqp.connect.mirror.AMQPMirro public class AMQPMirrorControllerTarget extends ProtonAbstractReceiver implements MirrorController { - private static final Logger logger = LoggerFactory.getLogger(AMQPMirrorControllerTarget.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final ThreadLocal CONTROLLER_THREAD_LOCAL = new ThreadLocal<>(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/MirrorTransaction.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/MirrorTransaction.java index 011fe21dd0..79508f3219 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/MirrorTransaction.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/MirrorTransaction.java @@ -24,10 +24,11 @@ import org.apache.activemq.artemis.core.transaction.TransactionOperation; import org.apache.activemq.artemis.core.transaction.impl.TransactionImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MirrorTransaction extends TransactionImpl { - private static final Logger logger = LoggerFactory.getLogger(MirrorTransaction.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); MirrorController controlInUse; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/coreWrapper/CoreMessageWrapper.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/coreWrapper/CoreMessageWrapper.java index cfe892dc75..cf1917a72b 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/coreWrapper/CoreMessageWrapper.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/coreWrapper/CoreMessageWrapper.java @@ -32,6 +32,7 @@ import org.apache.qpid.proton.amqp.messaging.Properties; import org.apache.qpid.proton.amqp.messaging.Section; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.api.core.FilterConstants.NATIVE_MESSAGE_ID; import static org.apache.activemq.artemis.api.core.Message.BYTES_TYPE; @@ -46,7 +47,7 @@ import static org.apache.activemq.artemis.protocol.amqp.converter.AMQPMessageSup import static org.apache.activemq.artemis.protocol.amqp.converter.AMQPMessageSupport.PERSISTENT; public class CoreMessageWrapper { - private static final Logger logger = LoggerFactory.getLogger(CoreMessageWrapper.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected final ICoreMessage message; private ActiveMQBuffer readBodyBuffer; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConnectionContext.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConnectionContext.java index a1ecc7014c..486d39c9e5 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConnectionContext.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConnectionContext.java @@ -74,6 +74,7 @@ import org.apache.qpid.proton.engine.Session; import org.apache.qpid.proton.engine.Transport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.protocol.amqp.proton.AmqpSupport.FAILOVER_SERVER_LIST; import static org.apache.activemq.artemis.protocol.amqp.proton.AmqpSupport.HOSTNAME; @@ -83,7 +84,7 @@ import static org.apache.activemq.artemis.protocol.amqp.proton.AmqpSupport.SCHEM public class AMQPConnectionContext extends ProtonInitializable implements EventHandler { - private static final Logger log = LoggerFactory.getLogger(AMQPConnectionContext.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final Symbol CONNECTION_OPEN_FAILED = Symbol.valueOf("amqp:connection-establishment-failed"); public static final String AMQP_CONTAINER_ID = "amqp-container-id"; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPSessionContext.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPSessionContext.java index 6f0478ff06..14ad8197f6 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPSessionContext.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPSessionContext.java @@ -42,10 +42,11 @@ import org.apache.qpid.proton.engine.Sender; import org.apache.qpid.proton.engine.Session; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class AMQPSessionContext extends ProtonInitializable { - private static final Logger log = LoggerFactory.getLogger(AMQPSessionContext.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected final AMQPConnectionContext connection; protected final AMQPSessionCallback sessionSPI; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerReceiverContext.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerReceiverContext.java index 2b5d1bd4d0..eb19c0b22e 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerReceiverContext.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerReceiverContext.java @@ -51,13 +51,14 @@ import org.apache.qpid.proton.engine.Delivery; import org.apache.qpid.proton.engine.Receiver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This is the equivalent for the ServerProducer */ public class ProtonServerReceiverContext extends ProtonAbstractReceiver { - private static final Logger log = LoggerFactory.getLogger(ProtonServerReceiverContext.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected SimpleString address; protected SimpleString lastAddress; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerSenderContext.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerSenderContext.java index 85840c332b..65952fb298 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerSenderContext.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerSenderContext.java @@ -94,13 +94,14 @@ import org.apache.qpid.proton.engine.Link; import org.apache.qpid.proton.engine.Sender; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This is the Equivalent for the ServerConsumer */ public class ProtonServerSenderContext extends ProtonInitializable implements ProtonDeliveryHandler { - private static final Logger log = LoggerFactory.getLogger(ProtonServerSenderContext.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final Symbol COPY = Symbol.valueOf("copy"); private static final Symbol TOPIC = Symbol.valueOf("topic"); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ProtonHandler.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ProtonHandler.java index c9f7509710..b7cfae0cf7 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ProtonHandler.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ProtonHandler.java @@ -52,10 +52,11 @@ import org.apache.qpid.proton.engine.Transport; import org.apache.qpid.proton.engine.impl.TransportInternal; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ProtonHandler extends ProtonInitializable implements SaslListener { - private static final Logger log = LoggerFactory.getLogger(ProtonHandler.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final byte SASL = 0x03; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/transaction/ProtonTransactionHandler.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/transaction/ProtonTransactionHandler.java index 716050fd37..e09b0bce76 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/transaction/ProtonTransactionHandler.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/transaction/ProtonTransactionHandler.java @@ -39,13 +39,14 @@ import org.apache.qpid.proton.message.Message; import org.apache.qpid.proton.message.impl.MessageImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * handles an amqp Coordinator to deal with transaction boundaries etc */ public class ProtonTransactionHandler implements ProtonDeliveryHandler { - private static final Logger log = LoggerFactory.getLogger(ProtonTransactionHandler.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final int amqpCredit; private final int amqpLowMark; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/ExternalServerSASLFactory.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/ExternalServerSASLFactory.java index 3fd3954c7f..97c916b509 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/ExternalServerSASLFactory.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/ExternalServerSASLFactory.java @@ -27,13 +27,14 @@ import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; import org.apache.activemq.artemis.spi.core.remoting.Connection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * */ public class ExternalServerSASLFactory implements ServerSASLFactory { - private static final Logger logger = LoggerFactory.getLogger(ExternalServerSASLFactory.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override public String getMechanism() { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/GSSAPIServerSASL.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/GSSAPIServerSASL.java index dff70a67d0..a3b67f4fed 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/GSSAPIServerSASL.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/GSSAPIServerSASL.java @@ -18,6 +18,7 @@ package org.apache.activemq.artemis.protocol.amqp.sasl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import javax.security.auth.Subject; import javax.security.auth.callback.Callback; @@ -37,7 +38,7 @@ import java.util.HashMap; * delegate the the jdk GSSAPI support */ public class GSSAPIServerSASL implements ServerSASL { - private static final Logger log = LoggerFactory.getLogger(GSSAPIServerSASL.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String NAME = "GSSAPI"; private String loginConfigScope; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/GSSAPIServerSASLFactory.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/GSSAPIServerSASLFactory.java index 1888a0b1da..8fb5872136 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/GSSAPIServerSASLFactory.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/GSSAPIServerSASLFactory.java @@ -25,10 +25,11 @@ import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; import org.apache.activemq.artemis.spi.core.remoting.Connection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class GSSAPIServerSASLFactory implements ServerSASLFactory { - private static final Logger logger = LoggerFactory.getLogger(GSSAPIServerSASLFactory.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override public String getMechanism() { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/SCRAMServerSASLFactory.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/SCRAMServerSASLFactory.java index 927946ca63..76f1e24da8 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/SCRAMServerSASLFactory.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/SCRAMServerSASLFactory.java @@ -52,6 +52,7 @@ import org.slf4j.LoggerFactory; public abstract class SCRAMServerSASLFactory implements ServerSASLFactory { private final Logger logger = LoggerFactory.getLogger(getClass()); + private final SCRAM scramType; public SCRAMServerSASLFactory(SCRAM scram) { diff --git a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/converter/TestConversions.java b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/converter/TestConversions.java index c4920e272b..9ddc71f9a0 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/converter/TestConversions.java +++ b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/converter/TestConversions.java @@ -56,6 +56,7 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.protocol.amqp.converter.AMQPMessageSupport.AMQP_NULL; import static org.apache.activemq.artemis.protocol.amqp.converter.AMQPMessageSupport.JMS_AMQP_ENCODED_DELIVERY_ANNOTATION_PREFIX; @@ -65,7 +66,7 @@ import static org.apache.activemq.artemis.protocol.amqp.converter.AMQPMessageSup public class TestConversions extends Assert { - private static final Logger logger = LoggerFactory.getLogger(TestConversions.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testAmqpValueOfBooleanIsPassedThrough() throws Exception { diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java index b88da006f6..575c979e73 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java @@ -53,6 +53,7 @@ import org.apache.activemq.artemis.spi.core.protocol.ConnectionEntry; import org.apache.activemq.artemis.utils.actors.Actor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static io.netty.handler.codec.mqtt.MqttProperties.MqttPropertyType.AUTHENTICATION_DATA; import static io.netty.handler.codec.mqtt.MqttProperties.MqttPropertyType.AUTHENTICATION_METHOD; @@ -64,7 +65,7 @@ import static io.netty.handler.codec.mqtt.MqttProperties.MqttPropertyType.SESSIO */ public class MQTTProtocolHandler extends ChannelInboundHandlerAdapter { - private static final Logger logger = LoggerFactory.getLogger(MQTTProtocolHandler.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private ConnectionEntry connectionEntry; diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java index a436e3fa0b..461811b5bf 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManager.java @@ -47,10 +47,11 @@ import org.apache.activemq.artemis.spi.core.remoting.Connection; import org.apache.activemq.artemis.utils.collections.TypedProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MQTTProtocolManager extends AbstractProtocolManager implements NotificationListener { - private static final Logger logger = LoggerFactory.getLogger(MQTTProtocolManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final List websocketRegistryNames = Arrays.asList("mqtt", "mqttv3.1"); diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java index 9b4405e000..9e7c710dea 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java @@ -47,6 +47,7 @@ import org.apache.activemq.artemis.core.server.impl.ServerSessionImpl; import org.apache.activemq.artemis.core.transaction.Transaction; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static io.netty.handler.codec.mqtt.MqttProperties.MqttPropertyType.CONTENT_TYPE; import static io.netty.handler.codec.mqtt.MqttProperties.MqttPropertyType.CORRELATION_DATA; @@ -68,7 +69,7 @@ import static org.apache.activemq.artemis.core.protocol.mqtt.MQTTUtil.MQTT_USER_ */ public class MQTTPublishManager { - private static final Logger logger = LoggerFactory.getLogger(MQTTPublishManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private SimpleString managementAddress; diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSession.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSession.java index ddc1debe18..ee94cb6ed2 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSession.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSession.java @@ -33,10 +33,11 @@ import org.apache.activemq.artemis.core.server.impl.ServerSessionImpl; import org.apache.activemq.artemis.spi.core.protocol.SessionCallback; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MQTTSession { - private static final Logger logger = LoggerFactory.getLogger(MQTTSession.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final String id = UUID.randomUUID().toString(); diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSessionState.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSessionState.java index d66642af17..47af5195f7 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSessionState.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSessionState.java @@ -37,10 +37,11 @@ import org.apache.activemq.artemis.core.config.WildcardConfiguration; import org.apache.activemq.artemis.core.settings.impl.Match; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MQTTSessionState { - private static final Logger logger = LoggerFactory.getLogger(MQTTSessionState.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final MQTTSessionState DEFAULT = new MQTTSessionState(null); diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTUtil.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTUtil.java index 677f0836b6..58fd64b4d5 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTUtil.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTUtil.java @@ -52,6 +52,7 @@ import org.apache.activemq.artemis.core.message.impl.CoreMessage; import org.apache.activemq.artemis.reader.MessageUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static io.netty.handler.codec.mqtt.MqttProperties.MqttPropertyType.CONTENT_TYPE; import static io.netty.handler.codec.mqtt.MqttProperties.MqttPropertyType.CORRELATION_DATA; @@ -64,7 +65,7 @@ import static io.netty.handler.codec.mqtt.MqttProperties.MqttPropertyType.USER_P * A Utility Class for creating Server Side objects and converting MQTT concepts to/from Artemis. */ public class MQTTUtil { - private static final Logger logger = LoggerFactory.getLogger(MQTTUtil.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final boolean DURABLE_MESSAGES = true; diff --git a/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTRetainMessageManagerTest.java b/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTRetainMessageManagerTest.java index fdc05a831a..e21c63b658 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTRetainMessageManagerTest.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTRetainMessageManagerTest.java @@ -42,6 +42,7 @@ import org.junit.Test; import org.junit.rules.RuleChain; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import com.github.javafaker.ChuckNorris; import com.github.javafaker.Faker; @@ -49,7 +50,7 @@ import com.github.javafaker.Faker; @SuppressWarnings("deprecation") public class MQTTRetainMessageManagerTest { - private Logger log = LoggerFactory.getLogger(MQTTRetainMessageManagerTest.class); + private Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public EmbeddedJMSResource jmsServer = new EmbeddedJMSResource("embedded-artemis-server-mqtt.xml"); diff --git a/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/MqttClientService.java b/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/MqttClientService.java index 3e2fb06564..4e315cc919 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/MqttClientService.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/MqttClientService.java @@ -35,6 +35,7 @@ import org.eclipse.paho.client.mqttv3.MqttMessage; import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import io.netty.util.concurrent.DefaultThreadFactory; @@ -50,7 +51,7 @@ public class MqttClientService implements MqttCallback { private ScheduledExecutorService executorService; private int corePoolSize = 5; - private Logger log = LoggerFactory.getLogger(MqttClientService.class); + private Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public MqttClientService() { this("producer", null); diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java index 8baa599e8c..3c639fbc13 100644 --- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java +++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java @@ -135,6 +135,7 @@ import org.apache.activemq.transport.TransmitCallback; import org.apache.activemq.util.ByteSequence; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Represents an activemq connection. @@ -145,7 +146,7 @@ public class OpenWireConnection extends AbstractRemotingConnection implements Se // to be used on the packet size estimate processing for the ThresholdActor private static final int MINIMAL_SIZE_ESTIAMTE = 1024; - private static final Logger logger = LoggerFactory.getLogger(OpenWireConnection.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final KeepAliveInfo PING = new KeepAliveInfo(); diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java index 2ef5a6637d..f8215c8532 100644 --- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java +++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java @@ -81,12 +81,13 @@ import org.apache.activemq.util.InetAddressUtil; import org.apache.activemq.util.LongSequenceGenerator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.core.protocol.openwire.util.OpenWireUtil.SELECTOR_AWARE_OPTION; public class OpenWireProtocolManager extends AbstractProtocolManager implements ClusterTopologyListener { - private static final Logger logger = LoggerFactory.getLogger(OpenWireProtocolManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final List websocketRegistryNames = Collections.EMPTY_LIST; diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java index 42e3d81592..057160ba33 100644 --- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java +++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java @@ -60,11 +60,12 @@ import org.apache.activemq.command.MessagePull; import org.apache.activemq.command.RemoveInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.core.protocol.openwire.OpenWireConstants.AMQ_MSG_MESSAGE_ID; public class AMQConsumer { - private static final Logger logger = LoggerFactory.getLogger(AMQConsumer.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final AMQSession session; private final org.apache.activemq.command.ActiveMQDestination openwireDestination; diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java index 9e1ab296c5..28caa08f92 100644 --- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java +++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java @@ -66,9 +66,10 @@ import org.apache.activemq.command.SessionInfo; import org.apache.activemq.openwire.OpenWireFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class AMQSession implements SessionCallback { - private final Logger logger = LoggerFactory.getLogger(AMQSession.class); + private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); // ConsumerID is generated inside the session, 0, 1, 2, ... as many consumers as you have on the session protected final IDGenerator consumerIDGenerator = new SimpleIDGenerator(0); diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java index 759226502b..f1b54520ce 100644 --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java @@ -56,13 +56,14 @@ import org.apache.activemq.artemis.utils.ExecutorFactory; import org.apache.activemq.artemis.utils.VersionLoader; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.core.protocol.stomp.ActiveMQStompProtocolMessageBundle.BUNDLE; import static org.apache.activemq.artemis.reader.MessageUtil.CONNECTION_ID_PROPERTY_NAME_STRING; public final class StompConnection extends AbstractRemotingConnection { - private static final Logger logger = LoggerFactory.getLogger(StompConnection.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String SERVER_NAME = "ActiveMQ-Artemis/" + VersionLoader.getVersion().getFullVersion() + " ActiveMQ Artemis Messaging Engine"; diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManager.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManager.java index a4c2c047e6..ab7e004f80 100644 --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManager.java +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManager.java @@ -48,6 +48,7 @@ import org.apache.activemq.artemis.spi.core.remoting.Connection; import org.apache.activemq.artemis.utils.UUIDGenerator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.core.protocol.stomp.ActiveMQStompProtocolMessageBundle.BUNDLE; @@ -56,7 +57,7 @@ import static org.apache.activemq.artemis.core.protocol.stomp.ActiveMQStompProto */ public class StompProtocolManager extends AbstractProtocolManager { - private static final Logger logger = LoggerFactory.getLogger(StompProtocolManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final List websocketRegistryNames = Arrays.asList("v10.stomp", "v11.stomp", "v12.stomp"); private final ActiveMQServer server; diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java index 78e2c8032d..2d9bddfee2 100644 --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java @@ -52,12 +52,13 @@ import org.apache.activemq.artemis.utils.PendingTask; import org.apache.activemq.artemis.utils.UUIDGenerator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.core.protocol.stomp.ActiveMQStompProtocolMessageBundle.BUNDLE; public class StompSession implements SessionCallback { - private static final Logger logger = LoggerFactory.getLogger(StompSession.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final StompProtocolManager manager; diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java index 4fc5924199..1e8d712fdd 100644 --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java @@ -41,10 +41,11 @@ import org.apache.activemq.artemis.spi.core.protocol.ConnectionEntry; import org.apache.activemq.artemis.utils.ExecutorFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements FrameEventListener { - private static final Logger logger = LoggerFactory.getLogger(StompFrameHandlerV11.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected static final char ESC_CHAR = '\\'; diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRABytesMessage.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRABytesMessage.java index 087195db28..f62ee992ca 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRABytesMessage.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRABytesMessage.java @@ -22,13 +22,14 @@ import java.util.Arrays; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A wrapper for a message */ public class ActiveMQRABytesMessage extends ActiveMQRAMessage implements BytesMessage { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRABytesMessage.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * Create a new wrapper diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionFactoryImpl.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionFactoryImpl.java index d43be8c533..9a4e97b4e0 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionFactoryImpl.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionFactoryImpl.java @@ -39,13 +39,14 @@ import org.apache.activemq.artemis.ra.referenceable.ActiveMQRAConnectionFactoryO import org.apache.activemq.artemis.ra.referenceable.SerializableObjectRefAddr; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * The connection factory */ public class ActiveMQRAConnectionFactoryImpl implements ActiveMQRAConnectionFactory { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRAConnectionFactoryImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * Serial version UID diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionManager.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionManager.java index 818a7f9130..edb72a4721 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionManager.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionManager.java @@ -25,13 +25,14 @@ import javax.resource.spi.ManagedConnectionFactory; import org.apache.activemq.artemis.utils.collections.ConcurrentHashSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * The connection manager used in non-managed environments. */ public class ActiveMQRAConnectionManager implements ConnectionManager { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRAConnectionManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionMetaData.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionMetaData.java index 814c46eb6c..78b6a80d63 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionMetaData.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionMetaData.java @@ -25,13 +25,14 @@ import java.util.Vector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This class implements javax.jms.ConnectionMetaData */ public class ActiveMQRAConnectionMetaData implements ConnectionMetaData { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRAConnectionMetaData.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String DEFAULT_PROP_FILE_NAME = "jms-version.properties"; diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionRequestInfo.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionRequestInfo.java index c33d354421..ca88e5d1f7 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionRequestInfo.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAConnectionRequestInfo.java @@ -21,13 +21,14 @@ import javax.resource.spi.ConnectionRequestInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Connection request information */ public class ActiveMQRAConnectionRequestInfo implements ConnectionRequestInfo { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRAConnectionRequestInfo.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * The user name diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRACredential.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRACredential.java index 1cf42f5aa5..9dd850afe4 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRACredential.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRACredential.java @@ -28,13 +28,14 @@ import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Credential information */ public class ActiveMQRACredential implements Serializable { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRACredential.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * Serial version UID diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRALocalTransaction.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRALocalTransaction.java index d82edc8a4a..fb861a83ee 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRALocalTransaction.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRALocalTransaction.java @@ -22,13 +22,14 @@ import javax.resource.spi.LocalTransaction; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * JMS Local transaction */ public class ActiveMQRALocalTransaction implements LocalTransaction { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRALocalTransaction.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * The managed connection diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMCFProperties.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMCFProperties.java index 1c74690953..b40ab6a5e5 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMCFProperties.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMCFProperties.java @@ -22,13 +22,14 @@ import java.io.Serializable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * The MCF default properties - these are set in the tx-connection-factory at the jms-ds.xml */ public class ActiveMQRAMCFProperties extends ConnectionFactoryProperties implements Serializable { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRAMCFProperties.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * Serial version UID diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAManagedConnection.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAManagedConnection.java index e63056e4a5..76d0438f91 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAManagedConnection.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAManagedConnection.java @@ -57,13 +57,14 @@ import org.apache.activemq.artemis.service.extensions.xa.ActiveMQXAResourceWrapp import org.apache.activemq.artemis.utils.VersionLoader; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * The managed connection */ public final class ActiveMQRAManagedConnection implements ManagedConnection, ExceptionListener { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRAManagedConnection.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * The managed connection factory diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAManagedConnectionFactory.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAManagedConnectionFactory.java index 71f08ae607..ad17d117c7 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAManagedConnectionFactory.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAManagedConnectionFactory.java @@ -34,13 +34,14 @@ import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; import org.apache.activemq.artemis.service.extensions.xa.recovery.XARecoveryConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * ActiveMQ Artemis ManagedConnectionFactory */ public final class ActiveMQRAManagedConnectionFactory implements ManagedConnectionFactory, ResourceAdapterAssociation { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRAManagedConnectionFactory.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * Serial version UID diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMapMessage.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMapMessage.java index 7299da7646..f7389a9dc5 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMapMessage.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMapMessage.java @@ -23,13 +23,14 @@ import java.util.Enumeration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A wrapper for a message */ public class ActiveMQRAMapMessage extends ActiveMQRAMessage implements MapMessage { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRAMapMessage.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * Create a new wrapper diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMessage.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMessage.java index 3b9d0bd37e..36cb8204d0 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMessage.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMessage.java @@ -24,6 +24,7 @@ import java.util.Enumeration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.utils.Preconditions.checkNotNull; @@ -32,7 +33,7 @@ import static org.apache.activemq.artemis.utils.Preconditions.checkNotNull; */ public class ActiveMQRAMessage implements Message { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRAMessage.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * The message diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMessageConsumer.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMessageConsumer.java index dd469700b3..00da38bdd2 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMessageConsumer.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMessageConsumer.java @@ -28,13 +28,14 @@ import javax.jms.TextMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A wrapper for a message consumer */ public class ActiveMQRAMessageConsumer implements MessageConsumer { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRAMessageConsumer.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * The wrapped message consumer diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMessageListener.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMessageListener.java index c6bd04f7cd..d269f1d49b 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMessageListener.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMessageListener.java @@ -21,13 +21,14 @@ import javax.jms.MessageListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A wrapper for a message listener */ public class ActiveMQRAMessageListener implements MessageListener { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRAMessageListener.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMessageProducer.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMessageProducer.java index 9b12538127..24502fd29e 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMessageProducer.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMessageProducer.java @@ -24,13 +24,14 @@ import javax.jms.MessageProducer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * ActiveMQMessageProducer. */ public class ActiveMQRAMessageProducer implements MessageProducer { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRAMessageProducer.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * The wrapped message producer diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMetaData.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMetaData.java index b8fbea7f4d..153d2689e1 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMetaData.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMetaData.java @@ -21,13 +21,14 @@ import javax.resource.spi.ManagedConnectionMetaData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Managed connection meta data */ public class ActiveMQRAMetaData implements ManagedConnectionMetaData { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRAMetaData.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * The managed connection diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAObjectMessage.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAObjectMessage.java index d5158089fb..05ce308eb1 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAObjectMessage.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAObjectMessage.java @@ -22,13 +22,14 @@ import java.io.Serializable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A wrapper for a message */ public class ActiveMQRAObjectMessage extends ActiveMQRAMessage implements ObjectMessage { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRAObjectMessage.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * Create a new wrapper diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAProperties.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAProperties.java index 93dfcf6094..60f465fadd 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAProperties.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAProperties.java @@ -24,13 +24,14 @@ import org.apache.activemq.artemis.api.core.client.ActiveMQClient; import org.apache.activemq.artemis.utils.PasswordMaskingUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * The RA default properties - these are set in the ra.xml file */ public class ActiveMQRAProperties extends ConnectionFactoryProperties implements Serializable { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRAProperties.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * Serial version UID diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAQueueReceiver.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAQueueReceiver.java index df05ba33d2..d0f694d932 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAQueueReceiver.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAQueueReceiver.java @@ -22,13 +22,14 @@ import javax.jms.QueueReceiver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A wrapper for a queue receiver */ public class ActiveMQRAQueueReceiver extends ActiveMQRAMessageConsumer implements QueueReceiver { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRAQueueReceiver.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * Create a new wrapper diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAQueueSender.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAQueueSender.java index 4c559c1faa..1d02def198 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAQueueSender.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAQueueSender.java @@ -23,13 +23,14 @@ import javax.jms.QueueSender; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * ActiveMQQueueSender. */ public class ActiveMQRAQueueSender extends ActiveMQRAMessageProducer implements QueueSender { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRAQueueSender.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * Create a new wrapper diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASession.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASession.java index e898286ccf..9364a4d4eb 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASession.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASession.java @@ -57,13 +57,14 @@ import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal import org.apache.activemq.artemis.jms.client.ActiveMQSession; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A joint interface for JMS sessions */ public class ActiveMQRASession implements QueueSession, TopicSession, XAQueueSession, XATopicSession { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRASession.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * The managed connection diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASessionFactoryImpl.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASessionFactoryImpl.java index 3269248d28..c214772786 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASessionFactoryImpl.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASessionFactoryImpl.java @@ -50,13 +50,14 @@ import org.apache.activemq.artemis.jms.client.ActiveMQConnectionForContext; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionForContextImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Implements the JMS Connection API and produces {@link ActiveMQRASession} objects. */ public final class ActiveMQRASessionFactoryImpl extends ActiveMQConnectionForContextImpl implements ActiveMQRASessionFactory, ActiveMQConnectionForContext, Referenceable { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRAConnectionMetaData.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAStreamMessage.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAStreamMessage.java index 2b6b7863c7..658eb4e49c 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAStreamMessage.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAStreamMessage.java @@ -22,13 +22,14 @@ import java.util.Arrays; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A wrapper for a message */ public class ActiveMQRAStreamMessage extends ActiveMQRAMessage implements StreamMessage { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRAStreamMessage.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * Create a new wrapper diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRATextMessage.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRATextMessage.java index 14b58623a5..3b0e63fb2f 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRATextMessage.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRATextMessage.java @@ -21,13 +21,14 @@ import javax.jms.TextMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A wrapper for a message */ public class ActiveMQRATextMessage extends ActiveMQRAMessage implements TextMessage { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRATextMessage.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * Create a new wrapper diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRATopicPublisher.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRATopicPublisher.java index 01db553873..bf024bfbcf 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRATopicPublisher.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRATopicPublisher.java @@ -23,13 +23,14 @@ import javax.jms.TopicPublisher; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * ActiveMQQueueSender. */ public class ActiveMQRATopicPublisher extends ActiveMQRAMessageProducer implements TopicPublisher { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRATopicPublisher.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * Create a new wrapper diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRATopicSubscriber.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRATopicSubscriber.java index 10f2d860d1..844af8d83b 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRATopicSubscriber.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRATopicSubscriber.java @@ -22,13 +22,14 @@ import javax.jms.TopicSubscriber; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A wrapper for a topic subscriber */ public class ActiveMQRATopicSubscriber extends ActiveMQRAMessageConsumer implements TopicSubscriber { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRATopicSubscriber.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * Create a new wrapper diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAXAResource.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAXAResource.java index 510c48e6ae..8c3df9a162 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAXAResource.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAXAResource.java @@ -25,13 +25,14 @@ import org.apache.activemq.artemis.core.client.impl.ActiveMQXAResource; import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * ActiveMQXAResource. */ public class ActiveMQRAXAResource implements ActiveMQXAResource { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRAXAResource.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * The managed connection diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRaUtils.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRaUtils.java index ab62c55924..3a8d65bd03 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRaUtils.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRaUtils.java @@ -30,12 +30,13 @@ import java.util.UUID; import org.jgroups.JChannel; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Various utility functions */ public final class ActiveMQRaUtils { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQRaUtils.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * Private constructor diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQResourceAdapter.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQResourceAdapter.java index 6b77313593..580c12c5c7 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQResourceAdapter.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQResourceAdapter.java @@ -61,6 +61,7 @@ import org.apache.activemq.artemis.service.extensions.ServiceUtils; import org.apache.activemq.artemis.service.extensions.xa.recovery.XARecoveryConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.jgroups.JChannel; /** @@ -68,7 +69,7 @@ import org.jgroups.JChannel; */ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQResourceAdapter.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final long serialVersionUID = 4756893709825838770L; diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ConnectionFactoryProperties.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ConnectionFactoryProperties.java index b4b205645a..aaf57f606b 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ConnectionFactoryProperties.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ConnectionFactoryProperties.java @@ -22,10 +22,11 @@ import java.util.Map; import org.apache.activemq.artemis.jms.client.ConnectionFactoryOptions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ConnectionFactoryProperties implements ConnectionFactoryOptions { - private static final Logger logger = LoggerFactory.getLogger(ConnectionFactoryProperties.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private boolean hasBeenUpdated = false; diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java index 4947d6681f..9eac12d2a5 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java @@ -65,13 +65,14 @@ import org.apache.activemq.artemis.utils.FutureLatch; import org.apache.activemq.artemis.utils.PasswordMaskingUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * The activation. */ public class ActiveMQActivation { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQActivation.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * The onMessage method diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java index 69c7afa041..0bbf61bd57 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java @@ -30,6 +30,7 @@ import org.apache.activemq.artemis.ra.ActiveMQResourceAdapter; import org.apache.activemq.artemis.ra.ConnectionFactoryProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * The activation spec @@ -37,7 +38,7 @@ import org.slf4j.LoggerFactory; */ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implements ActivationSpec, Serializable { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQActivationSpec.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final long serialVersionUID = -7997041053897964654L; diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java index 0cc20608f0..80beaa5108 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQMessageHandler.java @@ -55,13 +55,14 @@ import org.apache.activemq.artemis.utils.FutureLatch; import org.apache.activemq.artemis.utils.VersionLoader; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * The message handler */ public class ActiveMQMessageHandler implements MessageHandler, FailoverEventListener { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQMessageHandler.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * The session diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/recovery/RecoveryManager.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/recovery/RecoveryManager.java index db30e4bad3..00047feac3 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/recovery/RecoveryManager.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/recovery/RecoveryManager.java @@ -27,10 +27,11 @@ import org.apache.activemq.artemis.service.extensions.xa.recovery.XARecoveryConf import org.apache.activemq.artemis.utils.collections.ConcurrentHashSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public final class RecoveryManager { - private static final Logger logger = LoggerFactory.getLogger(RecoveryManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private ActiveMQRegistry registry; diff --git a/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorParserTest.java b/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorParserTest.java index 86275c9609..ab097df7da 100755 --- a/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorParserTest.java +++ b/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorParserTest.java @@ -27,10 +27,11 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class SelectorParserTest { - private static final Logger log = LoggerFactory.getLogger(SelectorParserTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public void info(String msg) { log.debug(msg); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java index 6c20585680..5f1793554f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java @@ -115,10 +115,11 @@ import org.apache.commons.beanutils.PropertyUtilsBean; import org.apache.commons.beanutils.expression.DefaultResolver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ConfigurationImpl implements Configuration, Serializable { - private static final Logger logger = LoggerFactory.getLogger(ConfigurationImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final JournalType DEFAULT_JOURNAL_TYPE = JournalType.ASYNCIO; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/LegacyJMSConfiguration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/LegacyJMSConfiguration.java index 1cc9385106..43c58a7175 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/LegacyJMSConfiguration.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/LegacyJMSConfiguration.java @@ -33,6 +33,7 @@ import org.apache.activemq.artemis.utils.XMLConfigurationUtil; import org.apache.activemq.artemis.utils.XMLUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; @@ -40,7 +41,7 @@ import org.w3c.dom.NodeList; public class LegacyJMSConfiguration implements Deployable { - private static final Logger logger = LoggerFactory.getLogger(LegacyJMSConfiguration.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String CONFIGURATION_SCHEMA_URL = "schema/artemis-jms.xsd"; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java index ac15be79fb..abc2478d35 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java @@ -113,6 +113,7 @@ import org.apache.activemq.artemis.utils.XMLUtil; import org.apache.activemq.artemis.utils.critical.CriticalAnalyzerPolicy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; @@ -123,7 +124,7 @@ import org.w3c.dom.NodeList; */ public final class FileConfigurationParser extends XMLConfigurationUtil { - private static final Logger logger = LoggerFactory.getLogger(FileConfigurationParser.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); // Security Parsing public static final String SECURITY_ELEMENT_NAME = "security-setting"; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/impl/FilterImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/impl/FilterImpl.java index b4b7d9dfff..29d8b1d623 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/impl/FilterImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/impl/FilterImpl.java @@ -33,6 +33,7 @@ import org.apache.activemq.artemis.selector.impl.SelectorParser; import org.apache.activemq.artemis.utils.ByteUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.api.core.FilterConstants.NATIVE_MESSAGE_ID; @@ -56,7 +57,7 @@ import static org.apache.activemq.artemis.api.core.FilterConstants.NATIVE_MESSAG */ public class FilterImpl implements Filter { - private static final Logger logger = LoggerFactory.getLogger(FilterImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final SimpleString sfilterString; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java index b37c2c2be9..d50016fd8b 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java @@ -145,10 +145,11 @@ import org.apache.activemq.artemis.utils.SecurityFormatter; import org.apache.activemq.artemis.utils.collections.TypedProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ActiveMQServerControlImpl extends AbstractControl implements ActiveMQServerControl, NotificationEmitter, org.apache.activemq.artemis.core.server.management.NotificationListener { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQServerControlImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final PostOffice postOffice; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AddressControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AddressControlImpl.java index 03676e83be..d88051e392 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AddressControlImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AddressControlImpl.java @@ -54,10 +54,11 @@ import org.apache.activemq.artemis.logs.AuditLogger; import org.apache.activemq.artemis.utils.JsonLoader; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class AddressControlImpl extends AbstractControl implements AddressControl { - private static final Logger logger = LoggerFactory.getLogger(AddressControlImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private AddressInfo addressInfo; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java index c6d29feb86..c78111ba57 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java @@ -62,10 +62,11 @@ import org.apache.activemq.artemis.utils.JsonLoader; import org.apache.activemq.artemis.utils.collections.LinkedListIterator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class QueueControlImpl extends AbstractControl implements QueueControl { - private static final Logger logger = LoggerFactory.getLogger(QueueControlImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final int FLUSH_LIMIT = 500; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/PagedReferenceImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/PagedReferenceImpl.java index 02020e807a..e4ee0bfd78 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/PagedReferenceImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/PagedReferenceImpl.java @@ -31,10 +31,11 @@ import org.apache.activemq.artemis.core.transaction.Transaction; import org.apache.activemq.artemis.utils.collections.LinkedListImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class PagedReferenceImpl extends LinkedListImpl.Node implements PagedReference, Runnable { - private static final Logger logger = LoggerFactory.getLogger(PagedReferenceImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final AtomicIntegerFieldUpdater DELIVERY_COUNT_UPDATER = AtomicIntegerFieldUpdater .newUpdater(PagedReferenceImpl.class, "deliveryCount"); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageCursorProviderImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageCursorProviderImpl.java index ab317dad3b..68e8889064 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageCursorProviderImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageCursorProviderImpl.java @@ -41,11 +41,12 @@ import org.apache.activemq.artemis.utils.collections.LinkedList; import org.apache.activemq.artemis.utils.collections.LongHashSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class PageCursorProviderImpl implements PageCursorProvider { - private static final Logger logger = LoggerFactory.getLogger(PageCursorProviderImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionCounterImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionCounterImpl.java index c30d415ba1..1cd294c5c8 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionCounterImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionCounterImpl.java @@ -37,13 +37,14 @@ import org.apache.activemq.artemis.core.transaction.impl.TransactionImpl; import org.apache.activemq.artemis.utils.ArtemisCloseable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This class will encapsulate the persistent counters for the PagingSubscription */ public class PageSubscriptionCounterImpl implements PageSubscriptionCounter { - private static final Logger logger = LoggerFactory.getLogger(PageSubscriptionCounterImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int FLUSH_COUNTER = 1000; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java index 76829fa193..2e9bd25443 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java @@ -60,12 +60,13 @@ import org.apache.activemq.artemis.core.transaction.impl.TransactionImpl; import org.apache.activemq.artemis.utils.collections.LinkedListIterator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.core.server.impl.QueueImpl.DELIVERY_TIMEOUT; public final class PageSubscriptionImpl implements PageSubscription { - private static final Logger logger = LoggerFactory.getLogger(PageSubscriptionImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final Object DUMMY = new Object(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/Page.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/Page.java index d6d9b928c8..b9d7b8e09b 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/Page.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/Page.java @@ -39,10 +39,11 @@ import org.apache.activemq.artemis.utils.collections.LinkedListImpl; import org.apache.activemq.artemis.utils.collections.LinkedListIterator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public final class Page { - private static final Logger logger = LoggerFactory.getLogger(Page.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final AtomicInteger factory = new AtomicInteger(0); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageCache.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageCache.java index f5f2017d01..4ddf57bf12 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageCache.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageCache.java @@ -22,12 +22,13 @@ import io.netty.util.collection.LongObjectHashMap; import org.apache.activemq.artemis.core.paging.PagingStore; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This is a simple cache where we keep Page objects only while they are being used. */ public class PageCache { - private static final Logger logger = LoggerFactory.getLogger(PageCache.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final PagingStore owner; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageReadWriter.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageReadWriter.java index de2c33d473..e006086fa0 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageReadWriter.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageReadWriter.java @@ -33,11 +33,12 @@ import org.apache.activemq.artemis.utils.DataConstants; import org.apache.activemq.artemis.utils.Env; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class PageReadWriter { - private static Logger logger = LoggerFactory.getLogger(PageReadWriter.class); + private static Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final int SIZE_RECORD = DataConstants.SIZE_BYTE + DataConstants.SIZE_INT + DataConstants.SIZE_BYTE; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageTransactionInfoImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageTransactionInfoImpl.java index 8c96074b5e..cf8536cf3e 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageTransactionInfoImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageTransactionInfoImpl.java @@ -37,11 +37,12 @@ import org.apache.activemq.artemis.core.transaction.TransactionPropertyIndexes; import org.apache.activemq.artemis.utils.DataConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public final class PageTransactionInfoImpl implements PageTransactionInfo { - private static final Logger logger = LoggerFactory.getLogger(PageTransactionInfoImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final AtomicIntegerFieldUpdater numberOfMessagesUpdater = AtomicIntegerFieldUpdater.newUpdater(PageTransactionInfoImpl.class, "numberOfMessages"); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingManagerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingManagerImpl.java index 4f79ab33d8..35bd40b938 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingManagerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingManagerImpl.java @@ -43,12 +43,13 @@ import org.apache.activemq.artemis.utils.collections.ConcurrentHashSet; import org.apache.activemq.artemis.utils.runnables.AtomicRunnable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public final class PagingManagerImpl implements PagingManager { private static final int ARTEMIS_DEBUG_PAGING_INTERVAL = Integer.valueOf(System.getProperty("artemis.debug.paging.interval", "0")); - private static final Logger logger = LoggerFactory.getLogger(PagingManagerImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private volatile boolean started = false; @@ -222,7 +223,7 @@ public final class PagingManagerImpl implements PagingManager { class LocalMonitor implements FileStoreMonitor.Callback { - private final Logger logger = LoggerFactory.getLogger(LocalMonitor.class); + private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override public void tick(long usableSpace, long totalSpace) { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java index f861bf162e..ddad68294c 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java @@ -61,13 +61,14 @@ import org.apache.activemq.artemis.utils.actors.ArtemisExecutor; import org.apache.activemq.artemis.utils.runnables.AtomicRunnable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * @see PagingStore */ public class PagingStoreImpl implements PagingStore { - private static final Logger logger = LoggerFactory.getLogger(PagingStoreImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final SimpleString address; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/AbstractJournalStorageManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/AbstractJournalStorageManager.java index ad9de79db7..e34840e8d7 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/AbstractJournalStorageManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/AbstractJournalStorageManager.java @@ -128,6 +128,7 @@ import org.apache.activemq.artemis.utils.critical.CriticalComponentImpl; import org.apache.activemq.artemis.utils.critical.CriticalMeasure; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Controls access to the journals and other storage files such as the ones used to store pages and @@ -144,7 +145,7 @@ public abstract class AbstractJournalStorageManager extends CriticalComponentImp protected static final int CRITICAL_STOP_2 = 2; - private static final Logger logger = LoggerFactory.getLogger(AbstractJournalStorageManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public enum JournalContent { BINDINGS((byte) 0), MESSAGES((byte) 1); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/BatchingIDGenerator.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/BatchingIDGenerator.java index a902c0e361..22d7a529e4 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/BatchingIDGenerator.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/BatchingIDGenerator.java @@ -29,6 +29,7 @@ import org.apache.activemq.artemis.utils.DataConstants; import org.apache.activemq.artemis.utils.IDGenerator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * An ID generator that allocates a batch of IDs of size {@link #checkpointSize} and records the ID @@ -38,7 +39,7 @@ import org.slf4j.LoggerFactory; */ public final class BatchingIDGenerator implements IDGenerator { - private static final Logger logger = LoggerFactory.getLogger(BatchingIDGenerator.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final AtomicLong counter; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/DescribeJournal.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/DescribeJournal.java index a17b308f4b..5a585fe8bb 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/DescribeJournal.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/DescribeJournal.java @@ -68,6 +68,7 @@ import org.apache.activemq.artemis.utils.XMLUtil; import org.apache.activemq.artemis.utils.XidCodecSupport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -106,7 +107,7 @@ import static org.apache.activemq.artemis.core.persistence.impl.journal.JournalR */ public final class DescribeJournal { - private static final Logger logger = LoggerFactory.getLogger(DescribeJournal.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final List records; private final List preparedTransactions; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java index e49fcc3be9..e5cf76b8ea 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java @@ -71,10 +71,11 @@ import org.apache.activemq.artemis.utils.ExecutorFactory; import org.apache.activemq.artemis.utils.critical.CriticalAnalyzer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class JournalStorageManager extends AbstractJournalStorageManager { - private static final Logger logger = LoggerFactory.getLogger(JournalStorageManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String ACTIVEMQ_DATA = "activemq-data"; protected SequentialFileFactory journalFF; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeBody.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeBody.java index 73c29a13d6..8f81e52bb5 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeBody.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeBody.java @@ -35,12 +35,13 @@ import org.apache.activemq.artemis.core.server.ActiveMQServerLogger; import org.apache.activemq.artemis.core.server.LargeServerMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class LargeBody { static final int MEMORY_OFFSET = 56; - private static final Logger logger = LoggerFactory.getLogger(LargeBody.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private long bodySize = -1; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeServerMessageImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeServerMessageImpl.java index 9501c5d2ae..ef9dcd84ac 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeServerMessageImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeServerMessageImpl.java @@ -32,6 +32,7 @@ import org.apache.activemq.artemis.utils.DataConstants; import org.apache.activemq.artemis.utils.collections.TypedProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public final class LargeServerMessageImpl extends CoreMessage implements CoreLargeServerMessage { @@ -79,7 +80,7 @@ public final class LargeServerMessageImpl extends CoreMessage implements CoreLar return lsm.toMessage(); } - private static final Logger logger = LoggerFactory.getLogger(LargeServerMessageImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final StorageManager storageManager; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeServerMessageInSync.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeServerMessageInSync.java index 30e8cab64b..5ad6805470 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeServerMessageInSync.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeServerMessageInSync.java @@ -29,10 +29,11 @@ import org.apache.activemq.artemis.core.server.ActiveMQServerLogger; import org.apache.activemq.artemis.core.server.LargeServerMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public final class LargeServerMessageInSync implements ReplicatedLargeMessage { - private static final Logger logger = LoggerFactory.getLogger(LargeServerMessageInSync.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final LargeServerMessage mainLM; private final StorageManager storageManager; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/BindingsImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/BindingsImpl.java index 08eb6ea02f..15d95d3a24 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/BindingsImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/BindingsImpl.java @@ -48,10 +48,11 @@ import org.apache.activemq.artemis.core.server.group.impl.Response; import org.apache.activemq.artemis.utils.CompositeAddress; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public final class BindingsImpl implements Bindings { - private static final Logger logger = LoggerFactory.getLogger(BindingsImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); // This is public as we use on test assertions public static final int MAX_GROUP_RETRY = 10; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/InMemoryDuplicateIDCache.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/InMemoryDuplicateIDCache.java index f948f574dc..dcb0cf4536 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/InMemoryDuplicateIDCache.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/InMemoryDuplicateIDCache.java @@ -33,6 +33,7 @@ import org.apache.activemq.artemis.core.transaction.TransactionOperationAbstract import org.apache.activemq.artemis.utils.ByteUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.core.postoffice.impl.IntegerCache.boxedInts; @@ -45,7 +46,7 @@ import static org.apache.activemq.artemis.core.postoffice.impl.IntegerCache.boxe */ final class InMemoryDuplicateIDCache implements DuplicateIDCache { - private static final Logger logger = LoggerFactory.getLogger(InMemoryDuplicateIDCache.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Map cache = new ConcurrentHashMap<>(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/LocalQueueBinding.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/LocalQueueBinding.java index 31aeb3785d..755d863367 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/LocalQueueBinding.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/LocalQueueBinding.java @@ -27,10 +27,11 @@ import org.apache.activemq.artemis.core.server.RoutingContext; import org.apache.activemq.artemis.api.core.RoutingType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class LocalQueueBinding implements QueueBinding { - private static final Logger logger = LoggerFactory.getLogger(LocalQueueBinding.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final SimpleString address; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PersistentDuplicateIDCache.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PersistentDuplicateIDCache.java index ff557687ef..95311e4f5c 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PersistentDuplicateIDCache.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PersistentDuplicateIDCache.java @@ -36,6 +36,7 @@ import org.apache.activemq.artemis.core.transaction.TransactionOperationAbstract import org.apache.activemq.artemis.utils.ByteUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.api.core.ObjLongPair.NIL; import static org.apache.activemq.artemis.core.postoffice.impl.IntegerCache.boxedInts; @@ -49,7 +50,7 @@ import static org.apache.activemq.artemis.core.postoffice.impl.IntegerCache.boxe */ final class PersistentDuplicateIDCache implements DuplicateIDCache { - private static final Logger logger = LoggerFactory.getLogger(PersistentDuplicateIDCache.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Map cache = new ConcurrentHashMap<>(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java index 3e5ecdf705..4ef4bf8025 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java @@ -102,6 +102,7 @@ import org.apache.activemq.artemis.utils.UUIDGenerator; import org.apache.activemq.artemis.utils.collections.TypedProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.utils.collections.IterableStream.iterableOf; @@ -111,7 +112,7 @@ import static org.apache.activemq.artemis.utils.collections.IterableStream.itera */ public class PostOfficeImpl implements PostOffice, NotificationListener, BindingsFactory { - private static final Logger logger = LoggerFactory.getLogger(PostOfficeImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final SimpleString HDR_RESET_QUEUE_DATA = new SimpleString("_AMQ_RESET_QUEUE_DATA"); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java index de72f96844..4e8fe0ef29 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java @@ -46,13 +46,14 @@ import org.apache.activemq.artemis.core.transaction.Transaction; import org.apache.activemq.artemis.utils.CompositeAddress; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A simple address manager that maintains the addresses and bindings. */ public class SimpleAddressManager implements AddressManager { - private static final Logger logger = LoggerFactory.getLogger(SimpleAddressManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final ConcurrentMap addressInfoMap = new ConcurrentHashMap<>(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java index 72d5a4eff4..2baf29f2ec 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java @@ -105,6 +105,7 @@ import org.apache.activemq.artemis.utils.actors.Actor; import org.apache.activemq.artemis.utils.actors.ArtemisExecutor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATE_ADDRESS; import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATE_QUEUE; @@ -148,7 +149,7 @@ public class ServerSessionPacketHandler implements ChannelHandler { private static final int MAX_CACHED_NULL_RESPONSES = 32; - private static final Logger logger = LoggerFactory.getLogger(ServerSessionPacketHandler.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final ServerSession session; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQPacketHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQPacketHandler.java index 907f14f5ba..03305509b1 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQPacketHandler.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQPacketHandler.java @@ -52,13 +52,14 @@ import org.apache.activemq.artemis.core.version.Version; import org.apache.activemq.artemis.logs.AuditLogger; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A packet handler for all packets that need to be handled at the server level */ public class ActiveMQPacketHandler implements ChannelHandler { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQPacketHandler.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final ActiveMQServer server; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreProtocolManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreProtocolManager.java index c61a491938..6bfbeab9b8 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreProtocolManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreProtocolManager.java @@ -73,10 +73,11 @@ import org.apache.activemq.artemis.spi.core.remoting.Acceptor; import org.apache.activemq.artemis.spi.core.remoting.Connection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class CoreProtocolManager implements ProtocolManager { - private static final Logger logger = LoggerFactory.getLogger(CoreProtocolManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final List websocketRegistryNames = Collections.EMPTY_LIST; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java index c73e636496..eee7967f93 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java @@ -43,6 +43,7 @@ import org.apache.activemq.artemis.utils.actors.OrderedExecutorFactory; import org.apache.activemq.artemis.utils.collections.TypedProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public final class InVMAcceptor extends AbstractAcceptor { @@ -72,7 +73,7 @@ public final class InVMAcceptor extends AbstractAcceptor { private final String name; - private static final Logger logger = LoggerFactory.getLogger(InVMAcceptor.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final boolean enableBufferPooling; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnection.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnection.java index 9a1618a85c..e00d4d43de 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnection.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnection.java @@ -38,10 +38,11 @@ import org.apache.activemq.artemis.spi.core.remoting.ReadyListener; import org.apache.activemq.artemis.utils.UUIDGenerator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class InVMConnection implements Connection { - private static final Logger logger = LoggerFactory.getLogger(InVMConnection.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final BufferHandler handler; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java index d6d6df392b..8a95885d11 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java @@ -45,12 +45,13 @@ import org.apache.activemq.artemis.utils.ConfigurationHelper; import org.apache.activemq.artemis.utils.actors.OrderedExecutorFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class InVMConnector extends AbstractConnector { public static String INVM_CONNECTOR_TYPE = "IN-VM"; - private static final Logger logger = LoggerFactory.getLogger(InVMConnector.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final Map DEFAULT_CONFIG; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java index aa11d1460b..e063cde8bd 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java @@ -98,13 +98,14 @@ import org.apache.activemq.artemis.utils.ConfigurationHelper; import org.apache.activemq.artemis.utils.collections.TypedProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A Netty TCP Acceptor that is embedding Netty. */ public class NettyAcceptor extends AbstractAcceptor { - private static final Logger logger = LoggerFactory.getLogger(NettyAcceptor.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String INVM_ACCEPTOR_TYPE = "IN-VM"; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java index d2c0c81c10..d4c4ce15e9 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java @@ -79,10 +79,11 @@ import org.apache.activemq.artemis.utils.ConfigurationHelper; import org.apache.activemq.artemis.utils.ReusableLatch; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class RemotingServiceImpl implements RemotingService, ServerConnectionLifeCycleListener { - private static final Logger logger = LoggerFactory.getLogger(RemotingServiceImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int ACCEPTOR_STOP_TIMEOUT = 3000; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicatedJournal.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicatedJournal.java index 8d6b59063c..54cc710486 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicatedJournal.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicatedJournal.java @@ -37,6 +37,7 @@ import org.apache.activemq.artemis.core.replication.ReplicationManager.ADD_OPERA import org.apache.activemq.artemis.utils.collections.SparseArrayLinkedList; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Used by the {@link org.apache.activemq.artemis.core.persistence.impl.journal.JournalStorageManager} to replicate journal calls. @@ -48,7 +49,7 @@ import org.slf4j.LoggerFactory; */ public class ReplicatedJournal implements Journal { - private static final Logger log = LoggerFactory.getLogger(ReplicatedJournal.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final ReplicationManager replicationManager; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationEndpoint.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationEndpoint.java index 39276edbf6..5eda1b009a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationEndpoint.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationEndpoint.java @@ -86,6 +86,7 @@ import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl; import org.apache.activemq.artemis.utils.actors.OrderedExecutorFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Handles all the synchronization necessary for replication on the backup side (that is the @@ -102,7 +103,7 @@ public final class ReplicationEndpoint implements ChannelHandler, ActiveMQCompon void onLiveNodeId(String nodeId); } - private static final Logger logger = LoggerFactory.getLogger(ReplicationEndpoint.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final ActiveMQServerImpl server; private final boolean wantedFailBack; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java index 6ae6986d6d..79450a18dd 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java @@ -88,6 +88,7 @@ import org.apache.activemq.artemis.utils.ExecutorFactory; import org.apache.activemq.artemis.utils.ReusableLatch; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Manages replication tasks on the live server (that is the live server side of a "remote backup" @@ -99,7 +100,7 @@ import org.slf4j.LoggerFactory; */ public final class ReplicationManager implements ActiveMQComponent { - private static final Logger logger = LoggerFactory.getLogger(ReplicationManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public enum ADD_OPERATION_TYPE { UPDATE { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/security/impl/SecurityStoreImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/security/impl/SecurityStoreImpl.java index bffe4effce..a68efe3679 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/security/impl/SecurityStoreImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/security/impl/SecurityStoreImpl.java @@ -50,13 +50,14 @@ import org.apache.activemq.artemis.utils.collections.ConcurrentHashSet; import org.apache.activemq.artemis.utils.collections.TypedProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * The ActiveMQ Artemis SecurityStore implementation */ public class SecurityStoreImpl implements SecurityStore, HierarchicalRepositoryChangeListener { - private static final Logger logger = LoggerFactory.getLogger(SecurityStoreImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final HierarchicalRepository> securityRepository; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/MemoryManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/MemoryManager.java index ba190a5b88..72998c325a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/MemoryManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/MemoryManager.java @@ -19,6 +19,7 @@ package org.apache.activemq.artemis.core.server; import org.apache.activemq.artemis.utils.SizeFormatterUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A memory usage watcher. @@ -28,7 +29,7 @@ import org.slf4j.LoggerFactory; */ public class MemoryManager implements ActiveMQComponent { - private static final Logger logger = LoggerFactory.getLogger(MemoryManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Runtime runtime; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/NodeManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/NodeManager.java index 013766c1fb..17cd4ec61e 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/NodeManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/NodeManager.java @@ -24,8 +24,10 @@ import org.apache.activemq.artemis.core.server.impl.FileLockNodeManager; import org.apache.activemq.artemis.utils.UUID; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public abstract class NodeManager implements ActiveMQComponent { + private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @FunctionalInterface public interface LockListener { @@ -33,7 +35,6 @@ public abstract class NodeManager implements ActiveMQComponent { void lostLock(); } - private static final Logger LOGGER = LoggerFactory.getLogger(NodeManager.class); protected final boolean replicatedBackup; protected final Object nodeIDGuard = new Object(); private SimpleString nodeID; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/BackupManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/BackupManager.java index 67f9e1a7c5..6c7a5db968 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/BackupManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/BackupManager.java @@ -40,13 +40,14 @@ import org.apache.activemq.artemis.core.server.NodeManager; import org.apache.activemq.artemis.utils.ExecutorFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /* * takes care of updating the cluster with a backups transport configuration which is based on each cluster connection. * */ public class BackupManager implements ActiveMQComponent { - private static final Logger logger = LoggerFactory.getLogger(BackupManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private ActiveMQServer server; private Executor executor; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterController.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterController.java index 7bad78c75e..b7064457f1 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterController.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterController.java @@ -54,13 +54,14 @@ import org.apache.activemq.artemis.core.server.impl.Activation; import org.apache.activemq.artemis.spi.core.remoting.Acceptor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * used for creating and managing cluster control connections for each cluster connection and the replication connection */ public class ClusterController implements ActiveMQComponent { - private static final Logger logger = LoggerFactory.getLogger(ClusterController.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final QuorumManager quorumManager; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterManager.java index debe5be9bf..3109e62496 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterManager.java @@ -67,6 +67,7 @@ import org.apache.activemq.artemis.utils.FutureLatch; import org.apache.activemq.artemis.utils.collections.ConcurrentHashSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A ClusterManager manages {@link ClusterConnection}s, {@link BroadcastGroup}s and {@link Bridge}s. @@ -77,7 +78,7 @@ import org.slf4j.LoggerFactory; */ public class ClusterManager implements ActiveMQComponent { - private static final Logger logger = LoggerFactory.getLogger(ClusterManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private ClusterController clusterController; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/BridgeImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/BridgeImpl.java index 83454385dd..7bfd2600f3 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/BridgeImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/BridgeImpl.java @@ -73,6 +73,7 @@ import org.apache.activemq.artemis.utils.UUID; import org.apache.activemq.artemis.utils.collections.TypedProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A Core BridgeImpl @@ -80,7 +81,7 @@ import org.slf4j.LoggerFactory; public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowledgementHandler, ReadyListener, ClientProducerFlowCallback { - private static final Logger logger = LoggerFactory.getLogger(BridgeImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected final ServerLocatorInternal serverLocator; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/BroadcastGroupImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/BroadcastGroupImpl.java index d7b73a845a..7d9ab5667c 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/BroadcastGroupImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/BroadcastGroupImpl.java @@ -38,6 +38,7 @@ import org.apache.activemq.artemis.utils.UUIDGenerator; import org.apache.activemq.artemis.utils.collections.TypedProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** *

This class will use the {@link BroadcastEndpoint} to send periodical updates on the list for connections @@ -48,7 +49,7 @@ import org.slf4j.LoggerFactory; */ public class BroadcastGroupImpl implements BroadcastGroup, Runnable { - private static final Logger logger = LoggerFactory.getLogger(BroadcastGroupImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final NodeManager nodeManager; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionBridge.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionBridge.java index 49b5457be7..34653356fe 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionBridge.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionBridge.java @@ -58,6 +58,7 @@ import org.apache.activemq.artemis.utils.UUID; import org.apache.activemq.artemis.utils.UUIDGenerator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A bridge with extra functionality only available when the server is clustered. @@ -65,7 +66,7 @@ import org.slf4j.LoggerFactory; * Such as such adding extra properties and setting up notifications between the nodes. */ public class ClusterConnectionBridge extends BridgeImpl { - private static final Logger logger = LoggerFactory.getLogger(ClusterConnectionBridge.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final ClusterConnection clusterConnection; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java index 07883d0d37..3b29ef9930 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java @@ -77,10 +77,11 @@ import org.apache.activemq.artemis.utils.FutureLatch; import org.apache.activemq.artemis.utils.collections.TypedProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public final class ClusterConnectionImpl implements ClusterConnection, AfterConnectInternalListener, TopologyManager { - private static final Logger logger = LoggerFactory.getLogger(ClusterConnectionImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String SN_PREFIX = "sf."; /** diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/RemoteQueueBindingImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/RemoteQueueBindingImpl.java index 62c0945ebf..b8ca80032d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/RemoteQueueBindingImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/RemoteQueueBindingImpl.java @@ -34,10 +34,11 @@ import org.apache.activemq.artemis.core.server.RoutingContext; import org.apache.activemq.artemis.core.server.cluster.RemoteQueueBinding; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class RemoteQueueBindingImpl implements RemoteQueueBinding { - private static final Logger logger = LoggerFactory.getLogger(RemoteQueueBindingImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final SimpleString address; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/qourum/SharedNothingBackupQuorum.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/qourum/SharedNothingBackupQuorum.java index 3cab0e4cbb..98dfb2877d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/qourum/SharedNothingBackupQuorum.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/qourum/SharedNothingBackupQuorum.java @@ -33,10 +33,11 @@ import org.apache.activemq.artemis.core.server.NetworkHealthCheck; import org.apache.activemq.artemis.core.server.NodeManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class SharedNothingBackupQuorum implements Quorum, SessionFailureListener, BackupRegistrationListener { - private static final Logger logger = LoggerFactory.getLogger(SharedNothingBackupQuorum.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public enum BACKUP_ACTIVATION { FAIL_OVER, FAILURE_RETRY, FAILURE_REPLICATING, ALREADY_REPLICATING, STOP; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/AbstractFederationStream.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/AbstractFederationStream.java index 0066c14a0c..03a1cd73bd 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/AbstractFederationStream.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/AbstractFederationStream.java @@ -30,11 +30,12 @@ import org.apache.activemq.artemis.core.server.federation.address.FederatedAddre import org.apache.activemq.artemis.core.server.federation.queue.FederatedQueue; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public abstract class AbstractFederationStream implements FederationStream { - private static final Logger logger = LoggerFactory.getLogger(AbstractFederationStream.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected final ActiveMQServer server; protected final Federation federation; protected final SimpleString name; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/FederatedAbstract.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/FederatedAbstract.java index 6023a002df..11964a5ae1 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/FederatedAbstract.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/FederatedAbstract.java @@ -30,10 +30,11 @@ import org.apache.activemq.artemis.core.server.plugin.ActiveMQServerBasePlugin; import org.apache.activemq.artemis.core.server.transformer.Transformer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public abstract class FederatedAbstract implements ActiveMQServerBasePlugin { - private static final Logger logger = LoggerFactory.getLogger(FederatedAbstract.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final WildcardConfiguration DEFAULT_WILDCARD_CONFIGURATION = new WildcardConfiguration(); protected final Federation federation; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/FederatedQueueConsumerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/FederatedQueueConsumerImpl.java index 115215f7d5..8b3297053e 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/FederatedQueueConsumerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/FederatedQueueConsumerImpl.java @@ -37,12 +37,13 @@ import org.apache.activemq.artemis.core.server.LargeServerMessage; import org.apache.activemq.artemis.core.server.transformer.Transformer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.core.client.impl.LargeMessageControllerImpl.LargeData; public class FederatedQueueConsumerImpl implements FederatedQueueConsumer, SessionFailureListener { - private static final Logger logger = LoggerFactory.getLogger(FederatedQueueConsumerImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final ActiveMQServer server; private final Federation federation; private final FederatedConsumerKey key; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/FederationDownstream.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/FederationDownstream.java index c1be8561ea..ae3bc80c99 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/FederationDownstream.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/FederationDownstream.java @@ -38,10 +38,11 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ActiveMQServerLogger; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class FederationDownstream extends AbstractFederationStream implements SessionFailureListener { - private static final Logger logger = LoggerFactory.getLogger(FederationDownstream.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private FederationDownstreamConfiguration config; private ClientSessionFactoryInternal clientSessionFactory; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/queue/FederatedQueue.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/queue/FederatedQueue.java index 3bc58f4bee..d886f42f8f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/queue/FederatedQueue.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/queue/FederatedQueue.java @@ -45,6 +45,7 @@ import org.apache.activemq.artemis.core.server.transformer.Transformer; import org.apache.activemq.artemis.core.settings.impl.Match; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Federated Queue, connect to upstream queues routing them to the local queue when a local consumer exist. @@ -55,7 +56,7 @@ import org.slf4j.LoggerFactory; */ public class FederatedQueue extends FederatedAbstract implements ActiveMQServerConsumerPlugin, Serializable { - private static final Logger logger = LoggerFactory.getLogger(FederatedQueue.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Set includes; private final Set excludes; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/files/FileMoveManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/files/FileMoveManager.java index b8c0935c60..8693905ca4 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/files/FileMoveManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/files/FileMoveManager.java @@ -26,6 +26,7 @@ import java.util.Arrays; import org.apache.activemq.artemis.core.server.ActiveMQServerLogger; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Used to move files away. @@ -34,7 +35,7 @@ import org.slf4j.LoggerFactory; */ public class FileMoveManager { - private static final Logger logger = LoggerFactory.getLogger(FileMoveManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final File folder; private final String[] prefixesToPreserve; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/files/FileStoreMonitor.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/files/FileStoreMonitor.java index 362607c520..5033c23336 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/files/FileStoreMonitor.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/files/FileStoreMonitor.java @@ -31,6 +31,7 @@ import org.apache.activemq.artemis.core.io.IOCriticalErrorListener; import org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This will keep a list of fileStores. It will make a comparison on all file stores registered. if any is over the limit, @@ -41,7 +42,7 @@ import org.slf4j.LoggerFactory; */ public class FileStoreMonitor extends ActiveMQScheduledComponent { - private static final Logger logger = LoggerFactory.getLogger(FileStoreMonitor.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Set callbackList = new HashSet<>(); private final Set stores = new HashSet<>(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/group/impl/LocalGroupingHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/group/impl/LocalGroupingHandler.java index d64105133e..fc1054df64 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/group/impl/LocalGroupingHandler.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/group/impl/LocalGroupingHandler.java @@ -43,13 +43,14 @@ import org.apache.activemq.artemis.utils.ExecutorFactory; import org.apache.activemq.artemis.utils.collections.TypedProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A Local Grouping handler. All the Remote handlers will talk with us */ public final class LocalGroupingHandler extends GroupHandlingAbstract { - private static final Logger logger = LoggerFactory.getLogger(LocalGroupingHandler.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final ConcurrentMap map = new ConcurrentHashMap<>(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java index 231b095059..5227413526 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java @@ -212,6 +212,7 @@ import org.apache.activemq.artemis.utils.critical.CriticalComponent; import org.apache.activemq.artemis.utils.critical.EmptyCriticalAnalyzer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.utils.collections.IterableStream.iterableOf; @@ -220,7 +221,7 @@ import static org.apache.activemq.artemis.utils.collections.IterableStream.itera */ public class ActiveMQServerImpl implements ActiveMQServer { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQServerImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String INTERNAL_NAMING_PREFIX = "$.artemis.internal"; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java index ed4cbb1871..d6e0ec8127 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java @@ -43,10 +43,11 @@ import org.apache.activemq.artemis.utils.JsonLoader; import org.apache.activemq.artemis.utils.PrefixUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class AddressInfo { - private static final Logger logger = LoggerFactory.getLogger(AddressInfo.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private long id; private long pauseStatusRecord = -1; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AnyLiveNodeLocatorForScaleDown.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AnyLiveNodeLocatorForScaleDown.java index ce294ee109..2bfd3202c9 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AnyLiveNodeLocatorForScaleDown.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AnyLiveNodeLocatorForScaleDown.java @@ -31,6 +31,7 @@ import org.apache.activemq.artemis.core.server.LiveNodeLocator; import org.apache.activemq.artemis.utils.ConcurrentUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This implementation looks for any available live node, once tried with no success it is marked as @@ -38,7 +39,7 @@ import org.slf4j.LoggerFactory; */ public class AnyLiveNodeLocatorForScaleDown extends LiveNodeLocator { - private static final Logger logger = LoggerFactory.getLogger(AnyLiveNodeLocatorForScaleDown.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Lock lock = new ReentrantLock(); private final Condition condition = lock.newCondition(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/DivertImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/DivertImpl.java index 181535329d..148689787b 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/DivertImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/DivertImpl.java @@ -28,13 +28,14 @@ import org.apache.activemq.artemis.core.server.RoutingContext; import org.apache.activemq.artemis.core.server.transformer.Transformer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A DivertImpl simply diverts a message to a different forwardAddress */ public class DivertImpl implements Divert { - private static final Logger logger = LoggerFactory.getLogger(DivertImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final PostOffice postOffice; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileBasedNodeManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileBasedNodeManager.java index d33f9b4f09..834e4509fa 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileBasedNodeManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileBasedNodeManager.java @@ -30,8 +30,6 @@ import org.apache.activemq.artemis.core.server.ActiveMQServerLogger; import org.apache.activemq.artemis.core.server.NodeManager; import org.apache.activemq.artemis.utils.UUID; import org.apache.activemq.artemis.utils.UUIDGenerator; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import static java.nio.file.StandardOpenOption.CREATE; import static java.nio.file.StandardOpenOption.READ; @@ -39,7 +37,6 @@ import static java.nio.file.StandardOpenOption.WRITE; public abstract class FileBasedNodeManager extends NodeManager { - private static final Logger LOGGER = LoggerFactory.getLogger(FileBasedNodeManager.class); protected static final byte FIRST_TIME_START = '0'; public static final String SERVER_LOCK_NAME = "server.lock"; public static final String SERVER_ACTIVATION_SEQUENCE_NAME = "server.activation.sequence"; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java index c2971cd734..659eca756d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java @@ -33,10 +33,11 @@ import org.apache.activemq.artemis.core.server.ActiveMQServerLogger; import org.apache.activemq.artemis.utils.UUID; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class FileLockNodeManager extends FileBasedNodeManager { - private static final Logger logger = LoggerFactory.getLogger(FileLockNodeManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int STATE_LOCK_POS = 0; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/LastValueQueue.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/LastValueQueue.java index 7f29a08f72..6c60028375 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/LastValueQueue.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/LastValueQueue.java @@ -42,6 +42,7 @@ import org.apache.activemq.artemis.utils.actors.ArtemisExecutor; import org.apache.activemq.artemis.utils.collections.LinkedListIterator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A queue that will discard messages if a newer message with the same @@ -54,7 +55,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings("ALL") public class LastValueQueue extends QueueImpl { - private static final Logger logger = LoggerFactory.getLogger(LastValueQueue.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Map map = new ConcurrentHashMap<>(); private final SimpleString lastValueKey; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/LegacyLDAPSecuritySettingPlugin.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/LegacyLDAPSecuritySettingPlugin.java index aae0ca959f..69c7bfe0fa 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/LegacyLDAPSecuritySettingPlugin.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/LegacyLDAPSecuritySettingPlugin.java @@ -46,10 +46,11 @@ import org.apache.activemq.artemis.core.server.SecuritySettingPlugin; import org.apache.activemq.artemis.core.settings.HierarchicalRepository; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class LegacyLDAPSecuritySettingPlugin implements SecuritySettingPlugin { - private static final Logger logger = LoggerFactory.getLogger(LegacyLDAPSecuritySettingPlugin.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final long serialVersionUID = 4793109879399750045L; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/LiveOnlyActivation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/LiveOnlyActivation.java index 421db5a8c9..8cc31a8ccb 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/LiveOnlyActivation.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/LiveOnlyActivation.java @@ -40,10 +40,11 @@ import org.apache.activemq.artemis.core.server.cluster.ha.ScaleDownPolicy; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class LiveOnlyActivation extends Activation { - private static final Logger logger = LoggerFactory.getLogger(LiveOnlyActivation.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); //this is how we act when we initially start as live private LiveOnlyPolicy liveOnlyPolicy; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/NamedLiveNodeLocatorForScaleDown.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/NamedLiveNodeLocatorForScaleDown.java index 89ae6c3ca4..4cc0558af8 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/NamedLiveNodeLocatorForScaleDown.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/NamedLiveNodeLocatorForScaleDown.java @@ -31,13 +31,14 @@ import org.apache.activemq.artemis.core.server.LiveNodeLocator; import org.apache.activemq.artemis.utils.ConcurrentUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * NamedLiveNodeLocatorForScaleDown looks for a live server in the cluster with a specific scaleDownGroupName */ public class NamedLiveNodeLocatorForScaleDown extends LiveNodeLocator { - private static final Logger logger = LoggerFactory.getLogger(NamedLiveNodeLocatorForScaleDown.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Lock lock = new ReentrantLock(); private final Condition condition = lock.newCondition(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java index 0ca2af03f5..c475d67193 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java @@ -65,10 +65,11 @@ import org.apache.activemq.artemis.core.transaction.impl.TransactionImpl; import org.apache.activemq.artemis.utils.collections.LinkedListIterator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class PostOfficeJournalLoader implements JournalLoader { - private static final Logger logger = LoggerFactory.getLogger(PostOfficeJournalLoader.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected final PostOffice postOffice; protected final PagingManager pagingManager; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java index cc59f212ea..0dab336f1c 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java @@ -120,6 +120,7 @@ import org.apache.activemq.artemis.utils.critical.CriticalComponentImpl; import org.apache.activemq.artemis.utils.critical.EmptyCriticalAnalyzer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.jctools.queues.MpscUnboundedArrayQueue; import static org.apache.activemq.artemis.utils.collections.IterableStream.iterableOf; @@ -138,7 +139,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue { protected static final int CRITICAL_CONSUMER = 3; protected static final int CRITICAL_CHECK_DEPAGE = 4; - private static final Logger logger = LoggerFactory.getLogger(QueueImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final AtomicIntegerFieldUpdater dispatchingUpdater = AtomicIntegerFieldUpdater.newUpdater(QueueImpl.class, "dispatching"); private static final AtomicLongFieldUpdater dispatchStartTimeUpdater = AtomicLongFieldUpdater.newUpdater(QueueImpl.class, "dispatchStartTime"); private static final AtomicLongFieldUpdater consumerRemovedTimestampUpdater = AtomicLongFieldUpdater.newUpdater(QueueImpl.class, "consumerRemovedTimestamp"); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueManagerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueManagerImpl.java index 89dfc3490b..d17d08ed5f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueManagerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueManagerImpl.java @@ -25,10 +25,11 @@ import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.utils.ReferenceCounterUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class QueueManagerImpl extends ReferenceCounterUtil implements QueueManager { - private static final Logger logger = LoggerFactory.getLogger(QueueManagerImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final SimpleString queueName; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueMessageMetrics.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueMessageMetrics.java index 261586e8b7..20e68d40cc 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueMessageMetrics.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueMessageMetrics.java @@ -26,10 +26,11 @@ import org.apache.activemq.artemis.core.server.MessageReference; import org.apache.activemq.artemis.core.server.Queue; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class QueueMessageMetrics { - private static final Logger logger = LoggerFactory.getLogger(QueueMessageMetrics.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final AtomicIntegerFieldUpdater COUNT_UPDATER = AtomicIntegerFieldUpdater.newUpdater(QueueMessageMetrics.class, "messageCount"); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RefsOperation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RefsOperation.java index 51c94689c2..0b74bcc8c9 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RefsOperation.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RefsOperation.java @@ -33,10 +33,11 @@ import org.apache.activemq.artemis.core.transaction.TransactionOperationAbstract import org.apache.activemq.artemis.core.transaction.impl.TransactionImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class RefsOperation extends TransactionOperationAbstract { - private static final Logger logger = LoggerFactory.getLogger(RefsOperation.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final AckReason reason; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ReplicationBackupActivation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ReplicationBackupActivation.java index c31c5d3866..4ed2b28e8e 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ReplicationBackupActivation.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ReplicationBackupActivation.java @@ -41,6 +41,7 @@ import org.apache.activemq.artemis.quorum.DistributedPrimitiveManager; import org.apache.activemq.artemis.quorum.UnavailableStateException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.core.server.NodeManager.NULL_NODE_ACTIVATION_SEQUENCE; import static org.apache.activemq.artemis.core.server.impl.ReplicationObserver.ReplicationFailure; @@ -53,7 +54,7 @@ import static org.apache.activemq.artemis.core.server.impl.quorum.ActivationSequ */ public final class ReplicationBackupActivation extends Activation implements DistributedPrimitiveManager.UnavailableManagerListener { - private static final Logger LOGGER = LoggerFactory.getLogger(ReplicationBackupActivation.class); + private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final ReplicationBackupPolicy policy; private final ActiveMQServerImpl activeMQServer; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ReplicationError.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ReplicationError.java index 7ccc89eca5..ac9ad3e7e0 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ReplicationError.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ReplicationError.java @@ -27,6 +27,7 @@ import org.apache.activemq.artemis.core.server.LiveNodeLocator; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Stops the backup in case of an error at the start of Replication. @@ -37,7 +38,7 @@ import org.slf4j.LoggerFactory; */ final class ReplicationError implements Interceptor { - private static final Logger logger = LoggerFactory.getLogger(ReplicationError.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private LiveNodeLocator nodeLocator; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ReplicationObserver.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ReplicationObserver.java index 23a354229d..abcdbc5ec8 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ReplicationObserver.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ReplicationObserver.java @@ -36,10 +36,11 @@ import org.apache.activemq.artemis.core.server.NodeManager; import org.apache.activemq.artemis.core.server.cluster.BackupManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; final class ReplicationObserver implements ClusterTopologyListener, SessionFailureListener, BackupRegistrationListener, ReplicationEndpoint.ReplicationEndpointEventListener, AutoCloseable { - private static final Logger logger = LoggerFactory.getLogger(ReplicationObserver.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public enum ReplicationFailure { VoluntaryFailOver, BackupNotInSync, NonVoluntaryFailover, RegistrationError, AlreadyReplicating, ClosedObserver, WrongNodeId, WrongActivationSequence diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ReplicationPrimaryActivation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ReplicationPrimaryActivation.java index e1a09f6e95..fb17ddea3c 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ReplicationPrimaryActivation.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ReplicationPrimaryActivation.java @@ -49,6 +49,7 @@ import org.apache.activemq.artemis.quorum.UnavailableStateException; import org.apache.activemq.artemis.spi.core.remoting.Acceptor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.core.server.ActiveMQServer.SERVER_STATE.STARTED; import static org.apache.activemq.artemis.core.server.impl.quorum.ActivationSequenceStateMachine.awaitNextCommittedActivationSequence; @@ -61,7 +62,8 @@ import static org.apache.activemq.artemis.core.server.impl.quorum.ActivationSequ */ public class ReplicationPrimaryActivation extends LiveActivation implements DistributedLock.UnavailableLockListener { - private static final Logger LOGGER = LoggerFactory.getLogger(ReplicationPrimaryActivation.class); + private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + // This is the time we expect a replica to become a live from the quorum pov // ie time to execute tryActivate and ensureSequentialAccessToNodeData private static final long FAILBACK_TIMEOUT_MILLIS = 4_000; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RoutingContextImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RoutingContextImpl.java index 741085a315..4c147972b3 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RoutingContextImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/RoutingContextImpl.java @@ -35,10 +35,11 @@ import org.apache.activemq.artemis.core.server.mirror.MirrorController; import org.apache.activemq.artemis.core.transaction.Transaction; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class RoutingContextImpl implements RoutingContext { - private static final Logger logger = LoggerFactory.getLogger(RoutingContextImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); // The pair here is Durable and NonDurable private final Map map = new HashMap<>(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScaleDownHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScaleDownHandler.java index 4b635a2944..90290354ca 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScaleDownHandler.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScaleDownHandler.java @@ -65,10 +65,11 @@ import org.apache.activemq.artemis.core.transaction.impl.TransactionImpl; import org.apache.activemq.artemis.utils.collections.LinkedListIterator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ScaleDownHandler { - private static final Logger logger = LoggerFactory.getLogger(ScaleDownHandler.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); final PagingManager pagingManager; final PostOffice postOffice; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScheduledDeliveryHandlerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScheduledDeliveryHandlerImpl.java index 93e2ea53d6..4fcd909102 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScheduledDeliveryHandlerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScheduledDeliveryHandlerImpl.java @@ -36,13 +36,14 @@ import org.apache.activemq.artemis.core.server.ScheduledDeliveryHandler; import org.apache.activemq.artemis.core.transaction.Transaction; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Handles scheduling deliveries to a queue at the correct time. */ public class ScheduledDeliveryHandlerImpl implements ScheduledDeliveryHandler { - private static final Logger logger = LoggerFactory.getLogger(ScheduledDeliveryHandlerImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final ScheduledExecutorService scheduledExecutor; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java index 5289afd104..9b07578dfc 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java @@ -71,6 +71,7 @@ import org.apache.activemq.artemis.utils.collections.LinkedListIterator; import org.apache.activemq.artemis.utils.collections.TypedProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Concrete implementation of a ClientConsumer. @@ -78,7 +79,7 @@ import org.slf4j.LoggerFactory; public class ServerConsumerImpl implements ServerConsumer, ReadyListener { - private static final Logger logger = LoggerFactory.getLogger(ServerConsumerImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final long id; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java index ce64167e16..28a80a4308 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java @@ -103,6 +103,7 @@ import org.apache.activemq.artemis.utils.collections.MaxSizeMap; import org.apache.activemq.artemis.utils.collections.TypedProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Server side Session implementation @@ -110,7 +111,7 @@ import org.slf4j.LoggerFactory; public class ServerSessionImpl implements ServerSession, FailureListener { - private static final Logger logger = LoggerFactory.getLogger(ServerSessionImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingBackupActivation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingBackupActivation.java index 0584dbae1c..f9fa83e672 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingBackupActivation.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingBackupActivation.java @@ -51,6 +51,7 @@ import org.apache.activemq.artemis.core.server.management.ManagementService; import org.apache.activemq.artemis.utils.ReusableLatch; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.core.server.cluster.qourum.SharedNothingBackupQuorum.BACKUP_ACTIVATION.FAILURE_REPLICATING; import static org.apache.activemq.artemis.core.server.cluster.qourum.SharedNothingBackupQuorum.BACKUP_ACTIVATION.FAIL_OVER; @@ -58,7 +59,7 @@ import static org.apache.activemq.artemis.core.server.cluster.qourum.SharedNothi public final class SharedNothingBackupActivation extends Activation implements ReplicationEndpointEventListener { - private static final Logger logger = LoggerFactory.getLogger(SharedNothingBackupActivation.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); //this is how we act when we start as a backup private ReplicaPolicy replicaPolicy; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingLiveActivation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingLiveActivation.java index 90145e9dd1..bae9b592ec 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingLiveActivation.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingLiveActivation.java @@ -62,10 +62,11 @@ import org.apache.activemq.artemis.core.server.cluster.qourum.QuorumManager; import org.apache.activemq.artemis.spi.core.remoting.Acceptor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class SharedNothingLiveActivation extends LiveActivation { - private static final Logger logger = LoggerFactory.getLogger(SharedNothingLiveActivation.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); //this is how we act when we initially start as a live private ReplicatedPolicy replicatedPolicy; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreBackupActivation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreBackupActivation.java index 2ebb8295eb..80af5743cc 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreBackupActivation.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreBackupActivation.java @@ -43,10 +43,11 @@ import org.apache.activemq.artemis.core.server.group.GroupingHandler; import org.apache.activemq.artemis.core.server.management.ManagementService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public final class SharedStoreBackupActivation extends Activation { - private static final Logger logger = LoggerFactory.getLogger(SharedStoreBackupActivation.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); //this is how we act as a backup private final SharedStoreSlavePolicy sharedStoreSlavePolicy; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreLiveActivation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreLiveActivation.java index 024ace2178..64ced96f0f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreLiveActivation.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreLiveActivation.java @@ -29,10 +29,11 @@ import org.apache.activemq.artemis.core.server.NodeManager.NodeManagerException; import org.apache.activemq.artemis.core.server.cluster.ha.SharedStoreMasterPolicy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public final class SharedStoreLiveActivation extends LiveActivation { - private static final Logger logger = LoggerFactory.getLogger(SharedStoreLiveActivation.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); // this is how we act when we initially start as live private final SharedStoreMasterPolicy sharedStoreMasterPolicy; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/TransientQueueManagerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/TransientQueueManagerImpl.java index f03660cde8..c30d421ad3 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/TransientQueueManagerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/TransientQueueManagerImpl.java @@ -25,10 +25,11 @@ import org.apache.activemq.artemis.core.server.TransientQueueManager; import org.apache.activemq.artemis.utils.ReferenceCounterUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class TransientQueueManagerImpl extends ReferenceCounterUtil implements TransientQueueManager { - private static final Logger logger = LoggerFactory.getLogger(TransientQueueManagerImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final SimpleString queueName; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/ActiveMQScheduledLeaseLock.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/ActiveMQScheduledLeaseLock.java index 1377d061c2..58dd34ce47 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/ActiveMQScheduledLeaseLock.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/ActiveMQScheduledLeaseLock.java @@ -25,13 +25,14 @@ import org.apache.activemq.artemis.core.server.NodeManager.LockListener; import org.apache.activemq.artemis.utils.actors.ArtemisExecutor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Default implementation of a {@link ScheduledLeaseLock}: see {@link ScheduledLeaseLock#of(ScheduledExecutorService, ArtemisExecutor, String, LeaseLock, long, LockListener)}. */ final class ActiveMQScheduledLeaseLock extends ActiveMQScheduledComponent implements ScheduledLeaseLock { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQScheduledLeaseLock.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final String lockName; private final LeaseLock lock; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcLeaseLock.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcLeaseLock.java index eb2f4274c5..7e11a384c3 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcLeaseLock.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcLeaseLock.java @@ -31,13 +31,14 @@ import org.apache.activemq.artemis.core.server.ActiveMQServerLogger; import org.apache.activemq.artemis.jdbc.store.drivers.JDBCConnectionProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * JDBC implementation of a {@link LeaseLock} with a {@code String} defined {@link #holderId()}. */ class JdbcLeaseLock implements LeaseLock { - private static final Logger logger = LoggerFactory.getLogger(JdbcLeaseLock.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int MAX_HOLDER_ID_LENGTH = 128; private final JDBCConnectionProvider connectionProvider; private final String holderId; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcNodeManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcNodeManager.java index edd203f685..9a3c2b25df 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcNodeManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcNodeManager.java @@ -36,6 +36,7 @@ import org.apache.activemq.artemis.utils.UUID; import org.apache.activemq.artemis.utils.UUIDGenerator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.core.server.impl.jdbc.LeaseLock.AcquireResult.Timeout; @@ -44,7 +45,7 @@ import static org.apache.activemq.artemis.core.server.impl.jdbc.LeaseLock.Acquir */ public final class JdbcNodeManager extends NodeManager { - private static final Logger logger = LoggerFactory.getLogger(JdbcNodeManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final long MAX_PAUSE_MILLIS = 2000L; private final Supplier sharedStateManagerFactory; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcSharedStateManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcSharedStateManager.java index 9639b4b753..8d3ff1937a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcSharedStateManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcSharedStateManager.java @@ -29,6 +29,7 @@ import org.apache.activemq.artemis.jdbc.store.sql.SQLProvider; import org.apache.activemq.artemis.utils.UUID; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * JDBC implementation of a {@link SharedStateManager}. @@ -36,7 +37,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings("SynchronizeOnNonFinalField") final class JdbcSharedStateManager extends AbstractJDBCDriver implements SharedStateManager { - private static final Logger logger = LoggerFactory.getLogger(JdbcSharedStateManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int MAX_SETUP_ATTEMPTS = 20; private final String holderId; private final long lockExpirationMillis; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ArtemisMBeanServerGuard.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ArtemisMBeanServerGuard.java index 8b51c2ab26..128f15d65d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ArtemisMBeanServerGuard.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ArtemisMBeanServerGuard.java @@ -20,6 +20,7 @@ package org.apache.activemq.artemis.core.server.management; import org.apache.activemq.artemis.logs.AuditLogger; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import javax.management.Attribute; import javax.management.AttributeList; @@ -40,7 +41,7 @@ import java.util.List; public class ArtemisMBeanServerGuard implements InvocationHandler { - private static final Logger logger = LoggerFactory.getLogger(ArtemisMBeanServerGuard.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private JMXAccessControlList jmxAccessControlList = JMXAccessControlList.createDefaultList(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ManagementConnector.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ManagementConnector.java index 7d476d46a1..dd33d174d8 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ManagementConnector.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ManagementConnector.java @@ -22,6 +22,7 @@ import org.apache.activemq.artemis.spi.core.security.ActiveMQBasicSecurityManage import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import javax.management.MBeanServer; import javax.management.ObjectName; @@ -32,7 +33,7 @@ import java.util.Map; public class ManagementConnector implements ActiveMQComponent { - private static final Logger logger = LoggerFactory.getLogger(ManagementConnector.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final JMXConnectorConfiguration configuration; private ConnectorServerFactory connectorServerFactory; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/HawtioSecurityControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/HawtioSecurityControlImpl.java index ce0de22612..1bce41a1de 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/HawtioSecurityControlImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/HawtioSecurityControlImpl.java @@ -23,6 +23,7 @@ import org.apache.activemq.artemis.core.server.management.ArtemisMBeanServerGuar import org.apache.activemq.artemis.core.server.management.HawtioSecurityControl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import javax.management.MBeanAttributeInfo; import javax.management.MBeanOperationInfo; @@ -44,7 +45,7 @@ import java.util.Map; public class HawtioSecurityControlImpl extends AbstractControl implements HawtioSecurityControl { - private static final Logger logger = LoggerFactory.getLogger(HawtioSecurityControlImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * The Tabular Type returned by the {@link #canInvoke(Map)} operation. The rows consist of diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java index 3c7cda555e..e0f4273a28 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java @@ -108,12 +108,13 @@ import org.apache.activemq.artemis.utils.collections.ConcurrentHashSet; import org.apache.activemq.artemis.utils.collections.TypedProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.api.core.FilterConstants.NATIVE_MESSAGE_ID; public class ManagementServiceImpl implements ManagementService { - private static final Logger logger = LoggerFactory.getLogger(ManagementServiceImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final MBeanServer mbeanServer; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/metrics/MetricsManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/metrics/MetricsManager.java index e9aa68abea..448b5c46b0 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/metrics/MetricsManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/metrics/MetricsManager.java @@ -38,10 +38,11 @@ import org.apache.activemq.artemis.core.settings.HierarchicalRepository; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MetricsManager { - private static final Logger log = LoggerFactory.getLogger(MetricsManager.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final String brokerName; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/impl/BrokerMessageAuthorizationPlugin.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/impl/BrokerMessageAuthorizationPlugin.java index c69df1ace4..2f530ff399 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/impl/BrokerMessageAuthorizationPlugin.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/impl/BrokerMessageAuthorizationPlugin.java @@ -33,10 +33,11 @@ import org.apache.activemq.artemis.core.server.plugin.ActiveMQServerPlugin; import org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class BrokerMessageAuthorizationPlugin implements ActiveMQServerPlugin { - private static final Logger logger = LoggerFactory.getLogger(BrokerMessageAuthorizationPlugin.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String ROLE_PROPERTY = "ROLE_PROPERTY"; private final AtomicReference server = new AtomicReference<>(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/impl/LoggingActiveMQServerPlugin.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/impl/LoggingActiveMQServerPlugin.java index 3d5f7c4d88..b26939e97d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/impl/LoggingActiveMQServerPlugin.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/impl/LoggingActiveMQServerPlugin.java @@ -45,6 +45,7 @@ import org.apache.activemq.artemis.spi.core.protocol.SessionCallback; import org.apache.activemq.artemis.utils.critical.CriticalComponent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * plugin to log various events within the broker, configured with the following booleans @@ -67,7 +68,7 @@ public class LoggingActiveMQServerPlugin implements ActiveMQServerPlugin, Serial public static final String LOG_SENDING_EVENTS = "LOG_SENDING_EVENTS"; public static final String LOG_INTERNAL_EVENTS = "LOG_INTERNAL_EVENTS"; public static final String UNAVAILABLE = "UNAVAILABLE"; - private static final Logger logger = LoggerFactory.getLogger(LoggingActiveMQServerPlugin.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final long serialVersionUID = 1L; private boolean logAll = false; private boolean logConnectionEvents = false; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/impl/NotificationActiveMQServerPlugin.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/impl/NotificationActiveMQServerPlugin.java index 31fdfb631b..0f232e9ea0 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/impl/NotificationActiveMQServerPlugin.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/impl/NotificationActiveMQServerPlugin.java @@ -35,13 +35,14 @@ import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; import org.apache.activemq.artemis.utils.collections.TypedProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * */ public class NotificationActiveMQServerPlugin implements ActiveMQServerPlugin { - private static final Logger logger = LoggerFactory.getLogger(NotificationActiveMQServerPlugin.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String SEND_CONNECTION_NOTIFICATIONS = "SEND_CONNECTION_NOTIFICATIONS"; public static final String SEND_ADDRESS_NOTIFICATIONS = "SEND_ADDRESS_NOTIFICATIONS"; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/reload/ReloadManagerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/reload/ReloadManagerImpl.java index bbecf09bab..7235d01b32 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/reload/ReloadManagerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/reload/ReloadManagerImpl.java @@ -31,10 +31,11 @@ import org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent; import org.apache.activemq.artemis.core.server.ActiveMQServerLogger; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ReloadManagerImpl extends ActiveMQScheduledComponent implements ReloadManager { - private static final Logger logger = LoggerFactory.getLogger(ReloadManagerImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private volatile Runnable tick; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/replay/ReplayManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/replay/ReplayManager.java index 2b2751a693..8ddeaedcfe 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/replay/ReplayManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/replay/ReplayManager.java @@ -48,13 +48,14 @@ import org.apache.activemq.artemis.core.server.impl.RoutingContextImpl; import org.apache.activemq.artemis.spi.core.protocol.MessagePersister; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ReplayManager { public static SimpleDateFormat newRetentionSimpleDateFormat() { return new SimpleDateFormat("yyyyMMddHHmmss"); } - private static final Logger logger = LoggerFactory.getLogger(ReplayManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final ActiveMQServer server; private JournalImpl journal; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/ConnectionRouter.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/ConnectionRouter.java index 96cb051d73..10323fd999 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/ConnectionRouter.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/ConnectionRouter.java @@ -27,12 +27,13 @@ import org.apache.activemq.artemis.core.server.routing.targets.TargetResult; import org.apache.activemq.artemis.spi.core.remoting.Connection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import java.util.List; import java.util.regex.Pattern; public class ConnectionRouter implements ActiveMQComponent { - private static final Logger logger = LoggerFactory.getLogger(ConnectionRouter.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String CLIENT_ID_PREFIX = ActiveMQDefaultConfiguration.DEFAULT_INTERNAL_NAMING_PREFIX + "router.client."; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/ConnectionRouterManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/ConnectionRouterManager.java index 9e538d3f7d..14df523a39 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/ConnectionRouterManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/ConnectionRouterManager.java @@ -45,6 +45,7 @@ import org.apache.activemq.artemis.core.server.routing.targets.TargetFactory; import org.apache.activemq.artemis.core.server.cluster.ClusterConnection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import java.util.ArrayList; import java.util.HashMap; @@ -53,7 +54,7 @@ import java.util.Map; import java.util.concurrent.ScheduledExecutorService; public final class ConnectionRouterManager implements ActiveMQComponent { - private static final Logger logger = LoggerFactory.getLogger(ConnectionRouterManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String CACHE_ID_PREFIX = "$.BC."; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/KeyResolver.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/KeyResolver.java index ec444dd284..3179edb663 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/KeyResolver.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/KeyResolver.java @@ -23,6 +23,7 @@ import org.apache.activemq.artemis.spi.core.remoting.Connection; import org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -31,7 +32,7 @@ public class KeyResolver { public static final String NULL_KEY_VALUE = "NULL"; - private static final Logger logger = LoggerFactory.getLogger(KeyResolver.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final char SOCKET_ADDRESS_DELIMITER = ':'; private static final String SOCKET_ADDRESS_PREFIX = "/"; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/caches/LocalCache.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/caches/LocalCache.java index 4052274ead..8dfcd59154 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/caches/LocalCache.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/caches/LocalCache.java @@ -24,13 +24,14 @@ import org.apache.activemq.artemis.core.persistence.StorageManager; import org.apache.activemq.artemis.core.persistence.config.PersistedKeyValuePair; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import java.util.Map; import java.util.Objects; import java.util.concurrent.TimeUnit; public class LocalCache implements Cache, RemovalListener { - private static final Logger logger = LoggerFactory.getLogger(LocalCache.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private String id; private boolean persisted; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/policies/LeastConnectionsPolicy.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/policies/LeastConnectionsPolicy.java index e16252cc19..c770a7db96 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/policies/LeastConnectionsPolicy.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/policies/LeastConnectionsPolicy.java @@ -21,6 +21,7 @@ import org.apache.activemq.artemis.core.server.routing.targets.Target; import org.apache.activemq.artemis.core.server.routing.targets.TargetProbe; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import java.util.ArrayList; import java.util.List; @@ -30,7 +31,7 @@ import java.util.TreeMap; import java.util.concurrent.ConcurrentHashMap; public class LeastConnectionsPolicy extends RoundRobinPolicy { - private static final Logger logger = LoggerFactory.getLogger(LeastConnectionsPolicy.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String NAME = "LEAST_CONNECTIONS"; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/pools/AbstractPool.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/pools/AbstractPool.java index f794ec87f3..52a2b86fc7 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/pools/AbstractPool.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/pools/AbstractPool.java @@ -24,6 +24,7 @@ import org.apache.activemq.artemis.core.server.routing.targets.TargetMonitor; import org.apache.activemq.artemis.core.server.routing.targets.TargetProbe; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import java.util.ArrayList; import java.util.Collections; @@ -37,7 +38,7 @@ import java.util.concurrent.locks.LockSupport; import java.util.stream.Collectors; public abstract class AbstractPool implements Pool { - private static final Logger logger = LoggerFactory.getLogger(AbstractPool.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final TargetFactory targetFactory; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/targets/ActiveMQTarget.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/targets/ActiveMQTarget.java index 14fadb6171..b8e670016c 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/targets/ActiveMQTarget.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/targets/ActiveMQTarget.java @@ -30,9 +30,10 @@ import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; import org.apache.activemq.artemis.utils.UUIDGenerator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ActiveMQTarget extends AbstractTarget implements FailureListener { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQTarget.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private boolean connected = false; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/targets/TargetMonitor.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/targets/TargetMonitor.java index 040ca2e3f8..3304f5dc3b 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/targets/TargetMonitor.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/routing/targets/TargetMonitor.java @@ -20,13 +20,14 @@ package org.apache.activemq.artemis.core.server.routing.targets; import org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import java.util.List; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; public class TargetMonitor extends ActiveMQScheduledComponent implements TargetListener { - private static final Logger logger = LoggerFactory.getLogger(TargetMonitor.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Target target; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/HierarchicalObjectRepository.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/HierarchicalObjectRepository.java index aab5f1dec9..3bf2808f04 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/HierarchicalObjectRepository.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/HierarchicalObjectRepository.java @@ -38,13 +38,14 @@ import org.apache.activemq.artemis.core.settings.HierarchicalRepositoryChangeLis import org.apache.activemq.artemis.core.settings.Mergeable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * allows objects to be mapped against a regex pattern and held in order in a list */ public class HierarchicalObjectRepository implements HierarchicalRepository { - private static final Logger logger = LoggerFactory.getLogger(HierarchicalObjectRepository.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final WildcardConfiguration DEFAULT_WILDCARD_CONFIGURATION = new WildcardConfiguration(); private boolean listenersEnabled = true; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImpl.java index 752a4b598c..0596243ad3 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImpl.java @@ -38,10 +38,11 @@ import org.apache.activemq.artemis.core.transaction.TransactionOperation; import org.apache.activemq.artemis.utils.ArtemisCloseable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class TransactionImpl implements Transaction { - private static final Logger logger = LoggerFactory.getLogger(TransactionImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private List operations; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/EmbedMessageUtil.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/EmbedMessageUtil.java index 501f8bfef7..5678f1b54c 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/EmbedMessageUtil.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/EmbedMessageUtil.java @@ -29,6 +29,7 @@ import org.apache.activemq.artemis.core.persistence.impl.journal.LargeServerMess import org.apache.activemq.artemis.core.server.LargeServerMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class EmbedMessageUtil { @@ -37,7 +38,7 @@ public class EmbedMessageUtil { private static final byte[] signature = new byte[]{(byte) 'E', (byte) 'M', (byte) 'B'}; - private static final Logger logger = LoggerFactory.getLogger(EmbedMessageUtil.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static ICoreMessage embedAsCoreMessage(Message source) { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/MessagePersister.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/MessagePersister.java index cf7a013771..67f65612f1 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/MessagePersister.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/MessagePersister.java @@ -28,6 +28,7 @@ import org.apache.activemq.artemis.core.persistence.StorageManager; import org.apache.activemq.artemis.core.server.LargeServerMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.core.persistence.PersisterIDs.MAX_PERSISTERS; @@ -38,7 +39,7 @@ public class MessagePersister implements Persister { return 0; } - private static final Logger logger = LoggerFactory.getLogger(MessagePersister.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final MessagePersister theInstance = new MessagePersister(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQBasicSecurityManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQBasicSecurityManager.java index a5b71bfb60..412ed5c188 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQBasicSecurityManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQBasicSecurityManager.java @@ -40,13 +40,14 @@ import org.apache.activemq.artemis.utils.ClassloadingUtil; import org.apache.activemq.artemis.utils.SecurityManagerUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * All user and role state (both in memory and on disk) is maintained by the underlying StorageManager */ public class ActiveMQBasicSecurityManager implements ActiveMQSecurityManager5, UserManagement { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQBasicSecurityManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String BOOTSTRAP_USER = "bootstrapUser"; public static final String BOOTSTRAP_PASSWORD = "bootstrapPassword"; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQJAASSecurityManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQJAASSecurityManager.java index cbc22eb837..c28abe9f16 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQJAASSecurityManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQJAASSecurityManager.java @@ -30,6 +30,7 @@ import org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal; import org.apache.activemq.artemis.utils.SecurityManagerUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.core.remoting.CertificateUtil.getCertsFromConnection; @@ -41,7 +42,7 @@ import static org.apache.activemq.artemis.core.remoting.CertificateUtil.getCerts */ public class ActiveMQJAASSecurityManager implements ActiveMQSecurityManager5 { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQJAASSecurityManager.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private String configurationName; private String certificateConfigurationName; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManagerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManagerImpl.java index ad78b5fcf5..1877c32e9d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManagerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManagerImpl.java @@ -25,6 +25,7 @@ import org.apache.activemq.artemis.core.security.Role; import org.apache.activemq.artemis.core.security.User; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A basic implementation of the ActiveMQSecurityManager. This can be used within an appserver and be deployed by @@ -35,7 +36,7 @@ public class ActiveMQSecurityManagerImpl implements ActiveMQSecurityManager { private final SecurityConfiguration configuration; - private static final Logger logger = LoggerFactory.getLogger(ActiveMQSecurityManagerImpl.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public ActiveMQSecurityManagerImpl() { configuration = new SecurityConfiguration(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/CertificateLoginModule.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/CertificateLoginModule.java index ac64631b76..684b12eb34 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/CertificateLoginModule.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/CertificateLoginModule.java @@ -31,6 +31,7 @@ import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A LoginModule that allows for authentication based on SSL certificates. @@ -39,7 +40,7 @@ import org.slf4j.LoggerFactory; */ public abstract class CertificateLoginModule extends PropertiesLoader implements AuditLoginModule { - private static final Logger logger = LoggerFactory.getLogger(CertificateLoginModule.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private CallbackHandler callbackHandler; private Subject subject; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/ExternalCertificateLoginModule.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/ExternalCertificateLoginModule.java index ed9e26df79..cb4359e510 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/ExternalCertificateLoginModule.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/ExternalCertificateLoginModule.java @@ -31,13 +31,14 @@ import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A LoginModule that propagates TLS certificates subject DN as a UserPrincipal. */ public class ExternalCertificateLoginModule implements AuditLoginModule { - private static final Logger logger = LoggerFactory.getLogger(ExternalCertificateLoginModule.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private CallbackHandler callbackHandler; private Subject subject; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/GuestLoginModule.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/GuestLoginModule.java index 42c2df2c66..94f0cc56d0 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/GuestLoginModule.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/GuestLoginModule.java @@ -30,6 +30,7 @@ import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Always login the user with a default 'guest' identity. @@ -39,7 +40,7 @@ import org.slf4j.LoggerFactory; */ public class GuestLoginModule implements AuditLoginModule { - private static final Logger logger = LoggerFactory.getLogger(GuestLoginModule.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String GUEST_USER = "org.apache.activemq.jaas.guest.user"; private static final String GUEST_ROLE = "org.apache.activemq.jaas.guest.role"; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/InVMLoginModule.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/InVMLoginModule.java index d0e749ea9d..c640682185 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/InVMLoginModule.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/InVMLoginModule.java @@ -34,10 +34,11 @@ import java.util.Set; import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class InVMLoginModule implements AuditLoginModule { - private static final Logger logger = LoggerFactory.getLogger(InVMLoginModule.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String CONFIG_PROP_NAME = "org.apache.activemq.jaas.invm.config"; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/LDAPLoginModule.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/LDAPLoginModule.java index 07c4d7b878..86201e9cd4 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/LDAPLoginModule.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/LDAPLoginModule.java @@ -60,10 +60,11 @@ import org.apache.activemq.artemis.core.server.ActiveMQServerLogger; import org.apache.activemq.artemis.utils.PasswordMaskingUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class LDAPLoginModule implements AuditLoginModule { - private static final Logger logger = LoggerFactory.getLogger(LDAPLoginModule.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); enum ConfigKey { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PrincipalConversionLoginModule.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PrincipalConversionLoginModule.java index 686bbcc3b4..87fbe84b7e 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PrincipalConversionLoginModule.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PrincipalConversionLoginModule.java @@ -24,6 +24,7 @@ import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * populate an empty (no UserPrincipal) subject with UserPrincipal seeded from existing principal @@ -31,7 +32,7 @@ import org.slf4j.LoggerFactory; */ public class PrincipalConversionLoginModule implements AuditLoginModule { - private static final Logger logger = LoggerFactory.getLogger(PrincipalConversionLoginModule.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String PRINCIPAL_CLASS_LIST = "principalClassList"; private Subject subject; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PropertiesLoader.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PropertiesLoader.java index ed47f4347e..19c326f5df 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PropertiesLoader.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PropertiesLoader.java @@ -22,10 +22,11 @@ import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class PropertiesLoader { - private static final Logger logger = LoggerFactory.getLogger(PropertiesLoader.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); static final Map staticCache = new HashMap<>(); protected boolean debug; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PropertiesLoginModule.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PropertiesLoginModule.java index 5bb2728552..808526d651 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PropertiesLoginModule.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PropertiesLoginModule.java @@ -37,10 +37,11 @@ import org.apache.activemq.artemis.utils.PasswordMaskingUtil; import org.apache.activemq.artemis.utils.SecureHashProcessor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class PropertiesLoginModule extends PropertiesLoader implements AuditLoginModule { - private static final Logger logger = LoggerFactory.getLogger(PropertiesLoginModule.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String USER_FILE_PROP_NAME = "org.apache.activemq.jaas.properties.user"; public static final String ROLE_FILE_PROP_NAME = "org.apache.activemq.jaas.properties.role"; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/ReloadableProperties.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/ReloadableProperties.java index a861eabddb..0a093719e3 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/ReloadableProperties.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/ReloadableProperties.java @@ -32,10 +32,11 @@ import java.util.regex.PatternSyntaxException; import org.apache.activemq.artemis.core.server.ActiveMQServerLogger; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ReloadableProperties { - private static final Logger logger = LoggerFactory.getLogger(ReloadableProperties.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); // use this whenever writing to the underlying properties files from another component public static final ReadWriteLock LOCK = new ReentrantReadWriteLock(); diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java index 7ded205ebe..98ce1b2294 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java @@ -64,13 +64,14 @@ import org.apache.activemq.artemis.utils.critical.CriticalAnalyzerPolicy; import org.apache.commons.lang3.ClassUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class ConfigurationImplTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(ConfigurationImplTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected Configuration conf; diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/GuestLoginModuleTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/GuestLoginModuleTest.java index 81b997c3b0..6b24cb9596 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/GuestLoginModuleTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/GuestLoginModuleTest.java @@ -32,12 +32,13 @@ import org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal; import org.apache.activemq.artemis.spi.core.security.jaas.UserPrincipal; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.Assert; import org.junit.Test; public class GuestLoginModuleTest extends Assert { - private static final Logger logger = LoggerFactory.getLogger(GuestLoginModuleTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); static { String path = System.getProperty("java.security.auth.login.config"); diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/JAASSecurityManagerTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/JAASSecurityManagerTest.java index 487897ac39..5715d60b7e 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/JAASSecurityManagerTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/JAASSecurityManagerTest.java @@ -24,6 +24,7 @@ import org.apache.activemq.artemis.core.security.impl.SecurityStoreImpl; import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; @@ -46,7 +47,7 @@ import static org.junit.Assert.assertTrue; @RunWith(Parameterized.class) public class JAASSecurityManagerTest { - private static final Logger log = LoggerFactory.getLogger(JAASSecurityManagerTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Parameterized.Parameters(name = "newLoader=({0})") public static Collection data() { diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/PropertiesLoginModuleTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/PropertiesLoginModuleTest.java index 2f074209b7..540c722183 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/PropertiesLoginModuleTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/PropertiesLoginModuleTest.java @@ -37,12 +37,13 @@ import org.apache.activemq.artemis.spi.core.security.jaas.UserPrincipal; import org.apache.commons.io.FileUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.Assert; import org.junit.Test; public class PropertiesLoginModuleTest extends Assert { - private static final Logger logger = LoggerFactory.getLogger(PropertiesLoginModuleTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); static { String path = System.getProperty("java.security.auth.login.config"); diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/TextFileCertificateLoginModuleTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/TextFileCertificateLoginModuleTest.java index 8c52fdfa43..7540018e5e 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/TextFileCertificateLoginModuleTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/TextFileCertificateLoginModuleTest.java @@ -36,13 +36,14 @@ import org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoader; import org.apache.activemq.artemis.spi.core.security.jaas.TextFileCertificateLoginModule; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.After; import org.junit.Before; import org.junit.Test; public class TextFileCertificateLoginModuleTest { - private static final Logger logger = LoggerFactory.getLogger(TextFileCertificateLoginModuleTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String CERT_USERS_FILE_SMALL = "cert-users-SMALL.properties"; private static final String CERT_USERS_FILE_LARGE = "cert-users-LARGE.properties"; diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/files/FileStoreMonitorTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/files/FileStoreMonitorTest.java index 0a88f8f267..7211582852 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/files/FileStoreMonitorTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/files/FileStoreMonitorTest.java @@ -32,6 +32,7 @@ import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.ReusableLatch; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -39,7 +40,7 @@ import org.junit.Test; public class FileStoreMonitorTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(FileStoreMonitorTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private ScheduledExecutorService scheduledExecutorService; private ExecutorService executorService; diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/impl/ScheduledDeliveryHandlerTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/impl/ScheduledDeliveryHandlerTest.java index 40e3f61e41..91ac9b32cc 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/impl/ScheduledDeliveryHandlerTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/impl/ScheduledDeliveryHandlerTest.java @@ -62,12 +62,13 @@ import org.apache.activemq.artemis.utils.critical.CriticalComponentImpl; import org.apache.activemq.artemis.utils.critical.EmptyCriticalAnalyzer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.Assert; import org.junit.Test; public class ScheduledDeliveryHandlerTest extends Assert { - private static final Logger log = LoggerFactory.getLogger(ScheduledDeliveryHandlerTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testScheduleRandom() throws Exception { diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImplTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImplTest.java index ecd29a709a..021bdce826 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImplTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImplTest.java @@ -69,11 +69,12 @@ import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.ArtemisCloseable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.Assert; import org.junit.Test; public class TransactionImplTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(TransactionImplTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testTimeoutAndThenCommitWithARollback() throws Exception { diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/spi/core/security/jaas/LDAPLoginModuleTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/spi/core/security/jaas/LDAPLoginModuleTest.java index 7aa4a1d749..32dd30e0a5 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/spi/core/security/jaas/LDAPLoginModuleTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/spi/core/security/jaas/LDAPLoginModuleTest.java @@ -50,6 +50,7 @@ import org.apache.directory.server.core.integ.AbstractLdapTestUnit; import org.apache.directory.server.core.integ.FrameworkRunner; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -65,7 +66,7 @@ import static org.junit.Assert.fail; @ApplyLdifFiles("test.ldif") public class LDAPLoginModuleTest extends AbstractLdapTestUnit { - private static final Logger logger = LoggerFactory.getLogger(LDAPLoginModuleTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String PRINCIPAL = "uid=admin,ou=system"; private static final String CREDENTIALS = "secret"; diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java index df9c541962..34a3630a01 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java @@ -154,6 +154,7 @@ import org.apache.activemq.artemis.utils.Wait; import org.apache.activemq.artemis.utils.actors.OrderedExecutorFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -172,9 +173,7 @@ import org.junit.runner.Description; */ public abstract class ActiveMQTestBase extends Assert { - private static final Logger log = LoggerFactory.getLogger(ActiveMQTestBase.class); - - private static final Logger baseLog = LoggerFactory.getLogger(ActiveMQTestBase.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected final Logger instanceLog = LoggerFactory.getLogger(this.getClass()); @@ -182,7 +181,7 @@ public abstract class ActiveMQTestBase extends Assert { Env.setTestEnv(true); } - private static final Logger logger = LoggerFactory.getLogger(ActiveMQTestBase.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** This will make sure threads are not leaking between tests */ @ClassRule @@ -282,12 +281,12 @@ public abstract class ActiveMQTestBase extends Assert { @Override protected void starting(Description description) { testClassName = description.getClassName(); - baseLog.info(String.format("**** start #test %s() ***", description.getMethodName())); + log.info(String.format("**** start #test %s() ***", description.getMethodName())); } @Override protected void finished(Description description) { - baseLog.info(String.format("**** end #test %s() ***", description.getMethodName())); + log.info(String.format("**** end #test %s() ***", description.getMethodName())); } }; @@ -1371,7 +1370,7 @@ public abstract class ActiveMQTestBase extends Assert { } if (!server.isStarted()) { - baseLog.info(threadDump("Server didn't start")); + log.info(threadDump("Server didn't start")); fail("server didn't start: " + server); } @@ -1393,7 +1392,7 @@ public abstract class ActiveMQTestBase extends Assert { } if (server.isStarted()) { - baseLog.info(threadDump("Server didn't start")); + log.info(threadDump("Server didn't start")); fail("Server didn't start: " + server); } } @@ -2062,7 +2061,7 @@ public abstract class ActiveMQTestBase extends Assert { ")" + ")"; - baseLog.error(msg); + log.error(msg); return false; } @@ -2185,7 +2184,7 @@ public abstract class ActiveMQTestBase extends Assert { int invmSize = InVMRegistry.instance.size(); if (invmSize > 0) { InVMRegistry.instance.clear(); - baseLog.info(threadDump("Thread dump")); + log.info(threadDump("Thread dump")); fail("invm registry still had acceptors registered"); } } @@ -2197,14 +2196,14 @@ public abstract class ActiveMQTestBase extends Assert { try { ServerLocatorImpl.clearThreadPools(); } catch (Throwable e) { - baseLog.info(threadDump(e.getMessage())); + log.info(threadDump(e.getMessage())); System.err.println(threadDump(e.getMessage())); } try { NettyConnector.clearThreadPools(); } catch (Exception e) { - baseLog.info(threadDump(e.getMessage())); + log.info(threadDump(e.getMessage())); System.err.println(threadDump(e.getMessage())); } } diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/NoFilesBehind.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/NoFilesBehind.java index 7020564451..d4f610ccee 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/NoFilesBehind.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/NoFilesBehind.java @@ -22,6 +22,7 @@ import java.io.File; import org.apache.activemq.artemis.utils.FileUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.Assert; import org.junit.rules.TestWatcher; import org.junit.runner.Description; @@ -31,7 +32,7 @@ import org.junit.runner.Description; */ public class NoFilesBehind extends TestWatcher { - private static Logger log = LoggerFactory.getLogger(NoFilesBehind.class); + private static Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final String[] filesToCheck; diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/NoProcessFilesBehind.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/NoProcessFilesBehind.java index e0655cdc79..ed6996e10e 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/NoProcessFilesBehind.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/NoProcessFilesBehind.java @@ -31,6 +31,7 @@ import org.apache.activemq.artemis.nativo.jlibaio.LibaioContext; import org.apache.activemq.artemis.utils.Wait; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.Assert; import org.junit.rules.TestWatcher; import org.junit.runner.Description; @@ -40,7 +41,7 @@ import org.junit.runner.Description; */ public class NoProcessFilesBehind extends TestWatcher { - private static Logger log = LoggerFactory.getLogger(NoProcessFilesBehind.class); + private static Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public NoProcessFilesBehind(long maxFiles) { this(-1, maxFiles); diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/uri/AcceptorParserTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/uri/AcceptorParserTest.java index c34c2a5e5e..ca4e274870 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/uri/AcceptorParserTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/uri/AcceptorParserTest.java @@ -27,11 +27,12 @@ import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; import org.apache.activemq.artemis.utils.ConfigurationHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.Assert; import org.junit.Test; public class AcceptorParserTest { - private static final Logger log = LoggerFactory.getLogger(AcceptorParserTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testAcceptor() throws Exception { diff --git a/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/ActiveMQXAResourceRecovery.java b/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/ActiveMQXAResourceRecovery.java index 1205b8ed64..ee7433d6d6 100644 --- a/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/ActiveMQXAResourceRecovery.java +++ b/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/ActiveMQXAResourceRecovery.java @@ -23,6 +23,7 @@ import java.util.Map; import org.apache.activemq.artemis.api.core.TransportConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A XAResourceRecovery instance that can be used to recover any JMS provider. @@ -49,7 +50,7 @@ import org.slf4j.LoggerFactory; * */ public class ActiveMQXAResourceRecovery { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQXAResourceRecovery.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private boolean hasMore; diff --git a/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/ActiveMQXAResourceWrapper.java b/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/ActiveMQXAResourceWrapper.java index 3e49012344..237735d610 100644 --- a/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/ActiveMQXAResourceWrapper.java +++ b/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/ActiveMQXAResourceWrapper.java @@ -31,6 +31,7 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.api.core.client.SessionFailureListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * XAResourceWrapper. @@ -43,7 +44,7 @@ import org.slf4j.LoggerFactory; */ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureListener { - private static final Logger logger = LoggerFactory.getLogger(ActiveMQXAResourceWrapper.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * The state lock diff --git a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/CleanupSystemPropertiesRule.java b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/CleanupSystemPropertiesRule.java index 1d3d1fdbc5..1d6c918269 100644 --- a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/CleanupSystemPropertiesRule.java +++ b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/CleanupSystemPropertiesRule.java @@ -23,6 +23,7 @@ import java.util.Properties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.rules.ExternalResource; /** @@ -30,7 +31,7 @@ import org.junit.rules.ExternalResource; */ public class CleanupSystemPropertiesRule extends ExternalResource { - private static Logger log = LoggerFactory.getLogger(CleanupSystemPropertiesRule.class); + private static Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private Properties originalProperties; diff --git a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/RetryRule.java b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/RetryRule.java index efb5ee042b..233241c422 100644 --- a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/RetryRule.java +++ b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/RetryRule.java @@ -19,6 +19,7 @@ package org.apache.activemq.artemis.utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.internal.AssumptionViolatedException; import org.junit.rules.MethodRule; import org.junit.runners.model.FrameworkMethod; @@ -32,7 +33,7 @@ public class RetryRule implements MethodRule { public static final String PROPERTY_NAME = "org.apache.activemq.artemis.utils.RetryRule.retry"; - private static Logger logger = LoggerFactory.getLogger(RetryRule.class); + private static Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); final int defaultNumberOfRetries; final boolean retrySuccess; diff --git a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/ThreadLeakCheckRule.java b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/ThreadLeakCheckRule.java index 0857dc57a2..afc908ec2a 100644 --- a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/ThreadLeakCheckRule.java +++ b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/ThreadLeakCheckRule.java @@ -28,6 +28,7 @@ import java.util.concurrent.TimeUnit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.Assert; import org.junit.rules.TestWatcher; import org.junit.runner.Description; @@ -37,7 +38,7 @@ import org.junit.runner.Description; */ public class ThreadLeakCheckRule extends TestWatcher { - private static Logger log = LoggerFactory.getLogger(ThreadLeakCheckRule.class); + private static Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static Set knownThreads = new HashSet<>(); diff --git a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/Wait.java b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/Wait.java index 84a02a907d..099f13971e 100644 --- a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/Wait.java +++ b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/Wait.java @@ -24,12 +24,13 @@ import java.util.function.Supplier; import org.junit.Assert; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Utility adapted from: org.apache.activemq.util.Wait */ public class Wait { - private static Logger logger = LoggerFactory.getLogger(Wait.class); + private static Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final long MAX_WAIT_MILLIS = 30 * 1000; public static final int SLEEP_MILLIS = 100; diff --git a/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java b/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java index 8f99b57ec3..00c2724a65 100644 --- a/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java +++ b/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java @@ -54,10 +54,11 @@ import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.webapp.WebAppContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class WebServerComponent implements ExternalComponent, WebServerComponentMarker { - private static final Logger logger = LoggerFactory.getLogger(WebServerComponent.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String DIR_ALLOWED = "org.eclipse.jetty.servlet.Default.dirAllowed"; // this should match the value of in the console war's WEB-INF/web.xml diff --git a/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebTmpCleaner.java b/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebTmpCleaner.java index 89fced57a7..ad00cd1124 100644 --- a/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebTmpCleaner.java +++ b/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebTmpCleaner.java @@ -24,6 +24,7 @@ import java.util.List; import org.apache.activemq.artemis.utils.SpawnedVMSupport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This class is used to remove the jar files @@ -33,7 +34,7 @@ import org.slf4j.LoggerFactory; */ public class WebTmpCleaner { - private static final Logger logger = LoggerFactory.getLogger(WebTmpCleaner.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static void main(String[] filesToClean) throws Exception { //It needs to retry a bit as we are not sure diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/Jmx.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/Jmx.java index 6f6fb20a37..c5568daf7b 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/Jmx.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/Jmx.java @@ -39,11 +39,12 @@ import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder; import org.apache.activemq.artemis.utils.JsonLoader; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class Jmx { - private static final Logger LOGGER = LoggerFactory.getLogger(Jmx.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @FunctionalInterface public interface ThrowableFunction { @@ -108,7 +109,7 @@ public class Jmx { final String backup = nodePair.getString("backup", null); networkTopology.put(nodeID, new Pair<>(live, backup)); } catch (Exception e) { - LOGGER.warn("Error on {}", nodePair, e); + logger.warn("Error on {}", nodePair, e); } } return networkTopology; diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/utils/ExecuteUtil.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/utils/ExecuteUtil.java index fbdd501fca..59a19381be 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/utils/ExecuteUtil.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/utils/ExecuteUtil.java @@ -18,6 +18,7 @@ package org.apache.activemq.artemis.utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import java.io.BufferedReader; import java.io.IOException; @@ -66,7 +67,7 @@ public class ExecuteUtil { } - private static final Logger logger = LoggerFactory.getLogger(ExecuteUtil.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static int runCommand(boolean logOutput, String... command) throws Exception { return runCommand(logOutput, 10, TimeUnit.SECONDS, command); diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpAbstractResource.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpAbstractResource.java index 73288049c7..86384e4a99 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpAbstractResource.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpAbstractResource.java @@ -24,6 +24,7 @@ import org.apache.qpid.proton.engine.Endpoint; import org.apache.qpid.proton.engine.EndpointState; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Abstract base for all AmqpResource implementations to extend. @@ -33,7 +34,7 @@ import org.slf4j.LoggerFactory; */ public abstract class AmqpAbstractResource implements AmqpResource { - private static final Logger LOG = LoggerFactory.getLogger(AmqpAbstractResource.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected AsyncResult openRequest; protected AsyncResult closeRequest; diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpClient.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpClient.java index d35d0ab490..0480e4590f 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpClient.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpClient.java @@ -26,6 +26,7 @@ import org.apache.activemq.transport.netty.NettyTransportFactory; import org.apache.qpid.proton.amqp.Symbol; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Connection instance used to connect to the Broker using Proton as @@ -33,7 +34,7 @@ import org.slf4j.LoggerFactory; */ public class AmqpClient { - private static final Logger LOG = LoggerFactory.getLogger(AmqpClient.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final String username; private final String password; diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpConnection.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpConnection.java index a24b509858..6f53a11e1d 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpConnection.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpConnection.java @@ -54,13 +54,14 @@ import org.apache.qpid.proton.engine.impl.CollectorImpl; import org.apache.qpid.proton.engine.impl.TransportImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import io.netty.buffer.ByteBuf; import io.netty.util.ReferenceCountUtil; public class AmqpConnection extends AmqpAbstractResource implements NettyTransportListener { - private static final Logger LOG = LoggerFactory.getLogger(AmqpConnection.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final NoOpAsyncResult NOOP_REQUEST = new NoOpAsyncResult(); diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpProtocolTracer.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpProtocolTracer.java index 68fcd856d1..5eab9f7a94 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpProtocolTracer.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpProtocolTracer.java @@ -16,6 +16,8 @@ */ package org.apache.activemq.transport.amqp.client; +import java.lang.invoke.MethodHandles; + import org.apache.qpid.proton.amqp.Binary; import org.apache.qpid.proton.amqp.transport.Attach; import org.apache.qpid.proton.amqp.transport.Begin; @@ -37,7 +39,7 @@ import org.slf4j.LoggerFactory; */ public class AmqpProtocolTracer implements ProtocolTracer, FrameBodyHandler { - private static final Logger TRACE_FRAMES = LoggerFactory.getLogger(AmqpProtocolTracer.class.getPackage().getName() + ".FRAMES"); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final AmqpConnection connection; @@ -48,7 +50,7 @@ public class AmqpProtocolTracer implements ProtocolTracer, FrameBodyHandler { - private static final Logger LOG = LoggerFactory.getLogger(AmqpReceiver.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final AtomicBoolean closed = new AtomicBoolean(); private final BlockingQueue prefetch = new LinkedBlockingDeque<>(); diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpSender.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpSender.java index eed7cf2766..9165f6f64f 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpSender.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpSender.java @@ -49,13 +49,14 @@ import org.apache.qpid.proton.engine.Sender; import org.apache.qpid.proton.message.Message; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Sender class that manages a Proton sender endpoint. */ public class AmqpSender extends AmqpAbstractResource { - private static final Logger LOG = LoggerFactory.getLogger(AmqpSender.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final byte[] EMPTY_BYTE_ARRAY = new byte[] {}; public static final long DEFAULT_SEND_TIMEOUT = 15000; diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpTransactionContext.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpTransactionContext.java index a9ef01cb9a..237830293f 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpTransactionContext.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpTransactionContext.java @@ -25,6 +25,7 @@ import org.apache.activemq.transport.amqp.client.util.ClientFuture; import org.apache.activemq.transport.amqp.client.util.ClientFutureSynchronization; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Defines a context under which resources in a given session @@ -32,7 +33,7 @@ import org.slf4j.LoggerFactory; */ public class AmqpTransactionContext { - private static final Logger LOG = LoggerFactory.getLogger(AmqpTransactionContext.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final AmqpSession session; private final Set txReceivers = new LinkedHashSet<>(); diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpTransactionCoordinator.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpTransactionCoordinator.java index ebc964dfee..2b61c81a30 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpTransactionCoordinator.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpTransactionCoordinator.java @@ -46,6 +46,7 @@ import org.apache.qpid.proton.engine.Sender; import org.apache.qpid.proton.message.Message; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Represents the AMQP Transaction coordinator link used by the transaction context @@ -53,7 +54,7 @@ import org.slf4j.LoggerFactory; */ public class AmqpTransactionCoordinator extends AmqpAbstractResource { - private static final Logger LOG = LoggerFactory.getLogger(AmqpTransactionCoordinator.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final byte[] OUTBOUND_BUFFER = new byte[64]; diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/sasl/SaslAuthenticator.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/sasl/SaslAuthenticator.java index 4ac3b7f992..49960ddfae 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/sasl/SaslAuthenticator.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/sasl/SaslAuthenticator.java @@ -24,13 +24,14 @@ import java.util.List; import org.apache.qpid.proton.engine.Sasl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Manage the SASL authentication process */ public class SaslAuthenticator { - private static final Logger LOG = LoggerFactory.getLogger(SaslAuthenticator.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Sasl sasl; private final String username; diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/IdGenerator.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/IdGenerator.java index 7a2017f475..6d0aecf894 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/IdGenerator.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/IdGenerator.java @@ -24,13 +24,14 @@ import java.util.concurrent.atomic.AtomicLong; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Generator for Globally unique Strings. */ public class IdGenerator { - private static final Logger LOG = LoggerFactory.getLogger(IdGenerator.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String UNIQUE_STUB; private static int instanceCount; private static String hostName; diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTcpTransport.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTcpTransport.java index b3701adc81..e467b2f5e4 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTcpTransport.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTcpTransport.java @@ -30,6 +30,7 @@ import io.netty.util.ReferenceCounted; import org.apache.activemq.transport.amqp.client.util.IOExceptionSupport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import io.netty.bootstrap.Bootstrap; import io.netty.buffer.ByteBuf; @@ -56,7 +57,7 @@ import io.netty.util.concurrent.GenericFutureListener; */ public class NettyTcpTransport implements NettyTransport { - private static final Logger LOG = LoggerFactory.getLogger(NettyTcpTransport.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int SHUTDOWN_TIMEOUT = 100; public static final int DEFAULT_MAX_FRAME_SIZE = 65535; diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTransportSupport.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTransportSupport.java index 9e0c2d7840..77c70655da 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTransportSupport.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTransportSupport.java @@ -41,6 +41,7 @@ import javax.net.ssl.X509TrustManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import io.netty.handler.ssl.SslHandler; @@ -49,7 +50,7 @@ import io.netty.handler.ssl.SslHandler; */ public class NettyTransportSupport { - private static final Logger LOG = LoggerFactory.getLogger(NettyTransportSupport.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * Creates a Netty SslHandler instance for use in Transports that require an SSL encoder / diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyWSTransport.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyWSTransport.java index 15efe54f81..6878eb24e1 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyWSTransport.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyWSTransport.java @@ -23,6 +23,7 @@ import java.nio.charset.StandardCharsets; import io.netty.channel.ChannelFuture; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import io.netty.buffer.ByteBuf; import io.netty.channel.Channel; @@ -49,7 +50,7 @@ import io.netty.handler.codec.http.websocketx.WebSocketVersion; */ public class NettyWSTransport extends NettyTcpTransport { - private static final Logger LOG = LoggerFactory.getLogger(NettyWSTransport.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String AMQP_SUB_PROTOCOL = "amqp"; diff --git a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/base/ClasspathBase.java b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/base/ClasspathBase.java index c24cedf82f..705f121e3f 100644 --- a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/base/ClasspathBase.java +++ b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/base/ClasspathBase.java @@ -37,6 +37,7 @@ import org.junit.rules.TestWatcher; import org.junit.runner.Description; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.tests.compatibility.GroovyRun.SNAPSHOT; @@ -44,7 +45,7 @@ import static org.apache.activemq.artemis.tests.compatibility.GroovyRun.SNAPSHOT public class ClasspathBase { - private static final Logger logger = LoggerFactory.getLogger(ClasspathBase.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Logger instanceLog = logger; diff --git a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/base/VersionedBase.java b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/base/VersionedBase.java index 706d8adff4..86da2378c4 100644 --- a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/base/VersionedBase.java +++ b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/base/VersionedBase.java @@ -23,10 +23,11 @@ import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public abstract class VersionedBase extends ClasspathBase { - private static final Logger logger = LoggerFactory.getLogger(VersionedBase.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected final String server; protected final String sender; diff --git a/tests/e2e-tests/src/test/java/org/apache/activemq/artemis/tests/e2e/brokerConnection/DualMirrorFailoverWithContainerTest.java b/tests/e2e-tests/src/test/java/org/apache/activemq/artemis/tests/e2e/brokerConnection/DualMirrorFailoverWithContainerTest.java index 8d8202a610..57bcf6f5ca 100644 --- a/tests/e2e-tests/src/test/java/org/apache/activemq/artemis/tests/e2e/brokerConnection/DualMirrorFailoverWithContainerTest.java +++ b/tests/e2e-tests/src/test/java/org/apache/activemq/artemis/tests/e2e/brokerConnection/DualMirrorFailoverWithContainerTest.java @@ -33,10 +33,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class DualMirrorFailoverWithContainerTest extends E2ETestBase { - private static final Logger logger = LoggerFactory.getLogger(DualMirrorFailoverWithContainerTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); Object network; diff --git a/tests/e2e-tests/src/test/java/org/apache/activemq/artemis/tests/e2e/brokerConnection/QpidDispatchPeerTest.java b/tests/e2e-tests/src/test/java/org/apache/activemq/artemis/tests/e2e/brokerConnection/QpidDispatchPeerTest.java index 057adf91a5..3680c48a06 100644 --- a/tests/e2e-tests/src/test/java/org/apache/activemq/artemis/tests/e2e/brokerConnection/QpidDispatchPeerTest.java +++ b/tests/e2e-tests/src/test/java/org/apache/activemq/artemis/tests/e2e/brokerConnection/QpidDispatchPeerTest.java @@ -34,6 +34,7 @@ import org.junit.BeforeClass; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * You need to build the Artemis Centos image before this test is executed. @@ -41,7 +42,7 @@ import org.slf4j.LoggerFactory; */ public class QpidDispatchPeerTest extends E2ETestBase { - private static final Logger logger = LoggerFactory.getLogger(QpidDispatchPeerTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); static Object network; static Object qpidServer; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/DuplicateDetectionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/DuplicateDetectionTest.java index b2f2509020..94b5d6cce0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/DuplicateDetectionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/DuplicateDetectionTest.java @@ -51,10 +51,13 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; @RunWith(Parameterized.class) public class DuplicateDetectionTest extends ActiveMQTestBase { + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + @Parameterized.Parameters(name = "persistentCache={0}") public static Collection parameters() { return Arrays.asList(new Object[][] { @@ -67,8 +70,6 @@ public class DuplicateDetectionTest extends ActiveMQTestBase { - private final Logger log = LoggerFactory.getLogger(this.getClass()); - private ActiveMQServer server; private final SimpleString propKey = new SimpleString("propkey"); @@ -412,7 +413,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase { Assert.assertEquals(i, message.getObjectProperty(propKey)); } - log.debug("Now sending more"); + logger.debug("Now sending more"); for (int i = 0; i < cacheSize; i++) { SimpleString dupID = new SimpleString("dupID" + i); @@ -807,13 +808,13 @@ public class DuplicateDetectionTest extends ActiveMQTestBase { message = consumer.receiveImmediate(); Assert.assertNull(message); - log.debug("ending session"); + logger.debug("ending session"); session.end(xid3, XAResource.TMSUCCESS); - log.debug("preparing session"); + logger.debug("preparing session"); session.prepare(xid3); - log.debug("committing session"); + logger.debug("committing session"); session.commit(xid3, false); } @@ -878,13 +879,13 @@ public class DuplicateDetectionTest extends ActiveMQTestBase { message = consumer.receiveImmediate(); Assert.assertNull(message); - log.debug("ending session"); + logger.debug("ending session"); session.end(xid3, XAResource.TMSUCCESS); - log.debug("preparing session"); + logger.debug("preparing session"); session.prepare(xid3); - log.debug("committing session"); + logger.debug("committing session"); session.commit(xid3, false); } @@ -948,13 +949,13 @@ public class DuplicateDetectionTest extends ActiveMQTestBase { message = consumer.receiveImmediate(); Assert.assertNull(message); - log.debug("ending session"); + logger.debug("ending session"); session.end(xid3, XAResource.TMSUCCESS); - log.debug("preparing session"); + logger.debug("preparing session"); session.prepare(xid3); - log.debug("committing session"); + logger.debug("committing session"); session.commit(xid3, false); } @@ -1165,13 +1166,13 @@ public class DuplicateDetectionTest extends ActiveMQTestBase { message = consumer.receiveImmediate(); Assert.assertNull(message); - log.debug("ending session"); + logger.debug("ending session"); session.end(xid3, XAResource.TMSUCCESS); - log.debug("preparing session"); + logger.debug("preparing session"); session.prepare(xid3); - log.debug("committing session"); + logger.debug("committing session"); session.commit(xid3, false); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/TwoWaysRemoveAddressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/TwoWaysRemoveAddressTest.java index a7b78f648c..1b12d8b0bd 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/TwoWaysRemoveAddressTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/TwoWaysRemoveAddressTest.java @@ -30,13 +30,14 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This test is simulating a dead lock that may happen while removing addresses. */ public class TwoWaysRemoveAddressTest extends ActiveMQTestBase { - private static Logger logger = LoggerFactory.getLogger(TwoWaysRemoveAddressTest.class); + private static Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test(timeout = 60_000) public void testDeadLock() throws Throwable { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDurableReceiverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDurableReceiverTest.java index ed486c4b51..d57288d590 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDurableReceiverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDurableReceiverTest.java @@ -41,13 +41,14 @@ import org.apache.qpid.proton.engine.Receiver; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Tests for broker side support of the Durable Subscription mapping for JMS. */ public class AmqpDurableReceiverTest extends AmqpClientTestSupport { - private static final Logger LOG = LoggerFactory.getLogger(AmqpDurableReceiverTest.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final String SELECTOR_STRING = "color = red"; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpInboundConnectionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpInboundConnectionTest.java index fef11bff5c..a7e9adb818 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpInboundConnectionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpInboundConnectionTest.java @@ -43,13 +43,14 @@ import org.apache.qpid.proton.engine.Connection; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Tests for behaviors expected of the broker when clients connect to the broker */ public class AmqpInboundConnectionTest extends AmqpClientTestSupport { - private static final Logger LOG = LoggerFactory.getLogger(AmqpInboundConnectionTest.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String BROKER_NAME = "localhost"; private static final String PRODUCT_NAME = "apache-activemq-artemis"; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpLargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpLargeMessageTest.java index a610d87e8f..2976a771b6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpLargeMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpLargeMessageTest.java @@ -73,11 +73,12 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; @RunWith(Parameterized.class) public class AmqpLargeMessageTest extends AmqpClientTestSupport { - protected static final Logger LOG = LoggerFactory.getLogger(AmqpLargeMessageTest.class); + protected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Random rand = new Random(System.currentTimeMillis()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMaxFrameSizeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMaxFrameSizeTest.java index 5931ec8396..518e5b41d0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMaxFrameSizeTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMaxFrameSizeTest.java @@ -38,10 +38,11 @@ import org.apache.qpid.proton.message.impl.MessageImpl; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class AmqpMaxFrameSizeTest extends AmqpClientTestSupport { - protected static final Logger LOG = LoggerFactory.getLogger(AmqpMaxFrameSizeTest.class); + protected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private boolean maxFrameSizeConfigSet = false; private static final int CONFIGURED_FRAME_SIZE = 4321; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessagePriorityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessagePriorityTest.java index 9e824f9ea1..83383bce60 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessagePriorityTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessagePriorityTest.java @@ -29,13 +29,14 @@ import org.apache.activemq.transport.amqp.client.AmqpSession; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Tests for handling of the AMQP message priority header. */ public class AmqpMessagePriorityTest extends AmqpClientTestSupport { - protected static final Logger LOG = LoggerFactory.getLogger(AmqpMessagePriorityTest.class); + protected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test(timeout = 60000) public void testMessageDefaultPriority() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java index b75a293f23..6fadc93627 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java @@ -56,13 +56,14 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Test basic send and receive scenarios using only AMQP sender and receiver links. */ public class AmqpSendReceiveTest extends AmqpClientTestSupport { - protected static final Logger LOG = LoggerFactory.getLogger(AmqpSendReceiveTest.class); + protected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override protected boolean isAutoCreateQueues() { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTempDestinationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTempDestinationTest.java index 0f33b4db68..fda01b07ad 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTempDestinationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTempDestinationTest.java @@ -37,13 +37,14 @@ import org.apache.qpid.proton.amqp.messaging.TerminusExpiryPolicy; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Tests for temporary destination handling over AMQP */ public class AmqpTempDestinationTest extends AmqpClientTestSupport { - protected static final Logger LOG = LoggerFactory.getLogger(AmqpTempDestinationTest.class); + protected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test(timeout = 60000) public void testCreateDynamicSenderToTopic() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTransactionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTransactionTest.java index 42822a120c..1b5a5485a6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTransactionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTransactionTest.java @@ -49,13 +49,14 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Test various aspects of Transaction support. */ public class AmqpTransactionTest extends AmqpClientTestSupport { - private static final Logger LOG = LoggerFactory.getLogger(AmqpTransactionTest.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test(timeout = 30000) public void testBeginAndCommitTransaction() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSClientTestSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSClientTestSupport.java index 33ec6beb31..4f202af0d0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSClientTestSupport.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSClientTestSupport.java @@ -30,10 +30,11 @@ import org.junit.After; import org.junit.Before; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public abstract class JMSClientTestSupport extends AmqpClientTestSupport { - private static final Logger logger = LoggerFactory.getLogger(JMSClientTestSupport.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected LinkedList jmsConnections = new LinkedList<>(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageConsumerTest.java index fab42318c3..4bc6c46b1e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageConsumerTest.java @@ -52,10 +52,11 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class JMSMessageConsumerTest extends JMSClientTestSupport { - protected static final Logger LOG = LoggerFactory.getLogger(JMSMessageConsumerTest.class); + protected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override protected String getConfiguredProtocols() { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageGroupsTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageGroupsTest.java index 76e6f3d21e..e054045883 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageGroupsTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageGroupsTest.java @@ -37,10 +37,11 @@ import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class JMSMessageGroupsTest extends JMSClientTestSupport { - protected static final Logger LOG = LoggerFactory.getLogger(JMSMessageGroupsTest.class); + protected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int ITERATIONS = 10; private static final int MESSAGE_COUNT = 10; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSNonDestructiveTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSNonDestructiveTest.java index 91b2d68f80..d2522a85c7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSNonDestructiveTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSNonDestructiveTest.java @@ -56,11 +56,12 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; @RunWith(Parameterized.class) public class JMSNonDestructiveTest extends JMSClientTestSupport { - private static final Logger logger = LoggerFactory.getLogger(JMSNonDestructiveTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Rule public RetryRule retryRule = new RetryRule(2); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSQueueBrowserTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSQueueBrowserTest.java index 7ab5333e1f..026c3e3590 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSQueueBrowserTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSQueueBrowserTest.java @@ -34,13 +34,14 @@ import org.apache.qpid.jms.policy.JmsDefaultPrefetchPolicy; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Tests for various QueueBrowser scenarios with an AMQP JMS client. */ public class JMSQueueBrowserTest extends JMSClientTestSupport { - protected static final Logger LOG = LoggerFactory.getLogger(JMSQueueBrowserTest.class); + protected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test(timeout = 60000) public void testBrowseAllInQueueZeroPrefetch() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSSaslGssapiTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSSaslGssapiTest.java index 99c4ae8d59..f81c4dd820 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSSaslGssapiTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSSaslGssapiTest.java @@ -74,10 +74,11 @@ import org.junit.BeforeClass; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class JMSSaslGssapiTest extends JMSClientTestSupport { - private static final Logger LOG = LoggerFactory.getLogger(JMSSaslGssapiTest.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); static { String path = System.getProperty("java.security.auth.login.config"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/SaslKrb5LDAPSecurityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/SaslKrb5LDAPSecurityTest.java index c82a15af25..1bc28a70fb 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/SaslKrb5LDAPSecurityTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/SaslKrb5LDAPSecurityTest.java @@ -101,6 +101,7 @@ import org.junit.rules.TemporaryFolder; import org.junit.runner.RunWith; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.tests.util.ActiveMQTestBase.NETTY_ACCEPTOR_FACTORY; @@ -119,7 +120,7 @@ import static org.apache.activemq.artemis.tests.util.ActiveMQTestBase.NETTY_ACCE @CreateKdcServer(transports = {@CreateTransport(protocol = "TCP", port = 0)}) @ApplyLdifFiles("SaslKrb5LDAPSecurityTest.ldif") public class SaslKrb5LDAPSecurityTest extends AbstractLdapTestUnit { - protected static final Logger LOG = LoggerFactory.getLogger(SaslKrb5LDAPSecurityTest.class); + protected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String QUEUE_NAME = "some_queue"; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/BrokerInSyncTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/BrokerInSyncTest.java index 7c41f4ff7f..a447e5ecc5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/BrokerInSyncTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/BrokerInSyncTest.java @@ -61,11 +61,12 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class BrokerInSyncTest extends AmqpClientTestSupport { protected static final int AMQP_PORT_2 = 5673; - private static final Logger logger = LoggerFactory.getLogger(BrokerInSyncTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); ActiveMQServer server_2; @After diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/QpidDispatchPeerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/QpidDispatchPeerTest.java index 0dfd6a3b6e..12e8dd775d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/QpidDispatchPeerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/QpidDispatchPeerTest.java @@ -46,10 +46,11 @@ import org.junit.BeforeClass; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** This test will only be executed if you have qdrouterd available on your system, otherwise is ignored by an assume exception. */ public class QpidDispatchPeerTest extends AmqpClientTestSupport { - private static final Logger logger = LoggerFactory.getLogger(QpidDispatchPeerTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); ExecuteUtil.ProcessHolder qpidProcess; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/ValidateAMQPErrorsTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/ValidateAMQPErrorsTest.java index 2de77ed22c..3287364e83 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/ValidateAMQPErrorsTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/ValidateAMQPErrorsTest.java @@ -69,6 +69,7 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static java.util.EnumSet.of; import static org.apache.qpid.proton.engine.EndpointState.ACTIVE; @@ -79,7 +80,7 @@ import static org.apache.qpid.proton.engine.EndpointState.ACTIVE; public class ValidateAMQPErrorsTest extends AmqpClientTestSupport { protected static final int AMQP_PORT_2 = 5673; - private static final Logger logger = LoggerFactory.getLogger(ValidateAMQPErrorsTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected Vertx vertx; protected MockServer mockServer; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/paging/AmqpMaxReadPagingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/paging/AmqpMaxReadPagingTest.java index 9d5d38a7c8..e79589fd1e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/paging/AmqpMaxReadPagingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/paging/AmqpMaxReadPagingTest.java @@ -36,10 +36,11 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class AmqpMaxReadPagingTest extends AmqpClientTestSupport { - private static final Logger logger = LoggerFactory.getLogger(AmqpMaxReadPagingTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public AmqpMaxReadPagingTest() { } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ActiveMQCrashTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ActiveMQCrashTest.java index 2f32ce5503..91a3a7dd9d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ActiveMQCrashTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ActiveMQCrashTest.java @@ -37,13 +37,14 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * From https://jira.jboss.org/jira/browse/HORNETQ-144 */ public class ActiveMQCrashTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(ActiveMQCrashTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public ActiveMQServer server; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateTest.java index 4f40ec665f..1e81825826 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateTest.java @@ -51,9 +51,10 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class AutoCreateTest extends ActiveMQTestBase { - private static final Logger logger = LoggerFactory.getLogger(AutoCreateTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public final SimpleString addressA = new SimpleString("addressA"); public final SimpleString queueA = new SimpleString("queueA"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerFilterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerFilterTest.java index 04259a3660..a81f893081 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerFilterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerFilterTest.java @@ -31,10 +31,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ConsumerFilterTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(ConsumerFilterTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private ActiveMQServer server; private ClientSession session; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerRoundRobinTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerRoundRobinTest.java index 98fa87e782..a4f3d31576 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerRoundRobinTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerRoundRobinTest.java @@ -30,10 +30,11 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ConsumerRoundRobinTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(ConsumerRoundRobinTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public final SimpleString addressA = new SimpleString("addressA"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FailureDeadlockTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FailureDeadlockTest.java index 98e6af699c..98ee67de42 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FailureDeadlockTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FailureDeadlockTest.java @@ -36,10 +36,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class FailureDeadlockTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(FailureDeadlockTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private ActiveMQServer server; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FlowControlOnIgnoreLargeMessageBodyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FlowControlOnIgnoreLargeMessageBodyTest.java index d9770f985f..08ff299fee 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FlowControlOnIgnoreLargeMessageBodyTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FlowControlOnIgnoreLargeMessageBodyTest.java @@ -33,10 +33,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class FlowControlOnIgnoreLargeMessageBodyTest extends JMSTestBase { - private static final Logger log = LoggerFactory.getLogger(FlowControlOnIgnoreLargeMessageBodyTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private Topic topic; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/IncompatibleVersionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/IncompatibleVersionTest.java index 98608902cd..9875687355 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/IncompatibleVersionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/IncompatibleVersionTest.java @@ -49,12 +49,13 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.tests.util.RandomUtil.randomString; public class IncompatibleVersionTest extends SpawnedTestBase { - private static final Logger log = LoggerFactory.getLogger(IncompatibleVersionTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String WORD_START = "&*STARTED&*"; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InfiniteRedeliveryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InfiniteRedeliveryTest.java index cf2a01011b..b43c1ce774 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InfiniteRedeliveryTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InfiniteRedeliveryTest.java @@ -53,11 +53,12 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; @RunWith(value = Parameterized.class) public class InfiniteRedeliveryTest extends ActiveMQTestBase { - private static final Logger logger = LoggerFactory.getLogger(InfiniteRedeliveryTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Parameterized.Parameters(name = "protocol={0}, useCLI={1}") public static Collection getParameters() { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java index c262cf3274..32f5e840cc 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java @@ -72,12 +72,13 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class InterruptedLargeMessageTest extends LargeMessageTestBase { static final int RECEIVE_WAIT_TIME = 60000; - private static final Logger log = LoggerFactory.getLogger(InterruptedLargeMessageTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final int LARGE_MESSAGE_SIZE = ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE * 3; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java index 25968310ee..19bb563916 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java @@ -72,10 +72,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class LargeMessageTest extends LargeMessageTestBase { - private static final Logger log = LoggerFactory.getLogger(LargeMessageTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int RECEIVE_WAIT_TIME = 10000; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConcurrencyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConcurrencyTest.java index 09879fc40f..d6cccf59dc 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConcurrencyTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConcurrencyTest.java @@ -37,10 +37,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MessageConcurrencyTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(MessageConcurrencyTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private ActiveMQServer server; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingTest.java index 2ecf8ffa95..84f8d8455f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingTest.java @@ -44,10 +44,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MessageGroupingTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(MessageGroupingTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private ActiveMQServer server; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessagePriorityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessagePriorityTest.java index e9ba58fc8b..582eef06fb 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessagePriorityTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessagePriorityTest.java @@ -34,10 +34,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MessagePriorityTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(MessagePriorityTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private ActiveMQServer server; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NIOvsOIOTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NIOvsOIOTest.java index 540be278f4..a890c93588 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NIOvsOIOTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NIOvsOIOTest.java @@ -44,10 +44,11 @@ import org.apache.activemq.artemis.utils.UUIDGenerator; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class NIOvsOIOTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(NIOvsOIOTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testNIOPerf() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionStopStartTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionStopStartTest.java index 300dca0eeb..8ac938209c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionStopStartTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionStopStartTest.java @@ -35,10 +35,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class SessionStopStartTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(SessionStopStartTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private ActiveMQServer server; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SlowConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SlowConsumerTest.java index db3d639c5e..5185a47d47 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SlowConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SlowConsumerTest.java @@ -52,6 +52,7 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.core.settings.impl.SlowConsumerThresholdMeasurementUnit.MESSAGES_PER_DAY; import static org.apache.activemq.artemis.core.settings.impl.SlowConsumerThresholdMeasurementUnit.MESSAGES_PER_MINUTE; @@ -59,7 +60,7 @@ import static org.apache.activemq.artemis.core.settings.impl.SlowConsumerThresho public class SlowConsumerTest extends ActiveMQTestBase { - private static final Logger logger = LoggerFactory.getLogger(SlowConsumerTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private int threshold = 10; private long checkPeriod = 1; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java index ccfd54443c..2b780db0e1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java @@ -56,10 +56,11 @@ import org.apache.activemq.artemis.utils.RandomUtil; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class TemporaryQueueTest extends SingleServerTestBase { - private static final Logger log = LoggerFactory.getLogger(TemporaryQueueTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final long CONNECTION_TTL = 2000; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientCrashTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientCrashTest.java index cadfdafb23..c15c3faf74 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientCrashTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientCrashTest.java @@ -38,6 +38,7 @@ import org.junit.Rule; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A test that makes sure that an ActiveMQ Artemis server cleans up the associated @@ -45,7 +46,7 @@ import org.slf4j.LoggerFactory; */ public class ClientCrashTest extends ClientTestBase { - private static final Logger log = LoggerFactory.getLogger(ClientCrashTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Rule public SpawnedVMCheck spawnedVMCheck = new SpawnedVMCheck(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientExitTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientExitTest.java index 563ae1bb80..0ee405c75f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientExitTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientExitTest.java @@ -29,6 +29,7 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A test that makes sure that an ActiveMQ Artemis client gracefully exists after the last session is @@ -44,7 +45,7 @@ public class ClientExitTest extends ClientTestBase { private static final SimpleString QUEUE = new SimpleString("ClientExitTestQueue"); - private static final Logger log = LoggerFactory.getLogger(ClientExitTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private ClientSession session; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/CrashClient.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/CrashClient.java index b72b724c83..f39dbc6b9c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/CrashClient.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/CrashClient.java @@ -27,13 +27,14 @@ import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactor import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Code to be run in an external VM, via main() */ public class CrashClient { - private static final Logger log = LoggerFactory.getLogger(CrashClient.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static int OK = 9; public static int NOT_OK = 1; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/CrashClient2.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/CrashClient2.java index d71f9371a3..c06fc19633 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/CrashClient2.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/CrashClient2.java @@ -27,13 +27,14 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Code to be run in an external VM, via main() */ public class CrashClient2 { - private static final Logger log = LoggerFactory.getLogger(CrashClient2.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final int OK = 9; public static void main(final String[] args) throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/DummyInterceptor.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/DummyInterceptor.java index c3b0979e7c..9f08de8bd4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/DummyInterceptor.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/DummyInterceptor.java @@ -27,10 +27,11 @@ import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionRec import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class DummyInterceptor implements Interceptor { - private static final Logger log = LoggerFactory.getLogger(DummyInterceptor.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); boolean sendException = false; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/DummyInterceptorB.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/DummyInterceptorB.java index 53831001cf..8d50117c8d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/DummyInterceptorB.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/DummyInterceptorB.java @@ -24,10 +24,11 @@ import org.apache.activemq.artemis.core.protocol.core.Packet; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class DummyInterceptorB implements Interceptor { - private static final Logger log = LoggerFactory.getLogger(DummyInterceptorB.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); static AtomicInteger syncCounter = new AtomicInteger(0); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/GracefulClient.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/GracefulClient.java index 96ecbcf4fd..68ecb0c838 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/GracefulClient.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/GracefulClient.java @@ -28,12 +28,13 @@ import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactor import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Code to be run in an external VM, via main() */ public class GracefulClient { - private static final Logger log = LoggerFactory.getLogger(GracefulClient.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static void main(final String[] args) throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeReconnectTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeReconnectTest.java index 8d563fc9a7..415d06f117 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeReconnectTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeReconnectTest.java @@ -71,6 +71,7 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; @RunWith(Parameterized.class) public class BridgeReconnectTest extends BridgeTestBase { @@ -85,7 +86,7 @@ public class BridgeReconnectTest extends BridgeTestBase { @Parameterized.Parameter(0) public boolean persistCache; - private static final Logger log = LoggerFactory.getLogger(BridgeReconnectTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int NUM_MESSAGES = 100; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java index 15d742639c..3e84ec5fdf 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java @@ -90,11 +90,12 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; @RunWith(value = Parameterized.class) public class BridgeTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(BridgeTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private ActiveMQServer server0; private ActiveMQServer server1; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/AutoDeleteDistributedTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/AutoDeleteDistributedTest.java index 2de920bde4..a1b4e1602d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/AutoDeleteDistributedTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/AutoDeleteDistributedTest.java @@ -38,9 +38,10 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class AutoDeleteDistributedTest extends ClusterTestBase { - private static final Logger log = LoggerFactory.getLogger(AutoDeleteDistributedTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override @Before diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java index 40f0faf0af..fd3506def6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java @@ -98,10 +98,11 @@ import org.junit.Before; import org.junit.ClassRule; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public abstract class ClusterTestBase extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(ClusterTestBase.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int[] PORTS = {TransportConstants.DEFAULT_PORT, TransportConstants.DEFAULT_PORT + 1, TransportConstants.DEFAULT_PORT + 2, TransportConstants.DEFAULT_PORT + 3, TransportConstants.DEFAULT_PORT + 4, TransportConstants.DEFAULT_PORT + 5, TransportConstants.DEFAULT_PORT + 6, TransportConstants.DEFAULT_PORT + 7, TransportConstants.DEFAULT_PORT + 8, TransportConstants.DEFAULT_PORT + 9,}; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusteredGroupingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusteredGroupingTest.java index f3b16c9e69..21f67b16a7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusteredGroupingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusteredGroupingTest.java @@ -54,10 +54,11 @@ import org.junit.Rule; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ClusteredGroupingTest extends ClusterTestBase { - private static final Logger log = LoggerFactory.getLogger(ClusteredGroupingTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Rule public RetryRule retryRule = new RetryRule(2); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/MessageRedistributionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/MessageRedistributionTest.java index 5efd8fd994..b6c1a2edd1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/MessageRedistributionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/MessageRedistributionTest.java @@ -54,10 +54,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MessageRedistributionTest extends ClusterTestBase { - private static final Logger log = LoggerFactory.getLogger(MessageRedistributionTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override @Before diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java index e1b7e7da65..e53269024f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java @@ -23,10 +23,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class OnewayTwoNodeClusterTest extends ClusterTestBase { - private static final Logger log = LoggerFactory.getLogger(OnewayTwoNodeClusterTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override @Before diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java index 6fabc652c3..430ce04029 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java @@ -33,10 +33,11 @@ import org.junit.Ignore; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class SimpleSymmetricClusterTest extends ClusterTestBase { - private static final Logger log = LoggerFactory.getLogger(SimpleSymmetricClusterTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterTest.java index 4b288d8e46..dd4860899e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterTest.java @@ -26,6 +26,7 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A SymmetricClusterTest @@ -34,7 +35,7 @@ import org.slf4j.LoggerFactory; */ public class SymmetricClusterTest extends ClusterTestBase { - private static final Logger log = LoggerFactory.getLogger(SymmetricClusterTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override @Before diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java index 67d9890a06..067f03c89a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java @@ -30,12 +30,13 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import java.util.Map; public class TwoWayTwoNodeClusterTest extends ClusterTestBase { - private static final Logger log = LoggerFactory.getLogger(TwoWayTwoNodeClusterTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override @Before diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/AsynchronousFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/AsynchronousFailoverTest.java index d477136c2a..75186181a7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/AsynchronousFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/AsynchronousFailoverTest.java @@ -45,6 +45,7 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A MultiThreadFailoverTest @@ -53,7 +54,7 @@ import org.slf4j.LoggerFactory; */ public class AsynchronousFailoverTest extends FailoverTestBase { - private static final Logger log = LoggerFactory.getLogger(AsynchronousFailoverTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private volatile CountDownSessionFailureListener listener; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java index b265b72840..3d752e2428 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java @@ -27,13 +27,14 @@ import org.apache.activemq.artemis.tests.integration.cluster.util.TestableServer import org.junit.Before; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public abstract class ClusterWithBackupFailoverTestBase extends ClusterTestBase { protected static final String QUEUE_NAME = "queue0"; protected static final String QUEUES_TESTADDRESS = "queues.testaddress"; - protected static final Logger log = LoggerFactory.getLogger(ClusterWithBackupFailoverTestBase.class); + protected static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected abstract void setupCluster(MessageLoadBalancingType messageLoadBalancingType) throws Exception; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackAutoTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackAutoTest.java index d093f5757d..50dc14585b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackAutoTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackAutoTest.java @@ -41,10 +41,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class FailBackAutoTest extends FailoverTestBase { - private static final Logger log = LoggerFactory.getLogger(FailBackAutoTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int NUM_MESSAGES = 100; private ServerLocatorInternal locator; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverOnFlowControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverOnFlowControlTest.java index bd5b38e86c..f5d80432c3 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverOnFlowControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverOnFlowControlTest.java @@ -37,10 +37,11 @@ import org.apache.activemq.artemis.tests.util.TransportConfigurationUtils; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class FailoverOnFlowControlTest extends FailoverTestBase { - private static final Logger log = LoggerFactory.getLogger(FailoverOnFlowControlTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testOverflowSend() throws Exception { ServerLocator locator = getServerLocator().setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(300).setProducerWindowSize(1000).setRetryInterval(100); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java index 8f0bb16ea0..32c5b4a8ea 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java @@ -91,10 +91,11 @@ import org.junit.Rule; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class FailoverTest extends FailoverTestBase { - private static final Logger log = LoggerFactory.getLogger(FailoverTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Rule public RetryRule retryRule = new RetryRule(2); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java index 23dd22fdf0..9a91257100 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java @@ -49,10 +49,11 @@ import org.apache.activemq.artemis.tests.util.TransportConfigurationUtils; import org.junit.Before; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public abstract class MultipleServerFailoverTestBase extends ActiveMQTestBase { - private static final Logger logger = LoggerFactory.getLogger(MultipleServerFailoverTestBase.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private DistributedPrimitiveManagerConfiguration pluggableQuorumConfiguration = null; private DistributedPrimitiveManagerConfiguration getOrCreatePluggableQuorumConfiguration() { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NetworkIsolationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NetworkIsolationTest.java index 0718d1e677..78fc8b30de 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NetworkIsolationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NetworkIsolationTest.java @@ -33,10 +33,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class NetworkIsolationTest extends FailoverTestBase { - private static final Logger logger = LoggerFactory.getLogger(NetworkIsolationTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); // This address is guaranteed to fail... reserved for documentation https://tools.ietf.org/html/rfc5737 private static final String badAddress = "203.0.113.1"; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PageCleanupWhileReplicaCatchupTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PageCleanupWhileReplicaCatchupTest.java index abe0e71686..953acffa52 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PageCleanupWhileReplicaCatchupTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PageCleanupWhileReplicaCatchupTest.java @@ -42,13 +42,14 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class PageCleanupWhileReplicaCatchupTest extends FailoverTestBase { private static final int NUMBER_OF_WORKERS = 5; private static final int NUMBER_OF_RESTARTS = 5; - private static final Logger logger = LoggerFactory.getLogger(PageCleanupWhileReplicaCatchupTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); volatile boolean running = true; @Override diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/quorum/PluggableQuorumNettyNoGroupNameReplicatedFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/quorum/PluggableQuorumNettyNoGroupNameReplicatedFailoverTest.java index 7171978c7d..d9335e689c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/quorum/PluggableQuorumNettyNoGroupNameReplicatedFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/quorum/PluggableQuorumNettyNoGroupNameReplicatedFailoverTest.java @@ -47,9 +47,10 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class PluggableQuorumNettyNoGroupNameReplicatedFailoverTest extends FailoverTest { - private static final Logger log = LoggerFactory.getLogger(PluggableQuorumReplicatedLargeMessageFailoverTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected void beforeWaitForRemoteBackupSynchronization() { } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/quorum/PluggableQuorumReplicatedLargeMessageFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/quorum/PluggableQuorumReplicatedLargeMessageFailoverTest.java index 6c122300a5..f0a70f9f56 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/quorum/PluggableQuorumReplicatedLargeMessageFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/quorum/PluggableQuorumReplicatedLargeMessageFailoverTest.java @@ -22,12 +22,13 @@ import org.apache.activemq.artemis.tests.integration.cluster.failover.LargeMessa import org.apache.activemq.artemis.tests.integration.cluster.util.TestableServer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.tests.integration.cluster.failover.quorum.PluggableQuorumNettyNoGroupNameReplicatedFailoverTest.doDecrementActivationSequenceForForceRestartOf; public class PluggableQuorumReplicatedLargeMessageFailoverTest extends LargeMessageFailoverTest { - private static final Logger log = LoggerFactory.getLogger(PluggableQuorumReplicatedLargeMessageFailoverTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override protected void createConfigs() throws Exception { createPluggableReplicatedConfigs(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java index 9a14cd9053..762c7774d1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java @@ -43,10 +43,11 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReattachSupportTestBase { - private static final Logger log = LoggerFactory.getLogger(MultiThreadRandomReattachTestBase.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int RECEIVE_TIMEOUT = 30000; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadReattachSupportTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadReattachSupportTestBase.java index 56be4e1647..0817bfe0d5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadReattachSupportTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadReattachSupportTestBase.java @@ -37,10 +37,11 @@ import org.junit.Before; import org.junit.Rule; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public abstract class MultiThreadReattachSupportTestBase extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(MultiThreadReattachSupportTestBase.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Rule public RetryRule retryRule = new RetryRule(2); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java index 880224106c..be65f5d4dc 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java @@ -50,13 +50,14 @@ import org.junit.Rule; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class RandomReattachTest extends ActiveMQTestBase { @Rule public RetryRule retryRule = new RetryRule(2); - private static final Logger log = LoggerFactory.getLogger(RandomReattachTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int RECEIVE_TIMEOUT = 10000; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/Outgoing.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/Outgoing.java index efea6ff178..661d064148 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/Outgoing.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/Outgoing.java @@ -25,10 +25,11 @@ import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionSen import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class Outgoing implements Interceptor { - private static final Logger log = LoggerFactory.getLogger(Outgoing.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override public boolean intercept(final Packet packet, final RemotingConnection connection) throws ActiveMQException { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java index ae03507b7f..6b27f2ceba 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java @@ -34,13 +34,14 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A FloodServerTest */ public class FloodServerTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(FloodServerTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private ActiveMQServer server; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ConnectionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ConnectionTest.java index 2fb2aafb74..f781ab8037 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ConnectionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ConnectionTest.java @@ -45,10 +45,11 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ConnectionTest extends JMSTestBase { - private static final Logger log = LoggerFactory.getLogger(ConnectionTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private Connection conn2; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java index 2d6d6382c7..adb67ebfdf 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java @@ -75,6 +75,7 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A JMSFailoverTest @@ -84,7 +85,7 @@ import org.slf4j.LoggerFactory; */ public class JMSFailoverTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(JMSFailoverTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AsyncOpenCloseTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AsyncOpenCloseTest.java index ad0e4a6159..ecbac3d43a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AsyncOpenCloseTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AsyncOpenCloseTest.java @@ -39,10 +39,11 @@ import org.junit.Assume; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class AsyncOpenCloseTest extends ActiveMQTestBase { - private static final Logger logger = LoggerFactory.getLogger(AsyncOpenCloseTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testCloseOnSubmit() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalCompactTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalCompactTest.java index ef3ade6659..b3c12cc755 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalCompactTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalCompactTest.java @@ -65,10 +65,11 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class NIOJournalCompactTest extends JournalImplTestBase { - private static final Logger logger = LoggerFactory.getLogger(NIOJournalCompactTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int NUMBER_OF_RECORDS = 100; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java index d794bf48fd..143c8d4968 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java @@ -37,13 +37,14 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This test spawns a remote VM, as we want to "crash" the VM right after the journal is filled with data */ public class ValidateTransactionHealthTest extends SpawnedTestBase { - private static final Logger log = LoggerFactory.getLogger(ValidateTransactionHealthTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int OK = 10; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java index 776d0f1039..247a3158f0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java @@ -54,12 +54,13 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; @RunWith(Parameterized.class) public abstract class LargeMessageTestBase extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(LargeMessageTestBase.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected final SimpleString ADDRESS = new SimpleString("SimpleAddress"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java index 712055e5c6..62e888e7df 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java @@ -115,11 +115,12 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; @RunWith(Parameterized.class) public class ActiveMQServerControlTest extends ManagementTestBase { - private static final Logger log = LoggerFactory.getLogger(ActiveMQServerControlTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Rule public RetryRule retryRule = new RetryRule(0); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementHelperTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementHelperTest.java index 62b1495949..f93f83feda 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementHelperTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementHelperTest.java @@ -28,10 +28,11 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ManagementHelperTest extends Assert { - private static final Logger log = LoggerFactory.getLogger(ManagementHelperTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testArrayOfStringParameter() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTFQQNTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTFQQNTest.java index 39c06bc526..0ed16e0953 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTFQQNTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTFQQNTest.java @@ -25,10 +25,11 @@ import org.apache.activemq.artemis.core.server.QueueQueryResult; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MQTTFQQNTest extends MQTTTestSupport { - private static final Logger LOG = LoggerFactory.getLogger(MQTTFQQNTest.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testMQTTSubNames() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTQueueCleanTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTQueueCleanTest.java index 355315bece..602368407c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTQueueCleanTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTQueueCleanTest.java @@ -25,6 +25,7 @@ import org.apache.activemq.artemis.tests.util.Wait; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import java.util.HashSet; import java.util.Random; @@ -32,7 +33,7 @@ import java.util.Set; public class MQTTQueueCleanTest extends MQTTTestSupport { - private static final Logger LOG = LoggerFactory.getLogger(MQTTQueueCleanTest.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testQueueClean() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTSessionExpiryIntervalTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTSessionExpiryIntervalTest.java index eb8987dcdc..285ac137fd 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTSessionExpiryIntervalTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTSessionExpiryIntervalTest.java @@ -24,10 +24,11 @@ import org.fusesource.mqtt.client.Topic; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MQTTSessionExpiryIntervalTest extends MQTTTestSupport { - private static final Logger log = LoggerFactory.getLogger(MQTTSessionExpiryIntervalTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test(timeout = 60 * 1000) public void testCustomSessionExpiryInterval() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTTest.java index 5aa35bd775..e191d468be 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTTest.java @@ -70,6 +70,7 @@ import org.junit.Ignore; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.utils.collections.IterableStream.iterableOf; @@ -78,7 +79,7 @@ import static org.apache.activemq.artemis.utils.collections.IterableStream.itera */ public class MQTTTest extends MQTTTestSupport { - private static final Logger log = LoggerFactory.getLogger(MQTTTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String AMQP_URI = "tcp://localhost:61616"; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTTestSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTTestSupport.java index 73e846a037..347db4a6ee 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTTestSupport.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/MQTTTestSupport.java @@ -68,12 +68,13 @@ import org.junit.Rule; import org.junit.rules.TestName; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static java.util.Collections.singletonList; public class MQTTTestSupport extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(MQTTTestSupport.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected ActiveMQServer server; static { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/PahoMQTTTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/PahoMQTTTest.java index c5ef33f934..5486bfd78a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/PahoMQTTTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/PahoMQTTTest.java @@ -38,11 +38,12 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; @RunWith(Parameterized.class) public class PahoMQTTTest extends MQTTTestSupport { - private static final Logger log = LoggerFactory.getLogger(PahoMQTTTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Parameterized.Parameters(name = "protocol={0}") public static Collection getParams() { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTT5Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTT5Test.java index 06946cf93f..1171e17f7a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTT5Test.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTT5Test.java @@ -48,13 +48,14 @@ import org.junit.Assume; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /* * General tests for things not covered directly in the specification. */ public class MQTT5Test extends MQTT5TestSupport { - private static final Logger log = LoggerFactory.getLogger(MQTT5Test.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public MQTT5Test(String protocol) { super(protocol); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTT5TestSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTT5TestSupport.java index f17d025c4e..11879f5d5a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTT5TestSupport.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/MQTT5TestSupport.java @@ -75,6 +75,7 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static java.util.Collections.singletonList; import static org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolManagerFactory.MQTT_PROTOCOL_NAME; @@ -110,7 +111,7 @@ public class MQTT5TestSupport extends ActiveMQTestBase { return new MqttAsyncClient(protocol + "://localhost:" + (isUseSsl() ? getSslPort() : getPort()), clientId, new MemoryPersistence()); } - private static final Logger log = LoggerFactory.getLogger(MQTT5TestSupport.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected static final long DEFAULT_TIMEOUT = 300000; protected ActiveMQServer server; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnectTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnectTests.java index 722276aeb3..8d159b0be2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnectTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnectTests.java @@ -47,6 +47,7 @@ import org.junit.Assume; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Fulfilled by client or Netty codec (i.e. not tested here): @@ -102,7 +103,7 @@ import org.slf4j.LoggerFactory; */ public class ConnectTests extends MQTT5TestSupport { - private static final Logger log = LoggerFactory.getLogger(ConnectTests.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public ConnectTests(String protocol) { super(protocol); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PublishTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PublishTests.java index 68e98ad2be..8625086722 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PublishTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PublishTests.java @@ -49,6 +49,7 @@ import org.junit.Ignore; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Fulfilled by client or Netty codec (i.e. not tested here): @@ -77,7 +78,7 @@ import org.slf4j.LoggerFactory; public class PublishTests extends MQTT5TestSupport { - private static final Logger log = LoggerFactory.getLogger(PublishTests.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public PublishTests(String protocol) { super(protocol); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/CompactingOpenWireTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/CompactingOpenWireTest.java index dbc7d91b0b..f9f3fdb2fe 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/CompactingOpenWireTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/CompactingOpenWireTest.java @@ -42,10 +42,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class CompactingOpenWireTest extends BasicOpenWireTest { - private static final Logger logger = LoggerFactory.getLogger(CompactingOpenWireTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override @Before diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/MaxMessagesPagingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/MaxMessagesPagingTest.java index b75996bcba..322c51b72b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/MaxMessagesPagingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/MaxMessagesPagingTest.java @@ -54,10 +54,11 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MaxMessagesPagingTest extends ActiveMQTestBase { - private static final Logger logger = LoggerFactory.getLogger(MaxMessagesPagingTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected static final int PAGE_MAX = 100 * 1024; protected static final int PAGE_SIZE = 10 * 1024; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/MessagesExpiredPagingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/MessagesExpiredPagingTest.java index 40d36d25a1..3a23b16f41 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/MessagesExpiredPagingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/MessagesExpiredPagingTest.java @@ -45,10 +45,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MessagesExpiredPagingTest extends ActiveMQTestBase { - private static final Logger logger = LoggerFactory.getLogger(MessagesExpiredPagingTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String ADDRESS = "MessagesExpiredPagingTest"; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java index 3af665a61b..b32f5587f3 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java @@ -127,11 +127,12 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; @RunWith(Parameterized.class) public class PagingTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(PagingTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Rule public RetryRule retryMethod = new RetryRule(1); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/XmlImportExportTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/XmlImportExportTest.java index 0aef8ae2b2..17dc90e400 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/XmlImportExportTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/XmlImportExportTest.java @@ -64,6 +64,7 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A test of the XML export/import functionality @@ -71,7 +72,7 @@ import org.slf4j.LoggerFactory; @RunWith(value = Parameterized.class) public class XmlImportExportTest extends ActiveMQTestBase { - private static final Logger logger = LoggerFactory.getLogger(XmlImportExportTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private boolean forceLongs; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/metrics/AbstractPersistentStatTestSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/metrics/AbstractPersistentStatTestSupport.java index 2247111fe2..ce49761ae8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/metrics/AbstractPersistentStatTestSupport.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/metrics/AbstractPersistentStatTestSupport.java @@ -41,6 +41,7 @@ import org.apache.activemq.artemis.jms.client.ActiveMQMessage; import org.apache.activemq.artemis.tests.util.JMSTestBase; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * @@ -48,7 +49,7 @@ import org.slf4j.LoggerFactory; */ public abstract class AbstractPersistentStatTestSupport extends JMSTestBase { - protected static final Logger LOG = LoggerFactory.getLogger(AbstractPersistentStatTestSupport.class); + protected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected static int defaultMessageSize = 1000; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/metrics/JournalPendingMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/metrics/JournalPendingMessageTest.java index 3ef0cc30e3..dbbbf05615 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/metrics/JournalPendingMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/metrics/JournalPendingMessageTest.java @@ -47,10 +47,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class JournalPendingMessageTest extends AbstractPersistentStatTestSupport { - protected static final Logger LOG = LoggerFactory.getLogger(JournalPendingMessageTest.class); + protected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); // protected URI brokerConnectURI; protected String defaultQueueName = "test.queue"; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/AmqpPluginTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/AmqpPluginTest.java index 56bae067d0..a79ee20e7a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/AmqpPluginTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/AmqpPluginTest.java @@ -66,13 +66,14 @@ import org.apache.activemq.transport.amqp.client.AmqpSession; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Test basic send and receive scenarios using only AMQP sender and receiver links. */ public class AmqpPluginTest extends AmqpClientTestSupport { - protected static final Logger LOG = LoggerFactory.getLogger(AmqpPluginTest.class); + protected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Map methodCalls = new ConcurrentHashMap<>(); private final MethodCalledVerifier verifier = new MethodCalledVerifier(methodCalls); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/ResourceBrokerPluginTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/ResourceBrokerPluginTest.java index 47f65dae29..8172287cad 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/ResourceBrokerPluginTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/ResourceBrokerPluginTest.java @@ -45,9 +45,10 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ResourceBrokerPluginTest extends ActiveMQTestBase { - private static final Logger logger = LoggerFactory.getLogger(ResourceBrokerPluginTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Map addressSettings = new HashMap<>(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/SharedNothingReplicationFlowControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/SharedNothingReplicationFlowControlTest.java index 148003d1aa..ea91a90d26 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/SharedNothingReplicationFlowControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/SharedNothingReplicationFlowControlTest.java @@ -87,6 +87,7 @@ import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class SharedNothingReplicationFlowControlTest extends ActiveMQTestBase { @@ -102,7 +103,7 @@ public class SharedNothingReplicationFlowControlTest extends ActiveMQTestBase { sendMessageExecutor.shutdownNow(); } - private static final Logger logger = LoggerFactory.getLogger(SharedNothingReplicationFlowControlTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Rule public TemporaryFolder brokersFolder = new TemporaryFolder(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/SharedNothingReplicationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/SharedNothingReplicationTest.java index 9153fc8752..14bacaa746 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/SharedNothingReplicationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/SharedNothingReplicationTest.java @@ -58,6 +58,7 @@ import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import java.io.File; import java.util.ArrayList; @@ -70,7 +71,7 @@ import java.util.concurrent.atomic.AtomicInteger; public class SharedNothingReplicationTest extends ActiveMQTestBase { - private static final Logger logger = LoggerFactory.getLogger(SharedNothingReplicationTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Rule public TemporaryFolder brokersFolder = new TemporaryFolder(); @@ -307,7 +308,7 @@ public class SharedNothingReplicationTest extends ActiveMQTestBase { boolean used = false; - private static final Logger logger = LoggerFactory.getLogger(SlowMessagePersister.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); static SlowMessagePersister theInstance; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/MultipliedDelayedMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/MultipliedDelayedMessageTest.java index fec21f8665..b40e12355b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/MultipliedDelayedMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/MultipliedDelayedMessageTest.java @@ -32,10 +32,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MultipliedDelayedMessageTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(MultipliedDelayedMessageTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private ActiveMQServer server; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AddressQueueDeleteDelayTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AddressQueueDeleteDelayTest.java index 07fc6b8d41..6afcf8c565 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AddressQueueDeleteDelayTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AddressQueueDeleteDelayTest.java @@ -36,10 +36,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class AddressQueueDeleteDelayTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(AddressQueueDeleteDelayTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final int DURATION_MILLIS = 30_000; public static final int NEGATIVE_DURATION_MILLIS = 1_000; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java index 1634eb374a..af3e4869b4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java @@ -40,10 +40,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ScaleDown3NodeTest extends ClusterTestBase { - private static final Logger log = LoggerFactory.getLogger(ScaleDown3NodeTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override @Before diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java index 497e29f8f6..b10b86249d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java @@ -77,13 +77,14 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.utils.collections.IterableStream.iterableOf; @RunWith(Parameterized.class) public class StompTest extends StompTestBase { - private static final Logger log = LoggerFactory.getLogger(StompTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected StompClientConnection conn; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java index e149b46a91..86c45253f8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java @@ -62,11 +62,12 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; @RunWith(Parameterized.class) public abstract class StompTestBase extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(StompTestBase.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Parameterized.Parameter public String scheme; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/util/StompClientConnectionV10.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/util/StompClientConnectionV10.java index 60f76f3b80..aa19d5da23 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/util/StompClientConnectionV10.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/util/StompClientConnectionV10.java @@ -22,10 +22,11 @@ import java.net.URI; import org.apache.activemq.artemis.core.protocol.stomp.Stomp; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class StompClientConnectionV10 extends AbstractStompClientConnection { - private static final Logger log = LoggerFactory.getLogger(StompClientConnectionV10.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public StompClientConnectionV10(String host, int port) throws IOException { super("1.0", host, port); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java index ce545ff3bc..4492603ac3 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java @@ -54,6 +54,7 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Testing Stomp version 1.2 functionalities @@ -61,7 +62,7 @@ import org.slf4j.LoggerFactory; @RunWith(Parameterized.class) public class StompV12Test extends StompTestBase { - private static final Logger log = LoggerFactory.getLogger(StompV12Test.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String CLIENT_ID = "myclientid"; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaRecoveryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaRecoveryTest.java index 5bf9751690..02c0ea60c8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaRecoveryTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaRecoveryTest.java @@ -52,11 +52,12 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; @RunWith(Parameterized.class) public class BasicXaRecoveryTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(BasicXaRecoveryTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Map addressSettings = new HashMap<>(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaTest.java index 230152442a..2ceb3e75ce 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaTest.java @@ -55,11 +55,12 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; @RunWith(Parameterized.class) public class BasicXaTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(BasicXaTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Map addressSettings = new HashMap<>(); diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/AcknowledgementTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/AcknowledgementTest.java index afa17fe0bc..9c396a5842 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/AcknowledgementTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/AcknowledgementTest.java @@ -39,12 +39,13 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static java.util.concurrent.TimeUnit.MILLISECONDS; public class AcknowledgementTest extends JMSTestCase { - private static final Logger logger = LoggerFactory.getLogger(AcknowledgementTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * Topics shouldn't hold on to messages if there are no subscribers diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ActiveMQServerTestCase.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ActiveMQServerTestCase.java index 8f72e5a1ff..49be1b7fe0 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ActiveMQServerTestCase.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ActiveMQServerTestCase.java @@ -55,6 +55,7 @@ import org.junit.rules.TestWatcher; import org.junit.runner.Description; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * @deprecated this infrastructure should not be used for new code. New tests should go into @@ -62,7 +63,7 @@ import org.slf4j.LoggerFactory; */ @Deprecated public abstract class ActiveMQServerTestCase { - private final Logger logger = LoggerFactory.getLogger(ActiveMQServerTestCase.class); + private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final int MAX_TIMEOUT = 1000 * 10 /* seconds */; diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/AutoAckMessageListenerTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/AutoAckMessageListenerTest.java index ab846b6643..e71dee0645 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/AutoAckMessageListenerTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/AutoAckMessageListenerTest.java @@ -29,10 +29,11 @@ import java.util.concurrent.TimeUnit; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class AutoAckMessageListenerTest extends JMSTestCase { - private static final Logger logger = LoggerFactory.getLogger(AutoAckMessageListenerTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConnectionClosedTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConnectionClosedTest.java index 2ba1d0fc7c..244466ba85 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConnectionClosedTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConnectionClosedTest.java @@ -32,13 +32,14 @@ import org.apache.activemq.artemis.jms.tests.util.ProxyAssertSupport; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * All tests related to closing a Connection. */ public class ConnectionClosedTest extends JMSTestCase { - private static final Logger logger = LoggerFactory.getLogger(ConnectionClosedTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConnectionFactoryTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConnectionFactoryTest.java index 2463422dec..18240764d0 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConnectionFactoryTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConnectionFactoryTest.java @@ -46,10 +46,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ConnectionFactoryTest extends JMSTestCase { - private static final Logger logger = LoggerFactory.getLogger(ConnectionFactoryTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final Random random = new Random(); private String testClientId; diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConnectionTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConnectionTest.java index c05888cf33..18ef8c1f44 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConnectionTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConnectionTest.java @@ -31,6 +31,7 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Connection tests. Contains all connection tests, except tests relating to closing a connection, @@ -38,7 +39,7 @@ import org.slf4j.LoggerFactory; */ public class ConnectionTest extends JMSTestCase { - private static final Logger logger = LoggerFactory.getLogger(ConnectionTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConsumerClosedTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConsumerClosedTest.java index dcd8ad2559..b2212b0427 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConsumerClosedTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConsumerClosedTest.java @@ -25,10 +25,11 @@ import javax.naming.InitialContext; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ConsumerClosedTest extends JMSTestCase { - private static final Logger logger = LoggerFactory.getLogger(ConsumerClosedTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final int NUMBER_OF_MESSAGES = 10; diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/JMSTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/JMSTest.java index 255dbe933a..2c9b491e5b 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/JMSTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/JMSTest.java @@ -33,6 +33,7 @@ import org.junit.After; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static java.util.concurrent.TimeUnit.MILLISECONDS; @@ -41,7 +42,7 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS; */ public class JMSTest extends JMSTestCase { - private static final Logger logger = LoggerFactory.getLogger(JMSTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); Connection conn = null; diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageConsumerTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageConsumerTest.java index 5dfd2f8fd8..17b80316a1 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageConsumerTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageConsumerTest.java @@ -52,10 +52,11 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MessageConsumerTest extends JMSTestCase { - private static final Logger logger = LoggerFactory.getLogger(MessageConsumerTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageProducerTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageProducerTest.java index d4ee0ad680..05109680aa 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageProducerTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageProducerTest.java @@ -46,13 +46,14 @@ import org.apache.activemq.artemis.jms.tests.util.ProxyAssertSupport; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; public class MessageProducerTest extends JMSTestCase { - private static final Logger logger = LoggerFactory.getLogger(MessageProducerTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testSendForeignWithForeignDestinationSet() throws Exception { diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/PersistenceTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/PersistenceTest.java index 5a5dd1d6b6..9591130ded 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/PersistenceTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/PersistenceTest.java @@ -27,10 +27,11 @@ import org.apache.activemq.artemis.jms.tests.util.ProxyAssertSupport; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class PersistenceTest extends JMSTestCase { - private static final Logger logger = LoggerFactory.getLogger(PersistenceTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * Test that the messages in a persistent queue survive starting and stopping and server, diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/TemporaryDestinationTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/TemporaryDestinationTest.java index 6e06ac9156..27350d5bd1 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/TemporaryDestinationTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/TemporaryDestinationTest.java @@ -31,10 +31,11 @@ import org.apache.activemq.artemis.jms.tests.util.ProxyAssertSupport; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class TemporaryDestinationTest extends JMSTestCase { - private static final Logger logger = LoggerFactory.getLogger(TemporaryDestinationTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/TransactedSessionTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/TransactedSessionTest.java index fba03f93a9..e89e9c5d34 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/TransactedSessionTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/TransactedSessionTest.java @@ -34,10 +34,11 @@ import org.junit.Ignore; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class TransactedSessionTest extends JMSTestCase { - private static final Logger logger = LoggerFactory.getLogger(TransactedSessionTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testSimpleRollback() throws Exception { diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/JMSExpirationHeaderTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/JMSExpirationHeaderTest.java index d5205a7c57..9e60068ed6 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/JMSExpirationHeaderTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/JMSExpirationHeaderTest.java @@ -29,10 +29,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class JMSExpirationHeaderTest extends MessageHeaderTestBase { - private static final Logger logger = LoggerFactory.getLogger(JMSExpirationHeaderTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private volatile boolean testFailed; diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/MessageBodyTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/MessageBodyTest.java index 544cd5e4cb..02ba6e9ff1 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/MessageBodyTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/MessageBodyTest.java @@ -34,10 +34,11 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MessageBodyTest extends MessageBodyTestCase { - private static final Logger logger = LoggerFactory.getLogger(MessageBodyTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testSMBodyReadable() throws Exception { diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/MessageHeaderTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/MessageHeaderTest.java index c0e447d191..b4ca0283c2 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/MessageHeaderTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/MessageHeaderTest.java @@ -63,10 +63,11 @@ import org.apache.activemq.artemis.jms.tests.util.ProxyAssertSupport; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MessageHeaderTest extends MessageHeaderTestBase { - private static final Logger logger = LoggerFactory.getLogger(MessageHeaderTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testClearMessage() throws Exception { diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/MessageTestBase.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/MessageTestBase.java index af1158b339..6faff36fe0 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/MessageTestBase.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/MessageTestBase.java @@ -31,10 +31,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public abstract class MessageTestBase extends ActiveMQServerTestCase { - private static final Logger logger = LoggerFactory.getLogger(MessageTestBase.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected Message message; diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignBytesMessageTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignBytesMessageTest.java index faab4fdfae..45f3591bc3 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignBytesMessageTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignBytesMessageTest.java @@ -24,13 +24,14 @@ import org.apache.activemq.artemis.jms.tests.message.SimpleJMSBytesMessage; import org.apache.activemq.artemis.jms.tests.util.ProxyAssertSupport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Tests the delivery/receipt of a foreign byte message */ public class ForeignBytesMessageTest extends ForeignMessageTest { - private static final Logger logger = LoggerFactory.getLogger(ForeignBytesMessageTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override protected Message createForeignMessage() throws Exception { diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignMapMessageTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignMapMessageTest.java index 4c3c446970..447af21511 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignMapMessageTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignMapMessageTest.java @@ -24,13 +24,14 @@ import org.apache.activemq.artemis.jms.tests.message.SimpleJMSMapMessage; import org.apache.activemq.artemis.jms.tests.util.ProxyAssertSupport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Tests the delivery/receipt of a foreign map message */ public class ForeignMapMessageTest extends ForeignMessageTest { - private static final Logger logger = LoggerFactory.getLogger(ForeignMapMessageTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final String obj = new String("stringobject"); diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignMessageTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignMessageTest.java index 9e57a29d91..5d02e64037 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignMessageTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignMessageTest.java @@ -30,13 +30,14 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Tests the delivery/receipt of a foreign message */ public class ForeignMessageTest extends MessageTestBase { - private static final Logger logger = LoggerFactory.getLogger(ForeignMessageTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override @Before diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignObjectMessageTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignObjectMessageTest.java index 258c9706ae..74ee0abcc8 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignObjectMessageTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignObjectMessageTest.java @@ -26,13 +26,14 @@ import org.junit.After; import org.junit.Before; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Tests the delivery/receipt of a foreign object message */ public class ForeignObjectMessageTest extends ForeignMessageTest { - private static final Logger logger = LoggerFactory.getLogger(ForeignObjectMessageTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private ForeignTestObject testObj; diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignStreamMessageTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignStreamMessageTest.java index 65ce470353..16f34210ad 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignStreamMessageTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignStreamMessageTest.java @@ -24,13 +24,14 @@ import org.apache.activemq.artemis.jms.tests.message.SimpleJMSStreamMessage; import org.apache.activemq.artemis.jms.tests.util.ProxyAssertSupport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Tests the delivery/receipt of a foreign stream message */ public class ForeignStreamMessageTest extends ForeignMessageTest { - private static final Logger logger = LoggerFactory.getLogger(ForeignStreamMessageTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override protected Message createForeignMessage() throws Exception { diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/selector/SelectorTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/selector/SelectorTest.java index b543d30d55..95717491d1 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/selector/SelectorTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/selector/SelectorTest.java @@ -37,13 +37,14 @@ import org.junit.Ignore; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; public class SelectorTest extends ActiveMQServerTestCase { - private static final Logger logger = LoggerFactory.getLogger(SelectorTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** * Test case for http://jira.jboss.org/jira/browse/JBMESSAGING-105 diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/ServerManagement.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/ServerManagement.java index fc8ec91bc8..4cb804c2a4 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/ServerManagement.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/ServerManagement.java @@ -25,6 +25,7 @@ import org.apache.activemq.artemis.jms.tests.tools.container.LocalTestServer; import org.apache.activemq.artemis.jms.tests.tools.container.Server; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Collection of static methods to use to start/stop and interact with the in-memory JMS server. It @@ -32,7 +33,7 @@ import org.slf4j.LoggerFactory; */ public class ServerManagement { - private static final Logger logger = LoggerFactory.getLogger(ServerManagement.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); // logging levels used by the remote client to forward log output on a remote server diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/InVMContext.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/InVMContext.java index 1ff08fa2b5..c3f17aa9e9 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/InVMContext.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/InVMContext.java @@ -38,10 +38,11 @@ import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class InVMContext implements Context, Serializable { - private static final Logger logger = LoggerFactory.getLogger(InVMContext.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final long serialVersionUID = 385743957345L; diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/InVMInitialContextFactoryBuilder.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/InVMInitialContextFactoryBuilder.java index 7ad512a488..5f60ba8d27 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/InVMInitialContextFactoryBuilder.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/InVMInitialContextFactoryBuilder.java @@ -23,10 +23,11 @@ import java.util.Hashtable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class InVMInitialContextFactoryBuilder implements InitialContextFactoryBuilder { - private static final Logger logger = LoggerFactory.getLogger(InVMInitialContextFactoryBuilder.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/LocalTestServer.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/LocalTestServer.java index c67a915d13..6cae9e8037 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/LocalTestServer.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/LocalTestServer.java @@ -50,10 +50,11 @@ import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager import org.apache.activemq.artemis.spi.core.security.jaas.InVMLoginModule; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class LocalTestServer implements Server, Runnable { - private static final Logger logger = LoggerFactory.getLogger(LocalTestServer.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private boolean started = false; diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/util/JNDIUtilTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/util/JNDIUtilTest.java index ccaf259554..19add95daf 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/util/JNDIUtilTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/util/JNDIUtilTest.java @@ -25,10 +25,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class JNDIUtilTest extends ActiveMQServerTestCase { - private static final Logger logger = LoggerFactory.getLogger(JNDIUtilTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private InitialContext ic; diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/util/ProxyAssertSupport.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/util/ProxyAssertSupport.java index 80948a3aa0..134669d4e5 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/util/ProxyAssertSupport.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/util/ProxyAssertSupport.java @@ -18,6 +18,7 @@ package org.apache.activemq.artemis.jms.tests.util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.Assert; /** @@ -25,7 +26,7 @@ import org.junit.Assert; */ public class ProxyAssertSupport { - private static final Logger logger = LoggerFactory.getLogger(ProxyAssertSupport.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static void assertTrue(final java.lang.String string, final boolean b) { try { diff --git a/tests/joram-tests/src/test/java/org/apache/activemq/artemis/common/testjndi/TestContext.java b/tests/joram-tests/src/test/java/org/apache/activemq/artemis/common/testjndi/TestContext.java index 9d8cb577e5..f28679f899 100644 --- a/tests/joram-tests/src/test/java/org/apache/activemq/artemis/common/testjndi/TestContext.java +++ b/tests/joram-tests/src/test/java/org/apache/activemq/artemis/common/testjndi/TestContext.java @@ -40,6 +40,7 @@ import java.util.Map; import org.apache.activemq.artemis.jndi.NameParserImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A read-only Context @@ -64,7 +65,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings("unchecked") public class TestContext implements Context, Serializable { - private static final Logger logger = LoggerFactory.getLogger(TestContext.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String SEPARATOR = "/"; protected static final NameParser NAME_PARSER = new NameParserImpl(); diff --git a/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/journal/JournalImplTestUnit.java b/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/journal/JournalImplTestUnit.java index 549eec88c8..998567da88 100644 --- a/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/journal/JournalImplTestUnit.java +++ b/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/journal/JournalImplTestUnit.java @@ -30,10 +30,11 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public abstract class JournalImplTestUnit extends JournalImplTestBase { - private static final Logger log = LoggerFactory.getLogger(JournalImplTestBase.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override @After diff --git a/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/journal/RealJournalImplAIOTest.java b/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/journal/RealJournalImplAIOTest.java index 5567a165d4..95f48b77ac 100644 --- a/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/journal/RealJournalImplAIOTest.java +++ b/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/journal/RealJournalImplAIOTest.java @@ -24,10 +24,11 @@ import org.junit.Before; import org.junit.BeforeClass; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class RealJournalImplAIOTest extends JournalImplTestUnit { - private static final Logger log = LoggerFactory.getLogger(RealJournalImplAIOTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @BeforeClass public static void hasAIO() { diff --git a/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/journal/RealJournalImplNIOTest.java b/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/journal/RealJournalImplNIOTest.java index ae71432828..ca9c8a595e 100644 --- a/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/journal/RealJournalImplNIOTest.java +++ b/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/journal/RealJournalImplNIOTest.java @@ -22,10 +22,11 @@ import org.apache.activemq.artemis.core.io.SequentialFileFactory; import org.apache.activemq.artemis.core.io.nio.NIOSequentialFileFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class RealJournalImplNIOTest extends JournalImplTestUnit { - private static final Logger log = LoggerFactory.getLogger(RealJournalImplNIOTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override protected SequentialFileFactory getFileFactory() throws Exception { diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/bridgeTransfer/BridgeTransferingTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/bridgeTransfer/BridgeTransferingTest.java index 5cd7e6cef5..1fd1d54346 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/bridgeTransfer/BridgeTransferingTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/bridgeTransfer/BridgeTransferingTest.java @@ -39,13 +39,14 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; @RunWith(Parameterized.class) public class BridgeTransferingTest extends SmokeTestBase { public static final String SERVER_NAME_0 = "bridgeTransfer/serverA"; public static final String SERVER_NAME_1 = "bridgeTransfer/serverB"; - private static final Logger logger = LoggerFactory.getLogger(BridgeTransferingTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String JMX_SERVER_HOSTNAME = "localhost"; private static final int JMX_SERVER_PORT = 11099; diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/crossprotocol/MultiThreadConvertTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/crossprotocol/MultiThreadConvertTest.java index 32a50643cc..62e1af40fd 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/crossprotocol/MultiThreadConvertTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/crossprotocol/MultiThreadConvertTest.java @@ -45,12 +45,13 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MultiThreadConvertTest extends SmokeTestBase { private static final String SERVER_NAME_0 = "standard"; - private static final Logger LOG = LoggerFactory.getLogger(MultiThreadConvertTest.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Before public void before() throws Exception { diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/dnsswitch/DNSSwitchTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/dnsswitch/DNSSwitchTest.java index 30b62a1fd4..080a1ebe26 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/dnsswitch/DNSSwitchTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/dnsswitch/DNSSwitchTest.java @@ -61,6 +61,7 @@ import org.junit.Rule; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * Validating connection retry scenarios where the DNS had changes @@ -71,7 +72,7 @@ public class DNSSwitchTest extends SmokeTestBase { private static final String JMX_SERVER_HOSTNAME = "localhost"; private static final int JMX_SERVER_PORT_0 = 10099; private static final int JMX_SERVER_PORT_1 = 10199; - private static final Logger logger = LoggerFactory.getLogger(DNSSwitchTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String SERVER_NAME_0 = "dnsswitch"; private static final String SERVER_NAME_1 = "dnsswitch2"; private static final String SERVER_STANDARD = "standard"; diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/infinite/InfiniteRedeliverySmokeTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/infinite/InfiniteRedeliverySmokeTest.java index 1608bf561b..fd85f8055b 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/infinite/InfiniteRedeliverySmokeTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/infinite/InfiniteRedeliverySmokeTest.java @@ -38,10 +38,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class InfiniteRedeliverySmokeTest extends SmokeTestBase { - private static final Logger logger = LoggerFactory.getLogger(InfiniteRedeliverySmokeTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String SERVER_NAME_0 = "infinite-redelivery"; diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/jmxmultiplefailback/ReplicatedMultipleFailbackTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/jmxmultiplefailback/ReplicatedMultipleFailbackTest.java index 6b3ee8be2b..d364deafa4 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/jmxmultiplefailback/ReplicatedMultipleFailbackTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/jmxmultiplefailback/ReplicatedMultipleFailbackTest.java @@ -49,10 +49,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ReplicatedMultipleFailbackTest extends SmokeTestBase { - private static final Logger LOGGER = LoggerFactory.getLogger(ReplicatedMultipleFailbackTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @FunctionalInterface interface ThrowableFunction { @@ -103,7 +104,7 @@ public class ReplicatedMultipleFailbackTest extends SmokeTestBase { final String backup = nodePair.getString("backup", null); networkTopology.put(nodeID, new Pair<>(live, backup)); } catch (Exception e) { - LOGGER.warn("Error on {}", nodePair, e); + logger.warn("Error on {}", nodePair, e); } } return networkTopology; @@ -222,7 +223,7 @@ public class ReplicatedMultipleFailbackTest extends SmokeTestBase { @Test public void testMultipleFailback() throws Exception { - LOGGER.info("TEST BOOTSTRAPPING START: STARTING brokers {}", Arrays.toString(Broker.values())); + logger.info("TEST BOOTSTRAPPING START: STARTING brokers {}", Arrays.toString(Broker.values())); final int failbackRetries = 10; final int timeout = (int) TimeUnit.SECONDS.toMillis(30); Process master1 = Broker.master1.startServer(this, timeout); @@ -239,7 +240,7 @@ public class ReplicatedMultipleFailbackTest extends SmokeTestBase { final String nodeIDlive3 = Broker.master3.getNodeID().get(); for (Broker broker : Broker.values()) { - LOGGER.info("CHECKING NETWORK TOPOLOGY FOR {}", broker); + logger.info("CHECKING NETWORK TOPOLOGY FOR {}", broker); Wait.assertTrue(() -> validateNetworkTopology(broker.listNetworkTopology().orElse(""), containsExactNodeIds(nodeIDlive1, nodeIDlive2, nodeIDlive3) .and(withLive(nodeIDlive1, Objects::nonNull)) @@ -254,23 +255,23 @@ public class ReplicatedMultipleFailbackTest extends SmokeTestBase { Assert.assertNotNull(urlMaster1); Assert.assertNotEquals(urlMaster1, urlSlave1); - LOGGER.info("Node ID live 1 is {}", nodeIDlive1); - LOGGER.info("Node ID live 2 is {}", nodeIDlive2); - LOGGER.info("Node ID live 3 is {}", nodeIDlive3); + logger.info("Node ID live 1 is {}", nodeIDlive1); + logger.info("Node ID live 2 is {}", nodeIDlive2); + logger.info("Node ID live 3 is {}", nodeIDlive3); - LOGGER.info("{} has url: {}", Broker.master1, urlMaster1); - LOGGER.info("{} has url: {}", Broker.slave1, urlSlave1); + logger.info("{} has url: {}", Broker.master1, urlMaster1); + logger.info("{} has url: {}", Broker.slave1, urlSlave1); - LOGGER.info("BOOTSTRAPPING ENDED: READ nodeIds and master1/slave1 urls"); + logger.info("BOOTSTRAPPING ENDED: READ nodeIds and master1/slave1 urls"); for (int i = 0; i < failbackRetries; i++) { - LOGGER.info("START TEST {}", i + 1); - LOGGER.info("KILLING master1"); + logger.info("START TEST {}", i + 1); + logger.info("KILLING master1"); killServer(master1); // wait until slave1 became live Wait.assertTrue(() -> !Broker.slave1.isBackup().orElse(true), timeout); - LOGGER.info("slave1 is LIVE"); - LOGGER.info("VALIDATE TOPOLOGY OF ALIVE BROKERS"); + logger.info("slave1 is LIVE"); + logger.info("VALIDATE TOPOLOGY OF ALIVE BROKERS"); Stream.of(Broker.master2, Broker.master3, Broker.slave1).forEach( broker -> Wait.assertTrue(() -> validateNetworkTopology(broker.listNetworkTopology().orElse(""), containsExactNodeIds(nodeIDlive1, nodeIDlive2, nodeIDlive3) @@ -280,14 +281,14 @@ public class ReplicatedMultipleFailbackTest extends SmokeTestBase { .and(withNodes(3))), timeout) ); // restart master1 - LOGGER.info("STARTING master1"); + logger.info("STARTING master1"); master1 = Broker.master1.startServer(this, 0); Wait.assertTrue(() -> Broker.slave1.isBackup().orElse(false), timeout); - LOGGER.info("slave1 is BACKUP"); + logger.info("slave1 is BACKUP"); Wait.assertTrue(() -> !Broker.master1.isBackup().orElse(true), timeout); - LOGGER.info("master1 is LIVE"); + logger.info("master1 is LIVE"); for (Broker broker : Broker.values()) { - LOGGER.info("CHECKING NETWORK TOPOLOGY FOR {}", broker); + logger.info("CHECKING NETWORK TOPOLOGY FOR {}", broker); Wait.assertTrue(() -> validateNetworkTopology(broker.listNetworkTopology().orElse(""), containsExactNodeIds(nodeIDlive1, nodeIDlive2, nodeIDlive3) .and(withLive(nodeIDlive1, urlMaster1::equals)) @@ -296,7 +297,7 @@ public class ReplicatedMultipleFailbackTest extends SmokeTestBase { .and(withNodes(4))), timeout); } } - LOGGER.info("TEST COMPLETED"); + logger.info("TEST COMPLETED"); } } diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/paging/FloodServerWithAsyncSendTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/paging/FloodServerWithAsyncSendTest.java index a90512c2aa..eac05a2fdb 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/paging/FloodServerWithAsyncSendTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/paging/FloodServerWithAsyncSendTest.java @@ -37,10 +37,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class FloodServerWithAsyncSendTest extends SmokeTestBase { - private static final Logger logger = LoggerFactory.getLogger(FloodServerWithAsyncSendTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String SERVER_NAME_0 = "paging"; volatile boolean running = true; diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/quorum/PluggableQuorumSinglePairTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/quorum/PluggableQuorumSinglePairTest.java index c3795edc33..0de7005a6e 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/quorum/PluggableQuorumSinglePairTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/quorum/PluggableQuorumSinglePairTest.java @@ -39,6 +39,7 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.tests.util.Jmx.backupOf; import static org.apache.activemq.artemis.tests.util.Jmx.containsExactNodeIds; @@ -53,7 +54,7 @@ import static org.apache.activemq.artemis.tests.util.Jmx.withNodes; @RunWith(Parameterized.class) public abstract class PluggableQuorumSinglePairTest extends SmokeTestBase { - private static final Logger LOGGER = LoggerFactory.getLogger(PluggableQuorumSinglePairTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); static final String JMX_SERVER_HOSTNAME = "localhost"; static final int JMX_PORT_PRIMARY = 10099; @@ -156,20 +157,20 @@ public abstract class PluggableQuorumSinglePairTest extends SmokeTestBase { @Test public void testCanQueryEmptyBackup() throws Exception { final int timeout = (int) TimeUnit.SECONDS.toMillis(30); - LOGGER.info("starting primary"); + logger.info("starting primary"); Process live = primary.startServer(this, timeout); Assert.assertTrue(awaitAsyncSetupCompleted(timeout, TimeUnit.MILLISECONDS)); Wait.assertTrue(() -> !primary.isBackup().orElse(true), timeout); - LOGGER.info("killing primary"); + logger.info("killing primary"); ServerUtil.killServer(live, forceKill); - LOGGER.info("starting backup"); + logger.info("starting backup"); backup.startServer(this, 0); Wait.assertTrue(() -> backup.isBackup().orElse(false), timeout); - LOGGER.info("Stopping majority of consensus nodes"); + logger.info("Stopping majority of consensus nodes"); final int[] stopped = stopMajority(); - LOGGER.info("Waiting until isolated"); + logger.info("Waiting until isolated"); Thread.sleep(2000); - LOGGER.info("Restarting majority of consensus nodes"); + logger.info("Restarting majority of consensus nodes"); restart(stopped); Wait.assertTrue(() -> backup.isBackup().orElse(false), timeout); } @@ -177,19 +178,19 @@ public abstract class PluggableQuorumSinglePairTest extends SmokeTestBase { @Test public void testBackupFailoverAndPrimaryFailback() throws Exception { final int timeout = (int) TimeUnit.SECONDS.toMillis(30); - LOGGER.info("starting primary"); + logger.info("starting primary"); Process primaryInstance = primary.startServer(this, timeout); Assert.assertTrue(awaitAsyncSetupCompleted(timeout, TimeUnit.MILLISECONDS)); // primary UN REPLICATED Assert.assertEquals(1L, primary.getActivationSequence().get().longValue()); - LOGGER.info("started primary"); - LOGGER.info("starting backup"); + logger.info("started primary"); + logger.info("starting backup"); Process backupInstance = backup.startServer(this, 0); Wait.assertTrue(() -> backup.isBackup().orElse(false), timeout); final String nodeID = primary.getNodeID().get(); Assert.assertNotNull(nodeID); - LOGGER.info("NodeID: {}", nodeID); + logger.info("NodeID: {}", nodeID); for (BrokerControl broker : brokers) { Wait.assertTrue(() -> validateNetworkTopology(broker.listNetworkTopology().orElse(""), containsExactNodeIds(nodeID) @@ -198,25 +199,25 @@ public abstract class PluggableQuorumSinglePairTest extends SmokeTestBase { .and(withMembers(1)) .and(withNodes(2))), timeout); } - LOGGER.info("primary topology is: {}", primary.listNetworkTopology().get()); - LOGGER.info("backup topology is: {}", backup.listNetworkTopology().get()); + logger.info("primary topology is: {}", primary.listNetworkTopology().get()); + logger.info("backup topology is: {}", backup.listNetworkTopology().get()); Assert.assertTrue(backup.isReplicaSync().get()); - LOGGER.info("backup is synchronized with live"); + logger.info("backup is synchronized with live"); final String urlBackup = backupOf(nodeID, decodeNetworkTopologyJson(backup.listNetworkTopology().get())); Assert.assertNotNull(urlBackup); - LOGGER.info("backup: {}", urlBackup); + logger.info("backup: {}", urlBackup); final String urlPrimary = liveOf(nodeID, decodeNetworkTopologyJson(primary.listNetworkTopology().get())); Assert.assertNotNull(urlPrimary); - LOGGER.info("primary: {}", urlPrimary); + logger.info("primary: {}", urlPrimary); Assert.assertNotEquals(urlPrimary, urlBackup); // primary REPLICATED, backup matches (has replicated) activation sequence Assert.assertEquals(1L, primary.getActivationSequence().get().longValue()); Assert.assertEquals(1L, backup.getActivationSequence().get().longValue()); - LOGGER.info("killing primary"); + logger.info("killing primary"); ServerUtil.killServer(primaryInstance, forceKill); - LOGGER.info("killed primary"); + logger.info("killed primary"); Wait.assertTrue(() -> !backup.isBackup().orElse(true), timeout); Wait.assertTrue(() -> validateNetworkTopology(backup.listNetworkTopology().orElse(""), containsExactNodeIds(nodeID) @@ -224,18 +225,18 @@ public abstract class PluggableQuorumSinglePairTest extends SmokeTestBase { .and(withBackup(nodeID, Objects::isNull)) .and(withMembers(1)) .and(withNodes(1))), timeout); - LOGGER.info("backup topology is: {}", backup.listNetworkTopology().get()); + logger.info("backup topology is: {}", backup.listNetworkTopology().get()); Assert.assertEquals(nodeID, backup.getNodeID().get()); // backup UN REPLICATED (new version) Assert.assertEquals(2L, backup.getActivationSequence().get().longValue()); // wait a bit before restarting primary - LOGGER.info("waiting before starting primary"); + logger.info("waiting before starting primary"); TimeUnit.SECONDS.sleep(4); - LOGGER.info("starting primary"); + logger.info("starting primary"); primaryInstance = primary.startServer(this, 0); - LOGGER.info("started primary"); + logger.info("started primary"); Wait.assertTrue(() -> backup.isBackup().orElse(false), timeout); Assert.assertTrue(!primary.isBackup().get()); for (BrokerControl broker : brokers) { @@ -246,17 +247,17 @@ public abstract class PluggableQuorumSinglePairTest extends SmokeTestBase { .and(withMembers(1)) .and(withNodes(2))), timeout); } - LOGGER.info("primary topology is: {}", primary.listNetworkTopology().get()); - LOGGER.info("backup topology is: {}", backup.listNetworkTopology().get()); + logger.info("primary topology is: {}", primary.listNetworkTopology().get()); + logger.info("backup topology is: {}", backup.listNetworkTopology().get()); Assert.assertTrue(backup.isReplicaSync().get()); - LOGGER.info("backup is synchronized with live"); + logger.info("backup is synchronized with live"); Assert.assertEquals(nodeID, primary.getNodeID().get()); // primary ran un replicated for a short while after failback, before backup was in sync Assert.assertEquals(3L, primary.getActivationSequence().get().longValue()); Assert.assertEquals(3L, backup.getActivationSequence().get().longValue()); - LOGGER.info("Done, killing both"); + logger.info("Done, killing both"); ServerUtil.killServer(primaryInstance); ServerUtil.killServer(backupInstance); } @@ -326,17 +327,17 @@ public abstract class PluggableQuorumSinglePairTest extends SmokeTestBase { @Test public void testOnlyLastUnreplicatedCanStart() throws Exception { final int timeout = (int) TimeUnit.SECONDS.toMillis(30); - LOGGER.info("starting primary"); + logger.info("starting primary"); Process primaryInstance = primary.startServer(this, timeout); Assert.assertTrue(awaitAsyncSetupCompleted(timeout, TimeUnit.MILLISECONDS)); Wait.assertTrue(() -> !primary.isBackup().orElse(true), timeout); - LOGGER.info("started primary"); - LOGGER.info("starting backup"); + logger.info("started primary"); + logger.info("starting backup"); Process backupInstance = backup.startServer(this, 0); Wait.assertTrue(() -> backup.isBackup().orElse(false), timeout); final String nodeID = primary.getNodeID().get(); Assert.assertNotNull(nodeID); - LOGGER.info("NodeID: {}", nodeID); + logger.info("NodeID: {}", nodeID); for (BrokerControl broker : brokers) { Wait.assertTrue(() -> validateNetworkTopology(broker.listNetworkTopology().orElse(""), containsExactNodeIds(nodeID) @@ -345,16 +346,16 @@ public abstract class PluggableQuorumSinglePairTest extends SmokeTestBase { .and(withMembers(1)) .and(withNodes(2))), timeout); } - LOGGER.info("primary topology is: {}", primary.listNetworkTopology().get()); - LOGGER.info("backup topology is: {}", backup.listNetworkTopology().get()); + logger.info("primary topology is: {}", primary.listNetworkTopology().get()); + logger.info("backup topology is: {}", backup.listNetworkTopology().get()); Assert.assertTrue(backup.isReplicaSync().get()); - LOGGER.info("backup is synchronized with live"); + logger.info("backup is synchronized with live"); final String urlBackup = backupOf(nodeID, decodeNetworkTopologyJson(backup.listNetworkTopology().get())); Assert.assertNotNull(urlBackup); - LOGGER.info("backup: {}", urlBackup); + logger.info("backup: {}", urlBackup); final String urlPrimary = liveOf(nodeID, decodeNetworkTopologyJson(primary.listNetworkTopology().get())); Assert.assertNotNull(urlPrimary); - LOGGER.info("primary: {}", urlPrimary); + logger.info("primary: {}", urlPrimary); Assert.assertNotEquals(urlPrimary, urlBackup); @@ -362,9 +363,9 @@ public abstract class PluggableQuorumSinglePairTest extends SmokeTestBase { Assert.assertEquals(1L, primary.getActivationSequence().get().longValue()); Assert.assertEquals(1L, backup.getActivationSequence().get().longValue()); - LOGGER.info("killing primary"); + logger.info("killing primary"); ServerUtil.killServer(primaryInstance, forceKill); - LOGGER.info("killed primary"); + logger.info("killed primary"); Wait.assertTrue(() -> !backup.isBackup().orElse(true), timeout); Wait.assertTrue(() -> validateNetworkTopology(backup.listNetworkTopology().orElse(""), containsExactNodeIds(nodeID) @@ -372,35 +373,35 @@ public abstract class PluggableQuorumSinglePairTest extends SmokeTestBase { .and(withBackup(nodeID, Objects::isNull)) .and(withMembers(1)) .and(withNodes(1))), timeout); - LOGGER.info("backup topology is: {}", backup.listNetworkTopology().get()); + logger.info("backup topology is: {}", backup.listNetworkTopology().get()); Assert.assertEquals(nodeID, backup.getNodeID().get()); // backup now UNREPLICATED, it is the only node that can continue Assert.assertEquals(2L, backup.getActivationSequence().get().longValue()); - LOGGER.info("killing backup"); + logger.info("killing backup"); ServerUtil.killServer(backupInstance, forceKill); // wait a bit before restarting primary - LOGGER.info("waiting before starting primary"); + logger.info("waiting before starting primary"); TimeUnit.SECONDS.sleep(4); - LOGGER.info("restarting primary"); + logger.info("restarting primary"); Process restartedPrimary = primary.startServer(this, 0); - LOGGER.info("restarted primary, " + restartedPrimary); + logger.info("restarted primary, " + restartedPrimary); Wait.assertFalse("Primary shouldn't activate", () -> primary.isActive().orElse(false), 5000); ServerUtil.killServer(restartedPrimary); - LOGGER.info("restarting backup"); + logger.info("restarting backup"); // backup can resume with data seq 3 final Process restartedBackupInstance = backup.startServer(this, 5000); Wait.waitFor(() -> backup.isActive().orElse(false), 5000); assertTrue(Wait.waitFor(() -> nodeID.equals(backup.getNodeID().orElse("not set yet")))); - LOGGER.info("restarted backup"); + logger.info("restarted backup"); Assert.assertEquals(3L, backup.getActivationSequence().get().longValue()); } diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/quorum/ZookeeperPluggableQuorumPeerTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/quorum/ZookeeperPluggableQuorumPeerTest.java index 6252ef5497..68a47c23d5 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/quorum/ZookeeperPluggableQuorumPeerTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/quorum/ZookeeperPluggableQuorumPeerTest.java @@ -28,6 +28,7 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.tests.util.Jmx.containsExactNodeIds; import static org.apache.activemq.artemis.tests.util.Jmx.decodeNetworkTopologyJson; @@ -40,7 +41,7 @@ import static org.apache.activemq.artemis.tests.util.Jmx.withNodes; public class ZookeeperPluggableQuorumPeerTest extends ZookeeperPluggableQuorumSinglePairTest { - private static final Logger LOGGER = LoggerFactory.getLogger(ZookeeperPluggableQuorumPeerTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public ZookeeperPluggableQuorumPeerTest() { super(); @@ -64,33 +65,33 @@ public class ZookeeperPluggableQuorumPeerTest extends ZookeeperPluggableQuorumSi // see FileLockTest::testCorrelationId to get more info why this is not peer-journal-001 as in broker.xml final String coordinationId = "peer.journal.001"; final int timeout = (int) TimeUnit.SECONDS.toMillis(30); - LOGGER.info("starting peer a"); + logger.info("starting peer a"); final Process live = primary.startServer(this, 0); - LOGGER.info("waiting peer a to increase coordinated activation sequence to 1"); + logger.info("waiting peer a to increase coordinated activation sequence to 1"); Wait.assertEquals(1L, () -> primary.getActivationSequence().orElse(Long.MAX_VALUE).longValue(), timeout); Assert.assertEquals(coordinationId, primary.getNodeID().get()); Wait.waitFor(() -> primary.listNetworkTopology().isPresent(), timeout); final String urlPeerA = liveOf(coordinationId, decodeNetworkTopologyJson(primary.listNetworkTopology().get())); Assert.assertNotNull(urlPeerA); - LOGGER.info("peer a acceptor: {}", urlPeerA); - LOGGER.info("killing peer a"); + logger.info("peer a acceptor: {}", urlPeerA); + logger.info("killing peer a"); ServerUtil.killServer(live, forceKill); - LOGGER.info("starting peer b"); + logger.info("starting peer b"); Process emptyBackup = backup.startServer(this, 0); - LOGGER.info("waiting until peer b act as empty backup"); + logger.info("waiting until peer b act as empty backup"); Wait.assertTrue(() -> backup.isBackup().orElse(false), timeout); - LOGGER.info("Stop majority of quorum nodes"); + logger.info("Stop majority of quorum nodes"); final int[] majority = stopMajority(); - LOGGER.info("Wait peer b to deactivate"); + logger.info("Wait peer b to deactivate"); Thread.sleep(2000); - LOGGER.info("Restart majority of quorum nodes"); + logger.info("Restart majority of quorum nodes"); restart(majority); - LOGGER.info("Restart peer a as legit last live"); + logger.info("Restart peer a as legit last live"); final Process restartedLive = primary.startServer(this, 0); - LOGGER.info("waiting peer a to increase coordinated activation sequence to 2"); + logger.info("waiting peer a to increase coordinated activation sequence to 2"); Wait.assertEquals(2L, () -> primary.getActivationSequence().orElse(Long.MAX_VALUE).longValue(), timeout); Assert.assertEquals(coordinationId, primary.getNodeID().get()); - LOGGER.info("waiting peer b to be a replica"); + logger.info("waiting peer b to be a replica"); Wait.waitFor(() -> backup.isReplicaSync().orElse(false)); Wait.assertEquals(2L, () -> backup.getActivationSequence().get().longValue()); final String expectedUrlPeerA = liveOf(coordinationId, decodeNetworkTopologyJson(primary.listNetworkTopology().get())); @@ -101,7 +102,7 @@ public class ZookeeperPluggableQuorumPeerTest extends ZookeeperPluggableQuorumSi public void testMultiPrimary_Peer() throws Exception { final int timeout = (int) TimeUnit.SECONDS.toMillis(30); - LOGGER.info("starting peer b primary"); + logger.info("starting peer b primary"); Process backupInstance = backup.startServer(this, timeout); @@ -110,9 +111,9 @@ public class ZookeeperPluggableQuorumPeerTest extends ZookeeperPluggableQuorumSi final String nodeID = backup.getNodeID().get(); Assert.assertNotNull(nodeID); - LOGGER.info("NodeID: {}", nodeID); + logger.info("NodeID: {}", nodeID); - LOGGER.info("starting peer a primary"); + logger.info("starting peer a primary"); primary.startServer(this, 0); Wait.assertTrue(() -> primary.isBackup().orElse(false), timeout); @@ -127,19 +128,19 @@ public class ZookeeperPluggableQuorumPeerTest extends ZookeeperPluggableQuorumSi .and(withNodes(2))), timeout); } - LOGGER.info("primary topology is: {}", primary.listNetworkTopology().get()); - LOGGER.info("backup topology is: {}", backup.listNetworkTopology().get()); + logger.info("primary topology is: {}", primary.listNetworkTopology().get()); + logger.info("backup topology is: {}", backup.listNetworkTopology().get()); Assert.assertTrue(backup.isReplicaSync().get()); Assert.assertTrue(primary.isReplicaSync().get()); - LOGGER.info("killing peer-b"); + logger.info("killing peer-b"); ServerUtil.killServer(backupInstance, forceKill); // peer-a now UNREPLICATED Wait.assertTrue(() -> 2L == primary.getActivationSequence().get().longValue()); - LOGGER.info("restarting peer-b"); + logger.info("restarting peer-b"); backup.startServer(this, 0); assertTrue(Wait.waitFor(() -> nodeID.equals(backup.getNodeID().orElse("not set yet")))); diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/quorum/ZookeeperPluggableQuorumSinglePairTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/quorum/ZookeeperPluggableQuorumSinglePairTest.java index 25ded27384..8a5de1c605 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/quorum/ZookeeperPluggableQuorumSinglePairTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/quorum/ZookeeperPluggableQuorumSinglePairTest.java @@ -29,10 +29,11 @@ import org.junit.Assert; import org.junit.Before; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ZookeeperPluggableQuorumSinglePairTest extends PluggableQuorumSinglePairTest { - private static final Logger LOGGER = LoggerFactory.getLogger(ZookeeperPluggableQuorumSinglePairTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int BASE_SERVER_PORT = 6666; // Beware: the server tick must be small enough that to let the session to be correctly expired private static final int SERVER_TICK_MS = 100; @@ -53,7 +54,7 @@ public class ZookeeperPluggableQuorumSinglePairTest extends PluggableQuorumSingl testingServer = new TestingCluster(clusterSpecs); testingServer.start(); Assert.assertEquals("127.0.0.1:6666,127.0.0.1:6667,127.0.0.1:6668", testingServer.getConnectString()); - LOGGER.info("Cluster of {} nodes on: {}", 3, testingServer.getConnectString()); + logger.info("Cluster of {} nodes on: {}", 3, testingServer.getConnectString()); } @Override diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/replicationflow/SoakPagingTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/replicationflow/SoakPagingTest.java index fcd4013f9d..5b23a70a1a 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/replicationflow/SoakPagingTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/replicationflow/SoakPagingTest.java @@ -65,11 +65,12 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; @RunWith(Parameterized.class) public class SoakPagingTest extends SmokeTestBase { - private static final Logger log = LoggerFactory.getLogger(SoakPagingTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final int LAG_CONSUMER_TIME = 1000; public static final int TIME_RUNNING = 4000; diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/SoakTestBase.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/SoakTestBase.java index df003515b1..1400884246 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/SoakTestBase.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/SoakTestBase.java @@ -41,9 +41,10 @@ import org.junit.After; import org.junit.Assert; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class SoakTestBase extends ActiveMQTestBase { - private static final Logger logger = LoggerFactory.getLogger(SoakTestBase.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); Set processes = new HashSet<>(); private static final String JMX_SERVER_HOSTNAME = "localhost"; private static final int JMX_SERVER_PORT = 10099; diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/TestParameters.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/TestParameters.java index 471a3847a9..32494da1a9 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/TestParameters.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/TestParameters.java @@ -20,12 +20,13 @@ package org.apache.activemq.artemis.tests.soak; import org.junit.Assert; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** Encapsulates System properties that could be passed on to the test. */ public class TestParameters { - private static final Logger logger = LoggerFactory.getLogger(TestParameters.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static String propertyName(String testName, String property) { if (testName == null) { diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/ClientAbstract.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/ClientAbstract.java index 08bfd002ee..7b4030f076 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/ClientAbstract.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/ClientAbstract.java @@ -25,6 +25,7 @@ import org.apache.activemq.artemis.core.transaction.impl.XidImpl; import org.apache.activemq.artemis.utils.UUIDGenerator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * WARNING: This is not a sample on how you should handle XA. You are supposed to use a @@ -37,7 +38,7 @@ import org.slf4j.LoggerFactory; */ public abstract class ClientAbstract extends Thread { - private static final Logger log = LoggerFactory.getLogger(ClientAbstract.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected ClientSession session; diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/ClientNonDivertedSoakTest.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/ClientNonDivertedSoakTest.java index 58c2c13d53..331897f234 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/ClientNonDivertedSoakTest.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/ClientNonDivertedSoakTest.java @@ -34,10 +34,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ClientNonDivertedSoakTest extends ActiveMQTestBase { - private static final Logger logger = LoggerFactory.getLogger(ClientNonDivertedSoakTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final SimpleString ADDRESS = new SimpleString("ADD"); diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/ClientSoakTest.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/ClientSoakTest.java index b62ad3639b..28c5ab611f 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/ClientSoakTest.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/ClientSoakTest.java @@ -36,10 +36,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ClientSoakTest extends ActiveMQTestBase { - private static final Logger logger = LoggerFactory.getLogger(ClientSoakTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final SimpleString ADDRESS = new SimpleString("ADD"); diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/Receiver.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/Receiver.java index 5d7ae4b8b5..7b71afe148 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/Receiver.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/Receiver.java @@ -26,10 +26,11 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; import org.apache.activemq.artemis.utils.ReusableLatch; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class Receiver extends ClientAbstract { - private static final Logger logger = LoggerFactory.getLogger(Receiver.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); // We should leave some messages on paging. We don't want to consume all for this test private final Semaphore minConsume = new Semaphore(0); diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/FlowControlPagingTest.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/FlowControlPagingTest.java index 8c49648718..4370ecd93f 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/FlowControlPagingTest.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/FlowControlPagingTest.java @@ -42,6 +42,7 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.tests.soak.TestParameters.intMandatoryProperty; import static org.apache.activemq.artemis.tests.soak.TestParameters.testProperty; @@ -70,7 +71,7 @@ public class FlowControlPagingTest extends SoakTestBase { private final int MESSAGE_SIZE; - private static final Logger logger = LoggerFactory.getLogger(FlowControlPagingTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String SERVER_NAME_0 = "flowControlPaging"; diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/HorizontalPagingTest.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/HorizontalPagingTest.java index 4f97920116..6234d59e8f 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/HorizontalPagingTest.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/HorizontalPagingTest.java @@ -43,6 +43,7 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.tests.soak.TestParameters.intMandatoryProperty; import static org.apache.activemq.artemis.tests.soak.TestParameters.testProperty; @@ -74,7 +75,7 @@ public class HorizontalPagingTest extends SoakTestBase { private final int PARALLEL_SENDS; - private static final Logger logger = LoggerFactory.getLogger(HorizontalPagingTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String SERVER_NAME_0 = "horizontalPaging"; diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/M_and_M_FactoryTest.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/M_and_M_FactoryTest.java index 673df62ae0..b400768eef 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/M_and_M_FactoryTest.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/M_and_M_FactoryTest.java @@ -50,10 +50,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class M_and_M_FactoryTest extends SoakTestBase { - private static final Logger logger = LoggerFactory.getLogger(M_and_M_FactoryTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String SERVER_NAME_0 = "mmfactory"; private static final String JMX_SERVER_HOSTNAME = "localhost"; diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/SubscriptionPagingTest.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/SubscriptionPagingTest.java index bc836545b2..ee83111076 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/SubscriptionPagingTest.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/SubscriptionPagingTest.java @@ -45,6 +45,7 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.tests.soak.TestParameters.intMandatoryProperty; import static org.apache.activemq.artemis.tests.soak.TestParameters.testProperty; @@ -76,7 +77,7 @@ public class SubscriptionPagingTest extends SoakTestBase { final String TOPIC_NAME = "SUB_TEST"; - private static final Logger logger = LoggerFactory.getLogger(SubscriptionPagingTest.class); + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public static final String SERVER_NAME_0 = "subscriptionPaging"; diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/MultipleConsumersPageStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/MultipleConsumersPageStressTest.java index 35c9f2e8bb..b3492e3f37 100644 --- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/MultipleConsumersPageStressTest.java +++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/MultipleConsumersPageStressTest.java @@ -39,10 +39,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MultipleConsumersPageStressTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(MultipleConsumersPageStressTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int TIME_TO_RUN = 60 * 1000; diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/remote/PingStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/remote/PingStressTest.java index f623c52d6e..46bf349365 100644 --- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/remote/PingStressTest.java +++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/remote/PingStressTest.java @@ -34,10 +34,11 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class PingStressTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(PingStressTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final long PING_INTERVAL = 500; diff --git a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/journal/impl/JournalImplTestUnit.java b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/journal/impl/JournalImplTestUnit.java index a50e21ea7e..5fa8b80c97 100644 --- a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/journal/impl/JournalImplTestUnit.java +++ b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/journal/impl/JournalImplTestUnit.java @@ -27,10 +27,11 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public abstract class JournalImplTestUnit extends JournalImplTestBase { - private static final Logger log = LoggerFactory.getLogger(JournalImplTestBase.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override @After diff --git a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueConcurrentTest.java b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueConcurrentTest.java index 90355ba791..e9f7136e31 100644 --- a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueConcurrentTest.java +++ b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueConcurrentTest.java @@ -34,6 +34,7 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * A concurrent QueueTest @@ -42,7 +43,7 @@ import org.slf4j.LoggerFactory; */ public class QueueConcurrentTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(QueueConcurrentTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private FakeQueueFactory queueFactory = new FakeQueueFactory(); diff --git a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java index 496eb03c2d..2b3e0976d6 100644 --- a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java +++ b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java @@ -71,10 +71,11 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class JMSBridgeImplTest extends ActiveMQTestBase { - private static Logger log = LoggerFactory.getLogger(JMSBridgeImplTest.class); + private static Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String SOURCE = RandomUtil.randomString(); diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/AllClassesTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/AllClassesTest.java index 13b9efa482..bb3a497622 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/AllClassesTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/AllClassesTest.java @@ -26,6 +26,7 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import java.lang.reflect.Constructor; import java.lang.reflect.Modifier; @@ -38,7 +39,7 @@ import java.util.List; @RunWith(value = Parameterized.class) public class AllClassesTest { - private static final Logger log = LoggerFactory.getLogger(AllClassesTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Parameterized.Parameters(name = "classInfo={0}") public static Collection getParameters() { diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java index 2dbeea1f1f..ca67a3fad6 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java @@ -36,6 +36,7 @@ import org.junit.BeforeClass; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * you need to define -Djava.library.path=${project-root}/native/src/.libs when calling the JVM @@ -46,7 +47,7 @@ import org.slf4j.LoggerFactory; */ public class MultiThreadAsynchronousFileTest extends AIOTestBase { - private static final Logger log = LoggerFactory.getLogger(MultiThreadAsynchronousFileTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @BeforeClass public static void hasAIO() { diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/AlignedJournalImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/AlignedJournalImplTest.java index b792f22f60..eb8758a718 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/AlignedJournalImplTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/AlignedJournalImplTest.java @@ -43,9 +43,10 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class AlignedJournalImplTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(AlignedJournalImplTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final LoaderCallback dummyLoader = new LoaderCallback() { diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestBase.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestBase.java index 0be6ee0c52..fab9f266e9 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestBase.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestBase.java @@ -49,6 +49,7 @@ import org.junit.Assert; import org.junit.Before; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public abstract class JournalImplTestBase extends ActiveMQTestBase { @@ -66,7 +67,7 @@ public abstract class JournalImplTestBase extends ActiveMQTestBase { } } - private static final Logger log = LoggerFactory.getLogger(JournalImplTestBase.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected List records = new LinkedList<>(); diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestUnit.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestUnit.java index d2494d7783..fccb6009dc 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestUnit.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestUnit.java @@ -34,13 +34,14 @@ import org.apache.activemq.artemis.tests.unit.core.journal.impl.fakes.SimpleEnco import org.apache.activemq.artemis.utils.RandomUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.junit.After; import org.junit.Assert; import org.junit.Test; public abstract class JournalImplTestUnit extends JournalImplTestBase { - private static final Logger log = LoggerFactory.getLogger(JournalImplTestUnit.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Override @After diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/TimedBufferTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/TimedBufferTest.java index 0c156724be..72395f7082 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/TimedBufferTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/TimedBufferTest.java @@ -38,9 +38,10 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class TimedBufferTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(TimedBufferTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final int ONE_SECOND_IN_NANOS = 1000000000; // in nanoseconds diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/message/impl/MessageImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/message/impl/MessageImplTest.java index ca520075cc..bee96dcad0 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/message/impl/MessageImplTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/message/impl/MessageImplTest.java @@ -45,9 +45,10 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MessageImplTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(MessageImplTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void getSetAttributes() { diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java index 65cc07b2b5..8ac2e9fd4a 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java @@ -86,11 +86,12 @@ import org.junit.Test; import org.mockito.Mockito; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import static org.apache.activemq.artemis.logs.AssertionLoggerHandler.findText; public class PagingStoreImplTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(PagingStoreImplTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); static { MessagePersister.registerPersister(CoreMessagePersister.getInstance()); diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/WildcardAddressManagerUnitTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/WildcardAddressManagerUnitTest.java index dc81d48de0..9dffb75bef 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/WildcardAddressManagerUnitTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/WildcardAddressManagerUnitTest.java @@ -45,12 +45,13 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This test is replicating the behaviour from https://issues.jboss.org/browse/HORNETQ-988. */ public class WildcardAddressManagerUnitTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(WildcardAddressManagerUnitTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testUnitOnWildCardFailingScenario() throws Exception { diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/QueueImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/QueueImplTest.java index 870b026588..903359c1a3 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/QueueImplTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/QueueImplTest.java @@ -62,9 +62,10 @@ import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class QueueImplTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(QueueImplTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); // The tests ---------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/util/RandomUtilDistributionTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/util/RandomUtilDistributionTest.java index 00a21f4955..c35dba8414 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/util/RandomUtilDistributionTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/util/RandomUtilDistributionTest.java @@ -27,12 +27,13 @@ import org.junit.Rule; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; /** * This test will start many parallel VMs, to make sure each VM would generate a good distribution of random numbers */ public class RandomUtilDistributionTest { - private static final Logger log = LoggerFactory.getLogger(RandomUtilDistributionTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Rule public SpawnedVMCheck check = new SpawnedVMCheck(); diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ActiveMQResourceAdapterConfigTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ActiveMQResourceAdapterConfigTest.java index 0b8652293b..2959fe770d 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ActiveMQResourceAdapterConfigTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ActiveMQResourceAdapterConfigTest.java @@ -29,6 +29,7 @@ import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -41,7 +42,7 @@ import org.xml.sax.InputSource; * add a description for each new property added and try and put it in the config some where appropriate. */ public class ActiveMQResourceAdapterConfigTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(ActiveMQResourceAdapterConfigTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static String config = "" + "\n" + diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/InVMContext.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/InVMContext.java index 93f469358f..d16a86f5b8 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/InVMContext.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/InVMContext.java @@ -38,10 +38,11 @@ import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class InVMContext implements Context, Serializable { - private static final Logger log = LoggerFactory.getLogger(InVMContext.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final long serialVersionUID = 385743957345L; diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/InVMNamingContext.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/InVMNamingContext.java index 439445bd74..458191e3d5 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/InVMNamingContext.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/InVMNamingContext.java @@ -38,10 +38,11 @@ import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class InVMNamingContext implements Context, Serializable { - private static final Logger log = LoggerFactory.getLogger(InVMNamingContext.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final long serialVersionUID = 385743957345L; diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/MemorySizeTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/MemorySizeTest.java index c72b88408f..af9de78d28 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/MemorySizeTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/MemorySizeTest.java @@ -23,9 +23,10 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class MemorySizeTest extends Assert { - private static final Logger log = LoggerFactory.getLogger(MemorySizeTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testObjectSizes() throws Exception { diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ReusableLatchTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ReusableLatchTest.java index 9d33de4351..e28897e9a5 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ReusableLatchTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ReusableLatchTest.java @@ -24,10 +24,11 @@ import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; public class ReusableLatchTest extends ActiveMQTestBase { - private static final Logger log = LoggerFactory.getLogger(ReusableLatchTest.class); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @Test public void testLatchWithParameterizedDown() throws Exception {